Document Type | Technical Information
Category | Backup/Recovery
Applicable Product Versions | Tibero 6FS07, 6FS07PS, 7FS02, 7FS02PS
Document Number | TBATI035
Overview
This document explains how to select a specific table from a backup file (containing multiple tables), import it as another table, and then use it to recover the operational table, with examples.
Method
1. Normal Operation State
There are tables T1 and T2 in the TIBERO schema, containing 10 and 20 rows of data respectively.
[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. Creating Backup File
Use tbExport to create export.dat containing the T1 and T2 tables.
[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. Partial Data Deletion
Delete some data from 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. Recovery Process
1) Create another schema and create the recovery target table 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) Load the TIBERO.T1 table data included in the export.dat file into the TIBERO2.T1 table.
[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
Note
Use the parameters Fromuser (original schema name) and Touser (changed schema name) together to perform schema change import.
3) Select necessary data from the loaded data and apply it to the operational table.
(Insert the 5 deleted rows from TIBERO.T1 table back into TIBERO.T1 table)
[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. Recovery Verification
Check the original table from which data was deleted.
[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.