문서유형ㅣ기술정보
분야ㅣ관리/환경설정
적용제품버전ㅣ T6, T7
문서번호ㅣTADTI134
개요
Online redo logfile 백업 없이 archive logfile들로만 standby 구축하는 방안에 대하여 설명합니다.
기존에는 무조건 standby suspend로 LGWR I/O를 멈춰두고 online redo logfile을 copy 하여 standby를 구축해야 했지만, primary DB에 부담을 줄 수 있는 I/O suspend 자체를 하지 않고자, 현재 존재하는 archive logfile들까지만 복구하고 archive logfile들로부터 online redo logfile을 역으로 생성해줍니다.
단, 이미 복구한 archive logfile seqno에 해당하는 online logfile들은 current logfile 의 직전으로 만들어주고,
current logfile은 switch 한 직후의 new 상태로 만들어줍니다.
current logfile은 switch 한 직후의 new 상태로 만들어줍니다.
이외 logfile들은 그냥 초기화 상태로 둡니다.
참고309100 패치가 있어야 가능합니다.
방법
1. HOT BACKUP 진행
SQL> alter database begin backup;
Database altered.
SQL> select a.name, b.status From v$datafile a, v$backup b where a.file#=b.file#;
NAME STATUS
-------------------------------------------------- ----------
/home/data/tibero_tsc/system01.dtf ACTIVE
/home/data/tibero_tsc/undo001.dtf ACTIVE
/home/data/tibero_tsc/usr01.dtf ACTIVE
/home/data/tibero_tsc/syssub01.dtf ACTIVE
SQL> exit
OS> cp /home/data/tibero_tsc/system01.dtf /home/data/tibero_tsc/hot/.
OS> cp /home/data/tibero_tsc/undo001.dtf /home/data/tibero_tsc/hot/.
OS> cp /home/data/tibero_tsc/usr01.dtf /home/data/tibero_tsc/hot/.
OS> cp /home/data/tibero_tsc/syssub01.dtf /home/data/tibero_tsc/hot/.
SQL> alter database backup controlfile to trace as '/home/data/tibero_tsc/hot/con.sql';
Database altered.
SQL> alter database end backup;
Database altered.
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> select sequence#,archived,status from v$log;
SEQUENCE# ARCHIVED STATUS
---------- -------- --------
22 YES INACTIVE
23 YES INACTIVE
24 NO CURRENT 2. Standby Server로 HOT BACKUP본 및 Archive 전송
OS> scp -p22 /home/data/tibero_tsc/hot/* tibero7@STANDBY_SERVER_IP:/home/data/tibero_tsc/. tibero7@STANDBY_SERVER_IP's password: con.sql 100% 3738 5.1MB/s 00:00 syssub01.dtf 100% 200MB 127.1MB/s 00:01 system01.dtf 100% 400MB 114.6MB/s 00:03 undo001.dtf 100% 250MB 126.6MB/s 00:01 usr01.dtf 100% 100MB 113.5MB/s 00:00 OS> scp -p22 /home/data/tibero_tsc_arch/* tibero7@STANDBY_SERVER_IP:/home/data/tibero_tsc_arch/. tibero7@STANDBY_SERVER_IP's password: log-t0-r0-s21.arc 100% 137KB 51.4MB/s 00:00 log-t0-r0-s22.arc 100% 512 754.6KB/s 00:00 log-t0-r0-s23.arc 100% 1024 851.9KB/s 00:00
3. HOT BACKUP 이후 데이터 동기화 테스트를 위한 데이터 입력
SQL> create table tibero.test (no number, name varchar(100));
Table 'TIBERO.TEST' created.
SQL> insert into tibero.test select level,'NAME'||level from dual connect by level<10001;
10000 rows inserted.
SQL> commit;
Commit completed.
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> select sequence#,archived,status from v$log;
SEQUENCE# ARCHIVED STATUS
---------- -------- --------
25 YES INACTIVE
26 YES INACTIVE
27 NO CURRENT4. Standby Server Recovery 진행 전 Control File 전송
OS> scp -p22 /home/data/tibero_tsc/c1.ctl tibero7@STANDBY_SERVER_IP:/home/data/tibero_tsc/. tibero7@STANDBY_SERVER_IP's password: c1.ctl 100% 94MB 128.6MB/s 00:00 100% 1024 851.9KB/s 00:00
5. Standby Server Mount Mode 기동
OS> tbboot mount Change core dump dir to /home/tibero7/tibero7/bin/prof. Listener port = 8629 Tibero 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Tibero instance started up (MOUNT mode).
6. Standby Server로 전송한 Archive File 까지만 Recovery 진행
SQL> alter database standby controlfile; Database altered. SQL> alter database recover automatic for standby init; Database altered.
7. Standby Server Recovery Mode 기동
OS> tbdown immediate Tibero instance terminated (NORMAL mode). OS> tbboot recovery Change core dump dir to /home/tibero7/tibero7/bin/prof. Listener port = 8629 Tibero 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Tibero instance started up (RECOVERY mode). SQL> select primary_addr, status,primary_tsn,recovered_tsn,open_seq from v$standby; PRIMARY_ADDR STATUS PRIMARY_TSN RECOVERED_TSN OPEN_SEQ ------------------------ ------------------------------- ----------- ------------- ---------- STANDBY_SERVER_IP:20273 STANDBY, RECOVERY IN PROGRESS 47961 47960 27