Oracle 11g replica uard creation in ORA-01665 resolution, dataguardora-01665

Source: Internet
Author: User

Oracle 11g replica uard creation in ORA-01665 resolution, dataguardora-01665
Oracle 11g fails to restore the standby control file when creating data guard. When I mount standby database, tell me that the control file is not a standby control file and the information is ORA-01665: control file is not a standby control file ".

The control file is generated using rman in the master database.
Backup current controlfile for standby format 'xxxxxx/ctl. stdy ';

Copy to the slave database for recovery. Use the rman tool for recovery according to the 10 Gb operating habits.


Many changes have been made to the 11g RMAN tool. For example, if you add the set function to directly generate the spfile file for standby, I think it is a weakness. The manual editing and modification operations are much better than the command knocking operation here.

In addition, you must manually specify the standby controlfile to be restored. The recovered control file is used for standby, otherwise it will not work.
Restore controlfile from '/u01/backup/db7881/ctl. stdy ';
Recovery is restored, but an error occurs when the standby database is mounted.

SQL> alter database mount standby database;
Alter database mount standby database
*
ERROR at line 1:
ORA-01665: control file is not a standby control file


If the standby database is not mounted, the mount is successful.

SQL> alter database mount;

Database altered.

This proves that my backup media is correct. Check the type of the control file. It is not the standby type I need.

SQL> select controlfile_type from v $ database;

CONTROL
-------
BACKUP

OK, then return to the 11g rman recovery control file operation.
The restoreobject In the restore Of The RMAN tool, one of which is standby controlfile.

Standby controlfile Restores a control file for a standby database. RMAN can transparently restore a normal control file backup and make it usable for a standby database.

RMAN restores either a normal or standby control file as appropriate, depending on the most recent database role known to the recovery catalog (RC_SITE.DATABASE_ROLE) for the target database. the purpose of this option to override the default setting in cases where the most recent database role is out-of-date. assume that you perform a switchover from primary database dgny to standby database dgsf, so that dgsf is the new primary database. later, you make dgny a standby database for dgsf. you want to restore a control file on dgny, but the recovery catalog was not resynchronized and still shows dgny as a primary database. in this case, you can specify standby controlfile to override the default RMAN behavior and restore a standby control file.

If you restore the control file of a database whose DB_UNIQUE_NAME is known to the recovery catalog, then RMAN updates all filenames in the control file to filenames known to the recovery catalog. any filenames explicitly renamed with alter database rename file take precedence over the filenames in the recovery catalog.

See Also: Table 2-36 for restrictions and usage notes

Note: You must always run the RECOVER command after mounting a restored control file, and must also always open the database with the RESETLOGS option.

Use "restore standby controlfile" to restore the instance.

RMAN> restore standby controlfile from '/u01/backup/db7881/ctl. stdy ';

Starting restore at 07-JAN-15
Using target database control file instead of recovery catalog
Allocated channel: ORA_DISK_1
Channel ORA_DISK_1: SID = 62 device type = DISK

Channel ORA_DISK_1: restoring control file
Channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
Output file name = + VG1/db7881dg/controlfile/current.447.868357987
Output file name = + VG1/db7881dg/controlfile/current.507.868357987
Finished restore at 07-JAN-15

After the database can restore the control file, check the controlfile_type of v $ database, which is already the type we need.

SQL> alter database mount standby database;

Database altered.

SQL> select controlfile_type from v $ database;

CONTROL
-------
STANDBY


-- End.

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.