문서유형ㅣ기술정보
분야ㅣ백업/복구
적용제품버전ㅣTibero 6FS07, 6FS07PS, 7FS02, 7FS02PS
문서번호ㅣTBATI035
개요
본 문서에서는 백업 파일(다수 테이블이 포함되어 있는)에서 특정한 테이블만 선택하여 다른 테이블로 import 한 후, 이를 이용하여 운영 테이블에 복구하는 방법을 예제와 함께 설명합니다.
방법
1. 정상 운영 중인 상태
TIBERO schema에 T1, T2 각각 테이블이 있고, 해당 테이블은 10건과 20건의 데이터가 포함되어 있습니다.
[tibero@vbox:/home/tibero]$ tbsql sys/tibero
tbSQL 7
TmaxTibero Corporation Copyright (c) 2020-. All rights reserved.
Connected to Tibero.
SQL> select count(*) from TIBERO.t1;
COUNT(*)
----------
10
1 row selected.
SQL> select count(*) from TIBERO.t2;
COUNT(*)
----------
20
1 row selected.
2. 백업 파일 생성
tbExport를 이용하여 T1, T2 테이블이 포함되어있는 export.dat를 생성합니다.
[tibero@vbox:/home/tibero]$ tbexport USERNAME=tibero PASSWORD=tmax SID=tibero PORT=8629 FILE='export.dat' TABLE=TIBERO.T1,TIBERO.T2
tbexport 7.2
Copyright 2020 TmaxTibero Co., Ltd. All Rights Reserved.
the TABLE: TIBERO.T1,TIBERO.T2: Tue Nov 18 15:56:54 KST 2025
Export character set: UTF-8
Export national character set: UTF-16
exporting table: "TIBERO"."T1"
exporting table: "TIBERO"."T2"
[0] TIBERO.T1 10 rows exported.
[1] TIBERO.T2 20 rows exported.
Packing the file...
Export completed successfully : Tue Nov 18 15:56:58 KST 2025
3. 일부 데이터 삭제
T1의 데이터 일부를 삭제합니다.
[tibero@vbox:/home/tibero]$ tbsql sys/tibero
tbSQL 7
TmaxTibero Corporation Copyright (c) 2020-. All rights reserved.
Connected to Tibero.
SQL> delete from TIBERO.t1 where c1 > 5 ;
5 rows deleted.
SQL> commit;
Commit completed.
SQL> select count(*) from TIBERO.t1;
COUNT(*)
----------
5
1 row selected.
4. 복구 진행
1) 다른 schema를 생성하여 복구 대상 테이블 T1을 생성합니다.
[tibero@vbox:/home/tibero]$ tbsql sys/tibero tbSQL 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Connected to Tibero. SQL> CREATE USER tibero2 IDENTIFIED BY tmax; User 'TIBERO2' created. SQL> GRANT create session, create table TO tibero2; Granted. SQL> GRANT select, insert on tibero.t1 TO tibero2; Granted. SQL> CREATE TABLE TIBERO2.t1 AS SELECT * FROM TIBERO.t1 WHERE ROWNUM < 1; Table 'TIBERO2.T1' created.
2) export.dat 파일에 포함된 TIBERO.T1 테이블 데이터를 TIBERO2.T1 테이블에 적재합니다.
[tibero@vbox:/home/tibero]$ tbimport USERNAME=tibero2 PASSWORD=tmax SID=tibero PORT=8629 FILE='export.dat' FROMUSER=tibero TOUSER=tibero2 TABLE=TIBERO.T1 IGNORE=y
tbimport 7.2
Copyright 2020 TmaxTibero Co., Ltd. All Rights Reserved.
Unpacking the file...
Import character set: UTF-8
the TABLE: TIBERO.T1: Tue Nov 18 16:20:13 KST 2025
Import national character set: UTF-16
importing from schema: "TIBERO" to schema "TIBERO2"
importing table "T1"
[0] TIBERO2.T1 10/10 rows imported.
Import completed successfully: Tue Nov 18 16:20:14 KST 2025
참고
Fromuser(기존 Schema명), Touser(변경된 Schema명) 파라미터를 같이 사용하여 Schema를 바꿔 import를 수행합니다.
3) 적재된 데이터에서 필요한 데이터를 선택하여 운영 테이블에 반영합니다.
(TIBERO.T1 테이블에서 삭제된 5건의 데이터를 TIBERO.T1 테이블로 INSERT)
[tibero@vbox:/home/tibero]$ tbsql sys/tibero
tbSQL 7
TmaxTibero Corporation Copyright (c) 2020-. All rights reserved.
Connected to Tibero.
SQL> select count(*) from TIBERO2.t1;
COUNT(*)
----------
10
1 row selected.
SQL> insert into TIBERO.t1 select * from TIBERO2.t1 where c1 > 5;
5 rows inserted.
SQL> commit;
Commit completed.
5. 복구 확인
데이터를 삭제하였던 원본 테이블을 확인합니다.
[tibero@vbox:/home/tibero]$ tbsql sys/tibero
tbSQL 7
TmaxTibero Corporation Copyright (c) 2020-. All rights reserved.
Connected to Tibero.
SQL> select count(*) from TIBERO.t1;
COUNT(*)
----------
10
1 row selected.