What is RMAN?
RMAN is an Oracle Database client that performs backup and recovery tasks on databases and automates administration of your backup strategies. It integrates with sessions running on an Oracle database to perform a range of backup and recovery activities, including maintaining an RMAN repository of historical data about backups.
What O/S and oracle user privilege required to use RMAN?
RMAN always connects to the target or auxiliary database using the SYSDBA privilege. In fact the SYSDBA keywords are implied and cannot be explicitly specified. Its connections to a database are specified and authenticated in the same way as SQL*Plus connections to a database. The O/S user should be part of the DBA group . For remote connection it needs the password file Authentication.Target database should have the initialization parameter REMOTE_LOGIN_PASSWORDFILE set to EXCLUSIVE or SHARED.
What is Target Database?
An Oracle database to which RMAN is connected with the TARGET keyword. A target database is a database on which RMAN is performing backup and recovery operations.
Where is RMAN metadata stored?
RMAN always maintains metadata about its operations on a database in the control file of the database.
Explain recovery Catalog:
A separate database schema used to record RMAN activity against one or more target databases. A recovery catalog preserves RMAN repository metadata if the control file is lost, making it much easier to restore and recover following the loss of the control file. The database may overwrite older records in the control file, but RMAN maintains records forever in the catalog unless deleted by the user.
What are Backup sets?
RMAN stores backup data in a logical structure called a backup set, which is the smallest unit of an RMAN backup. One backup set contains one or more datafiles a section of datafile or archivelogs.
What are Backup Piece?
A backup set contains one or more binary files in an RMAN-specific format. This file is known as a backup piece. Each backup piece is a single output file. The size of a backup piece can be restricted; if the size is not restricted, the backup set will comprise one backup piece. Backup piece size should be restricted to no larger than the maximum file size that your filesystem will support.
Define Image copies
An image copy is a copy of a single file (datafile, archivelog, or controlfile). It is very similar to an O/S copy of the file. It is not a backupset or a backup piece. No compression is performed.
when is Snapshot Controlfile created?
When RMAN needs to resynchronize from a read-consistent version of the control file, it creates a temporary snapshot control file. The default name for the snapshot control file is port-specific.
Explain Database Incarnation
Whenever you perform incomplete recovery or perform recovery using a backup control file, you must reset the online redo logs when you open the database. The new version of the reset database is called a new incarnation. The reset database command directs RMAN to create a new database incarnation record in the recovery catalog. This new incarnation record indicates the current incarnation.
How to check RMAN Configuration?
RMAN>Show all;
How to Reset to default Configuration?
To reset the default configuration setting use
Connect to the target database from sqlplus and run
SQL> connect <sys/passwd as sysdba>@target_database;
SQL> execute dbms_backup_restore.resetConfig;
What is Catalog database?
This is a separate database which contains catalog schema. You can use the same target database as the catalog database but it’s not at all recommended.
How Many catalog database I can have?
You can have multiple catalog databases for the same target database. But at a time you can connect to only 1 catalog database via RMAN. It’s not recommended to have multiple catalog databases.
Is this mandatory to use catalog database?
No It’s optional.
What is the advantage of catalog database?
Catalog database is a secondary storage of backup metadata. It’s very useful in case you lost the current controlfile, as all the backup information are there in the catalog schema. Secondly from contolfile the older backup information are aged out depending upon the control_file_record_keep_time. RMAN catalog database maintain the history of data.
What happens if catalog database lost?
Since catalog database is optional there is no direct effect. Create a new catalog database and register the target database with the newly created catalog DB. All the backup information from the target database current controlfile will be updated to the catalog schema. If any backup information which is aged out from the target database then you need to manually catalog those backup pieces.
What are the files that RMAN can backup?
RMAN can backup Controlfile, Datafiles, Archive logs, standby database controfile, Spfile
What are the files that RMAN cannot backup?
RMAN cannot take backup of the pfile, Redo logs, network configuration files, password files, external tables and the contents of the Oracle home files
Can I have archivelogs and datafile backup in a single backupset?
No. we cannot put datafiles and archive logs in the same backupset.
Can I have datafiles and contolfile backup in a single backup set?
Yes.
Can we set the size of backup piece and backupset?
Yes, we 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. we can use the MAXPIECESIZE channel parameter to set limits on the size of backup pieces. we can also use the MAXSETSIZE parameter on the BACKUP and CONFIGURE commands to set a
limit for the size of backup sets.
What is the difference between backup set backup and Image copy backup?
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
What is RMAN consistent backup and inconsistent backup?
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 it’s not a consistent backup.
A backup 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 cannot take inconsistent backup when the database is in NoArchivelog mode.
Can we take RMAN backup when the database is down?
No, we can take RMAN backup only when the target database is Open or in Mount stage. It’s because RMAN keep the backup metadata in controfile. Only in open or mount mode controlfile is accessible.
Can RMAN backups be compressed?
RMAN supports binary compression of backup sets. The supported algorithms are BZIP2 (default) and ZLIB. It’s not recommended to compress the RMAN backup using any other OS or third party utility.
RMAN compressed backup with BZIP2 provides great compression but is CPU intensive. Using ZLIB compression requires the Oracle Database 11g Advanced Compression Option and is only supported with an 11g database. The feature is not backward compatible with 10g databases.
Can RMAN backup be encrypted?
RMAN supports backup encryption for backup sets. We can use wallet-based transparent encryption, password-based encryption, or both. Use the CONFIGURE ENCRYPTION command to configure persistent transparent encryption. Use the SET ENCRYPTION, command at the RMAN session level to specify password-based encryption.
Can RMAN take backup to Tape?
Yes RMAN can be configured to backup to tape. But RMAN cannot write directly to tape, a third party Media Management Software should be installed. Oracle has published an API specification which Media Management Vendor’s who are members of Oracle’s Backup Solutions Partner program have access to. Media Management Vendors (MMVs) then write an interface library which the Oracle server uses to write and read to
and from tape.
How RMAN Interacts 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.
What is Proxy copy backup to tape?
Proxy copy is functionality, supported by few media manager in which they handle the entire data movement between datafiles and the backup devices. Such products may use technologies such as high-speed connections between storage and media subsystems to reduce load on the primary database server. RMAN provides a list of files requiring backup or restore to the media manager, which in turn makes all decisions regarding how and when to move the data.
What is Oracle Secure backup?
Oracle Secure Backup is a media manager provided by oracle that provides reliable and secure data protection through file system backup to tape. All major tape drives and tape libraries in SAN, Gigabit Ethernet, and SCSI environments are supported.