Call (800) 766-1884 for Oracle support & training
Free Oracle Tips


Oracle Consulting Support
Oracle Upgrades
Use New Oracle Features
Oracle Replication Support
Oracle Training
Remote Oracle DBA
System Documentation
Oracle Tips
Oracle Performance
 

Free Oracle Tips


 

HTML Text

BC Oracle tuning

Oracle training

Oracle support

Remote Oracle

 

 

 
 

Oracle Tips by Burleson Consulting
 

A step-by-step approach to deleting unwanted UNIX files

When writing UNIX scripts to automatically delete obsolete Oracle trace files, audit files, dump files and archived redo logs, it is a good idea to carefully develop the UNIX script through iteration, getting each piece working. Remember, even seasoned UNIX guru’s will not write a complex command until each component is tested.

We start by going to the archived redo log directory and finding all redo log files that are more than 7 days old. In this example, we take a cold backup each night, and the DBA has not use for elderly redo log files.

root> cd $DBA/$ORACLE_SID/arch
root> find . -mtime +7

./archlog2251.arc
./archlog2252.arc
./archlog2253.arc
./archlog2254.arc

Now that we have the list of files, we can add the UNIX rm command to this syntax to automatically remove all files that are more than 7 days old. In this case, we can use either the –exec or the xargs commands to remove the files.

find . –mtime +7 –exec rm {} \;


The above is an excerpt from the "Oracle UNIX Administration Handbook" by Oracle press, authored by Donald K. Burleson.

 

Download your Oracle scripts now:

www.oracle-script.com

The definitive Oracle Script collection for every Oracle professional DBA

 

 

  
 

Oracle performance tuning software 
 
 
 
 

Oracle performance tuning book

 

 
 
 
Oracle performance Tuning 10g reference poster
 
 
 
Oracle training in Linux commands
 
Oracle training Excel
 
Oracle training & performance tuning books
 

 

   

Copyright © 1996 -  2014 by Burleson. All rights reserved.

Oracle® is the registered trademark of Oracle Corporation. 

Hit Counter