Вы находитесь на странице: 1из 12

Oracle 11gR1 RMAN New Features

Michael Messina, Management Consultant Rolta-TUSC Database Services Last Updated: 07/16/2010

Table of Contents
DATA RECOVERY ADVISOR................................................................................................................... 2 FAILURE EXAMPLE ...................................................................................................................................... 2 LIST FAILURES ............................................................................................................................................ 2 LIST FAILURE DETAIL ................................................................................................................................. 3 ADVISE FOR AUTOMATED REPAIR OPTIONS ................................................................................................ 3 FAILURE REPAIR PREVIEW .......................................................................................................................... 4 REPAIR FAILURE.......................................................................................................................................... 4 RMAN PROACTIVE HEALTH CHECK .................................................................................................. 5 DATABASE................................................................................................................................................... 5 TABLESPACE ............................................................................................................................................... 7 DATAFILE .................................................................................................................................................... 7 BLOCK RECOVERY ENHANCEMENT .................................................................................................. 8 FLASHBACK LOGS ....................................................................................................................................... 8 BLOCK RECOVERY (PHYSICAL STANDBY) ................................................................................................... 8 ARCHIVED LOG DELETION POLICY ENHANCEMENTS ................................................................ 8 NEW COMPRESSION TYPE (ZLIB) ........................................................................................................ 9 PARALLEL BACKUP OF SAME DATAFILE ......................................................................................... 9 EXAMPLE..................................................................................................................................................... 9 NETWORK AWARE / ACTIVE DATABASE DUPLICATION ........................................................... 10 VIRTUAL PRIVATE CATALOG ............................................................................................................. 11 OPTIMIZED UNDO BACKUP ................................................................................................................. 12 READ-ONLY TRANSPORTABLE TABLESPACES BACKUP ........................................................... 12

RMAN 11gR1 New Features

Rolta-TUSC Confidential

Page 1

Data Recovery Advisor


The data recovery advisor helps simplify recoveries by allowing the DBA to check the failure, get some additional detail, get some repair advice as well as execute the advised repair. There are 2 flavors to the Data Recovery Advisor, command line and Oracle Enterprise Manager Database Control. The data recovery advisor simplifies the diagnosis, analysis and recovery steps for a database failure that will require media recovery via RMAN. Keep in mind however if you are not using RMAN for your backups this feature will not be available to you. The command line utility is used via rman command line.

Failure Example
$ sqlplus / AS SYSDBA SQL*Plus: Release 11.1.0.6.0 - Production on Tue Nov 27 15:13:53 2007 Copyright (c) 1982, 2007, Oracle. All rights reserved. Connected to an idle instance. SQL> startup ORACLE instance started. Total System Global Area 535662592 bytes Fixed Size 1334380 bytes Variable Size 209716116 bytes Database Buffers 318767104 bytes Redo Buffers 5844992 bytes Database mounted. ORA-01157: cannot identify/lock data file 4 - see DBWR trace file ORA-01110: data file 4: 'C:\ORACLE\ORADATA\ORCL11G\USERS01.DBF' SQL> exit $ rman target=/ Recovery Manager: Release 11.1.0.6.0 - Production on Tue Nov 27 15:17:51 2007 Copyright (c) 1982, 2007, Oracle. All rights reserved. connected to target database: ORCL11G (DBID=744414708, not open)

List Failures
RMAN> list failure ; using target database control file instead of recovery catalog List of Database Failures ========================= RMAN 11gR1 New Features Rolta-TUSC Confidential Page 2

Failure ID Priority Status Time Detected Summary ---------- -------- --------- ------------- ------222 HIGH OPEN 27-NOV-07 One or more non-system datafiles are missing If there are no failures then Oracle will return a message: using target database control file instead of recovery catalog no failures found that match specification The message indicates that I have a non-system tablespace datafile missing. A missing datafile is considered critical and therefore Priority is high. Since it is a non-system tablespace datafile the database can stay up with the tablespace this datafile goes with offline.

List Failure Detail


