Cleaning up the system – 11i and R12

Here is the small post which describes the potential placed where log files and trace files are present and can be cleaned up. This is requied when you want to free up space on the system.

Cleaning up R12 instance:

Following are the locations in applmgr side which you can check and clean up. Be careful while cleaning up the log files, because some might be needed for analysis or might contan errors for some reproducible test case. So if you delete some log file which is needed, you might have to redo that work. Usually its a good idea to leave the logs which are 1-2 days old and delete the other older logs

Main location for logs and other not useful files on applmgr side:

Forms dump files : $INST_TOP/logs/ora/10.1.2/forms

Reports Cache : $INST_TOP/logs/ora/10.1.2/reports/cache

Apache logs : $INST_TOP/logs/ora/10.1.3/Apache

OPMN Logs : $INST_TOP/logs/ora/10.1.3/opmn

Its advisable not to remove any logs under $INST_TOP/logs/ora/10.1.3/j2ee directory since these are very important logs and are required frequently for debugging.

Logs for service management : $INST_TOP/logs/appl/admin/log

Concurrent Manager logs : $INST_TOP/logs/appl/conc/log

Concurrent Manager out files : $INST_TOP/logs/appl/conc/out

Other then these directories if you have some patch downloaded at some location, it is advisable to remove those patches once applied.

Main location for logs and other not useful files on oracle side:

Cleanup background_dump_dest, user_dump_dest and core_dump_dest directories on database side. These locations usually have huge trace files.

Check the location of ORACLE_HOME using du -sh command. Usually the size of ORACLE_HOME should be aounr 3-4G. If size of ORACLE_HOME (other then datafiles) is abnormally large like 7-8G or more then you need to investigate which directory is consuming more space and accordingly clean up that directory if appropriate.

In some situation if it becomes impossible to clean up the space (because there are no trace files to cleanup) and you desperately want the space to be available on the file system, then you can connect to database as sysdba and try to reduce the size of temp files using “alter database tempfile .. resize” comamnd. This will release some space and prevent database from crashing in case file system is reaching 100% full.

Again if some patches are downloaded for application, make sure to remove the patches zip files once they are applied.

Some times we upgrade the database to a major release, like from 9i to 10g or from 10g to 11g. In that case its advicable to remove the old ORACLE_HOME. This will not only save space but also will avoid confusion.

Cleaning up 11i instance:

Main location for logs and other not useful files on applmgr side:

Logs for Concurrent manager, forms and reports: $COMMON_TOP/admin/log/$CONTEXT_NAME

Out files for Concurrent managers: $COMMON_TOP/admin/out/$CONTEXT_NAME

Apache Log files: $IAS_ORACLE_HOME/Apache/Apache/logs

Jserv Log files: $IAS_ORACLE_HOME/Apache/Jserv/logs

There are some log files in $APPL_TOP/admin/$TWO_TASK/log and $AD_TOP/log, but its advisable not to delete these logs as they are very important for debugging.

Main location for logs and other not useful files on oracle side:

Cleanup background_dump_dest, user_dump_dest and core_dump_dest directories on database side. These locations usually have huge trace files.

Hope this helps !!

Advertisement

AutoConfig Search Utility

Sometime if we want to find out a variable to be changed in context file, but we dont know the exact name and the meaning of the variable then we can use autoconfig search utility. Search utility will ask for the keyword to be searched for and will generate the report based on the available variables contaning that search keyword. It will also give the description about the autoconfig variables, which is very useful.

Following is the way to use search utility

-bash-3.00$ perl $FND_TOP/bin/txkrun.pl -script=GenCtxInfRep -keyword=mwa -outfile=$OA_HTML/txkContext_Apps.html
*** ALL THE FOLLOWING FILES ARE REQUIRED FOR RESOLVING RUNTIME ERRORS
*** Log File = /slot/ems2815/appmgr/inst/apps/az1mq206_rws60043rems/logs/appl/rgf/TXK/txkGenCtxInfRep_Wed_Jun_17_00_04_30_2009.log 
Program : /slot/ems2815/appmgr/apps/apps_st/appl/fnd/12.0.0/patch/115/bin/txkGenCtxInfRep.pl started @ Wed Jun 17 00:04:30 2009

*** Log File = /slot/ems2815/appmgr/inst/apps/az1mq206_rws60043rems/logs/appl/rgf/TXK/txkGenCtxInfRep_Wed_Jun_17_00_04_30_2009.log 

The HTML report is generated in /slot/ems2815/appmgr/apps/apps_st/comn/webapps/oacore/html/txkContext_Apps.html

Program : /slot/ems2815/appmgr/apps/apps_st/appl/fnd/12.0.0/patch/115/bin/txkGenCtxInfRep.pl completed @ Wed Jun 17 00:04:59 2009

End of /slot/ems2815/appmgr/apps/apps_st/appl/fnd/12.0.0/patch/115/bin/txkGenCtxInfRep.pl : No Errors encountered
-bash-3.00$

Here I used the keyword as mwa and the report will give all variables having mwa as sub-string. The report will look as shown in this link.

Hope this helps !!

The report will look as shown in this link

Automating FTP from Unix Shell Script

Recently I faced an issue about FTP. I was supposed to ask the name and location of the file as one of the input to the user and get the file at current host where I am running the script. The situation was bit complex. I mean, the inputs from the user were from a GUI tool and that was getting passed to oneĀ  of the shell script. One of the challenge that I faced was FTPing the file from some other server to the current server. Because normal FTP command ask for user ID and password and is interactive.

But with little investigation I was able to get the correct command options for FTP that can be used inside a shell script and its a totally non-interactive version. Here is the FTP code I used.

EMSUI_SOURCE_LOCATION=$1
echo "echo \"open statj11" >> $HOME/ftp.sh
echo "quote USER ora1818" >> $HOME/ftp.sh
echo "quote PASS ORA1818" >> $HOME/ftp.sh
echo "bin" >> $HOME/ftp.sh
echo "get $EMSUI_SOURCE_LOCATION $HOME/dump/GC_AGENT/`basename $EMSUI_SOURCE_LOCATION`" >> $HOME/ftp.sh
echo "close" >> $HOME/ftp.sh
echo "quite\" | ftp -n" >> $HOME/ftp.sh

sh $HOME/ftp.sh

Basically I am connecting to statj11 server as ora1818 user. The password for this user is ORA1818. EMSUI_SOURCE_LOCATION is the variable which has name and location of the file to be FTPed. I am taking the name and location (complete path) of the file to be FTPed from the user. (EMSUI_SOURCE_LOCATION=$1)

`basename $EMSUI_SOURCE_LOCATION` will give you the name of the file to be FTPed, which I am using as the name of my FTPed file.

All the above commands are echoed to a file called $HOME/ftp.sh and then I am executing this script which will FTP the required file.

Hope this helps !!