Previous Table of Contents Next


Backup and Recovery Using Recovery Manager (RMAN)

A database backup represents your data, and it can be used to reconstruct lost information. Backup includes important database components such as control file, datafiles, and archive logs. In case of a media failure, the database backup can be a life saver. Oracle8 enhances the support of backup and recovery operations by kernel integration of the backup and recovery operations, and also through the introduction of a tool—Recovery Manager.

Recovery Manager provides an interactive interface to backup and recovery operations by means of a character or GUI front-end with its own command language. Recovery Manager can be used for creating, managing, and restoring the backups of a database, while maintaining superior performance and high availability of the database.

Recovery Manager has several features:

  Allowing backup of the entire database or a subset of the database in one operation
  Avoiding operator errors and also checking for database corruption
  Automatic parallelization of backup and recovery
  Minimizing redo generation
  Allowing hot and cold backups
  Supporting tape backups in conjunction with vendor-supplied tape management software like Legato or Epoch


Note:  
In Oracle8.0.4, Legato is provided as the default media manager.

When using the Recovery Manager in Oracle8, the recovery process for the entire database or part of it is very straightforward, because the RMAN can restore the appropriate backups and archive logs as needed.

Information about the backups and the archived logs is placed in a recovery catalog. The recovery catalog is a set of database objects that stores information related to the entire backup and recovery activities performed against the database(s).

The following things should be considered when using a recovery catalog:

  Reports can be printed using the recovery catalog to get information on all the backup and recovery activities.
  One recovery catalog can be used to keep information on multiple Oracle8 databases.
  In order to avoid a single point of failure, the recovery catalog of one database should be placed in another database, while the recovery catalog of a second should be placed in the first.
  Larger sites with multiple databases may use one recovery catalog for all of them, thereby simplifying the administration of the catalog.


Note:  
For smaller databases, there is a RMAN mode that allows the recovery catalog to be optional and gets all the needed information from the control file. When in this mode the following operations are not possible:
  Point-in-time recovery
  Automatic recovery when the control file is not current


Note:  
The Enterprise backup utility is not supported in Oracle8.


Note:  
See Oracle Bulletin 108898.604, titled “Automating Cold Backups on Windows NT,” for examples of a script-based approach.

Oracle8 provides three ways of taking database backups:

  Export. This method does not allow a way to perform fast backup and also requires the database to be shut down; it is, therefore, not very useful for backing up VLDB.
  O/S level backup. This method requires a lot of manual procedures and should be used carefully because errors during database backup and/or restore can result in a corrupt database.
  Recovery Manager. This method uses the information of the database to automatically locate, backup, restore, and recover datafiles, control files, and archived logs. It allows very fast backups by backing up only the changed blocks.

Recovery Manager allows commands to perform the following:

  Backup, restore, copy, and recover
  Maintenance of the recovery catalog
  Maintenance of the stored scripts
  Reporting

Using Recovery Manager—Examples

Before using RMAN with the recovery catalog and a particular target database, you need to perform the following tasks:

  Create a user called rman.
  Connect as rman and run a script called catrman.sql, located in the $ORACLE_HOME/rdbms/admin directory.
  Register the target database with the recovery catalog.


Note:  
The target database should at least be mounted. In addition, a unique number that is generated internally, called db identifier, is used to identify the database.

Before issuing a backup, restore, copy, or recovery command, a channel must be allocated that sets up a connection from RMAN to a target database instance by starting a server process on a target database. The type of I/O device that will be used is also specified during channel allocation. It is important to note that each allocate channel command uses a separate connection to the target database, and multiple backup sets or file copies can be read or written in parallel.

Examples of Backup and Restore Using RMAN

The following is an example of database backup (except offline tablespaces):


run{

allocate channel dev1 type ‘sbt_tape’;

backup skip offline (database format ‘%d_%u’);

}

The following is an example of backing up a tablespace:


run{

allocate channel dev1 type disk;

backup

(tablespace system, tablespace1, tablespace2

format ‘/oracle/backups/%d_%u’);

}

The following is an example of backing up a datafile:


run{

allocate channel dev1 type disk;

backup

(datafile ‘$ORACLE_HOME/dbs/user1.dbf’

format ‘%d_%u’);

}

The following is an example of restoring a datafile:


run{

allocate channel dev1 type ‘sbt_tape’;

sql “alter tablespace tablespace1 offline immediate”;

restore tablespace tablespace1;

recover tablespace tablespace1;

sql “alter tablespace tablespace1 online”;

release channel dev1;

}


Previous Table of Contents Next
Используются технологии uCoz