December 25, 2006

Purging Junk files from DBTier filesystem.

Often DBA's are facing disk full or excessive rate of disk usage issues. Excessive disk usage are caused by junk and temporary files that are created by various oracle programs that we are running. Also it slows down the full cold backup. Periodically we should cleanup the junk and temporary files from the database tier and apps tier filesystem in order to free up the filesystem and to speed up the backup process. The following discusses some of the areas that are need to be checked.

Database Tier Filesystem


bdump, cdump, udump directories

We can get the bdump, cdump, udump directories using the following SQL.
SELECT name, value FROM v$parameter WHERE name IN ('background_dump_dest','core_dump_dest','user_dump_dest');

From Oracle Manual :-
background_dump_dest stores trace files for the background processes (LGWR, DBWn, and so on) and an alert file alert_sid.log (where sid is the system identifier).
core_dump_dest It is primarily a UNIX platform parameter, which stores core dump files of oracle processes.
user_dump_dest stores the debugging trace files of oracle user processes.

In the above directories, we can keep only 7 days old log, trace files for reference and after proper backup, we can delete other files.

find $ORACLE_HOME/admin/bdump -name *.trc -mtime +7 -ls -exec rm {} \;
find $ORACLE_HOME/admin/cdump -mtime +7 -ls -exec rm {} \;
find $ORACLE_HOME/admin/udump -mtime +7 -ls -exec rm {} \;

Under background_dump_dest, the alert_SID.log will grow slowly. So we need to truncate it.
cd $ORACLE_HOME/admin/bdump;
cp alert_SID.log alert_SID.log_`date +"%d%m%Y%H%M%S"`;
tail -1 alert_SID.log > alert_SID.log;

$ORACLE_HOME/rdbms/audit
Whenever you are logging into database with sysdba priviliges, oracle server will record the session details in this diretory. Here also we can keep only 7 days old aud files for refernce and we can delete other files.

find $ORACLE_HOME/rdbms/audit -mtime +7 -ls -exec rm {} \;


$ORACLE_HOME/network/admin
Here you can find a log file called, sid.log This file is the listener log file. We can also truncate this file.

cd $ORACLE_HOME/network/admin;
cp sid.log sid.log_`date +"%d%m%Y%H%M%S"`;
tail -1 sid.log > sid.log;

Some of the other directories that are need to be checked.
$ORACLE_HOME/appsutil/outbound/
$ORACLE_HOME/appsutil/log/
$ORACLE_HOME/appsutil/out/
$ORACLE_HOME/.patch_storage

References :-
Note:296354.1 How Do You Reduce The Size Of An Alert Log That Is Too Large To Edit while the DB is running?
Note:1012933.6 General Information: Alert Logs and Trace Files


No comments: