Introduction to Oracle RMAN Maintenance (ii) Recovery directory Maintenance

Source: Internet
Author: User
Tags manual reset sqlplus

Some other maintenance activities are involved when using the recovery directory, such as upgrading the recovery directory during database upgrades or migrations, manually configuring the database counterpart, and synchronizing the recovery directory after some database operations.

1. Unregister the database in Rman

Before Oracle 10g, it was a manual process to unregister the database from the recovery directory. In 10g, removing a database from the recovery directory requires only the execution of unregister databases. Such as:

Rman>unregister database ORCL;

Note that this command does not delete the backup files for the database, but simply deletes the recovery directory references for those backup files. It is also necessary to note that the command can be executed simply by connecting to the recovery directory.

2, the database migration and upgrade issues

When upgrading a database, colleagues must upgrade the recovery directory because there are strict grids between the database version, the RMAN version, and the recovery catalog version.

You can see the version of the recovery catalog by using the Restore directory user to connect to the database and then querying the Rcver table:

Sql> Conn RMAN/RMAN@ORCL;

is connected.

Sql> select version from Rcver;

VERSION

------------

11.02.00.01

You can perform a variety of operations as long as the version of the catalog is not less than the version of the database. Therefore, if you store multiple databases in the same recovery directory, you can upgrade only one database in the recovery directory.

The Upgrade recovery catalog is simple enough to execute the Upgrade catalog command in Rman. RMAN prompts the user to enter the Upgrade Catalog command again, and then upgrades the recovery directory.

C:/users/administrator.daviddai>rman target/@bl Catalog Rman/rman@orcl;

Recovery manager: Release 11.2.0.1.0-production on Sunday July 11 10:16:20 2010

Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.

Connect to target database: BL (dbid=680066685)

Connecting to the Recovery directory database

rman> upgrade Catalog;

Recovery Directory owner is Rman

Enter the UPGRADE CATALOG command again to confirm the catalog upgrade

rman> upgrade Catalog;

The recovery catalog has been upgraded to version 11.02.00.01

Dbms_rcvman Package upgrade to version 11.02.00.01

Dbms_rcvcat Package upgrade to version 11.02.00.01

3. Manually reset the database counterpart (reset catalog)

When you open the database, if you use the Resetlogs parameter, a new counterpart is created. If this operation is done in Rman, the recovery directory will be updated correctly, but if you manually execute the resetlogs command (for example, Sqlplus), you must reset the database counterpart in the recovery directory.

Rman>reset database to incarnation 5;

4, Manual resynchronization Recovery directory (Resync catalog)

When Rman uses the recovery directory, it uses the synchronization process to ensure that the control files for the recovery directory and the target database are consistent. Typically, Oracle synchronizes the database after the Rman operation (backup and recovery), which eliminates the need to synchronize the recovery directory frequently. One instance of the need to synchronize the recovery directory is sometimes to use the recovery directory, sometimes without the recovery directory, at which point the Resync Catalog command can be used to manually synchronize the Oracle back to the directory.

Rman>resync Catalog;

When Oracle synchronizes the recovery directory, it first creates a snapshot control file and compares the file and the recovery directory. After the comparison is completed, the Oracle updates the recovery directory, which synchronizes the recovery directory with the database control files.

5, restore the deletion of the directory record

Only a small number of records are removed from the recovery directory and, if not maintained, the backup will reside in the recovery directory for the deleted state. To address this issue, ORACLE provides a $oracle_home/rdbms/admin/prgmanc.sql script to delete all records in the recovery directory with status deleted. It is recommended that this script be executed periodically to control the size of the file recovery directory.

If you want to delete the old counterpart records from the recovery directory, you must remove the corresponding objects from the Dbinc table. You can use the Rc_database_incarnation view to determine which counterpart to delete, and to record the Dbinc_key value of each corresponding object that you want to delete. Then execute the delete command in Sqlplus, such as:

Sql> select * from Rc_database_incarnation;

Db_key DBID dbinc_key NAME resetlogs_change# resetlogs_time CUR P

---------- ---------- ---------- -------- ----------------- -------------- --- -

2 1247395743 4 ORCL 940976 2 January-May -10 NO 0

2 1247395743 ORCL 1 February-April -10 NO

2 1247395743 787 ORCL 8554968 June-July -10 YES 2

Sql> Delete from dbinc where dbinc_key=4;

1 rows have been deleted.

6. Backup Recovery Directory

We can use Rman to back up the database, and we can also use Rman to back up the recovery catalog database. You can quickly restore the recovery directory as long as you ensure that you have a reasonable recovery strategy in place.

The loss of the recovery directory is not scary, even if the recovery directory is used, you can later recover the database without using the recovery directory. The key is that we need a backup of the database control files.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.