Home » Server Options » Data Guard » Switch over Primary Database TO Standby Database via SQL COMMAND (Release 11.2.0.1.0, RHEL5)
Switch over Primary Database TO Standby Database via SQL COMMAND [message #661502] Tue, 21 March 2017 23:29 Go to previous message
prashanthk.dbafreelanzee
Messages: 1
Registered: March 2017
Junior Member
Hi, I have recently configured ---- Primary Database and Physical Standby Database on same Machine (Test case).

Primary Database : orcl
Standby Database : orcl_stby

I have too configured - DGMRL , Successfully.

I just want to clear concept of "SWITCH -- PRIM DATABASE TO STANDBY"

---- While performing "switchover to Standby database" using "DGMGRL, went fine. No problem. [ ORCL ----> ORCL_STBY]

----- But the same when I tried to perform Switch via - SQL COMMAND - I faced an Issue , stating.. [ ORCL_STBY ---> ORCL]


Primary:
========
SQL> alter database commit to switchover to standby;
alter database commit to switchover to standby
*
ERROR at line 1:
ORA-01093: ALTER DATABASE CLOSE only permitted with no sessions connected

Then after some R&D, I observed, that my Standby Database was in "READ ONLY APPLY" MODE

Then I performed : Primary Database MachinE :

SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY
2 WITH SESSION SHUTDOWN;
Database altered.

And once I finish-up Entire process of Switchover successfull, then I found --- On Standby

[ORCL]
=======
SQL> select name,open_mode,database_role,db_unique_name,protection_mode from v$database;

NAME OPEN_MODE DATABASE_ROLE DB_UNIQUE_NAME PROTECTION_MODE
--------- -------------------- ---------------- ------------------------------ --------------------
ORCL READ WRITE PRIMARY orcl MAXIMUM PERFORMANCE

SQL> SELECT sequence#, first_time, next_time, applied FROM v$archived_log ORDER BY sequence#;

SEQUENCE# FIRST_TIM NEXT_TIME APPLIED
---------- --------- --------- ---------
19 08-APR-16 12-MAR-17 YES
19 08-APR-16 12-MAR-17 YES
20 12-MAR-17 12-MAR-17 YES
20 12-MAR-17 12-MAR-17 YES
21 12-MAR-17 12-MAR-17 YES
21 12-MAR-17 12-MAR-17 YES
22 12-MAR-17 12-MAR-17 YES
22 12-MAR-17 12-MAR-17 YES
23 12-MAR-17 12-MAR-17 YES
23 12-MAR-17 12-MAR-17 YES
24 12-MAR-17 12-MAR-17 YES
......
......
SEQUENCE# FIRST_TIM NEXT_TIME APPLIED
---------- --------- --------- ---------
173 20-MAR-17 20-MAR-17 YES
174 20-MAR-17 20-MAR-17 YES
175 20-MAR-17 20-MAR-17 YES
176 20-MAR-17 20-MAR-17 YES
177 20-MAR-17 20-MAR-17 NO ----> Logs not applied.
178 20-MAR-17 20-MAR-17 NO ----> Logs not applied.

292 rows selected.

[ORCL_STBY]
===========
SQL> select name,open_mode,database_role,db_unique_name,protection_mode from v$database;

NAME OPEN_MODE DATABASE_ROLE DB_UNIQUE_NAME PROTECTION_MODE
--------- -------------------- ---------------- ------------------------------ --------------------
ORCL MOUNTED PHYSICAL STANDBY orcl_stby MAXIMUM PERFORMANCE

Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 0
Next log sequence to archive 0
Current log sequence 0
SQL>

Even .... Log GAp also happened.. and took little time to bring into Synch.. As my Standby Machine stop appling Redo.

Is this because my Standby database to "MOUNT" STATE??? , OR some other reason could it be...??

Should I need to bring my Standby database to "MOUNT" STATE, then I have to execute --- alter database commit to switchover to standby; --- in Primary Database Machine

Please Clarify me so that Next time, I will be bit careful, to perform this operation.

Thanks & Regards
Prashanthk
 
Read Message
Read Message
Read Message
Previous Topic: Physical Standby
Next Topic: sync between Dc and Dr archive
Goto Forum:
  


Current Time: Fri Apr 26 03:44:43 CDT 2024