RMAN> list failure 222 detail ; List of Database Failures ========================= Failure ID Priority Status Time Detected Summary ---------- -------- --------- ------------- ------222 HIGH OPEN 27-NOV-07 One or more non-system datafiles are missing Impact: See impact for individual child failures List of child failures for parent failure ID 222 Failure ID Priority Status Time Detected Summary ---------- -------- --------- ------------- ------225 HIGH OPEN 27-NOV-07 Datafile 4: 'C:\ORACLE\ORADATA\ORC L11G\USERS01.DBF' is missing Impact: Some objects in tablespace USERS might be unavailable

Advise for Automated Repair Options


RMAN> advise failure ; List of Database Failures ========================= Failure ID Priority Status Time Detected Summary ---------- -------- --------- ------------- ------222 HIGH OPEN 27-NOV-07 One or more non-system datafiles are missing Impact: See impact for individual child failures List of child failures for parent failure ID 222 Failure ID Priority Status Time Detected Summary ---------- -------- --------- ------------- -------

RMAN 11gR1 New Features

Rolta-TUSC Confidential

Page 3

225 HIGH OPEN 27-NOV-07 Datafile 4: 'C:\ORACLE\ORADATA\ORC L11G\USERS01.DBF' is missing Impact: Some objects in tablespace USERS might be unavailable analyzing automatic repair options; this may take some time allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=152 device type=DISK analyzing automatic repair options complete Mandatory Manual Actions ======================== no manual actions available Optional Manual Actions ======================= 1. If file C:\ORACLE\ORADATA\ORCL11G\USERS01.DBF was unintentionally renamed or moved, restore it Automated Repair Options ======================== Option Repair Description ------ -----------------1 Restore and recover datafile 4 Strategy: The repair includes complete media recovery with no data loss Repair script: c:\oracle\diag\rdbms\orcl11g\orcl11g\hm\reco_1022222764.hm

Failure Repair Preview


RMAN> repair failure preview ; Strategy: The repair includes complete media recovery with no data loss Repair script: c:\oracle\diag\rdbms\orcl11g\orcl11g\hm\reco_1022222764.hm contents of repair script: # restore and recover datafile restore datafile 4; recover datafile 4;

Repair Failure
RMAN> repair failure ; Strategy: The repair includes complete media recovery with no data loss Repair script: c:\oracle\diag\rdbms\orcl11g\orcl11g\hm\reco_1022222764.hm contents of repair script: # restore and recover datafile restore datafile 4; recover datafile 4; RMAN 11gR1 New Features Rolta-TUSC Confidential Page 4

Do you really want to execute the above repair (enter YES or NO)? YES executing repair script Starting restore at 27-NOV-07 using channel ORA_DISK_1 channel ORA_DISK_1: starting datafile backup set restore channel ORA_DISK_1: specifying datafile(s) to restore from backup set channel ORA_DISK_1: restoring datafile 00004 to C:\ORACLE\ORADATA\ORCL11G\USERS0 1.DBF channel ORA_DISK_1: reading from backup piece C:\ORACLE\FLASH_RECOVERY_AREA\ORCL 11G\BACKUPSET\2007_11_27\O1_MF_NNNDF_TAG20071127T144712_3NRX264W_.BKP channel ORA_DISK_1: piece handle=C:\ORACLE\FLASH_RECOVERY_AREA\ORCL11G\BACKUPSET \2007_11_27\O1_MF_NNNDF_TAG20071127T144712_3NRX264W_.BKP tag=TAG20071127T144712 channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: restore complete, elapsed time: 00:00:25 Finished restore at 27-NOV-07 Starting recover at 27-NOV-07 using channel ORA_DISK_1 starting media recovery media recovery complete, elapsed time: 00:00:01 Finished recover at 27-NOV-07 repair failure complete Do you want to open the database (enter YES or NO)? YES database opened

RMAN Proactive Health Check


11g with RMAN provides the ability to pro-actively check you database for corrupt blocks. The check can be performed for the entire database, a tablespace or for a specific datafile. This provides the DBA the ability to periodically check the database for corruption through a scheduled process, or check a part of the database for corruption where a DBA suspects corruption might exist.

