Forgot your password?    
+ Reply to Thread
Results 1 to 5 of 5

Thread: RMAN Backup , List ,Configure and Report Backups

  1. #1
    Expert Oracle Administrator
    Join Date
    Oct 2011
    Location
    New Delhi, India
    Posts
    427

    RMAN Backup , List ,Configure and Report Backups

    A. Backup a database

    RMAN> BACKUP DATABASE;

    backup current controlfile
    RMAN> BACKUP CURRENT CONTROLFILE;

    --backup datafiles
    RMAN> BACKUP AS BACKUPSET DATAFILE
    '<datafile name>', '<datafile name>';

    --backup all datafiles in the database: (bit-for-bit copies, created on disk)
    RMAN> BACKUP AS COPY DATABASE;

    Backup archive logs:
    RMAN> BACKUP ARCHIVELOG TIME BETWEEN 'SYSDATE-10' AND 'SYSDATE-2';

    Backup tablespace:
    RMAN> BACKUP TABLESPACE system, users, tools;

    Backup controlfile:
    RMAN> BACKUP CURRENT CONTROLFILE TO DESTINATION '<directory where backup is to be taken>';

    Backup parameter file:
    RMAN> BACKUP SPFILE;


    Backup validation confirms that a backup could be run, by confirming that all database filesexist and are free of physical and logical corruption, this does not generate any output.
    BACKUP VALIDATE DATABASE ARCHIVELOG ALL;

    backup all archive logs created more than 1 and less than 5 days ago.
    BACKUP ARCHIVELOG FROM TIME 'SYSDATE-5' UNTIL TIME 'SYSDATE-1';

    backup all archive redo logs created between sequence numbers <startseq> and <tillseq>
    BACKUP ARCHIVELOG FROM SEQUENCE <startseq> UNTIL SEQUENCE <tillseq>;

    backup all archive redo logs created between SCN <startscn> and <tillscn>
    BACKUP ARCHIVELOG FROM SCN <startscn> UNTIL SCN <tillscn>;


    Example 1 : To Backup a database with 2 channels (for parallelism) to Tape with 2 files in one backupset at a particular location use :
    (for Disk use disk instead of sbt_tape)

    run {
    allocate channel t1 type SBT_TAPE;
    allocate channel t2 type SBT_TAPE;
    backup filesperset 2 format ‘/u01/backuploc/df_%t_%s_%p’ database;
    }

    Example 2 : To Backup a archives with 2 channels (for parallelism) to Tape , and remove the archive after backup use :

    run {
    allocate channel t1 type ‘SBT_TAPE’;
    allocate channel t2 type ‘SBT_TAPE’;
    backup format ‘al_%t_%s_%p’ archivelog all delete input;
    }




    B. LISTING BACKUPS

    Listing Incarnations

    A new incarnation of the database is created when you perform the open resetlogs operation. To view the list of database incarnations,

    RMAN> List incarnation;

    List Summary of Backups

    The summary of backups include backupset key, the status, device type, completion time etc,

    RMAN> List Backup Summary;
    RMAN> List expired Backup of archivelog all summary;
    RMAN> List Backup of tablespace Users summary;

    List Backups of various files

    It provides the summary of the backups available for each datafile, controlfile, archivelog file and spfile.

    RMAN> List Backup By File;

    Detailed Report

    If you want the detailed report on the backups, then issue the following command.

    RMAN> List Backup;

    It lists the all available information about the backups.

    Expired Backups

    The list backup shows both available and expired backups. To view only the expired backups,

    RMAN> List expired Backup;
    RMAN> List expired Backup summary;
    RMAN> List expired Backup of Archivelog all;
    RMAN> List expired Backup of datafile 1;

    Listing Tablespace and Datafile Backups

    RMAN> List Backup of Tablespace Users;
    RMAN> List Backup of Datafile 1;

    Listing Archivelog Backups

    RMAN> List Archivelog all;
    RMAN> List Archivelog all backedup 2 times to device type sbt;

    Listing Controlfile and Spfile Backups

    RMAN> List Backup of Controlfile;
    RMAN> List Backup of Spfile;

    The above list commands displayed information about the backusets.
    If you have performed Image copy backups then you must use the list copy command as shown below


    RMAN> List Copy;
    RMAN> List Copy of database;
    RMAN> List Copy of tablespace test;
    RMAN> List Copy of archivelog all;
    RMAN> List Copy of archivelog from sequence 121 until sequence 160;
    RMAN> List Copy of Controlfile;
    RMAN> List Copy of Spfile;


    C. CONFIGURE BACKUPS

    Show all configurable settings:
    RMAN> SHOW ALL;

    Write disk backups to the /tmp directory (%U will be replaced with unique filenames)
    RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/tmp/%U';

    Backup using a flash recovery area rather than disk
    RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT CLEAR;

    Configure RMAN to back up the control file after each backup
    RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;

    By default, RMAN automatically names control file backups and stores them in the flash recovery area.
    To configure RMAN to write control file backups to the /cfilebackups directory( %F will generate a unique filename) :
    RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/cfilebackups/cf%F';

    Ensure that RMAN retains all backups needed to recover the database to any point in time in the last 7 days:
    RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;

    Retain three backups of each datafile:
    RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 3;

    Delete backups no longer required by the retention policy:
    RMAN> DELETE OBSOLETE

    To override the configured retention policy for individual backups - use BACKUP.. KEEP (or CHANGE.. KEEP)

    Configure backups to run in parallel by assigning two sbt channels:
    RMAN> CONFIGURE DEVICE TYPE sbt PARALLELISM 2;

    Reset any CONFIGURE setting to its default by running the command with the CLEAR option
    RMAN> CONFIGURE CHANNEL DEVICE TYPE sbt CLEAR;
    RMAN> CONFIGURE RETENTION POLICY CLEAR;


    D. REPORT BACKUPS

    To see what datafiles/tablespaces haven't been backed up in the last 3 days use:
    RMAN> report need backup days=3;


    To see for which datafiles/tablespaces you haven't got at least 2 copies of backups (Retention policy to REDUNDANCY 2).
    RMAN> report need backup redundancy 2;


    To see objects which have been created with options like UNRECOVERABLE (for reasons of speed) and have not been backed up yet use:
    RMAN> report unrecoverable;


    For the format specifiers specified in format clause refer to : RMAN-Format-clause

  2. #2
    Administrator
    Join Date
    Oct 2011
    Posts
    13

    ORA-19566: exceeded limit of 0 corrupt blocks

    Hello sir,

    Need your help please check the logs below.


    RMAN> backup database;

    Starting backup at 06-FEB-12
    using channel ORA_DISK_1
    channel ORA_DISK_1: starting full datafile backupset
    channel ORA_DISK_1: specifying datafile(s) in backupset
    input datafile fno=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf
    input datafile fno=00003 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
    input datafile fno=00002 name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
    input datafile fno=00004 name=/u01/app/oracle/oradata/orcl/users01.dbf
    channel ORA_DISK_1: starting piece 1 at 06-FEB-12
    RMAN-03009: failure of backup command on ORA_DISK_1 channel at 02/06/2012 00:36:36
    ORA-19566: exceeded limit of 0 corrupt blocks for file /u01/app/oracle/oradata/orcl/system01.dbf
    continuing other job steps, job failed will not be re-run
    channel ORA_DISK_1: starting full datafile backupset
    channel ORA_DISK_1: specifying datafile(s) in backupset
    including current control file in backupset
    including current SPFILE in backupset
    channel ORA_DISK_1: starting piece 1 at 06-FEB-12
    channel ORA_DISK_1: finished piece 1 at 06-FEB-12
    piece handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/2012_02_06/o1_mf_ncsnf_TAG20120206T003551_7lz48pnj_.bkp tag=TAG20120206T003551 comment=NONE
    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
    RMAN-00571: ================================================== =========
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ================================================== =========

    RMAN-03009: failure of backup command on ORA_DISK_1 channel at 02/06/2012 00:36:36
    ORA-19566: exceeded limit of 0 corrupt blocks for file /u01/app/oracle/oradata/orcl/system01.dbf


    Thanks,
    Pradip

  3. #3
    Oracle Administrator
    Join Date
    Dec 2011
    Posts
    92
    You have some block corruption in your system datafile.

    You can find the corrupt blocks either by querying the v$database_block_corruption

    or

    by checking your alert log file.

    The alert log file should contain a error like this


    Code:
    Corrupt block relative dba: 0x0040f001 (file 1, block 61445)
    Completely zero block found during backing up datafile
    Reread of blocknum=61445, file=/u01/app/oracle/oradata/orcl/system01.dbf. found same corrupt data
    To fix the problem do block media recovery in rman.

    RMAN> blockrecover datafile 1 block 61445;

  4. #4
    Expert Oracle Administrator
    Join Date
    Oct 2011
    Location
    New Delhi, India
    Posts
    427
    Pradeep ,

    1) First run dbv (dbverify ) against the file which is reporting the corrupt blocks

    2) If you have many corrupt blocks and have a proper backup , you can restore and recover the corrupt datafile - as this is system , the databaser needs to be closed

    3) If very few blocks are corrupt -
    a) You can also use the RMAN blockrecover feature
    b) You can use this script to get the segment for the corrupted block Retrieve-Segment-from-dba_extents-for-a-file-and-block-in-Oracle-Database
    c) Based on the segment too , corrective action can be taken.

  5. #5

    Difference between RMAN and User Managed Backups

    Recovery Manager User-Managed Method
    When backing up online files, RMAN rereads fractured data blocks to get a consistent read. You do not need to place online table spaces in backup mode when performing backups. Requires placing online tablespaces in backup mode before backing them up, and then taking the tablespaces out of this mode after the backup is complete. Serious database performance and manageability problems can occur if you neglect to take tablespaces out of backup mode after an online backup is complete
    Performs incremental backups, which back up only those data blocks that changed after a previous backup. You can recover the database using incremental backups, which means that you can recover a NOARCHIVELOG database. However, you can only take incremental backups of a NOARCHIVELOG database after a consistent shutdown. Backs up all blocks, not just the changed blocks. Does not allow you to recover a NOARCHIVELOG database.
    Computes checksums for each block during a backup, and checks for corrupt blocks when backing up or restoring. Many of the integrity checks that are normally performed when executing SQL are also performed when backing up or restoring. Does not provide error checking.
    Omits never-used blocks from datafile backups so that only data blocks that have been written to be included in a backup Includes all data blocks, regardless of whether they contain data.
    Uses the repository to report on crucial information, including:
    • Database schema at a specified time
    • Which files need a backup
    • Which files have not had a backup in a specified number of days
    • Which backups can be deleted because they are redundant or cannot be used for recovery
    • Current RMAN persistent settings
    Does not include any reporting functionality
    Stores RMAN scripts in the recovery catalog. Requires storage and maintenance of operating system-based scripts.
    Allows you to easily create a duplicate of the production database for testing purposes, or easily create or back up a standby database. Requires you to follow a complicated procedure when creating a test or standby database.
    Performs checks to determine whether backups on disk or in the media catalog are still available. Requires you to locate and test backups manually.
    Performs automatic parallelization of backup and restore operations. Requires you to parallelize manually by determining which files you need to back up and then issuing operating system commands in parallel.
    Tests whether files can be backed up or restored without actually performing the backup or restore. Requires you to actually restore backup files before you can perform a trial recovery of the backups.
    Performs archived log failover automatically. If RMAN discovers a corrupt or missing log during a backup, then it considers all logs and log copies listed in the repository as alternative candidates for the backup. Cannot failover to an alternative archived log if the backup encounters a problem.

