|
Explain what is RMAN?
Recovery Manager is a tool that manages the process of creating backups and also manages the process of restoring and recovering from them. Explain why should use RMAN? The advantages are:
The RMAN architecture are as follows:
Media Management software is a must if you are using RMAN for storing backup in tape drive directly. Backups in RMAN Oracle backups in RMAN are of the following type: RMAN complete backup OR RMAN incremental backup. These backups are of RMAN proprietary nature. IMAGE COPY Its again a kind of backup. The advantage of uing Image
copy is its not in RMAN proprietary format.
RMAN backup is not in oracle format but in RMAN format. Oracle backup comprises of backup sets and it consists of backup pieces. Backup sets are logical entity. In oracle 9i it gets stored in a default location. There are two type of backup sets: 1. Datafile backup sets,
One more important point of data file backup sets is it do not include empty blocks. A backup set would contain many backup pieces. A single backup piece consists of physical files which are in RMAN proprietary format. You can go to RMAN prompt by just typing rman. RMAN executable is present in ORACLE_HOME/bin location. bash-2.05$ rman You can use target connect to connect to database. The database it will connect to depends on the environment variable ORACLE_HOME. RMAN> connect target Alternatively you can use “rman TARGET SYS/oracle@test NOCATALOG” to connect to the RMAN of “test” instance. Here we will be using target database control file to store all the information required for RMAN, like backupsets and backup image information etc. Backup Database: RMAN> shutdown immediate
You can also create a repository for RMAN to store all this information. Repository will be just another small database which can store the catalog information. Creating a catalog is a 3 step process 1) Create database which will hold the catalog. Else you can use the existing database also. All you need is to create a seperate tablespace for holding the information about RMAN catalog. 2) Create RMAN tablespace and RMAN user SQL> create tablespace rman_tbs datafile ‘/dy/oracle/product/db10g/dbf/rman01.dbf’ size 500M EXTENT MANAGEMENT LOCAL segment SPACE MANAGEMENT AUTO ; Tablespace created. SQL> create user rman identified by rman
User created. After creating user, you need to grant RECOVERY_CATALOG_OWNER role to that user. SQL> grant recovery_catalog_owner to rman; Grant succeeded. 3) Now Create RMAN catalog. bash-2.05$ rman catalog rman/rman@test connected to recovery catalog database RMAN> create catalog For registering the database, you need to get connected to database as well as catalog at the same time. Here is how you can do. RMAN> connect target
The above error is because the database we connected to is not found in the catalog database. We can register the database in catalog. RMAN> register database; database registered in recovery catalog
Registering database will also resynch the information present in the target database control file and catalog database. Since we have taken 1 backup early, it will synchup that information with RMAN catalog. We can check the same using LIST BACKUP command at RMAN prompt. RMAN> list backup;
Backing up the Controlfile and Spfile The control file can be automatically backed up after
each RMAN backup and database structure change as a way to protect the
RMAN repository (when we are not using a seperate catalog for RMAN).
Backing up control file RMAN> backup current controlfile; Creating Image copy of all datafiles in database These are the image copies and are stored in ORACLE format and not in RMAN format. Backupsets and backuppieces are stored in internal RMAN format. Hence these image copies can be used for manual restore and recovery as well. RMAN> backup as copy database; Creating backupsets of all datafiles in database If you specify BACKUP AS BACKUPSET, then RMAN stores its backups in backup sets. A backup set, consisting of one or more backup pieces, contains the physical file data being backed up. This backupset is written in a format that only RMAN can access. Only RMAN can create and restore backup sets. Backup sets can be written to disk or tape, and they are the only type of backup which RMAN can use to write backups to tape. RMAN> backup as backupset database; Backup individual tablespace as backupsets RMAN> backup tablespace system, HTMLDB; Backup individual tablespace as image copies RMAN> backup as copy tablespace system; Backup individual files as image copies RMAN> backup as copy datafile ‘/dy/oracle/product/db10g/dbf/system01.dbf’; Backup individual files as Backupsets RMAN> backup datafile ‘/dy/oracle/product/db10g/dbf/system01.dbf’; Backup archivelogs We can backup the archive logs according to the output of some search condition. Example we want to backup only those archivelogs which starts with “ARCH_616814159_”. RMAN> backup acrchivelog like ‘%ARCH_616814159_%’; Copy archivelogs from some time stamp. Suppose we want to copy the archivelogs of last 2 days, then we can use the following commands. RMAN> BACKUP ARCHIVELOG from time ’sysdate-2?; Backup all archivelog files RMAN> Backup archivelog all; Backup archivelog between some time. RMAN> BACKUP ARCHIVELOG FROM TIME ‘SYSDATE-30? UNTIL TIME ‘SYSDATE-7?; Specifying copies while backing up. RMAN> backup copies 2 datafile ‘/dy/oracle/product/db10g/dbf/cs_tbs01.dbf’; Remember that copies option cannot be used with image copies. It can be used only with backupsets. Giving tags to backups RMAN> BACKUP TAG ‘weekly_full_db_bkup’ DATABASE MAXSETSIZE
100M;
Backup imagecopies RMAN> Backup as copy backupset all; List Imagecopies RMAN> list copy; List Backupsets RMAN> list backup; |
|
See Also
Have a Oracle Question
Oracle Books
Oracle Application
Oracle Home
All the site contents are Copyright © www.erpgreat.com
and the content authors. All rights reserved.
|