Database
RMAN> validate database ; Starting validate at 27-NOV-07 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=138 device type=DISK channel ORA_DISK_1: starting validation of datafile channel ORA_DISK_1: specifying datafile(s) for validation input datafile file number=00001 name=C:\ORACLE\ORADATA\ORCL11G\SYSTEM01.DBF RMAN 11gR1 New Features Rolta-TUSC Confidential Page 5

input datafile file number=00002 name=C:\ORACLE\ORADATA\ORCL11G\SYSAUX01.DBF input datafile file number=00004 name=C:\ORACLE\ORADATA\ORCL11G\USERS01.DBF input datafile file number=00006 name=C:\ORACLE\ORADATA\ORCL11G\UNDOTBS02.DBF input datafile file number=00005 name=C:\ORACLE\ORADATA\ORCL11G\EXAMPLE01.DBF channel ORA_DISK_1: validation complete, elapsed time: 00:03:25 List of Datafiles ================= File Status Marked Corrupt Empty Blocks Blocks Examined High SCN ---- ------ -------------- ------------ --------------- ---------1 OK 0 11278 512000 13548003 File Name: C:\ORACLE\ORADATA\ORCL11G\SYSTEM01.DBF Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------Data 0 487268 Index 0 11166 Other 0 2288 File Status Marked Corrupt Empty Blocks Blocks Examined High SCN ---- ------ -------------- ------------ --------------- ---------2 OK 0 26072 75512 13548017 File Name: C:\ORACLE\ORADATA\ORCL11G\SYSAUX01.DBF Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------Data 0 12195 Index 0 10225 Other 0 27020 File Status Marked Corrupt Empty Blocks Blocks Examined High SCN ---- ------ -------------- ------------ --------------- ---------4 OK 0 51199 64000 13457224 File Name: C:\ORACLE\ORADATA\ORCL11G\USERS01.DBF Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------Data 0 12357 Index 0 33 Other 0 411 File Status Marked Corrupt Empty Blocks Blocks Examined High SCN ---- ------ -------------- ------------ --------------- ---------5 OK 0 1719 12800 13345172 File Name: C:\ORACLE\ORADATA\ORCL11G\EXAMPLE01.DBF Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------Data 0 4406 Index 0 1264 Other 0 5411 File Status Marked Corrupt Empty Blocks Blocks Examined High SCN ---- ------ -------------- ------------ --------------- ---------6 OK 0 23908 64000 13548017 File Name: C:\ORACLE\ORADATA\ORCL11G\UNDOTBS02.DBF Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------RMAN 11gR1 New Features Rolta-TUSC Confidential Page 6

Data Index Other

0 0 0

0 0 40092

channel ORA_DISK_1: starting validation of datafile channel ORA_DISK_1: specifying datafile(s) for validation including current control file for validation including current SPFILE in backup set channel ORA_DISK_1: validation complete, elapsed time: 00:00:01 List of Control File and SPFILE =============================== File Type Status Blocks Failing Blocks Examined ------------ ------ -------------- --------------SPFILE OK 0 2 Control File OK 0 624 Finished validate at 27-NOV-07

Tablespace
RMAN> validate tablespace users ; Starting validate at 27-NOV-07 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=128 device type=DISK channel ORA_DISK_1: starting validation of datafile channel ORA_DISK_1: specifying datafile(s) for validation input datafile file number=00004 name=C:\ORACLE\ORADATA\ORCL11G\USERS01.DBF channel ORA_DISK_1: validation complete, elapsed time: 00:00:15 List of Datafiles ================= File Status Marked Corrupt Empty Blocks Blocks Examined High SCN ---- ------ -------------- ------------ --------------- ---------4 OK 0 51199 64000 13457224 File Name: C:\ORACLE\ORADATA\ORCL11G\USERS01.DBF Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------Data 0 12357 Index 0 33 Other 0 411 Finished validate at 27-NOV-07

Datafile
RMAN> validate datafile 4 block 1 ; Starting validate at 27-NOV-07 using channel ORA_DISK_1 channel ORA_DISK_1: starting validation of datafile channel ORA_DISK_1: specifying datafile(s) for validation input datafile file number=00004 name=C:\ORACLE\ORADATA\ORCL11G\USERS01.DBF channel ORA_DISK_1: validation complete, elapsed time: 00:00:01 RMAN 11gR1 New Features Rolta-TUSC Confidential Page 7

