Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 

Script to clean up Oracle trace & dump files

Oracle Database Tips by Donald BurlesonDecember 10,  2015

 

This is an excerpt from the book "Oracle Shell Scripting", a great source of UNIX scripts for file management.

The UNIX/Linux "find" command can be used to locate any external Oracle files including database files (dbf), alert log files, and all trace and dump files.  The "which" command can also find files, and we can easily find the location of the SQL*Plus executable:

root> which sqlplus
/u01/home/oracle/product/9.1.2/bin/sqlplus


For non-executable files, you can use the UNIX find command to locate a particular file. Please note that in chapter 8 we extend this command to search for all files that contain specific strings:

root> pwd
/

root> find . -print|grep –i dbmspool.sql
./oracle/product/9.1.2/rdbms/admin/dbmspool.sql

In the example above, we cd to the root directory (/) and issue a UNIX find command to display every file on the Oracle server.  Next, we pipe the output of the find command to grep, which searches for the dbmspool.sql file.

Below is a script that will automatically remove all trace files from the background_dump_destination filesystem in UNIX.


# Cleanup trace files more than 7 days old

root> find $DBA/$ORACLE_SID/bdump/*.trc -mtime +7 -exec rm {} \;
root> find $DBA/$ORACLE_SID/udump/*.trc -mtime +7 -exec rm {} \;
root> find $DBA/$ORACLE_SID/cdump/*.trc -mtime +7 -exec rm {} \;

Note that the first part of this script (before the –exec) displays all trace files that are more than 7 days old.

root> find $DBA/$ORACLE_SID/bdump/*.trc -mtime +7

/u01/app/oracle/admin/janet1/bdump/janet1_arc0_25005.trc
/u01/app/oracle/admin/janet1/bdump/janet1_arc0_25173.trc
/u01/app/oracle/admin/janet1/bdump/janet1_arc0_9312.trc


 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.