I. Data Guard Broker 설정
1. Data Guard Broker 활성화
A) dg_broker_start 파라미터 설정
sys 유저로 primary와 standby에서 모두 수행
ALTER SYSTEM SET dg_broker_start=true;
[oracle@orcl ~]$ sqlplus sys/oracle@ORCL as sysdba SQL*Plus: Release 12.2.0.1.0 Production on Wed Aug 29 13:49:32 2018 Copyright (c) 1982, 2016, Oracle. All rights reserved. Connected to: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production SQL> ALTER SYSTEM SET dg_broker_start=true; System altered. SQL> exit Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
[oracle@orcl ~]$ sqlplus sys/oracle@ORCL_STB as sysdba SQL*Plus: Release 12.2.0.1.0 Production on Wed Aug 29 13:49:52 2018 Copyright (c) 1982, 2016, Oracle. All rights reserved. Connected to: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production SQL> ALTER SYSTEM SET dg_broker_start=true; System altered. SQL> exit Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
2. Data Guard Broker 환경 구성
A) DGMGRL 접속
sys 유저로 접속
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:50:28 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) 데이터베이스 등록
Data Guard 대상 데이터베이스 등록
CREATE CONFIGURATION dg_orcl AS PRIMARY DATABASE IS orcl CONNECT IDENTIFIER IS orcl; ADD DATABASE orcl_stb AS CONNECT IDENTIFIER IS orcl_stb MAINTAINED AS PHYSICAL;
DGMGRL> CREATE CONFIGURATION dg_orcl AS PRIMARY DATABASE IS orcl CONNECT IDENTIFIER IS orcl; Configuration "dg_orcl" created with primary database "orcl" DGMGRL> ADD DATABASE orcl_stb AS CONNECT IDENTIFIER IS orcl_stb MAINTAINED AS PHYSICAL; Database "orcl_stb" added
C) Data Guard Broker 설정 활성화
설정 활성화
ENABLE CONFIGURATION;
DGMGRL> ENABLE CONFIGURATION; Enabled.
D) Data Guard Broker 등록 정보 조회
Broker에 등록된 정보 조회
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 57 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: 3.00 KByte/s Real Time Query: OFF Instance(s): orcl Database Status: SUCCESS
E) 문제 발생시 Standby 데이터베이스 재기동(옵션)
sys 유저로 standby에서 수행
SHUTDOWN IMMEDIATE; STARTUP MOUNT;
SHOW CONFIGURATION에서 오류 확인
DGMGRL> SHOW CONFIGURATION; Configuration - dg_orcl Protection Mode: MaxPerformance Members: orcl - Primary database orcl_stb - Physical standby database Error: ORA-16810: multiple errors or warnings detected for the member Fast-Start Failover: DISABLED Configuration Status: ERROR (status updated 38 seconds ago)
Standby 데이터베이스 재기동
SQL> shutdown immediate; ORA-01109: database not open Database dismounted. ORACLE instance shut down. SQL> startup mount ORACLE instance started. Total System Global Area 838860800 bytes Fixed Size 8798312 bytes Variable Size 637538200 bytes Database Buffers 188743680 bytes Redo Buffers 3780608 bytes Database mounted. SQL>
정상 확인
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 57 seconds ago)