Primary Database ( TRAIN )
SQL> select name,open_mode,database_role from v$database;
NAME OPEN_MODE DATABASE_ROLE
--------- -------------------- ----------------
TRAIN READ WRITE PRIMARY
<testing switchover status>
SQL> select switchover_status from v$database;
SWITCHOVER_STATUS
--------------------
FAILED DESTINATION
SQL> alter system switch logfile;
System altered.
SQL> /
System altered.
<testing switchover status>
SQL> select switchover_status from v$database;
SWITCHOVER_STATUS
--------------------
TO STANDBY
<switchover to standby>
SQL> alter database commit to switchover to standby;
Database altered.
<shutdown immediate>
SQL> shutdown immediate;
ORA-01507: database not mounted
ORACLE instance shut down.
<startup mount>
SQL> startup mount
ORACLE instance started.
Total System Global Area 1.1458E+10 bytes
Fixed Size 2217120 bytes
Variable Size 9831451488 bytes
Database Buffers 1610612736 bytes
Redo Buffers 13496320 bytes
Database mounted.
SQL> select name,open_mode,database_role from v$database;
NAME OPEN_MODE DATABASE_ROLE
--------- -------------------- ----------------
TRAIN MOUNTED PHYSICAL STANDBY
<start managed recovery again>
SQL> alter database recover managed standby database disconnect from session;
Database altered.
======================================================================
On Standby Database ( TRAINSBY )
======================================================================
SQL> select name,open_mode,database_role from v$database;
NAME OPEN_MODE DATABASE_ROLE
--------- -------------------- ----------------
TRAIN MOUNTED PHYSICAL STANDBY
<checking switch over status>
SQL> select switchover_status from v$database;
SWITCHOVER_STATUS
--------------------
TO PRIMARY
<switchover to primary>
SQL> alter database commit to switchover to primary;
Database altered.
<shutdown immediate>
SQL> shutdown immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
<startup new primary database>
SQL> startup
ORACLE instance started.
Total System Global Area 1.0689E+10 bytes
Fixed Size 2216200 bytes
Variable Size 3959426808 bytes
Database Buffers 6710886400 bytes
Redo Buffers 16945152 bytes
Database mounted.
Database opened.
SQL> select name,open_mode,database_role from v$database;
NAME OPEN_MODE DATABASE_ROLE
--------- -------------------- ----------------
TRAIN READ WRITE PRIMARY
SQL> alter system switch logfile;
System altered.
No comments:
Post a Comment