위로 아래

테스트 환경

<Tibero DB>

OS : Ubuntu 24.04.1

Tibero Version : 6.7.1

hostname : tibero01

ip : 192.168.1.214

TB_HOME : /home/tibero01/tibero6

TB_SID : tibero / tibero2 (멀티 인스턴스)

Hardware : R640

 

script 위치 : /nsr/scripts/

log 위치 : /nsr/scirpts/logs/

 

 

 


복구할 백업본 확인

백업셋 확인

select * from v$BACKUP_SET;

쉘 이용해서 출력

 

START_TIME 확인해서 복구에 사용할 백업본 SET_ID 확인

 

해당 SET_ID를 가진 백업본 위치 확인

백업셋 번호 28번

경로 : /tibero_full_20250103114649

 

 

 


장애 시나리오

datafile 확인

tbsql 접속

tbsql sys/tibero

 

데이터파일 이름 및 용량 조회

SELECT FILE_NAME FROM DBA_DATA_FILES;

 

datafile 강제 삭제

rm -rf $TB_HOME/database/<SID>/test01001.dtf

 

DB Down

ps -ef | grep tbsvr

kill -9 <tbsvr_AGNT의 PID>

 

DB open

tbboot

 

error 메세지 발생

TBR-1024 : Database needs media recovery : open failed(/home/tibero01/tibero6/database/tibero/test01001.dtf).

 

데이터 조회

select * from test01;

table이 없는 것으로 출력

 

 

 

 

 


Full 복구

모니터링 방법 2가지

1. -v 옵션 사용 (1회성)

tbrmgr recover -w -p 8 -v -o /tibero_full_20250103114649

 

2. log 생성 후 세션 하나 더 열어서  tail -f

tbrmgr recover -w -p 8 -o /tibero_full_20250103114649 > /nsr/scripts/logs/recover_full.txt

 

옵션 설명

-w : 아카이브 로그도 사용

-p 8 : 채널 8개 사용

-v : 모니터링 기능 사용

-o : 백업본 경로 지정

 

로그 생성 full 복구 진행

 

로그 결과 전문

Tibero instance terminated (ABNORMAL mode).

info file is deleted.
****************************************************
* Failed to access pstack path.
* Path: /home/tibero01/tibero6/dev-util/pstack64
* Pstack is required to dump the callstack.
****************************************************

Tibero 6

TmaxTibero Corporation Copyright (c) 2008-. All rights reserved.
Tibero instance started up (MOUNT mode).

==============================================================================
=   Recovery Manager(RMGR) starts                                            =
=                                                                            =
=   TmaxTibero Corporation Copyright (c) 2008-. All rights reserved.           =
==============================================================================
RMGR '-o' option used
: restoring from /tibero_full/

==============================================================================
    RMGR - recovery (WITH ARCHIVELOG)
==============================================================================
Shutting down the instance...

Control file #0 (/home/tibero01/tibero6/database/tibero/c1.ctl) is NOT accessible

No existing control files are found. The backup control file must be restored.

Recover control file #0 /home/tibero01/tibero6/database/tibero/c1.ctl from /tibero_full//bkp_20250103_27_cf_0
Control files are recovered from the backup control file.


Booting up the instance...


Initializing the restore progress, it may take few minutes...

RMGR begins restoring backup files.
Full backup set_id: 27
Last incremental backup set_id: 27

RESTORE (set_id: 27, ts_id:  0, df_id:  0) - FULL BACKUP
 100.0% |===============================>|   14080/14080   blks    7.05s
 Synchronizing...
RESTORE (set_id: 27, ts_id:  1, df_id:  1) - FULL BACKUP
 100.0% |===============================>|   93440/93440   blks   29.08s
 Synchronizing...
RESTORE (set_id: 27, ts_id:  3, df_id:  2) - FULL BACKUP
 100.0% |===============================>|   12800/12800   blks    7.05s
 Synchronizing...
RESTORE (set_id: 27, ts_id:  4, df_id:  3) - FULL BACKUP
 100.0% |===============================>|    6400/6400    blks    3.04s
 Synchronizing...
RESTORE (set_id: 27, ts_id:  5, df_id:  4) - FULL BACKUP
 100.0% |===============================>|   12800/12800   blks    6.04s
 Synchronizing...
RESTORE (set_id: 27, ts_id:  6, df_id:  5) - FULL BACKUP
 100.0% |===============================>| 1310720/1310720 blks  138.44s
 Synchronizing...
