Oracle 11g Dataguard creation in ORA-01665 resolution process

Source: Internet
Author: User

Oracle 11g Recovery of standby control files was unsuccessful when creating data guard. At Mount Standby database, I was told that the control file was not a standby control file, and that the specific information was "Ora-01665:control file is not a standby-control".  

control files I generated in the main library using Rman.  
Backup current controlfile for standby format ' xxxxxx/ctl.stdy ';  

Copy to the standby for recovery. Follow the 10g operating habits and use the Rman tool for recovery operations.  


in the 11g Rman tool made a lot of changes, such as adding the set function to directly modify the SPFile file for standby, the personal feel is chicken. My manual editing is much more cool than knocking at the command here.  

and here to restore standby controlfile, to manually specify, I recover the control file is used for standby, otherwise it will not.  
restore Controlfile from '/u01/backup/db7881/ctl.stdy ';  
recovery was resumed, but there was an error in Mount standby database.  

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 you do not do standby database mount, then you can mount successfully.  

sql> ALTER DATABASE mount;  

Database altered.  

this proves that there is no problem with my backup media. Check the type of control file, not the type of standby I need.  

sql> Select Controlfile_type from V$database;  

CONTROL
------- 
BACKUP

OK, then go back to the operation of 11g Rman's recovery control file.  
One of the restoreobject of the RMAN tool's restore 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's perform a switchover from primary database Dgny to standby database DGSF, so that's dgsf is the new primary Database. Later Dgny a standby database for DGSF. You want-to-restore a control file on Dgny, but the recovery catalog is not resynchronized and still shows Dgny as a prim ary 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 are known to the recovery catalog and then RMAN updates All filenames with 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 Catalo G.

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 DA Tabase with the Resetlogs option.  

The restore operation was successful using "Restore Standby Controlfile".  

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 recover the control file, check the V$database Controlfile_type, is already the type we need.  

sql> ALTER DATABASE mount standby database;  

Database altered.  

sql> Select Controlfile_type from V$database;  

CONTROL
------- 
STANDBY


--end.

Oracle 11g Dataguard creation in ORA-01665 resolution process

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.