문서유형ㅣ기술정보
분야ㅣ설치
적용제품버전ㅣ7FS02PS
문서번호ㅣTINTI015
개요
참고본 문서를 수행하기 위해서는, 티베로 및 TSC 에 대한 기본적인 개념 학습이 필요합니다.
방법
TSC 연결이 되어있는 상태에서 Standby 에 장애 발생시, Suspend 기능을 활용한 TSC 재구성 방법입니다.
테스트 환경
| Primary | Standby |
|---|---|---|
OS | ip : 192.168.49.128 os : Rocky Linux release 8.10 cpu : 2 core memory : 4GB | ip : 192.168.49.129 os : Rocky Linux release 8.10 cpu : 2 core memory : 4GB |
DB | DB명 : t723 version : Tibero 7 (DB 7.2.3) Build 292332 port : 8629 tip : DB_NAME=t723 MAX_SESSION_COUNT=20 TOTAL_SHM_SIZE=1500M
| DB명 : t723 version : Tibero 7 (DB 7.2.3) Build 292332 port : 8629 tip : DB_NAME=t723 MAX_SESSION_COUNT=20 TOTAL_SHM_SIZE=1500M
|
TSC 재구성 방법
| Primary | Standby | 비고 |
|---|---|---|---|
1 | - Standby 에 티베로 엔진 설치 - 엔진 압축 해제 - tip 까지 설정 | Standby 설치 | |
2 | - logswitch 수행 [t723@localhost config]$ tbsql sys/tibero tbSQL 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Connected to Tibero. SQL> alter system switch logfile; SQL> <수회 수행> SQL> exit | Primary BEGIN BACKUP 전 logswitch 수행 | |
3 | - BEGIN BACKUP 수행 [t723@localhost config]$ tbsql sys/tibero tbSQL 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Connected to Tibero. SQL> alter database begin backup;
- 데이터 파일을 Standby 로 복사 [t723@localhost config]$ cd /home/t723/tibero7/database/t723 [t723@localhost t723]$ sftp t723@192.168.49.129 sftp> exit
- 복사 완료시 END BACKUP 수행 [t723@localhost config]$ tbsql sys/tibero tbSQL 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Connected to Tibero. SQL> alter database end backup; | Primary BEGIN BACKUP 후 | |
4 | - login history를 table에 기록 방지. SQL> alter system set _USE_LOGIN_RECORD=N; (디폴트 : N) | tbsql 접속 시 redo logging 동작 off | |
5 | - Primary 에서 Suspend 활성화 [t723@localhost t723]$ tbsql sys/tibero tbSQL 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Connected to Tibero. SQL> alter system suspend for standby;
| Primary Suspend 기능 활성화 | |
6 | - Suspend 활성화시 DML/DDL 수행 후 현상 SQL> create table test001 (col1 varchar(10)); <수행시 HANG 발생> SQL> select * from tibero.test; 0 row selected. SQL> insert into tibero.test values (1); 1 row inserted. (suspend 시 log flush 가 막히기 때문에 대량 DML 수행시 hang 발생할 수 있음) SQL> commit; <수행시 HANG 발생>
| Suspend 기능 활성화시 DML/DDL 수행에 제한이 걸림 | |
7 | - 리두, 컨트롤 파일을 Standby 로 복사 [t723@localhost t723]$ sftp t723@192.168.49.129 sftp> put c1.ctl
- Susepnd 적용 해제 tbSQL 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Connected to Tibero. SQL> alter system resume; System altered. | Primary 리두, 컨트롤 파일 복사 후 Suspend 적용 해제 | |
8 | - resume 직후에 백업해도 되지만, resume 직후 찰나에 log switch가 되어 current log가 달라져서 MR이 불가한 사태를 방지. SQL> alter database backup controlfile to 'ctl.bkp'; | CF backup | |
9 | - Suspend 적응 해제시 HANG 걸려있던 DML/DDL 수행 구문 현상 SQL> create table test001 (col1 varchar(10)); Table 'TEST001' created.
SQL> SQL> select * from tibero.test; 0 row selected. SQL> insert into tibero.test values (1); 1 row inserted. SQL> commit; Commit completed. | alter system resume; 수행시 Suspend 걸려있던 DML/DDL 들이 수행됨. | |
10 | - login history를 table에 기록. SQL> alter system set _USE_LOGIN_RECORD=Y; (기존 Y 일 경우 Y 로 변경 필요) | tbsql 접속 시 redo logging 동작 on | |
11 | - 아카이브로그 파일을 Standby 로 복사 [t723@localhost t723]$ sftp t723@192.168.49.129 | 백업 시간동안 생성된 archivelog 복사 | |
12 | - tbboot mount 기동 [t723@localhost t723]$ tbboot mount Tibero 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved.
- tbSQL 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Connected to Tibero. SQL> alter database standby controlfile; Database altered. SQL> alter database recover automatic for standby; Database altered. SQL> exit Tibero instance terminated (IMMEDIATE mode). | Standby Mount 기동 후 내부 싱크 작업 | |
13 | [t723@localhost t723]$ tbboot recovery Tibero 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. | Standby Recovery 기동 | |
14 | - FLAGS 가 CONNECTED 일 경우 정상. SQL> select * from v$standby_dest; STANDBY_ADDR TYPE
| SQL> select * from v$standby; PRIMARY_ADDR | 싱크 확인 |
주요 커맨드 설명
- alter system suspend for standby : online redo logfile 백업 시 블록 정합성을 보장하기 위해 I/O 발생 차단
log flush 가 막히기 때문에 대량 DML 작업시에도 hang 발생 가능 - alter system resume : redo logging 동작하도록 허용
- alter database standby controlfile : Standby DB 상태로 전환
- alter database recover automatic for standby : Standby DB 자동 복구(아카이브로그 적용) 시작