F90606341_Messia_37_1

Embed Size (px)

Citation preview

  • 8/3/2019 F90606341_Messia_37_1

    1/12

    RMAN 11gR1 Rolta-TUSC Confidential Page 1

    New Features

    Oracle 11gR1 RMAN New FeaturesMichael Messina, Management ConsultantRolta-TUSC Database Services

    Last Updated: 07/16/2010

    Table of ContentsDATA 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

  • 8/3/2019 F90606341_Messia_37_1

    2/12

    RMAN 11gR1 Rolta-TUSC Confidential Page 2

    New Features

    Data Recovery AdvisorThe data recovery advisor helps simplify recoveries by allowing the DBA to check thefailure, 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 OracleEnterprise 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 ifyou 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 2007Copyright (c) 1982, 2007, Oracle. All rights reserved.

    Connected to an idle instance.

    SQL> startupORACLE instance started.

    Total System Global Area 535662592 bytesFixed Size 1334380 bytesVariable Size 209716116 bytes

    Database Buffers 318767104 bytesRedo Buffers 5844992 bytesDatabase mounted.ORA-01157: cannot identify/lock data file 4 - see DBWR trace fileORA-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 2715:17:51 2007Copyright (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 catalogList of Database Failures=========================

  • 8/3/2019 F90606341_Messia_37_1

    3/12

    RMAN 11gR1 Rolta-TUSC Confidential Page 3

    New Features

    Failure ID Priority Status Time Detected Summary---------- -------- --------- ------------- -------222 HIGH OPEN 27-NOV-07 One or more non-systemdatafiles are missing

    If there are no failures then Oracle will return a message:

    using target database control file instead of recovery catalogno failures found that match specification

    The message indicates that I have a non-system tablespace datafilemissing. A missing datafile is considered critical and thereforePriority is high.

    Since it is a non-system tablespace datafile the database can stay upwith 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-systemdatafiles are missingImpact: See impact for individual child failuresList of child failures for parent failure ID 222Failure ID Priority Status Time Detected Summary---------- -------- --------- ------------- -------

    225 HIGH OPEN 27-NOV-07 Datafile 4:'C:\ORACLE\ORADATA\ORCL11G\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-systemdatafiles aremissingImpact: See impact for individual child failuresList of child failures for parent failure ID 222Failure ID Priority Status Time Detected Summary---------- -------- --------- ------------- -------

  • 8/3/2019 F90606341_Messia_37_1

    4/12

  • 8/3/2019 F90606341_Messia_37_1

    5/12

    RMAN 11gR1 Rolta-TUSC Confidential Page 5

    New Features

    Do you really want to execute the above repair (enter YES or NO)? YESexecuting repair script

    Starting restore at 27-NOV-07using channel ORA_DISK_1

    channel ORA_DISK_1: starting datafile backup set restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_DISK_1: restoring datafile 00004 toC:\ORACLE\ORADATA\ORCL11G\USERS01.DBFchannel ORA_DISK_1: reading from backup pieceC:\ORACLE\FLASH_RECOVERY_AREA\ORCL11G\BACKUPSET\2007_11_27\O1_MF_NNNDF_TAG20071127T144712_3NRX264W_.BKPchannel ORA_DISK_1: piecehandle=C:\ORACLE\FLASH_RECOVERY_AREA\ORCL11G\BACKUPSET\2007_11_27\O1_MF_NNNDF_TAG20071127T144712_3NRX264W_.BKPtag=TAG20071127T144712channel ORA_DISK_1: restored backup piece 1

    channel ORA_DISK_1: restore complete, elapsed time: 00:00:25Finished restore at 27-NOV-07

    Starting recover at 27-NOV-07using channel ORA_DISK_1

    starting media recoverymedia recovery complete, elapsed time: 00:00:01

    Finished recover at 27-NOV-07repair failure complete

    Do you want to open the database (enter YES or NO)? YESdatabase opened

    RMAN Proactive Health Check11g 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 specificdatafile. 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-07allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=138 device type=DISKchannel ORA_DISK_1: starting validation of datafilechannel ORA_DISK_1: specifying datafile(s) for validationinput datafile file number=00001name=C:\ORACLE\ORADATA\ORCL11G\SYSTEM01.DBF

  • 8/3/2019 F90606341_Messia_37_1

    6/12

    RMAN 11gR1 Rolta-TUSC Confidential Page 6

    New Features

    input datafile file number=00002name=C:\ORACLE\ORADATA\ORCL11G\SYSAUX01.DBFinput datafile file number=00004name=C:\ORACLE\ORADATA\ORCL11G\USERS01.DBFinput datafile file number=00006name=C:\ORACLE\ORADATA\ORCL11G\UNDOTBS02.DBFinput datafile file number=00005name=C:\ORACLE\ORADATA\ORCL11G\EXAMPLE01.DBFchannel ORA_DISK_1: validation complete, elapsed time: 00:03:25List of Datafiles=================File Status Marked Corrupt Empty Blocks Blocks Examined High SCN---- ------ -------------- ------------ --------------- ----------1 OK 0 11278 512000 13548003File Name: C:\ORACLE\ORADATA\ORCL11G\SYSTEM01.DBFBlock Type Blocks Failing Blocks Processed---------- -------------- ----------------Data 0 487268Index 0 11166Other 0 2288

    File Status Marked Corrupt Empty Blocks Blocks Examined High SCN---- ------ -------------- ------------ --------------- ----------2 OK 0 26072 75512 13548017File Name: C:\ORACLE\ORADATA\ORCL11G\SYSAUX01.DBFBlock Type Blocks Failing Blocks Processed---------- -------------- ----------------Data 0 12195Index 0 10225Other 0 27020

    File Status Marked Corrupt Empty Blocks Blocks Examined High SCN---- ------ -------------- ------------ --------------- ----------4 OK 0 51199 64000 13457224File Name: C:\ORACLE\ORADATA\ORCL11G\USERS01.DBFBlock Type Blocks Failing Blocks Processed---------- -------------- ----------------Data 0 12357Index 0 33Other 0 411

    File Status Marked Corrupt Empty Blocks Blocks Examined High SCN---- ------ -------------- ------------ --------------- ----------5 OK 0 1719 12800 13345172File Name: C:\ORACLE\ORADATA\ORCL11G\EXAMPLE01.DBFBlock Type Blocks Failing Blocks Processed---------- -------------- ----------------

    Data 0 4406Index 0 1264Other 0 5411

    File Status Marked Corrupt Empty Blocks Blocks Examined High SCN---- ------ -------------- ------------ --------------- ----------6 OK 0 23908 64000 13548017File Name: C:\ORACLE\ORADATA\ORCL11G\UNDOTBS02.DBFBlock Type Blocks Failing Blocks Processed---------- -------------- ----------------

  • 8/3/2019 F90606341_Messia_37_1

    7/12

    RMAN 11gR1 Rolta-TUSC Confidential Page 7

    New Features

    Data 0 0Index 0 0Other 0 40092

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

    Tablespace

    RMAN> validate tablespace users ;

    Starting validate at 27-NOV-07using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: SID=128 device type=DISKchannel ORA_DISK_1: starting validation of datafilechannel ORA_DISK_1: specifying datafile(s) for validationinput datafile file number=00004name=C:\ORACLE\ORADATA\ORCL11G\USERS01.DBFchannel ORA_DISK_1: validation complete, elapsed time: 00:00:15List of Datafiles=================File Status Marked Corrupt Empty Blocks Blocks Examined High SCN

    ---- ------ -------------- ------------ --------------- ----------4 OK 0 51199 64000 13457224File Name: C:\ORACLE\ORADATA\ORCL11G\USERS01.DBFBlock Type Blocks Failing Blocks Processed---------- -------------- ----------------Data 0 12357Index 0 33Other 0 411

    Finished validate at 27-NOV-07

    Datafile

    RMAN> validate datafile 4 block 1 ;

    Starting validate at 27-NOV-07using channel ORA_DISK_1channel ORA_DISK_1: starting validation of datafilechannel ORA_DISK_1: specifying datafile(s) for validationinput datafile file number=00004name=C:\ORACLE\ORADATA\ORCL11G\USERS01.DBFchannel ORA_DISK_1: validation complete, elapsed time: 00:00:01

  • 8/3/2019 F90606341_Messia_37_1

    8/12

    RMAN 11gR1 Rolta-TUSC Confidential Page 8

    New Features

    List of Datafiles=================File Status Marked Corrupt Empty Blocks Blocks Examined High SCN---- ------ -------------- ------------ --------------- ----------4 OK 0 0 1 0File Name: C:\ORACLE\ORADATA\ORCL11G\USERS01.DBFBlock Type Blocks Failing Blocks Processed---------- -------------- ----------------Data 0 0Index 0 0Other 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 aprevious 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 EnhancementsOracle 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

  • 8/3/2019 F90606341_Messia_37_1

    9/12

    RMAN 11gR1 Rolta-TUSC Confidential Page 9

    New Features

    deviceSpecifier | NONE | SHIPPED TO [ALL] STANDBY} [ {APPLIED

    ON [ALL] STANDBY | BACKED UP integer TIMES TO DEVICETYPE deviceSpecifier | NONE | SHIPPED TO [ALL] STANDBY}]...}

    New Compression Type (ZLIB)RMAN had compression of backups in Oracle Database 10g to conserve networkbandwidth. 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 thefiles 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 reduceCPU 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 CompressionOption.)

    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 DatafileRMAN 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 backedby 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> backup5> section size 50m6> datafile 4;7> }

  • 8/3/2019 F90606341_Messia_37_1

    10/12

    RMAN 11gR1 Rolta-TUSC Confidential Page 10

    New Features

    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 upin 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 #1BP Key Pc# Status Piece Name------- --- ------------------ ----------2007 1 AVAILABLE /backup1/9dhk7os1_1_12008 2 AVAILABLE /backup2/9dhk7os1_1_12009 3 AVAILABLE /backup1/9dhk7os1_1_32009 3 AVAILABLE /backup2/9dhk7os1_1_4

    Network Aware / Active Database DuplicationOracle 11g has added a great capability to duplicate a database without using or having tohave 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 Network-Enabled Database Duplication.

    The RMAN Active Database Duplication automatically performs the following:

    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.

    RMAN> duplicate target database to newdb2> from active database3> db_file_name_convert '/nf/','/duptest/'4> spfile

    5> parameter_value_convert '/db/','/newdb/'6> set log_file_name_convert '/db/','/newdb/' ;

  • 8/3/2019 F90606341_Messia_37_1

    11/12

    RMAN 11gR1 Rolta-TUSC Confidential Page 11

    New Features

    Virtual Private CatalogOracle 11g adds improved security for the RMAN catalog by enabling multiple virtualcatalogs 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 ofdatabases 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 ONusers; GRANT RECOVERY_CATALOG_OWNER TO vpc_a ;

    Grant access on the relevant databases to the virtual private catalog userusing 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 theCREATE 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 Oracle11g, log into SQL*Plus as the virtual private catalog owner and executethe CREATE_VIRTUAL_CATALOG procedure in the DBMS_RCVCATpackage 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 catalogowner 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.

  • 8/3/2019 F90606341_Messia_37_1

    12/12

    RMAN 11gR1 Rolta-TUSC Confidential Page 12

    New Features

    Optimized Undo BackupPrior 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 alarge 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 bebacked 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 BackupPrior 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.