List of Datafiles ================= File Status Marked Corrupt Empty Blocks Blocks Examined High SCN ---- ------ -------------- ------------ --------------- ---------4 OK 0 0 1 0 File Name: C:\ORACLE\ORADATA\ORCL11G\USERS01.DBF Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------Data 0 0 Index 0 0 Other 0 1 Finished validate at 27-NOV-07

Block Recovery Enhancement


Flashback Logs
Remember Flashback Logging introduced in Oracle 10g? It records the before-images of changed blocks into flashback logs that are generated in the Flashback Recovery Area when Flashback is enabled in the database. The logs help you flash the database back to a previous point in the time without having to do a point-in-time recovery from your backups. Since the flashback logs have the past images of the blocks, why can we not use them for block level recovery as well? Oracle Database 11g does exactly that. When you recover the specific block (or blocks), Oracle now looks in the Flashback logs to find a good copy of a past block image then applies archived redo logs to roll the block forward. This saves a lot of time by not having to go to the backups, especially when the backups are on tape.

Block Recovery (Physical Standby)


Automatic Block Recovery has been enhanced to execute a block recovery using a physical standby database when a physical standby database is available.

Archived Log Deletion Policy Enhancements


Oracle 11g has improved RMANs ability to manage archivelogs though improved archive log deletion policies. The policy improvements are to improve the flexibility and protection for Dataguard (standby) environments. Oracle 10g CONFIGURE ARCHIVELOG DELETION POLICY {CLEAR | TO {APPLIED ON STANDBY | NONE}} Oracle 11g ARCHIVELOG DELETION POLICY {CLEAR | TO {APPLIED ON [ALL] STANDBY | BACKED UP integer TIMES TO DEVICE TYPE
Rolta-TUSC Confidential Page 8

RMAN 11gR1 New Features

deviceSpecifier | NONE | SHIPPED TO [ALL] STANDBY} [ {APPLIED ON [ALL] STANDBY | BACKED UP integer TIMES TO DEVICE TYPE deviceSpecifier | NONE | SHIPPED TO [ALL] STANDBY}]...}

New Compression Type (ZLIB)


RMAN had compression of backups in Oracle Database 10g to conserve network bandwidth. Third-party compression utilities provided faster alternatives to RMAN's own, but RMAN 10g compression provided some features that the third-party ones did not. For example, when RMAN 10g restored datafiles, it did not need to uncompress the files first. This approach offers significant bandwidth savings during restores. Now in Oracle Database 11g, RMAN offers another algorithm, ZLIB, in addition to the previously available BZIP2. ZLIB is a much faster algorithm but it does not compress as much. However, it will not consume near as much CPU. Therefore if you need to reduce CPU consumption ZLIB compression can offer you some compression at a lower cost to the CPU. (Note that BZIP2 is the default in version 11.1.x; if you want to use the new ZLIB compression you will need to license a new option called Advanced Compression Option.) To use ZLIB compression just set the RMAN configuration parameter:
RMAN> configure compression algorithm 'ZLIB' ;

To change it to BZIP2:
RMAN> configure compression algorithm 'bzip2';

Parallel Backup of Same Datafile


RMAN can parallelize the backup by allocating more than one channel so that each channel becomes a RMAN session, however, each channel can only back up one datafile at a time. This means that even through there are several channels, each datafile is backed by only one channel. In Oracle 11g RMAN, the allocated channels can break a datafile into chunks also called "sections." You can indicate the size of each section.

Example
RMAN> run { 2> allocate channel c1 type disk format '/backup1/%U'; 3> allocate channel c2 type disk format '/backup2/%U'; 4> backup 5> section size 50m 6> datafile 4; 7> }

RMAN 11gR1 New Features

Rolta-TUSC Confidential

Page 9

