Wednesday, 18 January 2012

Oracle Recovery Manager(RMAN) New features in 11g

Oracle 11g introduced many exciting new features in Recovery Manager (RMAN). Lets start using these new features and benefit from it.

• RMAN Proactive health checks :- Now you can proactively check database block corruptions using VALIDATE DATABASE
RMAN > VALIDATE DATABASE;

You can also run the proactive check on a datafile, tablespace or block.
RMAN > VALIDATE DATAFILE 1 BLOCK 10;
RMAN > VALIDATE TABLESPACE users;

• Database Recovery Advisor : – The data recovery advisor automatically diagnoses the corruptions and loss of data on disk and determines the corrective repair options.

The LIST FAILURE command displays any failures with priority of CRITICAL or HIGH in order of importance
RMAN> LIST FAILURE

The ADVISE FAILURE command provides repair advice for failures listed by LIST FAILURE
RMAN > ADVICE FAILURE

The REPAIR FAILURE command applies the repair scripts advised by the ADVISE FAILURE command.
RMAN>REPAIR FAILURE

You can also use PREVIEW command to see the contents of the repair before proceeding to actual repair
RMAN>REPAIR FAILURE PREVIEW

• Faster Backup Compression: The ZLIB compression is faster than original B2ZIP compression with less CPU resources

Use below command for ZLIB compression
RMAN> configure compression algorithm 'ZLIB' ; 

Use below command to change compression to BZIP2
RMAN> configure compression algorithm 'bzip2';

• More backup Comcodession Choices (11gR2 only): Now we have different types of comcodession levels, i.e. LOW, MEDIUM and HIGHT and with CPU resource usage from least to highest.

Here is the example
RMAN> configure comcodession algorithm ‘medium’;

• RMAN Backups to Cloud: Now you can set your RMAN backup destination to Cloud. Amazon provides cloud computing service, but you need to use specially developed media management library. 

• RMAN UNDO bypass: The RMAN backup command no longer backs up the UNDO data that is not needed for recovery. Prior to Oracle 11g, all UNDO transactions that were already committed also backed up. This backup undo optimization minimizes the backup time and storage.

• Duplicate Database from Backup (11gR2 only): Prior 11g, In order to duplicate a database using DUPLICATE TARGET DATABASE command you need connect to target database. In case if target database is down you cannot able to duplicate. From 11g, you can able to duplicate the database without connecting to target database, make sure that you have backups available on duplicate site.

Here is the example for duplicate database
connect auxiliary sys/xxxx@dup 
connect catalog rman/xxx@rmancat
duplicate database 'PRD' to DUP' until time "to_date('01/01/11 10:00:00','mm/dd/yy hh24:mi:ss')" 
db_file_name_convert =( “/dbs1/oradata/PRD","/dbs2/oradata/DUP") 
backup location '/rman_backup' ; 

Duplicate Database options
-NOREDO – Using this option no archivelogs will be applied
-UNDO_TABLESPACE – You must specify the UNDO tablesapce when you are not connected to target database.

• Set NEWNAME Flexibility while restoring Database (11gR2 only): When you are restoring database on different server with different file system structure you need to change data file path using “SET NEWNAME” command. If you have hundreds of datafiles then you need to change the path for all data files.

run 
{
set newname for datafile 1 to ‘/dbs1/oradata/system01.dbf’;
set newname for datafile 2 to ‘/dbs2/oradata/users01.dbf’;
---- (Some detail removed for brevity) ----
restore database; 
}

From 11g, you have flexibility using a single “SET NEWNAME” clause for all datafiles in a tablespace.

run 
{
set newname for tablespace DATA to '/dbs1/oradata/data%b.dbf';
set newname for tablespace INDEX to '/dbs2/oradata/index%b.dbf';
---- (Some detail removed for brevity) ----
Restore database;
}

You can also set the path for entire database using a single command.
run 
{ 
set newname for database to '/dbs1/oradata/%b'; 
restore database;
} 

• TO DESTINATION Clause in BACKUP command (11gR2 only): You can specify a destination location for RMAN backups using “TO DESTINATION” clause .

RMAN> backup tablespace users to destination '/backup/rman;
You can also use this clause in ALLOCATE CHANNEL command 
RMAN> run { 
2> allocate channel c1 type disk to destination '/backup/rman'; 
backup database; 
3> }

• Parallel backup of Same datafile: Now you can break the large datafiles into small sections and it reduces the backup time of large datafiles 

Here is the example
run {
allocate channel c1 type disk format '/rman_backup1/%U';
allocate channel c2 type disk format '/rman_backup2/%U';
backup section size 100m 
datafile 10;
}

• Automatic Block Repair (11g R2 Only): This feature automatically repairs the blocks on primary from blocks on Physical Standby. RECOVER BLOCK enhanced to repair the blocks on Primary as soon as it detects the corruption from standby when available.

• Transported Tablespace Enhancement: Prior 11g, the transported tablespace must be in read-only mode. But from 11g onwards you can transport the tablespace both in read-only and read-write mode.

• Virtual Private Catalog: The virtual catalogs are created within in same RMAN Catalog. Prior to 11g, we have only one catalog and catalog owner can able to see repository information for all databases. From 11g, you can separate the catalog database access across the departments/groups (for ex, Manufacturing, IT…etc.) using virtual catalogs feature to maximize the security. 

Create a separate user for IT department to grant catalog access
SQL> create user it_user identified by xxxxx quota unlimited on users;
SQL> grant recovery_catalog_owner to it_user;

Grant catalog access on “itdb1” to virtual catalog owner “it_user”
$ rman target=/ rcvcat rman/rman@rmancat
RMAN> grant catalog for database itdb1 to it_user;

Now connect using the virtual catalog owner “it_user” and create virtual catalog
$ rman target=/ rcvcat ituser/xxxx@rmancat
RMAN> create virtual catalog;

• Merging RMAN Catalogs: If you have operations across different regions and maintaining different catalogs for each state and want to merge then you can use merge catalog feature without re-registering the databases in new catalog.
In below example we are importing rmancat2 into rmancat1
$ rman target=/ rcvcat rman/rman@rmancat1
RMAN> import catalog rman/rman@rmancat2;

• GUI interface for RMAN: Now you can use RMAN functionality through a GUI iFrom Enterprise manager

•Archive log Deletion Policy Enhancements: The archive log deletion policy has been extended in 11g for greater flexibility and protection for Dataguard environments.

Oracle 10g Syntax.
CONFIGURE ARCHIVELOG DELETION POLICY {CLEAR | TO {APPLIED ON STANDBY | NONE}}

Oracle 11g Syntax.
ARCHIVELOG DELETION POLICY {CLEAR | TO {APPLIED ON [ALL] STANDBY |BACKED UP integer TIMES TO DEVICE TYPE deviceSpecifier |NONE | SHIPPED TO [ALL] STANDBY}[ {APPLIED ON [ALL] STANDBY | BACKED UP integer TIMES TO DEVICE TYPE deviceSpecifier |NONE | SHIPPED TO [ALL] STANDBY}]...}



No comments:

Post a Comment