Hi All,
We have a requirement in our environment to switch over standby to primary. This is to shutdown the primary database machine as it is now up for more than 350 days.
I have some doubts reg switchover.
we have two servers
1. Server1-Prim - hosts primary database with SID - LPBT
LISTENER - WITH SID-LPBT ON PORT -1521 WITH HOST = 80.0.1.187
TNSNAMES with entries for both services LPBT and STBYLPBT
2. Server2-Stby - hosts secondary database with SID- STBYLPBT
LISTENER - WITH SID-STBYLPBT ON PORT -1521 WITH HOST = 80.0.0.240
TNSNAMES with entries for both services LPBT and STBYLPBT
Our's is a physical standby and have procedure to switchover as below manually using SQL commands instead of dataguard
Switchover allows a primary and standby to reverse roles without any data loss.
No need to re-create the old primary. Performed for planned maintenance.
Steps:
1. Verify if primary can be switched over to standby
SQL> select switchover_status from v$database;
If value returns “TO_STANDBY”, its alright to switch the primary to standby role.
2. Convert primary to standby
SQL> alter database commit to switchover to physical standby;
If value is “SESSIONS ACTIVE” from step 1, then
SQL> alter database commit to switchover to physical standby with session shutdown;
3. Shutdown & restart the old primary as standby
SQL> shutdown immediate;
SQL> startup nomount;
At this point, we now have both databases as standby.
4. On target standby database, verify switchover status. If value is “TO_PRIMARY” then
SQL> alter database commit to switchover to primary;
If value is “SESSIONS ACTIVE”, then append “WITH SESSION SHUTDOWN” to above command.
5. Shutdown and restart the new primary database
SQL> shutdown immediate;startup;
6. start recover on new standby database (old primary)
SQL > alter database mount standby database
SQL > alter database recover managed standby database using current logfile disconnect;
----------------------------------------------------------------------------------------------------------------------------------------
My Doubt is after switchover , if we connect as "conn sys@lpbt as sysdba" from sqlplus window from a different pc, how the request will go to new primary database server(80.0.0.240) since tnsnames only will point to old primary server (80.0.1.187) .
can you please explain how this works or should we add some other entries in listener or tnsnames files.
please advise