IQ: How to Check the Status of an Oracle Database Backup (Turnkey Systems)


Doc ID    SOLN243131
Version:    11.0
Status:    Published
Published date:    17 Feb 2016
Created Date:    14 Jan 2014
Author:   
emilio
 

Details

This article is to give some items to check for a successful database backup

Problem Clarification

There is currently no easy way to determine if a DB Backup is good, how long it took and the size from a single snapshot, other than by reviewing the /var/log/Avaya/CCR/backup/db_backup.log which is hard to read.

This article will address the following questions.

  • Determine the Status, Start time, size and duration of DB Backups for Full, Incremental and Archive log backups
  • Determine if the a DB Backup (file) is valid
    • Listed in the Oracle Database Dictionary
    • Validate a DB Backup using RMAN
  • Determine the contents and location of a Oracle Database Backup Set using RMAN

 

Cause

 There is no easy way to check if a DB Backup was complete or how long it took, currently the only way to do this is by viewing of the /var/log/Avaya/CCR/backup/db_backup.log by matching the timestamps of the start and finish of each backup execution, this is tedious and error prone.

Solution

 Use the following script and run agains the Oracle Dictionary:

 Determine the Status, Start time, size and duration of DB Backups for Full, Incremental and Archive log backups

Show all the status of all backups (Full, Incremental, Archiveolog).

[oracle@poppy ~]$  sqlplus / as sysdba @/home/oracle/check_db_backups.sql

 Show all Full and Incremental Backups (it excludes Archivelog Backups)

[oracle@poppy ~]$  sqlplus / as sysdba @/home/oracle/check_db_backups.sql | egrep 'FULL|INC';

SESSION_KEY INPUT_TYPE    STATUS     START_TIME       OUTPUT_BYTES TIME_TAKE

----------- ------------- ---------- ---------------- ------------ ---------

       4446 DB INCR       COMPLETED  2014-01-02 01:45     1.11G    00:05:44

       4526 DB INCR       COMPLETED  2014-01-03 01:45     1.11G    00:05:42

       4606 DB FULL       COMPLETED  2014-01-04 01:45     2.15G    00:18:19

       4680 DB INCR       COMPLETED  2014-01-05 01:45     1.45G    00:07:35

       4760 DB INCR       COMPLETED  2014-01-06 01:45     1.35G    00:07:32

       4840 DB INCR       COMPLETED  2014-01-07 01:45     1.30G    00:07:16

       4920 DB INCR       COMPLETED  2014-01-08 01:45     1.29G    00:07:27

       5011 DB INCR       COMPLETED  2014-01-09 01:45     1.38G    00:07:54

       5091 DB INCR       COMPLETED  2014-01-10 01:45     1.52G    00:08:32

       5171 DB FULL       COMPLETED  2014-01-11 01:45     2.46G    00:21:45

       5245 DB INCR       COMPLETED  2014-01-12 01:45     1.70G    00:09:27

       5325 DB INCR       COMPLETED  2014-01-13 01:45     1.54G    00:08:06

       5405 DB INCR       COMPLETED  2014-01-14 01:45     1.65G    00:09:12

 

[oracle@poppy ~]$ cat /home/oracle/check_db_backups.sql

 

(See Attached file if you need to want to cut & paste the above)

 

In order to run the script you need to create/upload  it on the target server (IQ TK DB Server)

su - oracle

Create the file  from scratch by cut & pasting  (See Attachements section of this KB for the source file).

  • vi /home/oracle/check_db_backups.sql
  • Copy code into file
  • save file with ":q"         

If you prefer you can download the script, which is attached to this article, and upload to the /home/oracle directory of the DB TK Server.

Make sure it is readable by oracle, if it is not then do this

  • chown oracle:oinstall /home/oracle/check_db_backups.sql

Then run it as sysdba user

sqlplus / as sysdba @/home/oracle/check_db_backups.sql

 

Determine if the an Oracle Database Backup (file) is valid

      Listed in the Oracle Database Dictionary

                   If the database backup is listed  in the Oracle dictionary (See above query against the then v$rman* views, according to Oracle it is a valid backup

                   

        Validate a DB Backup using RMAN

                  To validate the authenticity of an Oracle Database Backup with 100% is by performing a restore on target or test bed, it is recommended to do this at least once before disaster strikes. 

                  The alternative is to run a logical restore using RMAN tools. Details TBA.

Determine the (configured) location for the TK DB Backups:

1) One way, check the /avaya/log/bkup_config.log, assuming cofig_db_backup.sh script was used to confgire  (db server)

2)Another way, using SQLPLUS

su - oracle                                       (from DB Server)

sqlplus / as sysdba                          

sql>show parameter recovery

db_recovery_file_dest                string      /u02/db_backups

3)Another way, check the /var/log/backup/db_backup.log  and check where last backup was directed to.

 

Attachment File

check_db_backups.sql
534Bytes • < 1 minute @ 56k, < 1 minute @ broadband


Additional Relevant Phrases

How to tell if a backup completed

Avaya -- Proprietary. Use pursuant to the terms of your signed agreement or Avaya policy