RMAN environment
The RMAN environment consist of following components:
Required components:
- RMAN client : The client application that manages the backup and recovery of target database.
- target database: A database that RMAN backs up and restores
Optional components:
- recovery catalogy database:
- recovery catalog schema
- physical standby database
- duplicate database: a copy of the primary database that you can use for testing purposes
- fast recovery area:
- media manager:
- media mangement catalog
RMAN channels
The RMAN client itself does not perform backup, restore or recovery opertations. When you connect the RMAN client to a target database, RMAN allocates server sessions on the target instance and directs them to perfom the operations.
The RMAN channel corresponds to a one database server session. It represents one stream of data to a device.
A channel establishes a connection from the RMAN client to a target or auxiallary database instance by starting a server session on the instance.
The RMAN supported device types are disk and SBT (system backup to tape). An SBT device is controlled by third party media manager.
The RMAN channels can be allocated either automatically or manually .
You can enable automatic channel allocation by using configure_channel command. . When you run a command that can use automatic channels, RMAN automatically allocates the channels with the options you specified in configure_channel command. RMAN determines the names for the automatic channels. RMAN comes preconfigured with DISK channel that you can use for backups to disk.
You can manually allocate channels as well. You give user defined names to manually created channels.
The number of channels available for use with a device determines whether RMAN reads from or write to this device in parallel or not. In parallelism, the back up of the file is performed by more than one channel. Each channel may back up more than one file but unless a multisection backup is performed, no file is backed up by more than one channel.
RMAN Backup Options
You can backup your database using "BACKUP" command. RMAN determines backup options based on RMAN environment and RMAN defaults.
This table summarizes the RMAN options and their default values:
Backup Option | Default Value | All possible values | Example | Note |
Device type | Value set in CONFIGURE_DEFAULT_DEVICE_TYPE | Device type can be disk or SBT | BACKUP Database device type disk (or) device type SBT | |
Backup type | By default , RMAN creates backup sets | Backup type can be backupset or image copy | Backup as copy (or) backup as backupset | |
File Format | format "/disk1/backup_%U" (file location) (or) format 'tdgroup' (ASM group) | |||
Overview of RMAN backups
When you issue BACKUP command the following files are backed up:- Datafiles and control files
- Server parameter files
- Archived redo logs
- RMAN backups
The backups created can either be consistent or in-consistent.
The entire database can be backup ed with "backup database" command. The database should either be mounted or open for backup to succeed.
Backing up tablespaces and datafiles:
If you want to backup only certain tablespaces or datafiles, you can issue BACKUP TABLESPACES or BACKUP DATAFILES command. When you specify tablespaces, RMAN translates the tablespace name internally into a list of datafiles.
RMAN automatically backs up control file and server parameter file when datafile 1 is included in the backup. If the control file autobackup is enabled , then RMAN writes the current control file and server parameter file to a seperate autobackup piece.
Backing up control files :
If the configure controlfile autobackup is set to ON, RMAN automatically backs up the control file and server parameter file after every backup and after database structural changes. The control file autobackup contains metadata about the previous backup, which is crucial for disaster recovery.You can take manual backup of control file by
Running backup current controlfile command
Include a backup of control file within any backup by using include current controlfile option of the backup command
Backup datafile 1 (as it automoatically includes backup of control file and sp file)
Manual backup of control file is not the same as autobackup. Autoback contains metadata about the backup that just completed. Also, RMAN can automatically restore autobackups without the user of recovery catalog
Overview of Incremental backups
An incremental backup copies only datafile blocks that have changed since a specified previous backup.
An incremental backup is of two types:
- Cumulative incremental backup
- Backs up all blocks changed after the most recent incremental backup at level 0
- Differential incremental backup
- Backs up all blocks changes after the most recent incremental backup at level 1 or level 0
- By default incremental backups are differntial.
A good rule of thump is to take new level 0 backup whenever 20% or more of the data has changed.
In a data guard environment, you can offload incremental backups to a physical standby database. Incremental backups of a standby and primary database are interchangeable.
To make differential incremental backup
backup
incremental level 0
database ;
To make cumulative incremental backup
backup
incremental level 1 cumulative
database;
To make incremental backups in the fast recovery area:
backup
incremental level 1
from scn <look this up>
Archival backups:
You can use BACKUP ....KEEP to creat a backup that is both all-inclusive and exempt from the backup retention policy. The KEEP options also specifies that the backup should be exempt from the retention policy either forever or for a specified period of time (KEEP UNTIL TIME '01-JAN-08'.
The characteristics of BACKUP ....KEEP command are as under:
- It automatically backs up datafiles, control file (even if control file autobackup is disabled) and server parameter file.
- It automatically generates an archived redo log backip to ensure that the database backup can be recovered to a consistent state.
An Overview of Data Recovery Manager
Data recovery manager is a tool to help reduce MTTS (Mean time to recover). The GUI of DRA is available in database control and grid control by selecting Perform Recovery in Availability tab. DRA has following commands:- LIST FAILURE
- ADVISE FAILURE
- REPAIR FAILURE
- CHANGE FAILURE
Advise failure comand is used to view repair options which typically include both automated and manual options. Repair failure command is used to repair the failure automatically. Once the failure is repaired, Repair failure command closes the relevant repaired failure. If you chose to repair failure manually, you should use change failure command to change the status of an open failure to closed. Change failure command is used to alter the status and priority of failure. You can change the status of the failure to closed or to priority high or priority low. You cannot set the status to open nor can you set the priority to critical with change failure command.
To list all failures:
- rman > list failure
- rman > list failure <failure id > detail
- rman > list failure low ( low is the failure priority; high and critical are the other two failure priority values)
- rman > list failure close
- rman > list failure exclude failure <failure id>
- rman > advice failure <failure id>
- rman > repair failure preview
No comments:
Post a Comment