Oracle 11g的dataguard创建中ORA-01665解决过程
2015-01-07 11:34
543 查看
Oracle 11g在创建data guard时,恢复standby控制文件不成功。在mount standby database时告诉我,控制文件不是standby控制文件,具体信息为“ORA-01665: control file is not a standby control file”。
控制文件我在主库中,使用rman生成的。
backup current controlfile for standby format 'xxxxxx/ctl.stdy';
拷贝到备库上恢复。按照10g的操作习惯,使用rman工具进行恢复操作。
在11g的RMAN工具做了不少改动,如加了set功能直接修改生成适用于standby的spfile文件,个人觉得是鸡肋。我手工编辑修改比这里敲命令操作爽多了。
还有这里恢复standby controlfile时,要手工指定,我恢复的控制文件是用于standby,否则就不行了。
restore controlfile from '/u01/backup/db7881/ctl.stdy';
恢复是恢复了,但在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
如果不做standby database的mount,那么则可以mount成功。
SQL> alter database mount;
Database altered.
这点证明我的备份介质是没有问题的。检查一下控制文件的类型,不是我需要的standby类型。
SQL> select controlfile_type from v$database;
CONTROL
-------
BACKUP
好,再回到11g rman的恢复控制文件的操作上来。
RMAN 工具的restore 的restoreobject,有一项是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.
使用”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
数据库可以恢复控制文件后,检查v$database的controlfile_type,已经是我们需要的类型了。
SQL> alter database mount standby database;
Database altered.
SQL> select controlfile_type from v$database;
CONTROL
-------
STANDBY
--end.
控制文件我在主库中,使用rman生成的。
backup current controlfile for standby format 'xxxxxx/ctl.stdy';
拷贝到备库上恢复。按照10g的操作习惯,使用rman工具进行恢复操作。
在11g的RMAN工具做了不少改动,如加了set功能直接修改生成适用于standby的spfile文件,个人觉得是鸡肋。我手工编辑修改比这里敲命令操作爽多了。
还有这里恢复standby controlfile时,要手工指定,我恢复的控制文件是用于standby,否则就不行了。
restore controlfile from '/u01/backup/db7881/ctl.stdy';
恢复是恢复了,但在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
如果不做standby database的mount,那么则可以mount成功。
SQL> alter database mount;
Database altered.
这点证明我的备份介质是没有问题的。检查一下控制文件的类型,不是我需要的standby类型。
SQL> select controlfile_type from v$database;
CONTROL
-------
BACKUP
好,再回到11g rman的恢复控制文件的操作上来。
RMAN 工具的restore 的restoreobject,有一项是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.
使用”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
数据库可以恢复控制文件后,检查v$database的controlfile_type,已经是我们需要的类型了。
SQL> alter database mount standby database;
Database altered.
SQL> select controlfile_type from v$database;
CONTROL
-------
STANDBY
--end.
相关文章推荐
- oracle 11g dataguard 出现ORA-16143: 终端恢复过程中或之后不允许进行 RFS 连接解决方法
- ORACLE 存储过程的创建以及ORA-06502:PL/SQL:数字或值错误的解决方法
- oracle 11g dataguard 创建过程
- bugzero的安装过程、tomcat与oracle XDB端口冲突的处理(ORA-01041的解决)
- 解决连接oracle 11g报ORA-01034和ORA-27101的错误
- 11G Oracle报ORA-01078和LRM-00109错解决方法
- Oracle创建表格报ORA-00906:缺失左括号错误解决办法
- Oracle物化视图创建报ORA-00942错的解决
- oracle 11g ORA-12514错误,我的解决办法
- Environment variable ORACLE_SID not defined. Please define it. (oracle 11g数据库创建完成后控制台不可用解决方法)
- 这周一个ORACLE问题的解决过程(ORA-12560:TNS:协议适配器错误! )
- 在搭建oracle dataguard 11g过程中遇到的问题一
- 创建Oracle群集服务器出现的ORA-01991及其解决
- Oracle 11g ORA-12154: TNS: could not resolve the connect identifier specified 问题解决!
- OWB错误集锦——OWB 11g创建Oracle模块编辑Location报ORA-00933
- 解决oracle 11g 问题之ORA-01078: failure in processing system parameters
- ORA-28002 Oracle 11g存在密码过期问题解决方案
- Oracle 11g创建远程物化视图时提示“ORA-01788: 此查询块中要求 CONNECT BY 子句”的解决方案
- Oracle 11g R2安装过程中遇到的报错及解决办法
- Oracle创建dblink报错:ORA-01017、ORA-02063解决