Document Type | Technical Information
Category | Backup/Recovery
Applicable Product Versions | 6FS07, 6FS07PS, 7FS02, 7FS02PS
Document Number | TBATI010
Overview
This method performs a backup without stopping the database by executing the Begin Backup command while Tibero is running. It guides the procedure to back up the data files located in TAS using the tbascmd command.
Method
1. Check Backup Target Files
Check the data files and tablespace information.
$ tbsql sys/tibero SQL> col FILE_NAME for a40 SQL> col TABLESPACE_NAME for a10 SQL> select FILE_NAME,FILE_ID,TABLESPACE_NAME,STATUS from dba_datafiles; SQL> select name from v$datafile; NAME -------------------------------------------------------------------------------- +DS0/tac/system01/system01.dbf +DS0/tac/system01/undo0_01.dbf +DS0/tac/system01/usr01.dbf +DS0/tac/system01/tpr01.dbf +DS0/tac/system02/undo1_01.dbf
2. Control File Backup
Back up the Control File as an SQL file.
SQL> alter database backup controlfile to trace as '{backup path}/control.sql' reuse noresetlogs;
SQL> alter database backup controlfile to trace as '{backup path}/control.sql' reuse resetlogs;3. Begin Backup
Perform an online backup of all files simultaneously.
SQL> alter database begin backup;
4. Backup File COPY
- Use tbascmd to copy TAS files to local storage.
- The tbascmd command connects to the TAS instance and allows you to view and manage files stored on the disk space.
$ tbascmd {TAS PORT}
[15:30]ASCMD +> cd +DS0/tac/system01
[15:31]ASCMD +DS0/tac/system01> ls
redo0_11.redo
redo0_21.redo
system01.dbf
undo0_01.dbf
tmp01.dbf
usr01.dbf
tpr01.dbf
redo1_11.redo
redo1_21.redo
-. Number of files found: 9
-. Use the cptolocal command to copy TAS files to local storage
[16:17]ASCMD +DS0/tac> cptolocal .passwd /home/tibero/backup
[15:32]ASCMD +DS0/tac/system01> cptolocal *.dbf /home/tibero/back/
[16:07]ASCMD +DS0/tac/system02> cptolocal *.dbf /home/tibero/back/
[16:10]ASCMD +DS0/tac/system02> exit
5. End Backup
End the backup mode.
SQL> alter database end backup;
Check the backup status.
SQL> select * from v$backup;
FILE# STATUS CHANGE# TIME
---------- ---------------- -------- -----------
0 NOT ACTIVE 567737 2024/05/08
1 NOT ACTIVE 567821 2024/05/08
2 NOT ACTIVE 567994 2024/05/08
3 NOT ACTIVE 568252 2024/05/086. Perform log switch
- Perform a log switch to prepare for potential online redo log loss situations.
- Perform a log switch equal to log group + 1 (if in archive mode).
SQL> alter system switch logfile global; SQL> alter system archive log all global;
7. Verify Backup
Check the backup files in the local directory.
$ ll total 12800044 -rw-r--r-- 1 tibero dba 4528 May 27 10:45 control.sql -rw-r--r-- 1 tibero dba 3145728000 May 27 10:49 system01.dbf -rw-r--r-- 1 tibero dba 3145728000 May 27 10:50 tmp01.dbf -rw-r--r-- 1 tibero dba 1048576000 May 27 10:49 tpr01.dbf -rw-r--r-- 1 tibero dba 1048576000 May 27 10:48 undo0_01.dbf -rw-r--r-- 1 tibero dba 3145728000 May 27 10:52 undo1_01.dbf -rw-r--r-- 1 tibero dba 1048576000 May 27 10:49 usr01.dbf
Note
Since changes to data files continue during the Begin Backup mode, the backup must be completed quickly.
Before and after the backup, consider system load and choose an appropriate time that suits the operational situation.