1) Application stop
2) Open Flashback in Primary sistem
sqlplus / as sysdba
alter system set db_recovery_file_dest_size=20...
------------------------------------------------ ---------- ------------------- ---------1 ARCH
22472 CLOSING
2
30183
6144...
10) Standby :
alter database commit to switchover to primary with session shutdown;
-- alert log
Completed: alter database...
drop restore point grp_switchover_start_primary;
select * from v$restore_point;
drop restore point grp_switchover_start_te...
Upcoming SlideShare
Loading in...5
×

SwitchOver Process

191

Published on

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
191
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
16
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

SwitchOver Process

  1. 1. 1) Application stop 2) Open Flashback in Primary sistem sqlplus / as sysdba alter system set db_recovery_file_dest_size=20g scope=both; alter system set db_recovery_file_dest='+ARCH' scope=both; srvctl stop database -d DEMO sqlplus / as sysdba startup nomount alter database mount; ALTER DATABASE FLASHBACK ON; alter database open; sqlplus / as sysdba shutdown abort; srvctl start database -d KBAZER 3) Primary : alter system set job_queue_processes=0 scope=both sid='*'; srvctl stop instance -i DEMO2 -d DEMO sqlplus / as sysdba create restore point grp_switchover_start_primary guarantee flashback database; 4) Standby: alter system set job_queue_processes=0 scope=both sid='*'; sqlplus / as sysdba create restore point grp_switchover_start_testist guarantee flashback database; 5) Primary : alter alter alter alter system system system system switch switch switch switch logfile; logfile; logfile; logfile; 6) Primary: select thread#, max(sequence#) from v$log_history group by thread#; alter session set nls_date_format='DD-MM-YYYY HH24:MI:SS'; select thread#, sequence#, first_time from (select * from v$log_history order by first_time desc) where rownum < 4; select inst_id, process, pid, status, thread#, sequence#, block#, blocks from gv$managed_standby; Checking prosess: select inst_id, process, pid, status, thread#, sequence#, block#, blocks from gv$managed_standby INST_ID PROCESS PID STATUS THREAD# SEQUENCE# BLOCK# BLOCKS ---------- ------------------------------------ ----------
  2. 2. ------------------------------------------------ ---------- ------------------- ---------1 ARCH 22472 CLOSING 2 30183 6144 1088 1 ARCH 22476 CLOSING 1 30865 57344 1718 1 ARCH 22478 CONNECTED 0 0 0 0 1 ARCH 22482 CLOSING 1 30866 28672 1732 1 RFS 27802 IDLE 1 30867 5383 1 1 RFS 27806 IDLE 0 0 0 0 1 RFS 27808 IDLE 0 0 0 0 1 RFS 27804 IDLE 2 30184 1411 1 1 MRP0 28337 APPLYING_LOG 1 30867 5382 1024000 7) Primary: select switchover_status from v$database; SWITCHOVER_STATUS -------------------SESSIONS ACTIVE 8) Switch Option: -- Primary - database starting switch process. alter database commit to switchover to physical standby with session shutdown; -- Need to see it alert log. Switchover: Complete - Database shutdown required Completed: alter database commit to switchover to physical standby with session shutdown -- Checking database role ve switchover_status select NAME,OPEN_MODE,DATABASE_ROLE,SWITCHOVER_STATUS,PROTECTION_MODE,PROTECTION_LEVEL from v$database; NAME OPEN_MODE DATABASE_ROLE SWITCHOVER_STATUS PROTECTION_MODE PROTECTION_LEVEL --------- -------------------- ---------------- --------------------------------------- -------------------TESTCRD READ WRITE PHYSICAL STANDBY RECOVERY NEEDED MAXIMUM AVAILABILITY UNPROTECTED 9) Primary: shutdown abort
  3. 3. 10) Standby : alter database commit to switchover to primary with session shutdown; -- alert log Completed: alter database commit to switchover to primary with session shutdown alter database open 11) Open old primary database: sqlplus / as sysdba startup nomount alter database mount standby database -- Checking database role ve switchover_status select NAME,OPEN_MODE,DATABASE_ROLE,SWITCHOVER_STATUS,PROTECTION_MODE,PROTECTION_LEVEL from v$database; NAME OPEN_MODE DATABASE_ROLE SWITCHOVER_STATUS PROTECTION_MODE PROTECTION_LEVEL --------- -------------------- ---------------- --------------------------------------- -------------------TESTCRD READ WRITE PHYSICAL STANDBY RECOVERY NEEDED MAXIMUM AVAILABILITY UNPROTECTED recover managed standby database using current logfile disconnect from session; 12) Checking all archivelog: -- primary alter alter alter alter system system system system switch switch switch switch -- primary and logfile; logfile; logfile; logfile; standby select NAME,OPEN_MODE,DATABASE_ROLE,SWITCHOVER_STATUS,PROTECTION_MODE,PROTECTION_LEVEL from v$database; select inst_id, process, pid, status, thread#, sequence#, block#, blocks from gv$managed_standby; select thread#, max(sequence#) from v$log_history group by thread#; alter session set nls_date_format='DD-MM-YYYY HH24:MI:SS'; select thread#, sequence#, first_time from (select * from v$log_history order by first_time desc) where rownum < 4; -- primary and standby alter system set job_queue_processes=1000 scope=both sid='*'; 13) Drop restore points:
  4. 4. drop restore point grp_switchover_start_primary; select * from v$restore_point; drop restore point grp_switchover_start_testist; select * from v$restore_point; 14) Restart Primary and Standby Database Old primary sqlplus / as sysdba recover managed standby database cancel; shutdown immediate; startup nomount; alter database mount; recover managed standby database using current logfile disconnect from session; Old Standby sqlplus / as sysdba shutdown immediate; startup;

×