Wednesday, December 8, 2010

RMAN - Theory : Session 1




    RMAN does NOT perform the backup, but the Oracle server. RMAN just 
    directs the server to backup a specified list of datafiles. 
Ob2rman.pl executes RMAN, which directs the Oracle server processes
on the target database to perform backup, restore and recovery. RMAN
maintains the required information about the target databases in the
recovery catalog, the Oracle central repository of information, and in the
control file of a particular target database
.
The main information which ob2rman.pl provides to RMAN is:
• Number of allocated RMAN channels
• RMAN channel environment parameters
• Information on the database objects to be backed up or restored

 

For backup, ob2rman.pl uses the Oracle target database views to get
information on which logical (tablespaces) and physical (datafiles) target
database objects are available for backup.

For restore,
ob2rman.pl uses current control file or recovery catalog (if
used) to get information on which objects are available for restore.
Using the Data Protector integration with RMAN, you can back up and
restore the Oracle control files, datafiles, and Archived Redo Logs.



How RMAN Compiles and Executes Commands
RMAN processes most commands in the two phases discussed in this section:
Compilation Phase
During the compilation phase, RMAN determines which objects the command will
access (for example, resolving a tablespace name into its component datafiles).
Then, RMAN constructs a sequence of remote procedure calls (RPCs) that instruct
 the server sessions on the target database to perform the desired operation.
Execution Phase
During the execution phase, RMAN sends the RPC calls to the target database,
monitors their progress, and collects the results. If more than one channel is allocated,
then RMAN can execute certain commands in parallel so that all of the channels' target database sessions are concurrently executing an RPC call.

Media Management
Oracle’s Media Management Layer (MML) API lets third-party vendors build a media
manager, software that works with RMAN and the vendor's hardware to allow backups to sequential media devices such as tape drives. The media manager handles
loading, unloading and labeling of sequential media such as tapes. You must install
media manager software to use RMAN with sequential media devices.
When backing up or restoring, the RMAN client connects to the target instance and
directs the instance to send requests to its media manager. No direct communication
occurs between the RMAN client and media manager.




Mechanics of Datafile Restore Operations
When you issue a RESTORE command, RMAN directs a server session to restore a
suitable backup to either:
The default location, overwriting the files with the same name currently there
A new location, which you can specify with the SET NEWNAME command
To restore a datafile, either mount the database, or keep it open and take the datafile to
be restored offline. When RMAN performs a restore, it creates the restored files as
datafile image copies and records them in the repository

Q. What is Recovery catalog?
A recovery catalog is a set of tables and views that Recovery Manager (RMAN) uses to store metadata (information about a database structure, archived redo logs, backup sets, and data file copies) about a target database (database that RMAN backups or restores). RMAN uses this metadata to conduct its backup, recovery, and maintenance operations. Recovery catalog is optional, i.e., if a recovery catalog is not created, RMAN uses the target database’s control file to store the metadata about the target database. Although RMAN can conduct all major backup and recovery operations by using the control file, some RMAN commands work only if a recovery catalog exists.
A recovery catalog is solely managed by RMAN. RMAN propagates information about the database structure, archived redo logs, backup sets, and data file copies into the recovery catalog from the target database’s control file.
A recovery catalog can be used to store metadata about multiple target databases. The tables and views constituting a recovery catalog are owned by a recovery catalog schema. Oracle recommends creating a recovery catalog schema in a separate dedicated database and not in the target database. A database containing a recovery catalog schema is called a recovery catalog database.

Q. What are the database file's that RMAN can backup ?
A. RMAN can backup  Controlfile , Datafiles , Archive logs , standby database controfile, Spfile

Q. What are the  database file's that RMAN can not backup ?
A.  RMAN can not take backup of the pfile, Redo logs , network configuration files, password files, external  tables and the contents of the Oracle home files 


Q. Can I regulate the size of backup piece and backupset ?
A. Yes ! You can set max size of the backupset as well as the backup piece. By default one RMAN channel  creates a single backupset with one backup piece in it. You can use the MAXPIECESIZE channel parameter to set limits on the size of backup pieces. You can also use the MAXSETSIZE parameter on the BACKUP and CONFIGURE commands to set a
limit for the size of backup sets.

Q. What is the difference between backup set backup and Image copy backup ?
A :  A backup set is an RMAN-specific proprietary format, whereas an image copy is a bit-for-bit copy of a file. By default,RMAN creates backup sets
Q. What is RMAN consistent backup and inconsistent backup ?
 
