通过DG来升级duplicate方法不合适

按照正常的流程成功地做成了第三个DG出来,主库的版本是11.2.0.1.0; 第三个DG的版本是11.2.0.4.0.

SQL> SELECT NAME,OPEN_MODE,PROTECTION_MODE,DATABASE_ROLE,SWITCHOVER_STATUS,DB_UNIQUE_NAME FROM V$DATABASE;

NAME       OPEN_MODE        PROTECTION_MODE      DATABASE_ROLE    SWITCHOVER_STATUS    DB_UNIQUE_
---------- -------------------- -------------------- -------------------- -------------------- ----------
ORCL       MOUNTED      MAXIMUM PERFORMANCE  PHYSICAL STANDBY     NOT ALLOWED          orcl_st2

启动恢复进程

SQL> select process,client_process,status from v$managed_standby;

PROCESS   CLIENT_P STATUS
--------- -------- ------------
ARCH      ARCH     CONNECTED
ARCH      ARCH     CONNECTED
ARCH      ARCH     CONNECTED
ARCH      ARCH     CLOSING
RFS       ARCH     IDLE
RFS       LGWR     IDLE
MRP0      N/A      APPLYING_LOG

可数据库状态还是MOUNT下

切换成只读模式,要求升级

SQL> ALTER DATABASE OPEN READ ONLY;
ERROR:
ORA-03114: 未连接到 ORACLE


ALTER DATABASE OPEN READ ONLY
*
第 1 行出现错误:
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00704: bootstrap process failure
ORA-39700: database must be opened with UPGRADE option
进程 ID: 2245
会话 ID: 17 序列号: 3

那做升级吧

SQL> startup upgrade
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE 例程已经启动。

Total System Global Area  521936896 bytes
Fixed Size          2254824 bytes
Variable Size         381683736 bytes
Database Buffers      134217728 bytes
Redo Buffers            3780608 bytes
数据库装载完毕。
ORA-16003: 备用数据库仅限只读访问

结果要变成主库才能

SQL> archive log list;
数据库日志模式            存档模式
自动存档             启用
存档终点            /u01/ora_archive
最早的联机日志序列     233
下一个存档日志序列   0
当前日志序列           235
SQL> archive log list;
数据库日志模式            存档模式
自动存档             启用
存档终点            /u01/ora_archive
最早的联机日志序列     234
下一个存档日志序列   0
当前日志序列           236
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
SQL> select switchover_status from v$database;

SWITCHOVER_STATUS
--------------------
NOT ALLOWED

已用时间:  00: 00: 00.05
SQL> alter database commit to switchover to primary;
alter database commit to switchover to primary
*1 行出现错误:
ORA-16139: 需要介质恢复

可归档日志已经传过来了呀

强制型来一下

SQL> ALTER  DATABASE RECOVER MANAGED STANDBY  DATABASE DISCONNECT FROM SESSION;

数据库已更改。

已用时间:  00: 00: 06.07
SQL>  ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
 ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY
*
第 1 行出现错误:
ORA-01013: 用户请求取消当前的操作

实在是后台告警一直在报错

Wed Jun 29 18:07:42 2016
Database not available for switchover
  End-Of-REDO archived log file has not been recovered Archived log files detected beyond End-Of-REDO Incomplete recovery SCN:0:9936030 archive SCN:0:9935642 Database not available for switchover End-Of-REDO archived log file has not been recovered Archived log files detected beyond End-Of-REDO Incomplete recovery SCN:0:9936030 archive SCN:0:9935642 Database not available for switchover End-Of-REDO archived log file has not been recovered Archived log files detected beyond End-Of-REDO Incomplete recovery SCN:0:9936030 archive SCN:0:9935642 ORA-1013 signalled during: ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY...

总结下 发生这问题 应该是SYSTEM表需要做恢复, 做DG的时候 只是把数据文件给传过来了,归档日志并没有传过来. 后来传过来了,当备库没有处于恢复模式,无法进行恢复.

我想应该采用RMAN 备份方式 先备份数据文件 最后再备份控制文件. 这样控制文件SCN 大于数据文件.
而DUPLICATE 方式会导致数据文件SCN大于控制文件,或者部分大于控制文件.

你可能感兴趣的:(数据库)