Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to free up the disk space on my Linux machine. I've drill down the space usage and found that the following directories have a big size

/u01/app/11.2.0/grid/cv/log
/u01/app/11.2.0/grid/log/diag/tnslsnr/r1n1/listener_scan2/alert (Contains xml files)
/u01/app/11.2.0/grid/rdbms/audit(Contains .aud files)
/home/oracle/oradiag_oracle/diag/clients/user_oracle/host_XXXXXXXXXX/alert(Contains xml files)
/u01/app/oracle/diag/rdbms/crimesys/crimesys1/alert (Contains xml files)

Can I delete contents from these directories? Note: I mean contents and not directories.

share|improve this question
    
I suggest you research what each directory contains, what is creating files there and how that should best be regulated (by direct delete or other means). Was that that intention of your question? – Leigh Riffel Mar 28 '12 at 13:38
    
@LeighRiffel I just wanted to free up the space and thought that these files were junks. I've already deleted files from /u01/app/11.2.0/grid/cv/log. These files are generating every 5 minutes. To stop generation of them you should write SRVM_TRACE="false" at the top of the script $ORA_CRS_HOME/bin/cluvfy for me it is /u01/app/11.2.0/grid/bin/cluvfy(line 25) The solution of this was found on metalink. – kupa Mar 28 '12 at 15:21

Almost all files can be safely deleted manually. Usually it is better to keep:

alert_+ASM1.log (or the one related to your instance)
trace.xml
listener.xml (or the one related to your listener)

Beside these there some notes:

  • Oracle alert.log is normally set to growth to infinite.
  • Alert xml files are automatically rotated so you can keep online the last one
  • All cdump, udump and other incident and trace files are unusel unless you need to debug a problem
  • In 11gR2 there are some bugs related to the infinite growth of rbal trace file and there is no patch for the moment

Oracle also suggest you to use adrci command to purge old logs. You can run adrci and execute the following command

purge -age 60 -type ALERT

This will purge only XML logfiles marked as alert. So trace.xml logs. Adrci does not work with text files: they must be managed manually. This is an expected behaviour. Moreover various bugs have been reported about adrci purge feature. I still prefer to remove them manually through a shell script keeping online online last recent files. For alert.log I just do:

zip alert.log (your log name may differ)
> alert.log
share|improve this answer
    
So, they created a product, that will gradually fill up your hard drive, causing your system to hang, and don't mention this in big red letters on the cover of their manual? Great... Oracle FTW – Wouter May 20 at 10:09

You can change the default retention policy of oracle log and trace files.

Source: https://streetkiter.wordpress.com/2011/04/06/do-you-really-need-one-year-old-logs-and-traces-for-your-oracle-database/

Relevant extract:
There are two parameters: SHORTP_POLICY (default 720 hours) and LONGP_POLICY (default 8720 hours). so SHORTP_POLICY is 30 days while LONGP_POLICY is 365 days.

From the commandline run "adrci". In adrci, use the following commands.

adrci> show homes
....(homes are listed)...
adrci> set home diag/....(the location)
adrci> show control
.... (current settings are listed) ....
adrci> set control (SHORTP_POLICY = 168)
adrci> set control (LONGP_POLICY = 720)

And now the traces are dropped after one week (SHORTP) or one month (LONGP).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.