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. I need to find a list of ""very essential"" user/schemas off oracle database. want to delete unnecessary users in order to gain more space and just keep the application data (which I know about users / schemas). However, I cannot find a list of what is needed and / or what can be deleted.
    can you give me a list or documentation that has this information?

    ReplyDelete
    Replies
    1. Hi Carlos,

      What are you trying to do is very critical, only Oracle Support can help you with that.

      Delete