DBAsupport.com Forums - Powered by vBulletin
Results 1 to 7 of 7

Thread: passing RMAN parameters

  1. #1
    Join Date
    Feb 2009
    Posts
    91

    passing RMAN parameters

    I am looking to automate a script that deletes archive logs from disc.

    I want to issue a command like this:

    DELETE NOPROMPT ARCHIVELOG UNTIL SEQUENCE = 300;


    Obviously the number 300 will have to be a variable. Does anybody have an
    example of how I can get a value from sqlplus and pass it to RMAN

  2. #2
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    4,166
    It helps to know what os you are using. If you are using Unix/Linux you can write something in bash shell. For example you can do this:

    Code:
    find /oracle/log/oradata/sid_name/archive/* -type f -mtime +3 -exec rm -rf {} \;
    Which will keep 4 days of archive logs and let RMAN backup the archive log files.

  3. #3
    Join Date
    Feb 2009
    Posts
    91
    thanks for your reply but thats not going to do it for me. Anyway if I were to take that approach I would not want to hard code the path of the archive logs I would want to get the path from the database.

    To expand on my problem I am looking to clean up achive logs on a stdby database and the find will just randomly remove them I need to know if they were actually applied.

    That is why I am looking for a way to pass values from sqlplus to rman.

  4. #4
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334

  5. #5
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    IMHO is probably use days, following will retains last 3 days archiveogs and delete only those who have been backed up

    DELETE NOPROMPT ARCHIVELOG ALL BACKED UP 1 TIMES TO SBT COMPLETED BEFORE 'SYSDATE - 3';

  6. #6
    Join Date
    Jul 2002
    Location
    Lake Worth, FL
    Posts
    1,492

    Cool Configure retention.

    The standard way is to configure the retention period:
    Code:
    CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
    CONFIGURE BACKUP OPTIMIZATION ON;
    And then simply DELETE:
    Code:
    run {
      SQL 'ALTER SYSTEM SWITCH LOGFILE';
      Backup Archivelog All Delete Input;
    }
    "The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb

  7. #7
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    4,166
    Quote Originally Posted by davey23uk View Post
    That is a great website!!!
    In fact I have already sent a link to my wife.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width