RESTORE (set_id: 27, ts_id:  7, df_id:  6) - FULL BACKUP
 100.0% |===============================>|  131088/131088  blks   37.24s
 Synchronizing...
RESTORE (set_id: 27, ts_id:  8, df_id:  7) - FULL BACKUP
 100.0% |===============================>|  131072/131072  blks   37.24s
 Synchronizing...
Settling...
Restoring logfiles...
Archivelog log-t0-r0-s80.arc (thread: 0, set_id: 27, low_tsn: 539030, next_tsn: 542643) restored

Tibero instance terminating (NORMAL mode)... /Listener port = 8629
Tibero instance terminated (NORMAL mode).

****************************************************
* Failed to access pstack path.
* Path: /home/tibero01/tibero6/dev-util/pstack64
* Pstack is required to dump the callstack.
****************************************************

Tibero 6

TmaxTibero Corporation Copyright (c) 2008-. All rights reserved.
Tibero instance started up (NORMAL mode).

Archive logfiles restoration succeeded

Database restoration succeeded

Given recovery point: COMPLETE RECOVERY
Recoverable point using only backup archivelogs: change 542642

recoverSQL: ALTER DATABASE RECOVER AUTOMATIC
Database automatic recovery succeeded
Shutting down the instance...
Booting up the instance...

RMGR recovery ends
Listener port = 8629

 

 

복구 성공

로그 밑 부분 succeed 결과 출력

 

데이터파일 조회 가능

 

 

 

 

 


Tablespace 복구

모니터링 방법 2가지

1. -v 옵션 사용 (1회성)

tbrmgr recover -w -p 8 -v --tablespace test01 -o /tibero_full_20250103114649

 

2. log 생성 후 세션 하나 더 열어서  tail -f

tbrmgr recover -w -p 8 --tablespace test01 -o /tibero_full_20250103114649 > /nsr/scripts/logs/recover_table.txt

 

옵션 설명

-w : 아카이브 로그도 사용

-p 8 : 채널 8개 사용

-v : 모니터링 기능 사용

-o : 백업본 경로 지정

--tablespace : 복구할 tablespace 지정

 

로그 생성 tablespace 복구 진행

 

 

 

출력 결과 전문

Tibero instance terminated (ABNORMAL mode).

info file is deleted.
****************************************************
* Failed to access pstack path.
* Path: /home/tibero01/tibero6/dev-util/pstack64
* Pstack is required to dump the callstack.
****************************************************

Tibero 6

TmaxTibero Corporation Copyright (c) 2008-. All rights reserved.
Tibero instance started up (MOUNT mode).

==============================================================================
=   Recovery Manager(RMGR) starts                                            =
=                                                                            =
=   TmaxTibero Corporation Copyright (c) 2008-. All rights reserved.           =
==============================================================================
RMGR '-o' option used
: restoring from /tibero_full_20250103114649/

==============================================================================
    RMGR - recovery (WITH ARCHIVELOG)
==============================================================================
Shutting down the instance...

Control file #0 (/home/tibero01/tibero6/database/tibero/c1.ctl) is accessible

All control files are accessible. No need to restore the backup control file.


Booting up the instance...


Initializing the restore progress, it may take few minutes...

RMGR begins restoring backup files.
Full backup set_id: 28
Last incremental backup set_id: 28

RESTORE (set_id: 28, ts_id:  7, df_id:  6) - FULL BACKUP
 100.0% |===============================>|  131088/131088  blks    5.04s
 Synchronizing...
Settling...
Restoring logfiles...
Archivelog log-t0-r0-s84.arc (thread: 0, set_id: 28, low_tsn: 544473, next_tsn: 544743) restored

Tibero instance terminating (NORMAL mode)... /Listener port = 8629
Tibero instance terminated (NORMAL mode).

****************************************************
* Failed to access pstack path.
* Path: /home/tibero01/tibero6/dev-util/pstack64
* Pstack is required to dump the callstack.
****************************************************

Tibero 6

TmaxTibero Corporation Copyright (c) 2008-. All rights reserved.
Tibero instance started up (NORMAL mode).

Archive logfiles restoration succeeded

Database restoration succeeded

Given recovery point: COMPLETE RECOVERY
Recoverable point using only backup archivelogs: change 544742

recoverSQL: ALTER DATABASE RECOVER AUTOMATIC
Database automatic recovery succeeded
Shutting down the instance...
Booting up the instance...

RMGR recovery ends

 

복구 성공