Thinking Out Loud

September 1, 2022

Delete Trace Files (“*.tr?”) For 44 ORACLE_HOME

Filed under: linux,oracle,shell scripting — mdinh @ 1:31 am

Recently, I had bloged about https://mdinh.wordpress.com/2022/08/21/find-all-oracle-alert-logs

The same concept can be used to delete tracefiles.

There are 44 ORACLE_HOMES for the ExaCS environment.

A lot of manual work was performed to clean up the enviroment.

Since there are so many trace files generated, trace files older than 7 days are removed to avoid any “Argument list too long” errors

[oracle@host1 ~]$  ps -ef|grep -c [p]mon
44
[oracle@host1 ~]$ rm /u02/app/oracle/diag/rdbms/$DB_UNIQUE_NAME/*/trace/*.tr?
-bash: /bin/rm: Argument list too long
[oracle@host1 ~]$ crontab -l
* * * * * /bin/find /u02/app/oracle/diag/rdbms/*/*/trace -name "*.tr?" -type f -mtime +7 -exec rm -fv {} \; > /tmp/rm_trace.txt 2>&1
[oracle@host1 ~]$ 

Advertisement

Create a free website or blog at WordPress.com.