全部博文(389)
分类: Oracle
2014-08-08 16:54:32
RAC到单实例SWITCHOVER
现有RAC(12C)到单实例的物理DATAGUARD,需要SWITCHOVER主库到单实例上 ,使原来的
RAC成为备库,单实例备库成为主库.
在rac和单实例备库上检查DG的相关参数,确认无误.
在RAC上,手动实现switch logfile,然后检查备库是已经应用了相用的logfile,以确保事务
完全在备库上应用。
SQL> alter system switch logfile;
System altered.
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/app/oracle/product/12.1.0.0/db_1/dbs/arch
Oldest online log sequence 69
Next log sequence to archive 70
Current log sequence 70
SQL> select database_role from v$database;
DATABASE_ROLE
----------------
PRIMARY
DG备库上检查
SQL> select database_role from v$database;
DATABASE_ROLE
----------------
PHYSICAL STANDBY
SQL> select process,client_process,thread#,sequence# from v$managed_standby;
PROCESS CLIENT_P THREAD# SEQUENCE#
--------- -------- ---------- ----------
ARCH ARCH 1 68
ARCH ARCH 1 64
ARCH ARCH 0 0
ARCH ARCH 1 69
RFS UNKNOWN 0 0
RFS ARCH 0 0
RFS LGWR 2 30
RFS UNKNOWN 0 0
RFS LGWR 1 70
RFS ARCH 0 0
RFS UNKNOWN 0 0
PROCESS CLIENT_P THREAD# SEQUENCE#
--------- -------- ---------- ----------
RFS UNKNOWN 0 0
MRP0 N/A 1 70
13 rows selected.
在rac主库上执行
SQL> alter database commit to switchover to physical standby;
Database altered.
SQL> select database_role from v$database;
DATABASE_ROLE
----------------
PHYSICAL STANDBY
在dg备库提升为主库.
SQL> alter database commit to switchover to primary;
Database altered.
SQL> select database_role from v$database;
DATABASE_ROLE
----------------
PRIMARY
打开单实例数据库
SQL> alter database open;
Database altered.
在11.2的版本中在SWITCHOVER时,不需要再更改cluster_database参数重启数据库了,这一点
比原来方便很多.
在rac节点上启动日志应用.
SQL> alter database recover managed standby database disconnect from session;
Database altered.
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
READ ONLY WITH APPLY --default已经使用active dataguard了.
在单实例主库上手动切换日志,检查在rac备库上应用情况,确认DATAGUARD工作正常.