## 백업복구pdf교재의 74page(온라인백업), 81page(복구) 내용을 실습하면서 캡춰한 내용임.
login as: tibero
tibero@192.168.56.241's password:
Last login: Thu Apr 13 11:16:23 2023 from 192.168.56.1
[tibero@T1:/home/tibero]$ cd /tibero
[tibero@T1:/tibero]$
[tibero@T1:/tibero]$ ### 온라인백업, 복구 실습
[tibero@T1:/tibero]$
[tibero@T1:/tibero]$ ls -al /tibero/s/on
ls: cannot access /tibero/s/on: No such file or directory
[tibero@T1:/tibero]$
[tibero@T1:/tibero]$ mkdir /tibero/s/on
[tibero@T1:/tibero]$
[tibero@T1:/tibero]$ tbsql tibero/tmax
tbSQL 7
TmaxTibero Corporation Copyright (c) 2020-. All rights reserved.
Connected to Tibero.
SQL> SELECT COUNT(*) FROM EMP;
COUNT(*)
----------
14
1 row selected.
SQL> SELECT TABLESPACE_NAME, TABL_NAME FROM USER_TABLES;
TBR-8026: Invalid identifier.
at line 1, column 26 of null:
SELECT TABLESPACE_NAME, TABL_NAME FROM USER_TABLES
^
SQL> SELECT TABLESPACE_NAME, TABLE_NAME FROM USER_TABLES;
TABLESPACE_NAME
--------------------------------------------------------------------------------
TABLE_NAME
--------------------------------------------------------------------------------
USR
PRODUCT
USR
DEPT
USR
EMP
USR
EMP_LOCAL
4 rows selected.
SQL> SELECT FILE_NAME FROM DBA_DATA_FILES WHERE TABLESPACE_NAME='USR';
FILE_NAME
--------------------------------------------------------------------------------
/tibero/tbdata/tibero/usr001.dtf
1 row selected.
SQL>
SQL> ALTER TABLESPACE USR BIGIN BACKUP;
TBR-7001: General syntax error.
at line 1, column 26 of null:
ALTER TABLESPACE USR BIGIN BACKUP
^^^^^
SQL> ALTER TABLESPACE USR BEGIN BACKUP;
Tablespace 'USR' altered.
SQL> !cp /tibero/tbdata/tibero/usr001.dtf /tibero/s/on
SQL>
SQL> ALTER TABLESPACE USR END BACKUP;
Tablespace 'USR' altered.
SQL> ALTER SYSTEM SWITCH LOGFILE;
System altered.
SQL> ED
Wrote file .tbedit.sql
1 ALTER DATABASE BACKUP CONTROLFILE TO TRACE AS '/tibero/s/on/crectl.sql'
2 REUSE NORESETLOGS;
SQL> ed
Wrote file .tbedit.sql
1 ALTER DATABASE BACKUP CONTROLFILE TO TRACE AS '/tibero/s/on/crectl.sql'
2 REUSE NORESETLOGS
SQL> ed
Wrote file .tbedit.sql
1 ALTER DATABASE BACKUP CONTROLFILE TO TRACE AS '/tibero/s/on/crectl.sql' REUSE NORESETLOGS
SQL> /
Database altered.
SQL> ALTER SYSTEM SWITCH LOGFILE;
System altered.
SQL> SELECT NAME FROM V$ARCHIVE_DEST_FILES;
NAME
--------------------------------------------------------------------------------
/tibero/tbdata/tibero/arch/log-t0-r0-s6.arc
/tibero/tbdata/tibero/arch/log-t0-r0-s7.arc
/tibero/tbdata/tibero/arch/log-t0-r0-s8.arc
/tibero/tbdata/tibero/arch/log-t0-r0-s9.arc
/tibero/tbdata/tibero/arch/log-t0-r0-s10.arc
/tibero/tbdata/tibero/arch/log-t0-r0-s11.arc
6 rows selected.
SQL> !cp /tibero/tbdata/tibero/arch/log-t0-r0-s*.arc /tibero/s/on
SQL>
SQL> SELECT VALUE FROM V$PARAMETERS WHERE NAME='DB_CREATE_FILE_DEST';
VALUE
--------------------------------------------------------------------------------
/tibero/tbdata/tibero/
1 row selected.
SQL> !ls -al /tibero/tbdata/tibero/.passwd
TBS-70003: Invalid command. Enter HELP or HELP <command>.
at line 1, column 9:
ls -al /tibero/tbdata/tibero/.passwd
^^^^^^
SQL> !ls -al /tibero/tbdata/tibero/.passwd
-rw-r--r-- 1 tibero dba 44 Apr 13 16:28 /tibero/tbdata/tibero/.passwd
SQL>
SQL> !cp /tibero/tbdata/tibero/.passwd /tibero/s/on
SQL> !cp $TB_HOME/config/$TB_SID.tip /tibero/s/on
SQL>
SQL> exit
Disconnected.
[tibero@T1:/tibero]$
[tibero@T1:/tibero]$ ls -al /tibero/s/on
total 165157
drwxrwx--- 1 root vboxsf 4096 Apr 14 10:14 .
drwxrwx--- 1 root vboxsf 4096 Apr 14 09:55 ..
-rwxrwx--- 1 root vboxsf 4096 Apr 14 10:09 crectl.sql
-rwxrwx--- 1 root vboxsf 30264832 Apr 14 10:11 log-t0-r0-s10.arc
-rwxrwx--- 1 root vboxsf 2048 Apr 14 10:11 log-t0-r0-s11.arc
-rwxrwx--- 1 root vboxsf 360448 Apr 14 10:11 log-t0-r0-s6.arc
-rwxrwx--- 1 root vboxsf 1595904 Apr 14 10:11 log-t0-r0-s7.arc
-rwxrwx--- 1 root vboxsf 35353600 Apr 14 10:11 log-t0-r0-s8.arc
-rwxrwx--- 1 root vboxsf 49092608 Apr 14 10:11 log-t0-r0-s9.arc
-rwxrwx--- 1 root vboxsf 44 Apr 14 10:14 .passwd
-rwxrwx--- 1 root vboxsf 262 Apr 14 10:14 tibero.tip
-rwxrwx--- 1 root vboxsf 52428800 Apr 14 10:03 usr001.dtf
[tibero@T1:/tibero]$
[tibero@T1:/tibero]$
[tibero@T1:/tibero]$
[tibero@T1:/tibero]$
[tibero@T1:/tibero]$
[tibero@T1:/tibero]$ tbsql sys/tibero
tbSQL 7
TmaxTibero Corporation Copyright (c) 2020-. All rights reserved.
Connected to Tibero.
SQL> SELECT NAME FROM V$DATAFILE;
NAME
--------------------------------------------------------------------------------
/tibero/tbdata/tibero/system001.dtf
/tibero/tbdata/tibero/undo001.dtf
/tibero/tbdata/tibero/usr001.dtf
/tibero/tbdata/tibero/syssub001.dtf
/tibero/tbdata/my_file001.dtf
5 rows selected.
SQL> !rm /tibero/tbdata/tibero/usr001.dtf
SQL>
SQL> q
Disconnected.
[tibero@T1:/tibero]$ tbdown abnormal
Tibero instance terminated (ABNORMAL mode).
[tibero@T1:/tibero]$
[tibero@T1:/tibero]$
[tibero@T1:/tibero]$
[tibero@T1:/tibero]$
[tibero@T1:/tibero]$
[tibero@T1:/tibero]$
[tibero@T1:/tibero]$ tbboot
Change core dump dir to /tibero/tibero7/bin/prof.
Listener port = 8629
********************************************************
* Critical Warning : Raise svmode failed. The reason is
* TBR-1024 : Database needs media recovery: open failed(/tibero/tbdata/tibero/usr001.dtf).
* Current server mode is MOUNT.
********************************************************
Tibero 7
TmaxTibero Corporation Copyright (c) 2020-. All rights reserved.
Tibero instance started suspended at MOUNT mode.
[tibero@T1:/tibero]$
[tibero@T1:/tibero]$
[tibero@T1:/tibero]$ tbsql sys/tibero
tbSQL 7
TmaxTibero Corporation Copyright (c) 2020-. All rights reserved.
Connected to Tibero.
SQL> COL TIME FOR A10
SQL> COL ERROR FOR A30
SQL> SELECT * FROM V$RECOVER_FILE;
FILE# ONLINE ERROR CHANGE# TIME
---------- ------- ------------------------------ ---------- ----------
2 ONLINE open failed 0
1 row selected.
SQL> SELECT NAME FROM V$DATAFILE WHERE FILE# = 2;
NAME
--------------------------------------------------------------------------------
/tibero/tbdata/tibero/usr001.dtf
1 row selected.
SQL> !ls -l /tibero/tbdata/tibero/usr001.dtf
ls: cannot access /tibero/tbdata/tibero/usr001.dtf: No such file or directory
SQL>
SQL> !ls -al /tibero/s/on/usr001.dtf
-rwxrwx--- 1 root vboxsf 52428800 Apr 14 10:03 /tibero/s/on/usr001.dtf
SQL>
SQL> !cp /tibero/s/on/usr001.dtf /tibero/tbdata/tibero/usr001.dtf
SQL>
SQL>
SQL> SELECT * FROM V$RECOVER_FILE;
FILE# ONLINE ERROR CHANGE# TIME
---------- ------- ------------------------------ ---------- ----------
2 ONLINE file restored 216681 2023/04/14
1 row selected.
SQL>
SQL>
SQL>
SQL> SELECT FILE#, CKPT_TSN FROM V$DATAFILE;
FILE# CKPT_TSN
---------- ----------
0 216683
1 216683
2 216683
3 216683
4 216683
5 rows selected.
SQL> SELECT FILE#, CKPT_TSN FROM V$DATAFILE_HEADER;
FILE# CKPT_TSN
---------- ----------
0 216683
1 216683
2 190993
3 216683
4 216683
5 rows selected.
SQL> ALTER DATABASE RECOVER AUTOMATIC DATABASE;
Database altered.
SQL> Q
Disconnected.
[tibero@T1:/tibero]$ tbsql sys/tibero
tbSQL 7
TmaxTibero Corporation Copyright (c) 2020-. All rights reserved.
Connected to Tibero.
SQL> SELECT FILE#, CKPT_TSN FROM V$DATAFILE;
FILE# CKPT_TSN
---------- ----------
0 217100
1 217100
2 217100
3 217100
4 217100
5 rows selected.
SQL> SELECT FILE#, CKPT_TSN FROM V$DATAFILE_HEADER;
FILE# CKPT_TSN
---------- ----------
0 217100
1 217100
2 217100
3 217100
4 217100
5 rows selected.
SQL> SELECT * FROM V$RECOVER_FILE;
0 row selected.
SQL> Q
Disconnected.
[tibero@T1:/tibero]$ tbdown
Tibero instance terminated (NORMAL mode).
[tibero@T1:/tibero]$
[tibero@T1:/tibero]$
[tibero@T1:/tibero]$ tbboot
Change core dump dir to /tibero/tibero7/bin/prof.
Listener port = 8629
Tibero 7
TmaxTibero Corporation Copyright (c) 2020-. All rights reserved.
Tibero instance started up (NORMAL mode).
[tibero@T1:/tibero]$
[tibero@T1:/tibero]$
[tibero@T1:/tibero]$