The RMAN command allocates two channels and backs up the users tablespace in on two channels in parallel. Each channel takes a 50MB section of the datafile and backs that up in parallel. This makes backup of larger files faster. When backed up this way, the backups show up as sections as well. Example of datafile 4 backup showing it in sections:
RMAN> list backup of datafile 4; List of Backup Pieces for backup set 901 Copy #1 BP Key Pc# Status Piece Name -------------------------- ---------2007 1 AVAILABLE /backup1/9dhk7os1_1_1 2008 2 AVAILABLE /backup2/9dhk7os1_1_1 2009 3 AVAILABLE /backup1/9dhk7os1_1_3 2009 3 AVAILABLE /backup2/9dhk7os1_1_4

Network Aware / Active Database Duplication


Oracle 11g has added a great capability to duplicate a database without using or having to have an existing RMAN backup or manual file coping. This allows those that do not us RMAN for their backups to utilize the RMAN duplicate functionality for creating a standby databases, a test or development environment without first having to create an RMAN backup. This feature utilizes the network and is also referred to a NetworkEnabled Database Duplication. The RMAN Active Database Duplication automatically performs the following: RMAN> 2> 3> 4> 5> 6> Copies the spfile to the destination server. Starts the auxiliary instance with the spfile. Copies relevant database files and archived redo logs over the network to the destination server. Recovers the database. Opens the database with the RESETLOGS option. duplicate target database to newdb from active database db_file_name_convert '/nf/','/duptest/' spfile parameter_value_convert '/db/','/newdb/' set log_file_name_convert '/db/','/newdb/' ;

RMAN 11gR1 New Features

Rolta-TUSC Confidential

Page 10

Virtual Private Catalog


Oracle 11g adds improved security for the RMAN catalog by enabling multiple virtual catalogs within the main RMAN catalog by allowing the owner of the main catalog to grant access on individual databases to other users. This allows the separation of databases or groups of databases within the RMAN catalog. Setting up and using a virtual private catalog is fairly simple and straight forward as outlined below:
CREATE USER vpc1 IDENTIFIED BY vpc_a QUOTA UNLIMITED ON users; GRANT RECOVERY_CATALOG_OWNER TO vpc_a ;

Grant access on the relevant databases to the virtual private catalog user using RMAN
$ rman RMAN> CONNECT CATALOG rman/rman@rman ; RMAN> GRANT CATALOG FOR DATABASE db11g TO vpc_a; Grant succeeded.

Log into RMAN using the virtual private catalog owner and issue the CREATE VIRTUAL CATALOG command.
$ rman RMAN> CONNECT CATALOG vpc_a/vpc_a@rman ; RMAN> CREATE VIRTUAL CATALOG;

If the catalog is to going to be used for a database releases prior to Oracle 11g, log into SQL*Plus as the virtual private catalog owner and execute the CREATE_VIRTUAL_CATALOG procedure in the DBMS_RCVCAT package where "rman" represents the name of the base catalog owner in the rman database.
SQL> CONN vpc_a/vpc_a@rman SQL> EXEC rman.DBMS_RCVCAT.CREATE_VIRTUAL_CATALOG;

Connect to the virtual private catalog using the virtual private catalog owner instead of the main catalog owner.
CONNECT CATALOG vpc_a/vpc_a@rman ; rman target / catalog vpc_a/vpc_a@rman

Use RMAN Normally as you would a RMAN catalog.

RMAN 11gR1 New Features

Rolta-TUSC Confidential

Page 11

Optimized Undo Backup


Prior to 11g The entire undo was backed up, now with 11g you can optimize undo backup so that undo for transactions already committed at the time the backup starts will not be backed up. This is largely beneficial to reduce backup time for databases with a large undo tablespaces. Be aware that if you want to retain the undo in the backup for the retention period will require an additional option otherwise this information will not be backed up and therefore after a recovery certain flashback operations will not be able to flashback as expected.
RMAN> CONFIGURE BACKUP UNDO OPTIMIZATION

Read-Only Transportable Tablespaces Backup


Prior to 11g Transportable tablespace backups for a Read-Only tablespace needed to be place in Read-Write mode. Now with 11g a tablespace can be Read-Only or Read-Write mode and Read-Only tablespaces no longer have to be place in Read-Write first.

RMAN 11gR1 New Features

Rolta-TUSC Confidential

Page 12

Вам также может понравиться