Friday, February 14, 2014

Oracle Logs CLEANUP Script

In this post, I'll share a script to backup & cleanup Oracle logs associated with a specific database on the Oracle server.

This script was tested on Linux & SUN environments.

You can download the script from here:
https://www.dropbox.com/s/eytsv5duxe95lrh/oracle_cleanup.sh?dl=0

Once you run it, it will ask you to select a database (in case you have multiple running databases on the server), then it will ask you the location you want to back up the logs, then it will start to clean up all logs under udump, bdump, cdump folder plus the audit logs and also will clean up the logs of the listener associated with the selected database.

Note: This script will backup and delete all logs and will keep the logs of the last 5 days only.

Note: it's recommended to test this script on a test environment before you run it on production.

Also, you can download the whole DBA bundle which having many other smart and easy to use scripts for database administration tasks:
http://dba-tips.blogspot.ae/2014/02/oracle-database-administration-scripts.html

DISCLAIMER: THIS SCRIPT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ANY WARRANTY. IT IS PROVIDED "AS IS".

Below is the code of this script in case the download link didn't work:



4 comments:

  1. Dear Script not available on provided links
    Thanks

    ReplyDelete
  2. Dear Md. Tanweer,

    Thanks a lot for your comment.

    I've updated the links to a good working ones.

    Thanks again and sorry for any inconvenience caused.

    Mahmmoud ADEL

    ReplyDelete
  3. Enjoyed reading the article above, really explains everything in detail, the article is very interesting and effective. Thank you and good luck for the upcoming articles Oracle soa certification

    ReplyDelete
  4. Enjoyed reading the article above, really explains everything in detail, the article is very interesting and effective. Thank you and good luck for the upcoming articles. OSB Online Training

    ReplyDelete