Showing posts with label RMAN. Show all posts
Showing posts with label RMAN. Show all posts

RMAN Cross check Commands

on Monday, 21 May 2012

RMAN Cross check Commands

Crosscheck is needed when an archivelog or file is manually removed i.e., not deleted by RMAN.  This command ensures the data about backups in recovery catalog or controlfile is synchronized with corresponding data on disk

The crosscheck command does not delete any file that is unable to find out, but updates their repository records to expired

Use the crosscheck command to synchronize the physical reality of backups and copies with their logical records in the RMAN repository

For example

            RMAN> crosscheck backupset 326;

                       You will get O/P as backup piece found it to be available, which confirms that the backup files exist and are usable.

Validate Commands for RMAN

on

Validate Commands for RMAN 

The validate commands helps you ensure that the backed-up files exist in the proper location and they are readable and free from any logical and physical corruption for exampme

            RMAN> validate backupset 9

                        The following command doesn’t restore any data files.  It only validates the contents of the backup sets are restorable

             RMAN> run {

                                    Allocate channel d1 type disk;

                                    Restore database validate;

                                    }

             The “finished restore” message indicates database can be recovered if necessary

Reports commands for RMAN

on

Reports commands for RMAN 

Use the report commands to answer for the following question
  1. which files need a backup?
  2. which files or backups are obsolete and can be deleted
  3. which files have not been backed up recently and etc….
  •  if you have retention policy configured, then you can just run report need backup to determine which files need backups
            RMAN> report need backup
  • To report the database structure at a specified point in time
             RMAN> report schema
  •  Which backup can be delete (obsolete)
                RMAN> report obsolete
  •  Which files are not recoverable
              RMAN> report unrecoverable
  •  To delete obsolete backup
              RMAN> delete obsolete

RMAN List commands

on

RMAN List commands

The primary purpose of list command is to determine which backups or copies are available
  • To list backup sets, backup pieces and proxy copies
             RMAN> list backup
  •  To list backups by file
             RMAN> list backup by file
  •  To list backups in summary mode
             RMAN> list backup summary
  •  To list backups of all files in database
             RMAN> list backup of database;
  •  To list copy of specified datafile
              RMAN> list copy of datafile ‘/disk1/oradata/tbs_1.f ’;
  •  To list specified backup set
               RMAN> list backupset 213
  •  To list a backup by tag
               RMAN> list backup TAG ‘weekly _full_db_bk’
  •  To list archivelog files
              RMAN> list archivelog all;

RMAN-Show commands

on

RMAN-Show commands

  •  To show all RMAN configuration settings
              RMAN> show all;
  •  To show retention policy configuration settings
              RMAN> show retention policy
  •  To show the automatic channel settings
              RMAN> show channel
  •  To show the default device type
             RMAN> show default device type
  •  To show the number of identical copies of each backup
             RMAN> show archivelog backup copies
             RMAN> show datafile copies
  •  To show the maximum size for RMAN backup sets
              RMAN> show maxsetsize
  •  To show the snapshot controlfile filename
              RMAN> show snapshot controlfile;

Steps for RMAN CLONING

on

Steps for RMAN CLONING

Step – 1

 Create a new init.ora(parameter file) file for the auxiliary database.  Create physical directories like udump, cdump, bdump.  If your target db datafiles and log files directories are different from source then mention following converters in parameter file

             . DB_file_name_convert

            . LOG_file_name_convert

 Step – 2

 Start the auxiliary db instance in nomount stage.  Target should be in mount or open stage

             Sql> startup nomount

 Step – 3

 Create network files.  Create listener at auxiliary side and tns at catalog

 Step – 4

 Connect to recovery catalog to target database and auxiliary database

             RMAN> connect catalog rman/rman target sys/sys@to-target auxiliary sys/sys@to-auxiliary

 Step – 5

After connecting all three databases take a backup of target database

            RMAN> backup database plus archivelog;

Step – 6

 Issue the RMAN duplicate command OS follows

             RMAN> duplicate target database to AUX (dbname)

 If you use above command, the files are restored to the target database, after which an incomplete recovery is performed and new database is opened with resetlogs command.