CATLOG CREATION

CATLOG CREATION

Discussion on creation and use of catalog

(Example scripts as provided by Oracle)

What is to be done in Oracle Version 8.1.x?

SVRMGR> spool create_rman.log
SVRMGR> connect internal
SVRMGR> create user rman identified by rman
temporary tablespace temp
default tablespace rcvcat quota unlimited on rcvcat;
SVRMGR> grant recovery_catalog_owner to rman;
SVRMGR> grant connect, resource to rman;
SVRMGR> connect rman/rman
SVRMGR> @d:oracleora805rdbmsadmincatrman.sql

Metalink Doc Id: 50875.1 helps manage RMAN ON 8i.

This Doc is edited to make it more interactive.

What is RMAN?

RMAN can be used to backup and restore database files, archive logs, and control files. It can also be used to perform complete or incomplete database recovery. Note that RMAN cannot be used to backup initialization files or password files.

RMAN starts Oracle server processes on the database to be backed up or restored. The backup, restore, and recovery is driven through these processes hence the term 'server-managed recovery'.

Note that SMR can also be controlled from OEM's Backup Manager GUI. This article will not discuss Backup Manager.

Terminology Used by RMAN

What are Backup sets?

A backup set is characterised by the following:

- Contains one or more datafiles or archivelogs
- Stored in an Oracle proprietary format
- Comprises a complete set of backup pieces
- Constitutes a full or incremental backup

What are Backup pieces?

A backup set is comprised of a number of backup pieces. 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 file system will support.

What are 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.

What are full backup sets?

A full backup is a backup of one or more datafiles that contains all used blocks in the datafile. Blocks that have never been used are not backed up i.e. oracle performs backup set compression.

What are Incremental backup sets?

An incremental backup is a backup of one or more datafiles that contains only those blocks that have been modified since a previous backup at the same or lower level. As with full backups, compression is performed.

What is File multiplexing?

Datablocks from multiple datafiles can be multiplexed in the same backupset.

What is Recovery catalog resyncing?

Resyncing the recovery catalog involves synchronizing the recovery catalog with the target database controlfile. Certain operations perform this implicitly. To resync manually, issue the 'resync catalog;' command from RMAN. The catalog should be resynced frequently, especially if the target database generates many archive logs. It should also be resynced after making any structural changes to the target database. Although the target database's controlfile is automatically updated whenever new controlfile records are created (for example, creation of new archived logs or new datafiles), if the target is not resync'd and a backup controlfile is restored, the new records must be cataloged manually (catalog archivelog '';).

What is Snapshot Controlfile?

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. Use the 'set snapshot controlfile name to file_name' command to change the name of the snapshot control file; subsequent snapshot control files that RMAN creates use the name specified in the command. The snapshot control file name can also be set to a raw device. This operation is important for OPS databases in which more than one instance in the cluster use RMAN because server sessions on each node must be able to create a snapshot control file with the same name and location.

What is Resetlogs Operation?

Whenever you open the database with the RESETLOGS option, all datafiles get a new RESETLOGS SCN and timestamp. Archived redo logs also have these two values in their header. Because Oracle will not apply an archived redo log to a datafile unless the RESETLOGS SCN and timestamps match, the RESETLOGS operations prevents you from corrupting your datafiles with old archived logs.

What is the 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. All archived redo logs generated after the point of the RESETLOGS on the old incarnation are invalid in the new incarnation.

How to Reset the Recovery Catalog?

Before you can use RMAN again with a target database that you have opened with the RESETLOGS option, notify RMAN that you have reset the database 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. RMAN associates all subsequent backups and log archiving done by the target database with the new database incarnation. If you issue the ALTER DATABASE OPEN RESETLOGS statement but do not reset the database, then RMAN cannot access the recovery catalog because it cannot distinguish between a RESETLOGS command and an accidental restore of an old control file. By resetting the database, you inform RMAN that the database has been opened with the RESETLOGS option.
In the rare situation in which you wish to undo the effects of opening with the RESETLOGS option by restoring backups of a prior incarnation of the database, use the 'reset database to incarnation key' command to change the current incarnation to an older incarnation.

How to create the recovery catalog Oracle 8.0.x?

The recovery catalog is a repository of information that is used and maintained by RMAN. RMAN uses the information in the recovery catalog to determine how to execute requested backup and restore actions..'.

The recovery catalog can be in a schema of an existing Oracle8 database.

However if RMAN is being used to backup multiple databases, it is probably worth creating a dedicated recovery catalog database. THE RECOVERY CATALOG DATABASE CANNOT BE USED TO CATALOG BACKUPS OF ITSELF.

To set up the recovery catalog, firstly ensure that catalog and catproc have been run, then execute the following:

SVRMGR> spool create_rman.log
SVRMGR> connect internal
SVRMGR>
create user rman identified by rman
temporary tablespace temp
default tablespace rcvcat
quota unlimited on rcvcat;
SVRMGR> grant recovery_catalog_owner to rman;
SVRMGR> grant connect, resource to rman;
SVRMGR> connect rman/rman
SVRMGR> @?/rdbms/admin/catrman

Check create_rman.log for errors. The above commands assume that the TEMP and RCVCAT tablespaces have been created.

In Oracle8i the catalog is created a little differently.

How to create the recovery catalog Oracle 8.1.5 and greater?
(Oracle 8.1.5,8.1.6 and 8.1.7)

From the UNIX shell run:

% set ORACLE_SID=RCAT
% rman catalog rman/rman
RMAN> create catalog;

This will generate the recovery catalog schema in the default tablespace for
RMAN.

Also ensure that catproc has been run on the target database as SYS (do _not_ use SYSTEM); RMAN makes extensive use of RPCs.

It is very important that the recovery catalog database is backed up regularly and frequently.

Note:

Although you are not required to use a recovery catalog with RMAN, it is recommended. Because most of the information in the recovery catalog is available via the target database's controlfile, RMAN can use this information for recovery purposes.

How to start RMAN?

RMAN has a command line interface, or can be run from Enterprise Manager.
For the purposes of this document, only the CLI will be covered.

The command line interface has following syntax:

rman target [rcvcat | cmdfile | msglog | append | trace ]

Argument

Quoted String Description

TARGET

A connect string containing a userid and password for the database on which Recovery Manager is to operate.

example:

rman target system/manager@target