A. A consistent backup occurs when the database is in a consistent state. That means backup of the database taken after a shutdown immediate , shutdown normal or shutdown transactional. If the database is shutdown with  abort option then its not a consistent backup.
A backup when when the database is Up and running is called an inconsistent backup. When a database is restored from an inconsistent backup, Oracle must perform media recovery before the database can be
opened, applying any pending changes from the redo logs. You can not take inconsistent backup when the database is in NoArchivelog mode.
Q. Can I take RMAN backup when the database is Down ?
A. No ! You can take RMAN backup only when the target database is Open or in Mount stage. Its because RMAN keep the backup metadata in controfile . Only in open or mount mode controlfile is accessible. 


Q. Do I need to place the database in begin backup mode while taking RMAN inconsistent backup ?
 
A. RMAN does not require extra logging or backup mode because it knows the format of data blocks. RMAN is guaranteed not to back up fractured blocks.No extra redo is generated during RMAN backup.


9.2 How RMAN Interact with Media manager ?
Before performing backup or restore to a media manager, you must allocate one or more channels or configure default channels for use with the media manager to handle the communication with the media manager. RMAN does not issue specific commands to load, label, or unload tapes. When backing up, RMAN gives the media manager a stream of bytes and associates a unique name with this stream. When RMAN needs to restore the backup, it asks the media manager to retrieve the byte stream. All details of how and where that stream is stored are handled entirely by the media manager.
RMAN Tables – 10g
SQL> select object_name from dba_objects
  where object_name like '%RMAN%'
  and object_type = 'SYNONYM';
  2    3
OBJECT_NAME
--------------------------------------------------------------------------------
V$RMAN_CONFIGURATION
GV$RMAN_CONFIGURATION
V$RMAN_STATUS
V$RMAN_OUTPUT
GV$RMAN_OUTPUT
V$RMAN_BACKUP_SUBJOB_DETAILS
V$RMAN_BACKUP_JOB_DETAILS
V$RMAN_BACKUP_TYPE

8 rows selected.

SQL> select object_name from dba_objects
 where object_name like '%BACKUP%'
 and object_type = 'SYNONYM';  2    3

OBJECT_NAME
--------------------------------------------------------------------------------
V$BACKUP
V$BACKUP_SET
V$BACKUP_PIECE
V$BACKUP_DATAFILE
V$BACKUP_SPFILE
V$BACKUP_REDOLOG
V$BACKUP_CORRUPTION
V$BACKUP_DEVICE
V$BACKUP_SYNC_IO
V$BACKUP_ASYNC_IO
GV$BACKUP

OBJECT_NAME
--------------------------------------------------------------------------------
GV$BACKUP_SET
GV$BACKUP_PIECE
GV$BACKUP_DATAFILE
GV$BACKUP_SPFILE
GV$BACKUP_REDOLOG
GV$BACKUP_CORRUPTION
GV$BACKUP_DEVICE
GV$BACKUP_SYNC_IO
GV$BACKUP_ASYNC_IO
V$BACKUP_FILES
V$RMAN_BACKUP_SUBJOB_DETAILS

OBJECT_NAME
--------------------------------------------------------------------------------
V$RMAN_BACKUP_JOB_DETAILS
V$BACKUP_SET_DETAILS
V$BACKUP_PIECE_DETAILS
V$BACKUP_COPY_DETAILS
V$BACKUP_DATAFILE_DETAILS
V$BACKUP_CONTROLFILE_DETAILS
V$BACKUP_ARCHIVELOG_DETAILS
V$BACKUP_SPFILE_DETAILS
V$BACKUP_SET_SUMMARY
V$BACKUP_DATAFILE_SUMMARY
V$BACKUP_CONTROLFILE_SUMMARY

OBJECT_NAME
--------------------------------------------------------------------------------
V$BACKUP_ARCHIVELOG_SUMMARY
V$BACKUP_SPFILE_SUMMARY
V$BACKUP_COPY_SUMMARY
V$UNUSABLE_BACKUPFILE_DETAILS
V$RMAN_BACKUP_TYPE

38 rows selected.
Rman Enhancements In Oracle 11g.
  1. Improved handling of long-term backups
  2. Backup failover for archived redo logs in the flash recovery area
  3. Archived log deletion policy enhancements
  4. Network-enabled database duplication without backups
  5. Rman Duplicate without target and recovery catalog connections.
  6. Virtual Private Catalog
  7. Import Catalog command
  8. Multisection backups
  9. Undo Optimization
  10. Improved block media recovery performance
  11. Improved block corruption detection
  12. Faster backup compression
  13. Block change tracking support for standby databases
  14. Backup of read-only transportable tablespaces
  15. RMAN Tablespace Point-in-Time Recovery (TSPITR) Enhancements
  16. SET NEWNAME Options
  17. CONVERT DATABASE Option
  18. Expanded Backup Compression Levels
  19. INCARNATION Specifier Enhancement
  20. To Destination Syntax
  21. ==========================
    ASM and RMAN : http://forums.oracle.com/forums/thread.jspa?threadID=568751 

No comments:

Post a Comment