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

Thread: RMAN script

  1. #1
    Join Date
    Oct 2004
    Posts
    3

    Question RMAN script

    I have many Oracle instances (8i) that I back up with RMAN. Most of them are on unix. Each time a backup is finished, I send a email to let me know the backup is finished. So, I have about 30 emails each morning. I was wondering if there were a script somewhere already written to query the rman database directly (not the catalog) to retreive the information I want (like last backup of all my database with the exit status) so I would have only one email! If it does not exist yet, do you know wich tables we can query to get the exit status of the backup. The only information I have is the command list or report of the rman utility.

    Thanks for the help.

  2. #2
    Join Date
    Sep 2001
    Location
    Ohio
    Posts
    334
    Look at the RC Views in the recovery catalog.

    Here is a script I use to check the backups for the last 14 days. I'm sure you can modify it to meet your needs.

    Code:
    BREAK ON DATABASE skip 1
    col elapsed for 99,999.9
    SELECT name "DataBase", bs_key, set_count, status,
            DECODE(backup_type,'D','DATABASE','L','ARCHIVE LOG','I','INCREMENTAL') TYPE,
            incremental_level "Level",
            TO_CHAR(start_time, 'MM/DD/YY-HH24:MI') "Start Time",
            elapsed_seconds/60 "Elapsed"
    FROM rc_backup_set a, rc_database b
    WHERE start_time > sysdate - 14
      AND name LIKE UPPER('&DataBase%')
      AND a.db_key = b.db_key
      AND elapsed_seconds BETWEEN 0 AND 86399
    ORDER BY 1, 7
    /
    HTH
    Jodie

  3. #3
    Join Date
    Oct 2004
    Posts
    3
    The command you sent tells me what backups were done on a database but does not tell me if the backup succeeded. For example, some of my database are on tape and sometimes, we get an error because of the tape. I was wondering if I can get the status from the database. Here is an example of one error I got :

    RMAN-10035: exception raised in RPC: ORA-19506: failed to create sequential file, name="al_17894_1_537998539", parms=""
    ORA-27028: skgfqcre: sbtbackup returned error
    ORA-19511: sbtbackup: Failed to open for backup.
    RMAN-10031: ORA-19624 occurred during call to DBMS_BACKUP_RESTORE.BACKUPPIECECREATE
    RMAN-10031: ORA-19624 occurred during call to DBMS_BACKUP_RESTORE.BACKUPPIECECREATE

    Recovery Manager complete.

  4. #4
    Join Date
    Sep 2001
    Location
    Ohio
    Posts
    334
    Originally posted by lemjoh01
    The command you sent tells me what backups were done on a database but does not tell me if the backup succeeded. For example, some of my database are on tape and sometimes, we get an error because of the tape. I was wondering if I can get the status from the database. Here is an example of one error I got :

    RMAN-10035: exception raised in RPC: ORA-19506: failed to create sequential file, name="al_17894_1_537998539", parms=""
    ORA-27028: skgfqcre: sbtbackup returned error
    ORA-19511: sbtbackup: Failed to open for backup.
    RMAN-10031: ORA-19624 occurred during call to DBMS_BACKUP_RESTORE.BACKUPPIECECREATE
    RMAN-10031: ORA-19624 occurred during call to DBMS_BACKUP_RESTORE.BACKUPPIECECREATE

    Recovery Manager complete.
    If you get an error like that, you won't have an entry in the Catalog. Only successful backups are in the catalog. So, you can check for a backup, if there isn't one, you had a problem!

  5. #5
    Join Date
    Aug 2002
    Location
    Atlanta
    Posts
    1,187
    I tail my logs and then pipe them to a file and then have that file emailed to me so I can quickly glance through the last 10 lines of each log.

    From my experience any sign of trouble will be so indicated in the last few lines of the logfile
    I'm stmontgo and I approve of this message

  6. #6
    Join Date
    Feb 2003
    Location
    Leeds, UK
    Posts
    367
    What 3rd party backup software are you using for media management? If it's Netbackup then I have a script that you could make some changes to that would provide you with that one email. Let me know if you me to post it.

  7. #7
    Join Date
    Oct 2004
    Posts
    3
    Yes, It is with NetBackup! If you can post it, It would be great!

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