What is RMAN?
Recovery Manager as it is popularly called RMAN is a platform independent Oracle utility for coordinating Backup and Restoration procedure. This is integrated as a part of Oracle server software. RMAN binary resides at $ORACLE_HOME/bin/rman. RMAN is the Oracle recommended tool to take database backups. It can be used to backup datafiles and datafile image copies, control file and control file image copies, archived redo logs, spfile and RMAN backup pieces.
RMAN Architecture:
RMAN operates via server sessions connecting to target databases which are the databases that need to be backed up. The collection of information about the target database such as its schema information, backup copy information, configuration settings, backup and recovery scripts is called the RMAN repository. RMAN uses this metadata about the target databases to perform its backup and recovery activity. RMAN periodically retrieves information from the target database control file and saves it in the recovery catalog. Brief listings of entities that enable RMAN to perform its function are given below:
Target database:
This is the database that RMAN needs to back up. RMAN server sessions running in the target database perform backup and recovery operations.
RMAN Repository:
This is RMANs metadata about backups, archived redologs, and its own activities. The control file of each database is the primary storage for RMAN repository.
-1-
RMAN
RMAN Client:
RMAN operations can be managed through RMAN client sessions. It is a CLI (command line interface) through which backup, recover, sql, special RMAN commands are issued. Commands communicate with RMAN server and operations are performed. The client starts RMAN server sessions on target databases and directs them to perform backup and recovery operations. The RMAN client uses Oracle Net to connect to the target database. RMAN client can be located on any host that connects to the target host through Oracle Net.
RMAN executable:
This is the actual program that manages all backup and recovery operations. RMAN executable resides at $ORACLE_HOME/bin directory. It performs backup and recovery operations and records the results in the control file and optional recovery catalog.
Server Processes:
These are the background processes that facilitate the communication between the RMAN executable and the target database. The server process performs the real work of reading and writing to disk devices and tape drives during backup and recovery. Apart from this there are three optional entities including flash recovery area, the recovery catalog database (and the recovery catalog schema) and the media management software.
No Extra Costs. It is available free. RMAN introduced in Oracle 8 it has become simpler with new version and easier that user managed backups. Proper Security You are 100% sure your database has been backed up. It contains details of backup taken in the central repository Facility of testing validity of backups also commands like cross check to check the status of backup.
-2-
RMAN
Oracle 10g has got further optimized incremental backups with has resulted in improvement of performance during backup and recovery time Parallel operation are supported Better Querying facility for knowing different details of backup. No Extra redo generated when backup is taken. compared to online backup Maintains repository of backup Knows what needs to be backed up metadata. Knows what is required for recovery Remembers backup locations Knows what backups are redundant Knows what needs backup set locations It handles database corruptions
Create rman schema owner SQL> create user mrman identified by mrman 2 temporary tablespace temp 3 default tablespace mrman 4 quota unlimited on mrman;
User created.
-3-
RMAN
Create the recovery catalog:
$ rman catalog=mrman/mrman@anand
Recovery Manager: Release 10.2.0.3.0 - Production on Mon Aug 4 13:18:22 2008 Copyright (c) 1982, 2005, Oracle. All rights reserved. connected to recovery catalog database
RMAN> register database; database registered in recovery catalog starting full resync of recovery catalog full resync complete RMAN>
-4-
RMAN
Run the following sql command to see the database recovery file destination is configured or not.
SQL> show parameter db
..
NAME TYPE VALUE db_keep_cache_size big integer 0 db_name string monish db_recovery_file_dest string /u02/monish/backup
.. . If its not configured then run the following: to set the controlfile backup location
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO /u01/%F;
new RMAN configuration parameters: CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO /u01/%F; new RMAN configuration parameters are successfully stored
To take the Backup: run { CROSSCHECK BACKUPSET; # To check available and expired backup sets. CROSSCHECK ARCHIVELOG ALL; # To check available and expired Archive Logs DELETE NOPROMPT EXPIRED BACKUP; # It will delete expired (old/not exists physically) backups DELETE NOPROMPT EXPIRED ARCHIVELOG ALL; # It will delete expired archive logs SQL ALTER SYSTEM ARCHIVE LOG CURRENT; # Switch Log BACKUP DATABASE PLUS ARCHIVELOG; # Backup the whole Database plus archive files DELETE NOPROMPT OBSOLETE; # It will remove old backups according to the redundancy period. } # End of Backup
-5-
RMAN
ORACLE instance shut down. SQL>
RMAN>
-6-