1.检查主库的状态:
成都创新互联公司是一家专注于成都做网站、网站设计与策划设计,郯城网站建设哪家好?成都创新互联公司做网站,专注于网站建设10年,网设计领域的专业建站公司;建站业务涵盖:郯城等地区。郯城做网站价格咨询:13518219792
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
--------------------
TO STANDBY
2.将主库设置为standby role
alter database commit to switchover to physical standby;
shutdown immediate;
startup mount;
3.将standby转为primary
SQL> select NAME ,DB_UNIQUE_NAME ,open_mode,DATABASE_ROLE from v$database;
NAME DB_UNIQUE_NAME OPEN_MODE DATABASE_ROLE
--------- ------------------------------ -------------------- ----------------
ORCL sty MOUNTED PHYSICAL STANDBY
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
--------------------
TO PRIMARY
alter database commit to switchover to primary;
alter database open;
SQL> select NAME ,DB_UNIQUE_NAME ,open_mode,DATABASE_ROLE from v$database;
NAME DB_UNIQUE_NAME OPEN_MODE DATABASE_ROLE
--------- ------------------------------ -------------------- ----------------
ORCL sty READ WRITE PRIMARY
4.原来的primary库上执行:
alter database recover managed standby database disconnect from session;
SQL> select NAME ,DB_UNIQUE_NAME ,open_mode,DATABASE_ROLE from v$database;
NAME DB_UNIQUE_NAME OPEN_MODE DATABASE_ROLE
--------- ------------------------------ -------------------- ----------------
ORCL pri MOUNTED PHYSICAL STANDBY
网站栏目:[ORACLEDATAGUARD]switchover的过程
文章链接:http://lswzjz.com/article/jgeioi.html