I. Switchover
1. Standby로 switchover
A) Primary에 DGMGRL로 접속
DGMGRL로 primary DB에 접속
dgmgrl sys/oracle@ORCL
[oracle@orcl ~]$ dgmgrl sys/oracle@ORCL DGMGRL for Linux: Release 12.2.0.1.0 - Production on Wed Aug 29 13:58:31 2018 Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved. Welcome to DGMGRL, type "help" for information. Connected to "ORCL" Connected as SYSDBA.
B) Standby로 switchover
Standby로 switchover 수행
SWITCHOVER TO orcl_stb;
DGMGRL> SWITCHOVER TO orcl_stb; Performing switchover NOW, please wait... Operation requires a connection to database "orcl_stb" Connecting ... Connected to "ORCL_STB" Connected as SYSDBA. New primary database "orcl_stb" is opening... Operation requires start up of instance "orcl" on database "orcl" Starting instance "orcl"... ORACLE instance started. Database mounted. Connected to "ORCL" Switchover succeeded, new primary is "orcl_stb"
C) Switchover 결과 확인
Switchover 결과 확인
SHOW CONFIGURATION; SHOW DATABASE orcl; SHOW DATABASE orcl_stb;
DGMGRL> SHOW CONFIGURATION; Configuration - dg_orcl Protection Mode: MaxPerformance Members: orcl_stb - Primary database orcl - Physical standby database Fast-Start Failover: DISABLED Configuration Status: SUCCESS (status updated 45 seconds ago) DGMGRL> SHOW DATABASE orcl; Database - orcl Role: PHYSICAL STANDBY Intended State: APPLY-ON Transport Lag: 0 seconds (computed 1 second ago) Apply Lag: 0 seconds (computed 1 second ago) Average Apply Rate: 211.00 KByte/s Real Time Query: OFF Instance(s): orcl Database Status: SUCCESS DGMGRL> SHOW DATABASE orcl_stb; Database - orcl_stb Role: PRIMARY Intended State: TRANSPORT-ON Instance(s): orcl Database Status: SUCCESS
2. Primary로 복원
A) Standby에 DGMGRL로 접속
DGMGRL로 standby DB에 접속
dgmgrl sys/oracle@ORCL_STB
[oracle@orcl ~]$ dgmgrl sys/oracle@ORCL_STB DGMGRL for Linux: Release 12.2.0.1.0 - Production on Wed Aug 29 14:00:56 2018 Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved. Welcome to DGMGRL, type "help" for information. Connected to "ORCL_STB" Connected as SYSDBA.
B) Primary로 switchover
Primary로 switchover 수행
SWITCHOVER TO orcl;
DGMGRL> SWITCHOVER TO orcl; Performing switchover NOW, please wait... Operation requires a connection to database "orcl" Connecting ... Connected to "ORCL" Connected as SYSDBA. New primary database "orcl" is opening... Operation requires start up of instance "orcl" on database "orcl_stb" Starting instance "orcl"... ORACLE instance started. Database mounted. Connected to "ORCL_STB" Switchover succeeded, new primary is "orcl"
C) 복원 결과 확인
복원 결과 확인
SHOW CONFIGURATION; SHOW DATABASE orcl; SHOW DATABASE orcl_stb;
DGMGRL> SHOW CONFIGURATION; Configuration - dg_orcl Protection Mode: MaxPerformance Members: orcl - Primary database orcl_stb - Physical standby database Fast-Start Failover: DISABLED Configuration Status: SUCCESS (status updated 54 seconds ago) DGMGRL> SHOW DATABASE orcl; Database - orcl Role: PRIMARY Intended State: TRANSPORT-ON Instance(s): orcl Database Status: SUCCESS DGMGRL> SHOW DATABASE orcl_stb; Database - orcl_stb Role: PHYSICAL STANDBY Intended State: APPLY-ON Transport Lag: 0 seconds (computed 1 second ago) Apply Lag: 0 seconds (computed 1 second ago) Average Apply Rate: 124.00 KByte/s Real Time Query: OFF Instance(s): orcl Database Status: SUCCESS