문서유형ㅣ기술정보
분야ㅣ유틸리티
적용제품버전ㅣ7FS02PS
문서번호ㅣTUTTI003
개요
tbrmgr --for-standby 옵션을 이용한 Tibero Standby Cluster (이하 TSC) 구축 방안입니다.
for-standby 옵션 이용 시 archivelog에 대한 백업과 .passwd에 대한 백업 뿐만 아니라 redo log file에 대한 백업도 진행하게 되며, TSC를 구축할 수도 있습니다.
방법
1. Primary 서버에서 RMGR --for-standby 옵션을 이용한 백업 진행
$ tbrmgr backup -o /home/rmgr1/backup --for-standby
==============================================================================
= Recovery Manager(RMGR) starts =
= =
= TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. =
==============================================================================
archive log check succeeded
RMGR '-o' option used
: backing up to /home/rmgr1/backup
==============================================================================
RMGR - Backup (FOR STANDBY)
==============================================================================
Initializing the backup progress, it may take few minutes...
BACKUP (set_id: 1, ts_id: 0, df_id: 0)
100.0% |===============================>| 14080/14080 blks 1.00s
Synchronizing...
BACKUP (set_id: 1, ts_id: 1, df_id: 1)
100.0% |===============================>| 25600/25600 blks 0.00s
Synchronizing...
BACKUP (set_id: 1, ts_id: 3, df_id: 2)
100.0% |===============================>| 12800/12800 blks 0.00s
Synchronizing...
BACKUP (set_id: 1, ts_id: 4, df_id: 3)
100.0% |===============================>| 2560/2560 blks 0.00s
Synchronizing...
Switching an online logfile...
Backing up archive logfiles...
Archivelog log-tibero-t0-r0-s3.arc (thread: 0, set_id: 1, low_tsn: 2310, next_tsn: 43329) backed up
Archive logfiles backup succeeded
Backing up online logfiles...
Backing up the control file...
Control file backup succeeded
Backing up the password file...
Password file backup succeeded
Database backup succeeded
RMGR backup ends
#. backup_set 확인
$ tbsql sys/tibero
SQL> select * from v$backup_set;
SET_ID STATUS BACKUP_TYPE BASE_SET
---------- ------------------------------------- ------------ ----------
1 COMPLETED FULL 0
START_TIME
--------------------------------------------------------------------------------
2025/01/15
FINISH_TIME
--------------------------------------------------------------------------------
2025/01/15
ELAPSED_SECONDS START_TSN FINISH_TSN RESETLOGS_TSN
--------------- ---------- ---------- -------------
7 43297 43326 0
BACKUP_OPTION LOGFILE_BACKUP_OPTION
------------------------------------- -------------------------------
NONE FOR_STANDBY
PARTIAL_BACKUP_OPTION OUTPUT_SIZE_MB STORAGE
--------------------------------------- -------------- ---------
NONE 502 DISK
BACKUP_PATH
--------------------------------------------------------------------------------
/home/rmgr1/backup
1 row selected.
2. Primary 서버에서 RMGR --for-standby 옵션을 이용한 백업 진행
$ scp -r backup rmgr1@192.168.179.66:/home/rmgr1/ rmgr1@192.168.179.66's password: bkp_20250115_1_0_0_0 100% 110MB 55.0MB/s 00:02 bkp_20250115_1_1_1_0 100% 200MB 50.0MB/s 00:04 bkp_20250115_1_3_2_0 100% 100MB 50.0MB/s 00:02 bkp_20250115_1_4_3_0 100% 20MB 46.6MB/s 00:00 bkl_1_t0_r0_s3.arc 100% 73MB 41.2MB/s 00:01 bkl_1_t0_log001.log 100% 100MB 50.0MB/s 00:02 bkl_1_t0_log002.log 100% 100MB 50.0MB/s 00:02 bkl_1_t0_log005.log 100% 100MB 49.9MB/s 00:02 bkl_1_t0_log006.log 100% 100MB 50.0MB/s 00:02 bkl_1_t0_log003.log 100% 100MB 50.0MB/s 00:02 bkl_1_t0_log004.log 100% 100MB 50.0MB/s 00:02 bkp_20250115_1_cf_0 100% 72MB 72.2MB/s 00:01 passwd 100% 88MB 1.4KB/s 00:00 $ ls -l 합계 4 drwxrwxr-x. 2 rmgr1 rmgr1 4096 1월 15 16:38 backup drwxr-xr-x. 10 rmgr1 rmgr1 107 1월 15 15:59 tibero7_2_2
3. Standby 서버에서 RMGR --for-standby 옵션을 이용하여 standby 구성 진행
$ tbrmgr recover -o /home/rmgr1/backup --for-standby ============================================================================== = Recovery Manager(RMGR) starts = = = = TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. = ============================================================================== RMGR '-o' option used : restoring from /home/rmgr1/backup ============================================================================== RMGR - recovery (STANDBY) ============================================================================== CM information =========================================================== CM NAME : cms CM UI PORT : 7510 RESOURCE FILE PATH : /home/rmgr1/tibero7_2_2/cm/config/cms_res.crf CM MODE : GUARD ON, FENCE OFF, ROOT ON LOG LEVEL : 2 CM BLOCK SIZE : 512 =========================================================== Trying to shutdown other instances =============================== SUCCESS! =============================== Succeeded to request at the local node to stop the service. Please use "cmrctl show service" command to verify the result. ======================================================================= Shutdown succeeded Shutting down the instance... tbdown failed. proc info file is deleted. Hint: Please check if the tbsvr instance was already stopped. info file is deleted. unlink failed.: No such file or directory Control file #0 (/home/rmgr1/tibero7_2_2/database/tibero7/c1.ctl) is NOT accessible No existing control files are found. The backup control file must be restored. Recover control file #0 /home/rmgr1/tibero7_2_2/database/tibero7/c1.ctl from /home/rmgr1/backup/bkp_20250115_1_cf_0 Control files are recovered from the backup control file. Restoring the password file... Password file restoration succeeded Booting up the instance... Change core dump dir to /home/rmgr1/tibero7_2_2/bin/prof. Listener port = 7070 Tibero 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Tibero instance started up (MOUNT mode). Initializing the restore progress, it may take few minutes... RMGR begins restoring backup files. Full backup set_id: 1 Last incremental backup set_id: 1 RESTORE (set_id: 1, ts_id: 0, df_id: 0) - FULL BACKUP 100.0% |===============================>| 14080/14080 blks 1.04s Synchronizing... RESTORE (set_id: 1, ts_id: 1, df_id: 1) - FULL BACKUP 100.0% |===============================>| 25600/25600 blks 2.01s Synchronizing... RESTORE (set_id: 1, ts_id: 3, df_id: 2) - FULL BACKUP 100.0% |===============================>| 12800/12800 blks 1.00s Synchronizing... RESTORE (set_id: 1, ts_id: 4, df_id: 3) - FULL BACKUP 100.0% |===============================>| 2560/2560 blks 0.00s Synchronizing... Settling... Restoring logfiles... Archivelog log-tibero-t0-r0-s3.arc (thread: 0, set_id: 1, low_tsn: 2310, next_tsn: 43329) restored Archive logfiles restoration succeeded Restoring online logfiles... Database restoration succeeded recoverSQL: ALTER DATABASE RECOVER AUTOMATIC FOR STANDBY Database automatic recovery succeeded Shutting down the instance... Tibero instance terminated (NORMAL mode). Booting up the instance... Change core dump dir to /home/rmgr1/tibero7_2_2/bin/prof. Listener port = 7070 Tibero 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Tibero instance started up (RECOVERY mode). RMGR recovery ends
4. Standby 서버에서 RMGR --for-standby 옵션을 이용하여 standby 구성 진행
#.Observer에서 확인
$ cmrctl show
Resource List of Observer obs
===================================================================
TSC_ID CLS_ID CM_NAME NID CM_STAT INST_STAT PRI/TAR
-------- -------- ----------- ----- --------- ----------- ---------
123 0 cmp 1 UP UP(NRML) PRIMARY
1 cms 1 UP UP(RECO) TARGET
===================================================================
#. Primary에서 확인
$ tbsql sys/tibero
SQL> select * from v$standby_dest;
STANDBY_ADDR
--------------------------------------------------------------------------------
192.168.179.66:7300
TYPE THREAD# FLAGS
-------------------------------- ---------- --------------------------------
LGWR ASYNC MAIN 0 CONNECTED
SENT_SEQ SENT_BLKNO ACKED_SEQ ACKED_BLKNO DELAY
---------- ---------- ---------- ----------- ----------
4 249 4 249 0
1 row selected.
#. Standby에서 확인
$ tbsql sys/tibero
SQL> select * from v$standby;
PRIMARY_ADDR
--------------------------------------------------------------------------------
192.168.179.65:26036
STATUS PRIMARY_TSN RECVED_SEQ RECVED_BLKNO
---------------------------------------- ----------- ---------- ------------
STANDBY, RECOVERY IN PROGRESS 43653 4 249
RECVED_TSN ACKED_SEQ ACKED_BLKNO RECOVERED_SEQ RECOVERED_BLKNO RECOVERED_TSN
---------- ---------- ----------- ------------- --------------- -------------
43652 4 249 4 249 43652
OPEN_SEQ OPEN_BLKNO
---------- ----------
4 250
1 row selected.