+ Reply to Thread

Similar Threads

  1. Difference / Advantages of Oracle RMAN over User Managed Backups
    By sukhman in forum Backup, Restoration & Recovery, RMAN, Flashback, Datapump, Export, Import
    Replies: 0
    Last Post: 02-10-2012, 03:01 PM
  2. Enable block change tracking in Oracle for RMAN backups
    By Amit in forum Backup, Restoration & Recovery, RMAN, Flashback, Datapump, Export, Import
    Replies: 2
    Last Post: 02-03-2012, 02:04 PM
  3. Regarding Rman backup retention policy
    By ajaysingh in forum Backup, Restoration & Recovery, RMAN, Flashback, Datapump, Export, Import
    Replies: 3
    Last Post: 11-09-2011, 07:27 PM
  4. Backup & Restoration of Control Files using RMAN
    By sandeep.negi27 in forum Backup, Restoration & Recovery, RMAN, Flashback, Datapump, Export, Import
    Replies: 1
    Last Post: 11-03-2011, 01:13 PM

Tags for this Thread

Posting Permissions

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

DBA Lounge (P) Ltd. deals in Oracle Technologies on Consulting, Resourcing, Corporate Training


Online and corporate training available on Oracle Database 11g, Oracle 11g Real Application Cluster (RAC), Oracle Applications 11i/R12, Oracle Fusion Middleware 11g, Oracle Identity Management-OIM, Oracle Internet Directory 11g-OID, Oracle Business Intelligence Enterprise Edition-OBIEE, Oracle Golden Gate, Oracle Access Management-OAM, Oracle Internet Directory-ODS, Oracle Identity Analytics Architecture-OIA Statistics