Monday, October 11, 2010

Meminfo in Linux

To check the total memory and swap allocated while installing the OS and all other useful information can be found using this command:

cat /proc/meminfo

While for checking the total memory used and free memory normally we use the command:

free -m (which shows the memory in MB)

The Details description of the free is given below:
   

The free command provides information about unused and used memory and swap space on any computer running Linux or another Unix-like operating system.

Memory consists of mainly of random access memory (RAM) chips that have been built into multi-chip modules that are, in turn, plugged into slots on the motherboard (i.e., the main circuit board on a personal computer or workstation). Swap space is is a portion of a hard disk drive (HDD) that is used to simulate additional main memory (i.e., which is used for virtual memory).

The basic syntax of free is

    free [options]

free accepts no arguments (i.e., input data) and is commonly used without any options. When used with no options, free presents a small table containing six columns and three rows of data, all expressed in kilobytes.

The first row, labeled Mem, displays physical memory utilization, including the amount of memory allocated to buffers and caches. A buffer, also called buffer memory, is usually defined as a portion of memory that is set aside as a temporary holding place for data that is being sent to or received from an external device, such as a HDD, keyboard, printer or network.

The second line of data, which begins with -/+ buffers/cache, shows the amount of physical memory currently devoted to system buffer cache. This is particularly meaningful with regard to application programs, as all data accessed from files on the system that are performed through the use of read() and write() system calls1 pass through this cache. This cache can greatly speed up access to data by reducing or eliminating the need to read from or write to the HDD or other disk.

The third row, which begins with Swap, shows the total swap space as well as how much of it is currently in use and how much is still available.

Several options are available to change the unit of display for free from its default kilobytes, including -b for bytes, -m for megabytes and -g for gigabytes. Of these, -m is usually the most useful. Thus, for example, to show all of the data in megabytes, the following would be used:

    free -m

free will report slightly less memory as being in a computer than the actual total. This is mostly because the kernel (i.e., the core of the operating system) cannot be swapped out (i.e., the kernel always remains in main memory while the computer is in operation), and thus the memory that it occupies can never be freed. There can also be regions of memory that are reserved for other purposes, according to the specific system architecture.

The -t option instructs free to additionally display a fourth line of data containing the totals for physical memory and swap space.

The -s option followed by an integer tells free to keep providing a new, updated output at regular intervals for which the integer indicates the number of seconds. This scrolling output can be terminated by simultaneously pressing the CONTROL and c keys. Thus, for example, the following would provide new data every five seconds and display the output in megabits:

    free -ms 5

An alternative to using free with its -s option would be to run it using the watch command, which by default runs a program provided to it as an argument every two seconds after first temporarily clearing the screen. This can make it easier to see changes as they occur because there is no scrolling. The program can be terminated and the screen returned to its former state by using the CONTROL and c key combination. Thus, for example, to display memory utilization every two seconds, the following would be used:

    watch free


--------------------------------------------------------------------------------------------------------

Alot of theory right..let us consider a small example:

Normally first row in the meminfo tells that most of the memory usage is due to data Buffers and cached which allocated and handled by the OS and tends to use up all the available memory , where the amount of memory used by user process /application is small.

Please take a look at the following example which illustrate how to use free command to verify the amount of free memory :

total used free shared buffers cached
Mem: 4040360 4012200 28160 0 176628 3571348
-/+ buffers/cache: 264224 3776136
Swap: 4200956 12184 4188772
$

In this example the total amount of available memory is 4040360 KB. 264224 KB are used by processes and 3776136 KB are free for other applications. Don't get confused by the first line which shows that 28160KB are free! If you look at the usage figures you can see that most of the memory use is for buffers and cache since Linux always tries to use RAM to the fullest extent to speed up disk operations. Using available memory for buffers (file system metadata) and cache (pages with actual contents of files or block devices) helps the system to run faster because disk information is already in memory which saves I/O. If space is needed by programs or applications like Oracle, then Linux will free up the buffers and cache to yield memory for the applications. So if your system runs for a while you will usually see a small number under the field "free" on the first line.

---------------------------------------------------------------------------------------------------------
How to check the total memory used in the server?

Use the following command, which will list memory usage ascending by process.

ps -e -orss=,args= | sort -b -k1,1n

Friday, October 01, 2010

Impacts and changes to be made after changing the IP Address or changing the Domain name on Existing Release 12

When we change the ip address on the server most of the times need not to worry because we always use the Host Name...is it so?????answer is NO.. we don't use the IP Address but we use the name of the server.So,
We are safe to change, as long as any customizations in the APPS related environment files with the HOSTNAME to IP ADDRESS. All customizations needs to be taken care manually to configure them.

From Last Few weeks we had similar kind of assignments to chainging the ip-addresses because of some sub-netting issues.For 11i its as simpler as it is..Just run the ad-preclone.pl script before changing the IP and run the adcfgclone.pl to re-clone the same server on the system with the same directories.Which will ensure that if any changes to be made manually can be taken care by this Clonig processes.

For R12, Do same as 11i but adstrtal.sh wont start all the services successfully.When we try to open the R12 Login Page we found AppsLogin not found... SOME ERROR...
When we checked the log, we found that
adformsctl.sh: exiting with status 204
adoafmctl.sh: exiting with status 204
adoacorectl.sh: exiting with status 204

A solution for the above is a bug and which has a solution(Ref: Oracle Support):


i) open a new shell and set your apps environment
ii) cd $ADMIN_SCRIPTS_HOME
iii) execute adopmnctl.sh stop
iv) Check for the OPMN process from Linux: ps -ef grep | opmn
v)delete the following:
rm -fr $INST_TOP/ora/10.1.3/j2ee/oacore/persistence/*

rm -fr $INST_TOP/ora/10.1.3/j2ee/oafm/persistence/*
rm -fr $INST_TOP/ora/10.1.3/j2ee/forms/persistence/*
vi ) adopmnctl.sh start.

The solution works..

The above action plan works if you're not integrated with SSO.If it is integrated then apart from the above need to follow some other steps which are explained in :
Oracle® Application Server Administrator's Guide 10g Release 3 (10.1.3.2.0)



Recently, We come across another requirement in our environment to change the DOMAIN name of the Server running on Oracle Applications Release 12


Follow the steps as follows, but before doing any major change it is recommended to take the backup of the instance.


1)  Run the autoconfig on DB Tier and APPS Tier.
2) Run Adpreclone.pl script on DB Tier and APPS Tier.
3) Stop all the services of APPS and check all the process at linux level.
4) Change the Domain name of the server at Linux Server in the following files:
                    i) /etc/hosts 
                   ii) /etc/resolv.conf
                  iii) /etc/sysconfig/network
                  iv) /etc/sysctl.conf
 5) Reboot the Server
6) check the changes by executing : uname -a
7) After confirmation, run adcfgclone.pl on DB Tier and Apps tier to effect the changes.
and perform the Post-clone steps as per the Oracle Metalink Note-ID: 406982.1


After starting the services and when we login into the Apps we may get this error: 
" You are trying to access a page that is no longer active.
- You may have attempted to access to this page directly by bookmarking the page or copying the URL. This page does not support bookmarking.
- The referring page may have come from a previous session. Please select Home to proceed"


The Above error occurs when one of the POST-CLONING step has not done i.e.

Update the SESSION_COOKIE_DOMAIN value in ICX_PARAMETERS with the new Domain name.