Document Type | Technical Information
Category | Backup/Recovery
Applicable Product Versions | 6FS07PS, 7FS02PS, 7FS03PS, 7FS04PS
Document Number | TBATI041
Overview
NoteThis feature is supported in versions with patch 320958 applied.
Method
1. Enter Test Data
1.1. Create Tablespaces
Create test tablespaces.
SQL> drop tablespace ts1 including contents and datafiles cascade constraint; TBR-7073: Specified tablespace 'TS1' was not found. SQL> drop tablespace ts2 including contents and datafiles cascade constraint; TBR-7073: Specified tablespace 'TS2' was not found. SQL> drop tablespace ts3 including contents and datafiles cascade constraint; TBR-7073: Specified tablespace 'TS3' was not found. SQL> drop tablespace ts4 including contents and datafiles cascade constraint; TBR-7073: Specified tablespace 'TS4' was not found. SQL> drop tablespace ts5 including contents and datafiles cascade constraint; TBR-7073: Specified tablespace 'TS5' was not found. SQL> drop tablespace ts_for_tbl including contents and datafiles cascade constraint; TBR-7073: Specified tablespace 'TS_FOR_TBL' was not found. SQL> drop tablespace ts_for_idx including contents and datafiles cascade constraint; TBR-7073: Specified tablespace 'TS_FOR_IDX' was not found. SQL> drop tablespace ts_has_dfs including contents and datafiles cascade constraint; TBR-7073: Specified tablespace 'TS_HAS_DFS' was not found. SQL> create tablespace ts1 datafile 'ts1.dtf' size 10M autoextend off; Tablespace 'TS1' created. SQL> create tablespace ts2 datafile 'ts2.dtf' size 20M autoextend off; Tablespace 'TS2' created. SQL> create tablespace ts3 datafile 'ts3.dtf' size 30M autoextend off; Tablespace 'TS3' created. SQL> create tablespace ts4 datafile 'ts4.dtf' size 40M autoextend off; Tablespace 'TS4' created. SQL> create tablespace ts5 datafile 'ts5.dtf' size 50M autoextend off; Tablespace 'TS5' created. SQL> create tablespace ts_has_dfs datafile 'ts_has_dfs_1.dtf' size 10M, 'ts_has_dfs_2.dtf' size 10M; Tablespace 'TS_HAS_DFS' created. SQL> create tablespace ts_for_tbl datafile 'ts_for_tbl.dtf' size 10M autoextend off; Tablespace 'TS_FOR_TBL' created. SQL> create tablespace ts_for_idx datafile 'ts_for_idx.dtf' size 10M autoextend off; Tablespace 'TS_FOR_IDX' created.
1.2. Create Tables
Create test tables.
SQL> create table t1 (a number) tablespace ts1; Table 'T1' created. SQL> create table t2 (a number) tablespace ts2; Table 'T2' created. SQL> create table t3 (a number) tablespace ts3; Table 'T3' created. SQL> create table t4 (a number) tablespace ts4; Table 'T4' created. SQL> create table t5 (a number) tablespace ts5; Table 'T5' created. SQL> create table t6 (a number) tablespace ts_has_dfs; Table 'T6' created. SQL> create table t7 (a number) tablespace ts_for_tbl; Table 'T7' created. SQL> create index t7_idx on t7(a) tablespace ts_for_idx; Index 'T7_IDX' created.
1.3. Enter Data
Insert data into the test tables.
SQL> begin
insert into t1 select level from dual connect by level <= 1000;
commit;
end;
/
PSM completed.
SQL> begin
for i in 1..2 loop
insert into t2 select level from dual connect by level <= 1000;
commit;
end loop;
end;
/
PSM completed.
SQL> begin
for i in 1..3 loop
level from dual connect by level <= 1000;
commit;
end loop;
end;
/
PSM completed.
SQL> begin
for i in 1..4 loop
insert into t4 select level from dual connect by level <= 1000;
commit;
end loop;
end;
/
PSM completed.
SQL> begin
for i in 1..5 loop
insert into t5 select level from dual connect by level <= 1000;
commit;
end loop;
end;
/
PSM completed.
SQL> begin
for i in 1..6 loop
insert into t6 select level from dual connect by level <= 1000;
commit;
end loop;
end;
/
PSM completed.
SQL> begin
for i in 1..10 loop
insert into t7 select level from dual connect by level <= 1000;
commit;
end loop;
end;
/
PSM completed.
1.4. Check Data
Check the data in the test tables.
SQL> select count(*) from t1;
COUNT(*)
----------
1000
1 row selected.
SQL>
SQL> select count(*) from t2;
COUNT(*)
----------
2000
1 row selected.
SQL> select count(*) from t3;
COUNT(*)
----------
3000
1 row selected.
SQL> select count(*) from t4;
COUNT(*)
----------
4000
1 row selected.
SQL> select count(*) from t5;
COUNT(*)
----------
5000
1 row selected.
SQL> select count(*) from t6;
COUNT(*)
----------
6000
1 row selected.
SQL> select count(*) from t7;
COUNT(*)
----------
10000
1 row selected.
1.5. Check Tablespace and Data Files
SQL> select name from v$tablespace; NAME -------------------------------------------------------------------------------------------------------------------------------- SYSTEM UNDO TEMP USR SYSSUB TS1 TS2 TS3 TS4 TS5 TS_HAS_DFS TS_FOR_TBL TS_FOR_IDX 13 rows selected. SQL> select name from v$datafile; NAME -------------------------------------------------------------------------------------------------------------------------------------------------------------- /home/tibero/tibero7/database/tibero0/system001.dtf /home/tibero/tibero7/database/tibero0/undo001.dtf /home/tibero/tibero7/database/tibero0/usr001.dtf /home/tibero/tibero7/database/tibero0/syssub001.dtf /home/tibero/tibero7/database/tibero0/ts1.dtf /home/tibero/tibero7/database/tibero0/ts2.dtf /home/tibero/tibero7/database/tibero0/ts3.dtf /home/tibero/tibero7/database/tibero0/ts4.dtf /home/tibero/tibero7/database/tibero0/ts5.dtf /home/tibero/tibero7/database/tibero0/ts_has_dfs_1.dtf /home/tibero/tibero7/database/tibero0/ts_has_dfs_2.dtf /home/tibero/tibero7/database/tibero0/ts_for_tbl.dtf /home/tibero/tibero7/database/tibero0/ts_for_idx.dtf 13 rows selected.
2. Backup
2.1. Perform begin backup
Perform begin backup for online hot backup.
SQL> alter database begin backup; Database altered.
2.2. Copy Data Files
Back up the data files while online.
$ rm -rf $TB_HOME/database/t7_bak $ mkdir $TB_HOME/database/t7_bak $ cp -rf $TB_HOME/database/$TB_SID/* $TB_HOME/database/t7_bak/
2.3. Perform end backup
After completing the data file backup, perform end backup.
SQL> alter database end backup; Database altered.
2.4. Perform log switch and back up archivelog
Perform log switch to secure the archivelog for which the end backup command was executed.
Then back up the archivelog.
SQL> alter system switch logfile; System altered. SQL> alter system switch logfile; System altered. TB_HOME/database/$TB_SID/archive/* $TB_HOME/database/t7_bak/archive
2.5. Back up controlfile
Back up with the resetlogs option.
SQL> alter database backup controlfile to trace as '/home/tibero/tibero7/database/t7_bak/ctrl_bak.sql' resetlogs; Database altered.
2.6. Shut Down DB
Shut down the running DB.
[tibero@kimmi ~]$ tbdown immediate Tibero instance terminated (IMMEDIATE mode).
Note
This process is required when building a Clone DB on the same server & user. If building a Clone DB on a different server or user, this can be omitted.
3. Restore Specific Tablespaces for Clone DB Creation
3.1. Replace Data Files
Back up the data files used in the existing operation and change the path of the backed-up data files.
$ mv $TB_HOME/database/$TB_SID $TB_HOME/database/org_bak_20251210 $ mv $TB_HOME/database/t7_bak $TB_HOME/database/$TB_SID
3.2. Delete Data Files for Tablespaces to Be Excluded from Recovery
Delete the data files for tablespaces to be excluded from recovery from the backup.
$ rm $TB_HOME/database/$TB_SID/ts4.dtf $ rm $TB_HOME/database/$TB_SID/ts5.dtf
3.3. Edit controlfile
Comment out the data files to be excluded from recovery.
If not backed up with the resetlogs option, manually change to resetlogs.
$ vi $TB_HOME/database/$TB_SID/ctrl_bak.sql
CREATE CONTROLFILE REUSE DATABASE "tibero0"
LOGFILE
-- Thread #0
GROUP 0 (
'/home/tibero/tibero7/database/tibero0/redo001.redo',
'/home/tibero/tibero7/database/tibero0/redo002.redo'
) SIZE 10M,
GROUP 1 (
'/home/tibero/tibero7/database/tibero0/redo011.redo',
'/home/tibero/tibero7/database/tibero0/redo012.redo'
) SIZE 10M,
GROUP 2 (
'/home/tibero/tibero7/database/tibero0/redo021.redo',
'/home/tibero/tibero7/database/tibero0/redo022.redo'
) SIZE 10M
RESETLOGS
DATAFILE
'/home/tibero/tibero7/database/tibero0/system001.dtf',
'/home/tibero/tibero7/database/tibero0/undo001.dtf',
'/home/tibero/tibero7/database/tibero0/usr001.dtf',
'/home/tibero/tibero7/database/tibero0/syssub001.dtf',
'/home/tibero/tibero7/database/tibero0/ts1.dtf',
'/home/tibero/tibero7/database/tibero0/ts2.dtf',
'/home/tibero/tibero7/database/tibero0/ts3.dtf',
--'/home/tibero/tibero7/database/tibero0/ts4.dtf',
--'/home/tibero/tibero7/database/tibero0/ts5.dtf',
'/home/tibero/tibero7/database/tibero0/ts_has_dfs_1.dtf',
'/home/tibero/tibero7/database/tibero0/ts_has_dfs_2.dtf',
'/home/tibero/tibero7/database/tibero0/ts_for_tbl.dtf',
'/home/tibero/tibero7/database/tibero0/ts_for_idx.dtf'
ARCHIVELOG
MAXLOGFILES 100
MAXFBLOGFILES 255
MAXLOGMEMBERS 8
MAXDATAFILES 8192
MAXARCHIVELOG 500
MAXBACKUPSET 500
MAXLOGHISTORY 500
MAXFBMARKER 168
MAXFBARCHIVELOG 500
CHARACTER SET MSWIN949
NATIONAL CHARACTER SET UTF16
;
3.4. Start nomount and Recreate controlfile
Start in nomount mode to recreate the controlfile.
Recreate the controlfile using the modifications from "3.3. Edit controlfile".
$ tbboot -t nomount Listener port = 8629 Tibero 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Tibero instance started up (NOMOUNT mode). [tibero@kimmi tibero0]$ tbsql sys/tibero tbSQL 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Connected to Tibero. SQL> @$TB_HOME/database/$TB_SID/ctrl_bak.sql Control File created.
3.5. Start mount and Perform Media Recovery
Start in mount mode to perform media recovery.
[tibero@kimmi tibero0]$ tbdown immediate Tibero instance terminated (IMMEDIATE mode). [tibero@kimmi tibero0]$ tbboot mount Tibero 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Tibero instance started up (MOUNT mode). [tibero@kimmi tibero0]$ tbsql sys/tibero tbSQL 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Connected to Tibero. SQL> alter database recover automatic; TBR-1147: Need log file (thread 0 seq 13) to recover from TSN 45357. Recovery done until 2025/12/1549 TSN 45351. Recovery is incomplete and resetlogs is required.
3.6. Start with resetlogs
Start the DB with resetlogs.
When starting with resetlogs, a TBR-24018 error occurs due to the data files excluded from recovery, and the DB starts in mount mode.
$ tbdown immediate; tbboot resetlogs; Tibero instance terminated (IMMEDIATE mode). Change core dump dir to /home/tibero/tibero7/bin/prof. 9 1) Find MISSING datafiles from V$DATAFILE. 2) Restore the corresponding backup datafiles. 3) If they were newly added after the start of the backup, create the physical files with each df id. : SQL> ALTER DATABASE CREATE DATAFILE df_id; 4) Rename(OS cmd) the corresponding files at DB_CREATE_FILE_DEST to their original names. 5) Rename(SQL) MISSING datafiles to each original names. : SQL> ALTER DATABASE RENAME FILE 'MISSING_file_path' to 'original_file_path'; 6) Request the Media Recovery again as before. ******************************************************** * Critical Warning : Raise svmode failed. The reason is * TBR-24018 : CF-DD correction is required due to wrong CF/DD info or added/dropped datafiles while recovery process. * Current server mode is MOUNT. ******************************************************** Tibero 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Tibero instance started suspended at MOUNT mode.
3.7. Perform Tablespace offline immediate
Query the data files excluded from recovery and perform offline immediate.
SQL> select * from v$datafile df ,v$tablespace ts where df.TS# = ts.TS# and df.name like '%MISSING%';
FILE# CREATE_TSN CREATE_DATE
---------- ---------- --------------------------------------------------------------------------------------------------------------------------------
TS# RFILE# BIGFILE STATUS ENABLED CKPT_TSN
---------- ---------- ------- ----------------- ---------- ----------
CKPT_DATE CREATE_BYTES
-------------------------------------------------------------------------------------------------------------------------------- ------------
NAME
--------------------------------------------------------------------------------------------------------------------------------------------------------------
TS# NAME TYPE BIGFILE
---------- -------------------------------------------------------------------------------------------------------------------------------- ---- -------
FLASHBACK_ON
------------
7 532374 2025/12/10
9 7 NO MR NEEDED READ WRITE 532374
2025/12/10 41943040
/home/tibero/tibero7/database/tibero0/MISSING000007
9 TS4 DATA NO
NO
8 532379 2025/12/10
10 8 NO MR NEEDED READ WRITE 532379
2025/12/10 52428800
/home/tibero/tibero7/database/tibero0/MISSING000008
10 TS5 DATA NO
NO
2 rows selected.
SQL> alter tablespace ts4 offline immediate;
Tablespace 'TS4' altered.
SQL> alter tablespace ts5 offline immediate;
Tablespace 'TS5' altered.
3.8. Perform Media Recovery
Perform media recovery again.
SQL> alter database recover automatic; TBR-1027: No log files found for thread 0 from recovery start tsn 45357.
3.9. Start with resetlogs
Start with resetlogs again.
[tibero@kimmi tibero0]$ tbdown immediate; tbboot resetlogs Tibero instance terminated (IMMEDIATE mode). Change core dump dir to /home/tibero/tibero7/bin/prof. Listener port = 8629 Tibero 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Tibero instance started up (NORMAL RESETLOGS mode).
3.10. Perform Drop DDL for Excluded Tablespaces
Execute the drop tablespace command for the tablespaces excluded from recovery.
drop tablespace ts4 including contents and datafiles; drop tablespace ts5 including contents and datafiles;