关于DG的一些问题!!!

DG环境已经搭建完成 DG1(主) DG2(备)
DG1:
SQL> create table t1 (id number(5));
Table created.
SQL> insert into t1 values(1);
1 row created.
SQL> commit;
Commit complete.
SQL> select * from t1;
        ID
----------
         1
SQL>  alter system switch logfile;
System altered.
SQL>  select max(sequence#) from v$archived_log;
MAX(SEQUENCE#)
--------------
            31

DG2:
SQL>  select max(sequence#) from v$archived_log;
MAX(SEQUENCE#)
--------------
            31

SQL>  ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
Database altered.
SQL>  ALTER DATABASE OPEN READ ONLY;
Database altered.
SQL> select * from t1;
        ID
----------
         1
SQL>  ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
Database altered.

insert之后不commit
DG1:
SQL> insert into t1 values(2);
1 row created.
没有commit,直接做了日志轮转
SQL>  alter system switch logfile;
System altered.
SQL> select * from t1;
        ID
----------
         1
         2
SQL>  select max(sequence#) from v$archived_log;
MAX(SEQUENCE#)
--------------
            32

DG2:
SQL>  select max(sequence#) from v$archived_log;
MAX(SEQUENCE#)
--------------
            32

SQL>  ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
Database altered.
SQL>  ALTER DATABASE OPEN READ ONLY;
Database altered.
SQL> select * from t1;
        ID
----------
         1
SQL>  ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
Database altered.

问题:
alter system switch logfile不是可以触发隐试提交吗,但是为什么DG2的数据没有同步?
以至于之后做主备切换的时候,备机切换主机
SQL> alter database commit to switchover to primary;
alter database commit to switchover to primary
*
ERROR at line 1:
ORA-16139: media recovery required


需要alter database recover managed standby database finish
SQL> alter database commit to switchover to primary;
Database altered.



标签: 暂无标签
zhaojingyuo

写了 14 篇文章,拥有财富 332,被 3 人关注

转播转播 分享分享 分享淘帖
回复

使用道具

hzs
P4 | 发表于 2011-5-14 22:01:06
切之前看状态了吗?
select switchover_status from v$database;
回复

使用道具

您需要登录后才可以回帖 登录 | 加入社区

本版积分规则

意见
反馈