Document Type | Technical Information
Category | Backup/Recovery
Applicable Product Version | Tibero7
Document Number | TBATI040
Overview
This document describes a method for quickly recovering from a specific data file issue or loss in a TAC environment by temporarily building a SINGLE node using a backup. However, it is not recommended to use the temporarily built SINGLE environment for production purposes.
Test Environment
OS Version: Rocky Linux 8.10 (Green Obsidian) Tibero Version: Tibero7 (DB7.2.4) Build 303667 AS-IS Tibero Configuration: 2Node TAC (Raw-Device) TO-BE Tibero Configuration: SINGLE
Method
Preparation
- Temporary TO-BE Server (SINGLE Build)
Precautions When Building the TO-BE Server
- Set the Hostname and OS Profile to be the same as the AS-IS server.
- Compress the Tibero engine on the AS-IS server and copy it to the TO-BE server.
- Decompress the engine. ( โป Do not create the DB. )
- Redefine the control and data file paths in the tip file. (raw->filesystem)
- Register tbcm.
-- Decompress TO-BE engine
[t7_1]tibero7@tibero_raw:/home/tibero7/tibero_engine> tar -xvf tibero7.tar.gz
tibero7/
tibero7/nls/
tibero7/nls/zoneinfo/
tibero7/nls/zoneinfo/timezone_be.dat
tibero7/nls/zoneinfo/timezone_le.dat
tibero7/client/
.. omitted
-- Redefine control and data file paths (raw->filesystem)
CONTROL_FILES="/home/tibero7/tibero_data/t7_1/control/c1.ctl","/home/tibero7/tibero_redo/t7_1/control/c2.ctl"
DB_CREATE_FILE_DEST="/home/tibero7/tibero_data/t7_1/data"
.. omitted
-- CM registration
[t7_1]tibero7@tibero_raw:/home/tibero7> cmrctl show
Resource List of Node cm1
=====================================================================
CLUSTER TYPE NAME STATUS DETAIL
------------------------
COMMON network t7_int UP (private) 192.168.29.105/8651
COMMON cluster t7_cls UP inc: t7_int, pub: N/A
t7_cls file t7_cls:0 UP /home/tibero7/tibero_engine/tbcm.log
t7_cls service t7 DOWN Database, Active Cluster (auto-restart: OFF)
t7_cls db t7_1 DOWN t7, /home/tibero7/tibero_engine/tibero7, failed retry cnt: 0
=====================================================================Execution Scenario
1. Assume Specific Data File Corruption
SQL> col file_name for a30
SQL> col tablespace_name for a20
SQL> select file_name, tablespace_name, sum(bytes/1024/1024) as MB
from dba_data_files
group by file_name, tablespace_name
order by 1,2;
FILE_NAME TABLESPACE_NAME MB
------------------------------ -------------------- ----------
/dev/raw/raw17 SYSTEM 500
/dev/raw/raw18 USR 500
/dev/raw/raw19 UNDO0 500
/dev/raw/raw20 UNDO1 500
/dev/raw/raw24 SYSSUB 500
/dev/raw/raw25 TEST 500 -- Assume data file corruption
/dev/raw/raw26 TEST 500 -- Assume data file corruption
/dev/raw/raw27 BACKUP 500
8 rows selected.
2. TAC (Raw-Device Configuration) Online Backup
-- db backup alter database begin backup; !dd if=/dev/raw/raw17 bs=128M iflag=direct oflag=direct of=/home/tibero7/system001.dtf bs=128M status=progress !dd if=/dev/raw/raw18 bs=128M iflag=direct oflag=direct of=/home/tibero7/usr001.dtf bs=128M status=progress !dd if=/dev/raw/raw19 bs=128M iflag=direct oflag=direct of=/home/tibero7/undo001.dtf bs=128M status=progress !dd if=/dev/raw/raw20 bs=128M iflag=direct oflag=direct of=/home/tibero7/undo002.dtf bs=128M status=progress !dd if=/dev/raw/raw22 bs=128M iflag=direct oflag=direct of=/home/tibero7/data001.dtf bs=128M status=progress !dd if=/dev/raw/raw23 bs=128M iflag=direct oflag=direct of=/home/tibero7/data002.dtf bs=128M status=progress !dd if=/dev/raw/raw24 bs=128M iflag=direct oflag=direct of=/home/tibero7/syssub001.dtf bs=128M status=progress !dd if=/dev/raw/raw25 bs=128M iflag=direct oflag=direct of=/home/tibero7/test001.dtf bs=128M status=progress !dd if=/dev/raw/raw26 bs=128M iflag=direct oflag=direct of=/home/tibero7/test002.dtf bs=128M status=progress !dd if=/dev/raw/raw27 bs=128M iflag=direct oflag=direct of=/home/tibero7/backup001.dtf bs=128M status=progress alter database end backup; alter system switch logfile; alter system switch logfile; alter system switch logfile; alter system switch logfile; alter system switch logfile; alter system checkpoint; SQL> alter database backup controlfile to trace as '/home/tibero7/reset.sql' resetlogs; Database altered.
3. Copy Backup and All Node Archive Files to TO-BE Server
-- SCP backup to TO-BE server [t7_1]tibero7@tibero_raw:/home/tibero7> scp ./*.dtf *.sql root@192.168.29.105:/home/tibero7 The authenticity of host '192.168.29.105 (192.168.29.105)' can't be established. ECDSA key fingerprint is SHA256:X1dZuXKK781n1qhXT7zPo/tAnYUL4AxmGN9ywX3sy/w. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added '192.168.29.105' (ECDSA) to the list of known hosts. root@192.168.29.105's password: backup001.dtf 100% 500MB 176.7MB/s 00:02 data001.d 500MB 166.4MB/s 00:03 data002.dtf 100% 500MB 169.5MB/s 00:02 syssub001.dtf 100% 500MB 166.7MB/s 00:02 system001.dtf 100% 500MB 159.5MB/s 00:03 test001.dtf 100% 1000MB 124.5MB/s 00:08 test002.dtf 100% 500MB 123.7MB/s 00.dtf 100% 500MB 117.3MB/s 00:04 undo002.dtf 100% 500MB 116.8MB/s 00:04 usr001.dtf 100% 500MB 119.4MB/s 00:04 reset.sql 100% 4403 2.5MB/s 00:00 -- SCP archive files from node 1 to TO-BE server [t7_1]tibero7@tibero_raw:/home/tibero7/tibero_arch/t7/t7_1/arch> scp ./*.arc root@192.168.29.105:/home/tibero7/tibero_arch/t7/t7_1/arch/ root@192.168.29.105's password: log-t0-r0-s12.arc 100% 512 484.1KB/s 00:00 log-t0-r0-s13.arc 100% 40KB 19.8MB/s 00:00 log-t0-r0-s14.arc 100% 320KB 39.5MB/s 00:00 log-t0-r0-s15.arc 100% 6389KB 58.8MB/s 00:00 log-t0-r0-s16.arc 100% 164KB 54.6MB/s 00:00 log-t0-r0-s17.arc 100% 100MB 163.2MB/s 00:00 log-t0-r0-s18.arc 100% 89MB 176.5MB/s 00:00 log-t0-r0-s19.arc 100% 512 216.7KB/s 00:00 log-t0-r0-s20.arc 100% 1024 1.2MB/s 00:00 log-t0-r0-s21.arc 100% 512 745.3KB/s 00:00 log-t0-r0-s22.arc 100% 512 748.9KB/s 00:00 -- SCP archive files from node 2 to TO-BE server [t7_2]tibero7@tibero_raw:/home/tibero7/tibero_arch/t7/t7_2/arch> scp ./*.arc root@192.168.29.105:/home/tibero7/tibero_arch/t7/t7_1/arch/ root@192.168.29.105's password: log-t1-r0-s7.arc 100% 512 563.4KB/s 00:00 log-t1-r0-s8.arc 100% 512 1.7MB/s 00:00 log-t1-r0-s9.arc 100% 30KB 53.4MB/s 00:00 log-t1-r0-s10.arc 100% 179KB 72.2MB/s 00:00 log-t1-r0-s11.arc 100% 3072 5.9MB/s 00:00 log-t1-r0-s12.arc 100% 95MB 159.5MB/s 00:00 log-t1-r0-s13.arc 100% 512 449.6KB/s 00:00 log-t1-r0-s14.arc 100% 512 954.0KB/s 00:00 log-t1-r0-s15.arc 100% 512 1.5MB/s 00:00 log-t1-r0-s16.arc 100% 512 1.5MB/s 00:00
4. Recreate Single Node Control File
ใด Remove corrupted data files
ใด UNDO tablespace must be included regardless of node
-- Modify control file path
CREATE CONTROLFILE REUSE DATABASE "t7"
LOGFILE
-- Thread #0
GROUP 0 (
'/home/tibero7/tibero_redo/t7_1/redo/redo001.redo',
'/home/tibero7/tibero_redo/t7_1/redo/redo002.redo'
,
GROUP 1 (
'/home/tibero7/tibero_redo/t7_1/redo/redo011.redo',
'/home/tibero7/tibero_redo/t7_1/redo/redo012.redo'
) SIZE 100M,
GROUP 2 (
'/home/tibero7/tibero_redo/t7_1/redo/redo021.redo',
'/home/tibero7/tibero_redo/t7_1/redo/redo022.redo'
) SIZE 100M
RESETLOGS
DATAFILE
'/home/tibero7/tibero_data/t7_1/data/system001.dtf',
'/home/tibero7/tibero_data/t7_1/data/undo001.dtf',
'/home/tibero7/tibero_data/t7_1/data/usr001.dtf',
'/home/tibero7/tibero_data/t7_1/data/syssub001.dtf',
'/home/tibero7/tibero_data/t7_1/data/undo002.dtf',
--'/home/tibero7/tibero_data/t7.dtf', -- Remove or comment out this data file
--'/home/tibero7/tibero_data/t7_1/data/test002.dtf', -- Remove or comment out this data file
'/home/tibero7/tibero_data/t7_1/data/backup001.dtf'
..omitted
-- After nomount startup, recreate control file
SQL> @reset.sql
Control File created.
-- Add redo group for thread 1 and activate thread 1
SQL> ALTER DATABASE ADD LOGFILE THREAD 1 GROUP 10 (
'/home/tibero7/tibero_redo/t7_1/redo/redo031.redo',
'/home/tibero7/tibero_redo/t7_1/redo/redo032.redo'
) SIZE 100M reuse ;
SQL> ALTER DATABASE ADD LOGFILE THREAD 1 GROUP 11 (
'/home/tibero7/tibero_redo/t7_1/redo/redo041.redo',
'/home/tibero7/tibero_redo/t7_1/redo/redo042.redo'
) SIZE 100M reuse ;
SQL> ALTER DATABASE ADD LOGFILE THREAD 1 GROUP 12 (
'/home/tibero7/tibero_redo/t7_1/redo/redo051.redo',
'/home/tibero7/tibero_redo/t7_1/redo/redo052.redo'
) SIZE 100M reuse ;
SQL> alter database enable public thread 1;
Database altered.
5. Perform Recovery
โป Precautions When Adding Parameters
These are hidden parameters, so be sure to consult with a Tibero engineer before use.
_TX_RECOVERY_SUSPEND=Y
ใด On startup, forcibly starts up by skipping recovery for previous tx._CF_DD_CHECK=N
ใด If a DF exists in DD but not in CF, all CF-DD corrections are skipped.
-- Perform recovery SQL> alter database recover automatic; TBR-1147: Need log file (thread 0 seq 23) to recover from TSN 204335. Recovery done until 2025/11/28 10:30:12 TSN 204330. Recovery is incomplete and resetlogs is required. -- Add parameters _TX_RECOVERY_SUSPEND=Y _CF_DD_CHECK=N -- Startup with resetlogs [t7_1]tibero7@tibero_raw:/home/tibero7/tibero_engine> tbboot resetlogs Listener port = 2629 Tibero 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Tibero instance started up (NORMAL RESETLOGS mode). -- Add temp file SQL> ALTER TABLESPACE TEMP ADD TEMPFILE '/home/tibero7/tibero_data/t7_1/data/temp001.dtf' SIZE 500M REUSE AUTOEXTEND OFF ;
6. Use tbexport/tbimport to extract and recover the necessary data from all normal areas except the damaged TEST TableSpace area.