DoubleDBDeep

[ORACLE] ADG : Snapshot Standby 본문

ORACLE/OGG | ADG

[ORACLE] ADG : Snapshot Standby

DBCAMI 2023. 8. 2. 10:16

Physical Standby Primary 동일한 데이터를 유지하기 위해 read only로만 사용이 된다

 

Snapshot Standby Physical Standby 데이터베이스로 부터 생성되고

read write 모드가 지원되기 때문에 테스트 / 다른 용도 등을 위해 독립적인 트랜잭션을 처리할 있는 mode이다.

  • Redo data 받고 Archive 하지만, apply 하지 않는다.
  • Snapshot -> Physical 전환 변경사항은 모두 rollback 되고 전환 시점으로 돌아가 primary에서 받은 redo data 적용시킴

 

Physical Standby -> Snapshot Standby 전환

# Database Mode 확인
SQL> select open_mode from v$database;

OPEN_MODE
--------------------
READ ONLY WITH APPLY
# Flashback mode 확인 (켜져 있어야 함)
SQL> select flashback_on from v$database;

FLASHBACK_ON
------------------
YES

# flashback mode on - 마운트 상태에서 진행해야 함.
alter database flashback on;
# Redo 적용 중지
alter database recover managed standby database cancel;
# Snapshot Standby로 Convert
-- 양쪽 노드 shutdown
$ srvctl stop database -d db_name

-- 한쪽 노드만 mount
SQL> startup mount

-- convert 
SQL> alter database convert to snapshot standby;

-- alert log
2023-08-02T09:34:52.426622+09:00
Standby became primary SCN: 4474612
2023-08-02T09:34:52.428742+09:00
Setting recovery target incarnation to 2
2023-08-02T09:34:52.538222+09:00
.... (PID:6419): Redo network throttle feature is disabled at mount time
Enabling Dynamic Remastering: STNDB->NORM switch
CONVERT TO SNAPSHOT STANDBY: Complete - Database mounted as snapshot standby
Completed: alter database convert to snapshot standby


-- open
SQL> alter database open;

-- Restore Point 조회
SQL> select NAME,GUARANTEE_FLASHBACK_DATABASE from v$restore_point;
NAME                                               GUA
-------------------------------------------------- ---
SNAPSHOT_STANDBY_REQUIRED_08/02/2023 09:34:50      YES

-- 현재 Database 상태 조회
SQL> select database_role, open_mode from v$database;

DATABASE_ROLE    OPEN_MODE
---------------- --------------------
SNAPSHOT STANDBY READ WRITE

 

 

Snapshot Standby -> Physical Standby 전환

# Physical Standby로 Convert
-- 양쪽 노드 shutdown
$ srvctl stop database -d db_name

-- 한쪽 노드만 mount
SQL> startup mount

-- Convert
SQL> ALTER DATABASE CONVERT TO PHYSICAL STANDBY;

-- 동기화 check
SQL> select database_role, open_mode from v$database;

DATABASE_ROLE    OPEN_MODE
---------------- --------------------
PHYSICAL STANDBY MOUNTED

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;

Database altered.

-- open
SQL> alter database open;

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;

Database altered.

SQL> select open_mode,database_role from v$database;

OPEN_MODE            DATABASE_ROLE
-------------------- ----------------
READ ONLY WITH APPLY PHYSICAL STANDBY

### 동기화 체크 1. gap차이 (VALUE) 조회
set line 200 pages 1000
col NAME for a30
col VALUE for a30
col UNIT for a30
col TIME_COMPUTED for a25
select NAME,VALUE,UNIT,TIME_COMPUTED from v$dataguard_stats;


### 동기화 체크 2. mrp 조회
select process, status, THREAD#,sequence#, block#, blocks, delay_mins 
from v$managed_standby;

 

728x90