[아이티윌 오라클 DBA 과정 91기] 260108 TIL
2026. 1. 8. 18:16ㆍCourses/아이티윌 오라클 DBA 과정
데이터베이스 복제
SYS@ora19c> select sequence#, name, first_change#, to_char(first_time, 'yyyy-mm-dd hh24:mi:ss') first_time, next_change#, to_char(next_time, 'yyyy-mm-dd hh24:mi:ss') next_time
from v$archived_log; 2
SEQUENCE# NAME FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME
---------- -------------------------------------------------- ------------- ------------------- ------------ -------------------
29 2850110 2025-12-23 10:12:10 2863868 2026-01-08 09:49:30
29 2850110 2025-12-23 10:12:10 2863868 2026-01-08 09:49:30
30 /home/oracle/arch1/arch_1_30_1218118200.arc 2863868 2026-01-08 09:49:30 2864049 2026-01-08 09:51:23
30 /home/oracle/arch2/arch_1_30_1218118200.arc 2863868 2026-01-08 09:49:30 2864049 2026-01-08 09:51:23
SYS@ora19c> select a.group#, a.sequence#, b.member, a.bytes/1024/1024 mb, a.archived, a.status, a.first_change#, to_char(first_time, 'yyyy-mm-dd hh24:mi:ss') first_time, a.next_change#, to_char(next_time, 'yyyy-mm-dd hh24:mi:ss') next_time
from v$log a, v$logfile b
where a.group# = b.group#; 2 3
GROUP# SEQUENCE# MEMBER MB ARC STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME
---------- ---------- -------------------------------------------------- ---------- --- ---------------- ------------- ------------------- ------------ -------------------
3 31 /u01/app/oracle/oradata/ORA19C/redo03.log 50 NO CURRENT 2864049 2026-01-08 09:51:23 1.8447E+19
2 30 /u01/app/oracle/oradata/ORA19C/redo02.log 50 YES INACTIVE 2863868 2026-01-08 09:49:30 2864049 2026-01-08 09:51:23
1 29 /u01/app/oracle/oradata/ORA19C/redo01.log 50 YES INACTIVE 2850110 2025-12-23 10:12:10 2863868 2026-01-08 09:49:30
SYS@ora19c> create table hr.emp_20260108 tablespace users as select * from hr.employees;
Table created.
SYS@ora19c> select count(*) from hr.emp_20260108;
COUNT(*)
----------
107
SYS@ora19c> alter system switch logfile;
System altered.
SYS@ora19c> ! ls arch*
arch1:
arch_1_30_1218118200.arc arch_1_31_1218118200.arc
arch2:
arch_1_30_1218118200.arc arch_1_31_1218118200.arc
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1 Full 1.27G DISK 00:00:08 08-JAN-26
BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20260108T095038
Piece Name: /u01/app/oracle/fast_recovery_area/ORA19C/backupset/2026_01_08/o1_mf_nnndf_TAG20260108T095038_noxzv1tf_.bkp
List of Datafiles in backup set 1
File LV Type Ckp SCN Ckp Time Abs Fuz SCN Sparse Name
---- -- ---- ---------- --------- ----------- ------ ----
1 Full 2863999 08-JAN-26 NO /u01/app/oracle/oradata/ORA19C/system01.dbf
3 Full 2863999 08-JAN-26 NO /u01/app/oracle/oradata/ORA19C/sysaux01.dbf
4 Full 2863999 08-JAN-26 NO /u01/app/oracle/oradata/ORA19C/undotbs01.dbf
7 Full 2863999 08-JAN-26 NO /u01/app/oracle/oradata/ORA19C/users01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
2 Full 10.20M DISK 00:00:00 08-JAN-26
BP Key: 2 Status: AVAILABLE Compressed: NO Tag: TAG20260108T095054
Piece Name: /u01/app/oracle/fast_recovery_area/ORA19C/autobackup/2026_01_08/o1_mf_s_1221990654_noxzvg81_.bkp
SPFILE Included: Modification time: 08-JAN-26
SPFILE db_unique_name: ORA19C
Control File Included: Ckp SCN: 2864012 Ckp time: 08-JAN-26
- 데이터파일 백업 : /u01/app/oracle/fast_recovery_area/ORA19C/backupset/2026_01_08/o1_mf_nnndf_TAG20260108T095038_noxzv1tf_.bkp
- 컨트롤파일 백업 : /u01/app/oracle/fast_recovery_area/ORA19C/autobackup/2026_01_08/o1_mf_s_1221990654_noxzvg81_.bkp
- 아카이브 파일:
/home/oracel/arch1/arch_1_30_1218118200.arc
/home/oracel/arch1/arch_1_31_1218118200.arc
/home/oracel/arch2/arch_1_30_1218118200.arc
/home/oracel/arch3/arch_1_31_1218118200.arc
1. clone 디렉터리 생성
[oracle@ora19c ~]$ ls
arch1 arch2 backup create_2026.txt data_pump
[oracle@ora19c ~]$ mkdir clone
[oracle@ora19c ~]$ ls
arch1 arch2 backup clone create_2026.txt data_pump
2. 백업 데이터파일, 컨트롤파일, 아카이브파일 clone 디렉터리에 복사
[oracle@ora19c ~]$ cd clone
[oracle@ora19c clone]$ cp -v /u01/app/oracle/fast_recovery_area/ORA19C/backupset/2026_01_08/o1_mf_nnndf_TAG20260108T095038_noxzv1tf_.bkp .
‘/u01/app/oracle/fast_recovery_area/ORA19C/backupset/2026_01_08/o1_mf_nnndf_TAG20260108T095038_noxzv1tf_.bkp’ -> ‘./o1_mf_nnndf_TAG20260108T095038_noxzv1tf_.bkp’
[oracle@ora19c clone]$ cp -v /u01/app/oracle/fast_recovery_area/ORA19C/autobackup/2026_01_08/o1_mf_s_1221990654_noxzvg81_.bkp .
‘/u01/app/oracle/fast_recovery_area/ORA19C/autobackup/2026_01_08/o1_mf_s_1221990654_noxzvg81_.bkp’ -> ‘./o1_mf_s_1221990654_noxzvg81_.bkp’
[oracle@ora19c clone]$ cp -v /home/oracle/arch1/* .
‘/home/oracle/arch1/arch_1_30_1218118200.arc’ -> ‘./arch_1_30_1218118200.arc’
‘/home/oracle/arch1/arch_1_31_1218118200.arc’ -> ‘./arch_1_31_1218118200.arc’
3. clone 데이터베이스 초기파라미터 파일 생성
SYS@ora19c> create pfile='/home/oracle/clone/initclone.ora' from spfile;
File created.
SYS@ora19c> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@ora19c ~]$ cd clone
[oracle@ora19c clone]$ vi initclone.ora
[oracle@ora19c clone]$ cat initclone.ora
*.compatible='19.0.0'
*.control_files='/home/oracle/clone/control01.ctl'#Restore Controlfile
*.db_name='clone'
*.log_archive_dest_1='location=/home/oracle/clone/ mandatory'
*.log_archive_format='arch_%t_%s_%r.arc'
*.undo_tablespace='UNDOTBS1'
*.shared_pool_size=300m
4. clone 데이터베이스를 pfile 이용해서 nomount까지만 시작
[oracle@ora19c clone]$ cd
[oracle@ora19c ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/19.3.0/dbhome_1
[oracle@ora19c ~]$ . oraenv
ORACLE_SID = [ora19c] ? clone
ORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/19.3.0/dbhome_1
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@ora19c ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Thu Jan 8 10:34:08 2026
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to an idle instance.
SYS@clone> startup pfile=/home/oracle/clone/initclone.ora nomount
ORACLE instance started.
Total System Global Area 385872048 bytes
Fixed Size 8896688 bytes
Variable Size 318767104 bytes
Database Buffers 50331648 bytes
Redo Buffers 7876608 bytes
SYS@clone> select instance_name, status from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
clone STARTED
SYS@clone> show parameter control_files;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_files string /home/oracle/clone/control01.c
tl
5. clone 복제 데이터베이스 생성
SYS@clone> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@ora19c ~]$ rman auxiliary /
Recovery Manager: Release 19.0.0.0.0 - Production on Thu Jan 8 10:40:43 2026
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to auxiliary database: CLONE (not mounted)
run {
set newname for datafile 1 to '/home/oracle/clone/system01.dbf';
set newname for datafile 3 to '/home/oracle/clone/sysaux01.dbf';
set newname for datafile 4 to '/home/oracle/clone/undotbs01.dbf';
set newname for datafile 7 to '/home/ora2> cle/clone/users01.dbf';
set newname for tempfile 1 to '/home/oracle/clone/temp01.dbf';
duplicate target database to 'clone'
pfile='/home/oracle/clone/initclone.ora'
nofilenamecheck
backup location '/home/oracle/clone'
logfile
'/home/oracle/clone/redo01.log' size 50m,
'/home/oracle/clone/redo02.log' size 50m,
'/home/oracle/clone/redo03.log' size 50m;
}
- 데이터베이스를 복제하면서 데이터베이스를 내렸다 올리므로 pfile 지정해줘야 함
- nofilenamecheck : 소스DB와 타겟DB의 파일 경로가 서로 겹치는지에 대한 검사를 생략
- backup 위치 지정
- redo log 위치 지정
RMAN> report schema;
Report of database schema for database with db_unique_name CLONE
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 910 SYSTEM *** /home/oracle/clone/system01.dbf
3 720 SYSAUX *** /home/oracle/clone/sysaux01.dbf
4 340 UNDOTBS1 *** /home/oracle/clone/undotbs01.dbf
7 5 USERS *** /home/oracle/clone/users01.dbf
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 32 TEMP 32767 /home/oracle/clone/temp01.dbf
RMAN> exit
Recovery Manager complete.
[oracle@ora19c ~]$ cd clone
[oracle@ora19c clone]$ ls
arch_1_30_1218118200.arc initclone.ora redo01.log sysaux01.dbf undotbs01.dbf
arch_1_31_1218118200.arc o1_mf_nnndf_TAG20260108T095038_noxzv1tf_.bkp redo02.log system01.dbf users01.dbf
control01.ctl o1_mf_s_1221990654_noxzvg81_.bkp redo03.log temp01.dbf
[oracle@ora19c clone]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Thu Jan 8 11:17:20 2026
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SYS@clone> select instance_name, status from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
clone OPEN
SYS@clone> select count(*) from hr.emp_20260108;
COUNT(*)
----------
107
디렉터리 생성
# 물리적 디렉터리 생성
[oracle@ora19c ~]$ ls
arch1 arch2 backup clone create_2026.txt data_pump
[oracle@ora19c ~]$ mkdir clone_pump
[oracle@ora19c ~]$ ls
arch1 arch2 backup clone clone_pump create_2026.txt data_pump
[oracle@ora19c ~]$ exit
exit
# 논리적 디렉터리 생성
SYS@clone> create directory clone_pump as '/home/oracle/clone_pump';
Directory created.
SYS@clone> select * from dba_directories where directory_name = 'CLONE_PUMP';
OWNER DIRECTORY_NAME DIRECTORY_PATH ORIGIN_CON_ID
------------------------------ ------------------------------ -------------------------------------------------- -------------
SYS CLONE_PUMP /home/oracle/clone_pump 0
hr 유저 export
[oracle@ora19c ~]$ expdp system/oracle schemas=hr directory=clone_pump dumpfile=hr_schema.dmp
Export: Release 19.0.0.0.0 - Production on Thu Jan 8 11:26:49 2026
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Starting "SYSTEM"."SYS_EXPORT_SCHEMA_01": system/******** schemas=hr directory=clone_pump dumpfile=hr_schema.dmp
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type SCHEMA_EXPORT/STATISTICS/MARKER
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/TABLESPACE_QUOTA
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/SEQUENCE/SEQUENCE
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type SCHEMA_EXPORT/TABLE/COMMENT
Processing object type SCHEMA_EXPORT/PROCEDURE/PROCEDURE
Processing object type SCHEMA_EXPORT/PROCEDURE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type SCHEMA_EXPORT/PROCEDURE/ALTER_PROCEDURE
Processing object type SCHEMA_EXPORT/VIEW/VIEW
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/TRIGGER
. . exported "HR"."EMPLOYEES" 17.08 KB 107 rows
. . exported "HR"."EMP_20260108" 17.09 KB 107 rows
. . exported "HR"."LOCATIONS" 8.437 KB 23 rows
. . exported "HR"."JOB_HISTORY" 7.195 KB 10 rows
. . exported "HR"."JOBS" 7.109 KB 19 rows
. . exported "HR"."DEPARTMENTS" 7.125 KB 27 rows
. . exported "HR"."COUNTRIES" 6.367 KB 25 rows
. . exported "HR"."REGIONS" 5.546 KB 4 rows
. . exported "HR"."FGA_EMP_LOG" 9.695 KB 24 rows
Master table "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_SCHEMA_01 is:
/home/oracle/clone_pump/hr_schema.dmp
Job "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully completed at Thu Jan 8 11:28:27 2026 elapsed 0 00:01:04
temp 공간에 문제가 발생한 경우
SYS@clone> select * from dba_temp_files;
FILE_NAME FILE_ID TABLESPACE_NAME BYTES BLOCKS STATUS RELATIVE_FNO AUT MAXBYTES MAXBLOCKS INCREMENT_BY USER_BYTES USER_BLOCKS
-------------------------------------------------- ---------- ------------------------------ ---------- ---------- ------- ------------ --- ---------- ---------- ------------ ---------- -----------
SHARED INST_ID
------------- ----------
/home/oracle/clone/temp01.dbf 1 TEMP 33554432 4096 ONLINE 1 YES 3.4360E+10 4194302 80 32505856 3968
SHARED
# temp 추가
alter tablespace temp add tempfile '' size 10m autoextend on;
# temp 삭제
alter tablespace temp drop tempfile '';
# temp 파일 자동 확장 기능 활성화
alter database tempfile '' autoextend on;
# temp 파일 자동 확장 기능 비활성화
alter database tempfile '' autoextend off;
# temp 파일 크기 수정
alter database tempfile '' resize 20m;
hr 유저 import
hr 유저 삭제
SYS@clone> select count(*) from dba_objects where owner = 'HR';
COUNT(*)
----------
39
# hr 유저 삭제
SYS@clone> drop user hr cascade;
User dropped.
hr 유저 import
SYS@clone> ! impdp system/oracle directory=clone_pump dumpfile=hr_schema.dmp schemas=hr
Import: Release 19.0.0.0.0 - Production on Thu Jan 8 11:49:00 2026
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Master table "SYSTEM"."SYS_IMPORT_SCHEMA_01" successfully loaded/unloaded
Starting "SYSTEM"."SYS_IMPORT_SCHEMA_01": system/******** directory=clone_pump dumpfile=hr_schema.dmp schemas=hr
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/TABLESPACE_QUOTA
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/SEQUENCE/SEQUENCE
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
. . imported "HR"."EMPLOYEES" 17.08 KB 107 rows
. . imported "HR"."EMP_20260108" 17.09 KB 107 rows
. . imported "HR"."LOCATIONS" 8.437 KB 23 rows
. . imported "HR"."JOB_HISTORY" 7.195 KB 10 rows
. . imported "HR"."JOBS" 7.109 KB 19 rows
. . imported "HR"."DEPARTMENTS" 7.125 KB 27 rows
. . imported "HR"."COUNTRIES" 6.367 KB 25 rows
. . imported "HR"."REGIONS" 5.546 KB 4 rows
. . imported "HR"."FGA_EMP_LOG" 9.695 KB 24 rows
Processing object type SCHEMA_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type SCHEMA_EXPORT/TABLE/COMMENT
Processing object type SCHEMA_EXPORT/PROCEDURE/PROCEDURE
Processing object type SCHEMA_EXPORT/PROCEDURE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type SCHEMA_EXPORT/PROCEDURE/ALTER_PROCEDURE
Processing object type SCHEMA_EXPORT/VIEW/VIEW
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/TRIGGER
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type SCHEMA_EXPORT/STATISTICS/MARKER
ORA-39082: Object type PROCEDURE:"HR"."INSERT_EMP2" created with compilation warnings
ORA-39082: Object type PROCEDURE:"HR"."INSERT_EMP1" created with compilation warnings
Job "SYSTEM"."SYS_IMPORT_SCHEMA_01" completed with 2 error(s) at Thu Jan 8 11:49:29 2026 elapsed 0 00:00:26
SYS@clone> select count(*) from dba_objects where owner = 'HR';
COUNT(*)
----------
39
데이터베이스 복제 2
현재 상태 확인
RMAN> report schema;
using target database control file instead of recovery catalog
Report of database schema for database with db_unique_name ORA19C
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 910 SYSTEM YES /u01/app/oracle/oradata/ORA19C/system01.dbf
3 720 SYSAUX NO /u01/app/oracle/oradata/ORA19C/sysaux01.dbf
4 340 UNDOTBS1 YES /u01/app/oracle/oradata/ORA19C/undotbs01.dbf
7 5 USERS NO /u01/app/oracle/oradata/ORA19C/users01.dbf
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 32 TEMP 32767 /u01/app/oracle/oradata/ORA19C/temp01.dbf
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3 Full 1.26G DISK 00:00:05 08-JAN-26
BP Key: 3 Status: AVAILABLE Compressed: NO Tag: TAG20260108T135050
Piece Name: /u01/app/oracle/fast_recovery_area/ORA19C/backupset/2026_01_08/o1_mf_nnndf_TAG20260108T135050_noyfxc5y_.bkp
List of Datafiles in backup set 3
File LV Type Ckp SCN Ckp Time Abs Fuz SCN Sparse Name
---- -- ---- ---------- --------- ----------- ------ ----
1 Full 2877158 08-JAN-26 NO /u01/app/oracle/oradata/ORA19C/system01.dbf
3 Full 2877158 08-JAN-26 NO /u01/app/oracle/oradata/ORA19C/sysaux01.dbf
4 Full 2877158 08-JAN-26 NO /u01/app/oracle/oradata/ORA19C/undotbs01.dbf
7 Full 2877158 08-JAN-26 NO /u01/app/oracle/oradata/ORA19C/users01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
4 Full 10.20M DISK 00:00:00 08-JAN-26
BP Key: 4 Status: AVAILABLE Compressed: NO Tag: TAG20260108T135058
Piece Name: /u01/app/oracle/fast_recovery_area/ORA19C/autobackup/2026_01_08/o1_mf_s_1222005058_noyfxlbx_.bkp
SPFILE Included: Modification time: 08-JAN-26
SPFILE db_unique_name: ORA19C
Control File Included: Ckp SCN: 2877168 Ckp time: 08-JAN-26
RMAN> list archivelog all;
List of Archived Log Copies for database with db_unique_name ORA19C
=====================================================================
Key Thrd Seq S Low Time
------- ---- ------- - ---------
8 1 32 A 08-JAN-26
Name: /home/oracle/arch2/arch_1_32_1218118200.arc
7 1 32 A 08-JAN-26
Name: /home/oracle/arch1/arch_1_32_1218118200.arc
[oracle@ora19c ~]$ ls arch*
arch1:
arch_1_32_1218118200.arc
arch2:
arch_1_32_1218118200.arc
SYS@ora19c> select sequence#, name, first_change#, to_char(first_time, 'yyyy-mm-dd hh24:mi:ss') first_time, next_change#, to_char(next_time, 'yyyy-mm-dd hh24:mi:ss') next_time
from v$archived_log; 2
SEQUENCE# NAME FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME
---------- -------------------------------------------------- ------------- ------------------- ------------ -------------------
32 /home/oracle/arch1/arch_1_32_1218118200.arc 2867930 2026-01-08 10:19:29 2877197 2026-01-08 13:51:04
32 /home/oracle/arch2/arch_1_32_1218118200.arc 2867930 2026-01-08 10:19:29 2877197 2026-01-08 13:51:04
8 rows selected.
SYS@ora19c> select a.group#, a.sequence#, b.member, a.bytes/1024/1024 mb, a.archived, a.status, a.first_change#, to_char(first_time, 'yyyy-mm-dd hh24:mi:ss') first_time, a.next_change#, to_char(next_time, 'yyyy-mm-dd hh24:mi:ss') next_time
2 from v$log a, v$logfile b
3 where a.group# = b.group#;
GROUP# SEQUENCE# MEMBER MB ARC STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME
---------- ---------- -------------------------------------------------- ---------- --- ---------------- ------------- ------------------- ------------ -------------------
3 31 /u01/app/oracle/oradata/ORA19C/redo03.log 50 YES INACTIVE 2864049 2026-01-08 09:51:23 2867930 2026-01-08 10:19:29
2 33 /u01/app/oracle/oradata/ORA19C/redo02.log 50 NO CURRENT 2877197 2026-01-08 13:51:04 1.8447E+19
1 32 /u01/app/oracle/oradata/ORA19C/redo01.log 50 YES INACTIVE 2867930 2026-01-08 10:19:29 2877197 2026-01-08 13:51:04
clone 디렉터리에 백업 데이터파일, 컨트롤파일, 아카이브파일 복사
[oracle@ora19c clone]$ cp -v /u01/app/oracle/fast_recovery_area/ORA19C/backupset/2026_01_08/o1_mf_nnndf_TAG20260108T135050_noyfxc5y_.bkp .
‘/u01/app/oracle/fast_recovery_area/ORA19C/backupset/2026_01_08/o1_mf_nnndf_TAG20260108T135050_noyfxc5y_.bkp’ -> ‘./o1_mf_nnndf_TAG20260108T135050_noyfxc5y_.bkp’
[oracle@ora19c clone]$ cp -v /u01/app/oracle/fast_recovery_area/ORA19C/autobackup/2026_01_08/o1_mf_s_1222005058_noyfxlbx_.bkp .
‘/u01/app/oracle/fast_recovery_area/ORA19C/autobackup/2026_01_08/o1_mf_s_1222005058_noyfxlbx_.bkp’ -> ‘./o1_mf_s_1222005058_noyfxlbx_.bkp’
[oracle@ora19c clone]$ cp -v /home/oracle/arch1/* .
‘/home/oracle/arch1/arch_1_32_1218118200.arc’ -> ‘./arch_1_32_1218118200.arc’
[oracle@ora19c clone]$ ls
arch_1_32_1218118200.arc o1_mf_nnndf_TAG20260108T135050_noyfxc5y_.bkp o1_mf_s_1222005058_noyfxlbx_.bkp
pfile 생성
- 데이터파일과 로그파일이 생성될 위치를 지정
db_file_name_convert=(old, new)log_file_name_convert=(old,new)
[oracle@ora19c clone]$ vi initclone.ora
[oracle@ora19c clone]$ cat initclone.ora
*.compatible='19.0.0'
*.control_files='/home/oracle/clone/control01.ctl'#Restore Controlfile
*.db_name='clone'
*.log_archive_dest_1='location=/home/oracle/clone/ mandatory'
*.log_archive_format='arch_%t_%s_%r.arc'
*.undo_tablespace='UNDOTBS1'
*.shared_pool_size=300m
db_file_name_convert=(/u01/app/oracle/oradata/ORA19C/,/home/oracle/clone/)
log_file_name_convert=(/u01/app/oracle/oradata/ORA19C/,/home/oracle/clone/)
오라클 환경설정
[oracle@ora19c clone]$ cd
[oracle@ora19c ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/19.3.0/dbhome_1
[oracle@ora19c ~]$ . oraenv
ORACLE_SID = [ora19c] ? clone
ORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/19.3.0/dbhome_1
The Oracle base remains unchanged with value /u01/app/oracle
pfile을 이용해서 clone 데이터베이스를 nomount로 시작
[oracle@ora19c ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Thu Jan 8 14:04:52 2026
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to an idle instance.
SYS@clone> startup pfile=/home/oracle/clone/initclone.ora nomount
ORACLE instance started.
Total System Global Area 385872048 bytes
Fixed Size 8896688 bytes
Variable Size 318767104 bytes
Database Buffers 50331648 bytes
Redo Buffers 7876608 bytes
SYS@clone> select instance_name, status from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
clone STARTED
복제 데이터베이스 생성
SYS@clone> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@ora19c ~]$ rman auxiliary /
Recovery Manager: Release 19.0.0.0.0 - Production on Thu Jan 8 14:07:59 2026
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to auxiliary database: CLONE (not mounted)
RMAN> run {
duplicate target database to 'clone'
pfile='/home/oracle/clone/initclone.ora'
nofilenamecheck
backup location '/home/oracle/clone';
}2> 3> 4> 5> 6>
Starting Duplicate Db at 08-JAN-26
searching for database ID
found backup of database ID 1271306228
contents of Memory Script:
{
sql clone "create spfile from memory";
}
executing Memory Script
sql statement: create spfile from memory
contents of Memory Script:
{
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 385872048 bytes
Fixed Size 8896688 bytes
Variable Size 318767104 bytes
Database Buffers 50331648 bytes
Redo Buffers 7876608 bytes
contents of Memory Script:
{
sql clone "alter system set db_name =
''ORA19C'' comment=
''Modified by RMAN duplicate'' scope=spfile";
sql clone "alter system set db_unique_name =
''clone'' comment=
''Modified by RMAN duplicate'' scope=spfile";
shutdown clone immediate;
startup clone force nomount
restore clone primary controlfile from '/home/oracle/clone/o1_mf_s_1222005058_noyfxlbx_.bkp';
alter clone database mount;
}
executing Memory Script
sql statement: alter system set db_name = ''ORA19C'' comment= ''Modified by RMAN duplicate'' scope=spfile
sql statement: alter system set db_unique_name = ''clone'' comment= ''Modified by RMAN duplicate'' scope=spfile
Oracle instance shut down
Oracle instance started
Total System Global Area 385872048 bytes
Fixed Size 8896688 bytes
Variable Size 318767104 bytes
Database Buffers 50331648 bytes
Redo Buffers 7876608 bytes
Starting restore at 08-JAN-26
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=178 device type=DISK
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/home/oracle/clone/control01.ctl
Finished restore at 08-JAN-26
database mounted
released channel: ORA_AUX_DISK_1
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=178 device type=DISK
contents of Memory Script:
{
set until scn 2877197;
set newname for datafile 1 to
"/home/oracle/clone/system01.dbf";
set newname for datafile 3 to
"/home/oracle/clone/sysaux01.dbf";
set newname for datafile 4 to
"/home/oracle/clone/undotbs01.dbf";
set newname for datafile 7 to
"/home/oracle/clone/users01.dbf";
restore
clone database
;
}
executing Memory Script
executing command: SET until clause
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 08-JAN-26
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /home/oracle/clone/system01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00003 to /home/oracle/clone/sysaux01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00004 to /home/oracle/clone/undotbs01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00007 to /home/oracle/clone/users01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /home/oracle/clone/o1_mf_nnndf_TAG20260108T135050_noyfxc5y_.bkp
channel ORA_AUX_DISK_1: piece handle=/home/oracle/clone/o1_mf_nnndf_TAG20260108T135050_noyfxc5y_.bkp tag=TAG20260108T135050
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
Finished restore at 08-JAN-26
contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script
datafile 1 switched to datafile copy
input datafile copy RECID=5 STAMP=1222006248 file name=/home/oracle/clone/system01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=6 STAMP=1222006248 file name=/home/oracle/clone/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=7 STAMP=1222006248 file name=/home/oracle/clone/undotbs01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=8 STAMP=1222006248 file name=/home/oracle/clone/users01.dbf
contents of Memory Script:
{
set until scn 2877197;
recover
clone database
delete archivelog
;
}
executing Memory Script
executing command: SET until clause
Starting recover at 08-JAN-26
using channel ORA_AUX_DISK_1
starting media recovery
archived log for thread 1 with sequence 32 is already on disk as file /home/oracle/clone/arch_1_32_1218118200.arc
archived log file name=/home/oracle/clone/arch_1_32_1218118200.arc thread=1 sequence=32
media recovery complete, elapsed time: 00:00:00
Finished recover at 08-JAN-26
Oracle instance started
Total System Global Area 385872048 bytes
Fixed Size 8896688 bytes
Variable Size 318767104 bytes
Database Buffers 50331648 bytes
Redo Buffers 7876608 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "CLONE" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 ( '/home/oracle/clone/redo01.log' ) SIZE 50 M REUSE,
GROUP 2 ( '/home/oracle/clone/redo02.log' ) SIZE 50 M REUSE,
GROUP 3 ( '/home/oracle/clone/redo03.log' ) SIZE 50 M REUSE
DATAFILE
'/home/oracle/clone/system01.dbf'
CHARACTER SET AL32UTF8
contents of Memory Script:
{
set newname for tempfile 1 to
"/home/oracle/clone/temp01.dbf";
switch clone tempfile all;
catalog clone datafilecopy "/home/oracle/clone/sysaux01.dbf",
"/home/oracle/clone/undotbs01.dbf",
"/home/oracle/clone/users01.dbf";
switch clone datafile all;
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to /home/oracle/clone/temp01.dbf in control file
cataloged datafile copy
datafile copy file name=/home/oracle/clone/sysaux01.dbf RECID=1 STAMP=1222006261
cataloged datafile copy
datafile copy file name=/home/oracle/clone/undotbs01.dbf RECID=2 STAMP=1222006261
cataloged datafile copy
datafile copy file name=/home/oracle/clone/users01.dbf RECID=3 STAMP=1222006261
datafile 3 switched to datafile copy
input datafile copy RECID=1 STAMP=1222006261 file name=/home/oracle/clone/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=2 STAMP=1222006261 file name=/home/oracle/clone/undotbs01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=3 STAMP=1222006261 file name=/home/oracle/clone/users01.dbf
contents of Memory Script:
{
Alter clone database open resetlogs;
}
executing Memory Script
database opened
Finished Duplicate Db at 08-JAN-26
RMAN> report schema;
Report of database schema for database with db_unique_name CLONE
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 910 SYSTEM *** /home/oracle/clone/system01.dbf
3 720 SYSAUX *** /home/oracle/clone/sysaux01.dbf
4 340 UNDOTBS1 *** /home/oracle/clone/undotbs01.dbf
7 5 USERS *** /home/oracle/clone/users01.dbf
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 32 TEMP 32767 /home/oracle/clone/temp01.dbf
SYS@clone> select instance_name, status from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
clone OPEN
SYS@clone> select checkpoint_change#, scn_to_timestamp(checkpoint_change#) from v$database;
CHECKPOINT_CHANGE# SCN_TO_TIMESTAMP(CHECKPOINT_CHANGE#)
------------------ ---------------------------------------------------------------------------
2877201 08-JAN-26 01.46.55.000000000 PM
SYS@clone> select a.file#, a.creation_change#, to_char(a.creation_time, 'yyyy-mm-dd hh24:mi:ss') createion_time, b.name tbs_name, a.name file_name, a.checkpoint_change#, a.status
from v$datafile a, v$tablespace b
where a.ts# = b.ts#; 2 3
FILE# CREATION_CHANGE# CREATEION_TIME TBS_NAME FILE_NAME CHECKPOINT_CHANGE# STATUS
---------- ---------------- ------------------- ------------------------------ -------------------------------------------------- ------------------ -------
1 9 2019-04-17 00:56:09 SYSTEM /home/oracle/clone/system01.dbf 2877201 SYSTEM
3 5480 2019-04-17 00:56:21 SYSAUX /home/oracle/clone/sysaux01.dbf 2877201 ONLINE
4 1920446 2019-04-17 02:11:02 UNDOTBS1 /home/oracle/clone/undotbs01.dbf 2877201 ONLINE
7 32876 2019-04-17 00:57:08 USERS /home/oracle/clone/users01.dbf 2877201 ONLINE
SYS@clone> select sequence#, name, first_change#, to_char(first_time, 'yyyy-mm-dd hh24:mi:ss') first_time, next_change#, to_char(next_time, 'yyyy-mm-dd hh24:mi:ss') next_time
from v$archived_log; 2
no rows selected
SYS@clone> select a.group#, a.sequence#, b.member, a.bytes/1024/1024 mb, a.archived, a.status, a.first_change#, to_char(first_time, 'yyyy-mm-dd hh24:mi:ss') first_time, a.next_change#, to_char(next_time, 'yyyy-mm-dd hh24:mi:ss') next_time
from v$log a, v$logfile b
where a.group# = b.group#; 2 3
GROUP# SEQUENCE# MEMBER MB ARC STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME
---------- ---------- -------------------------------------------------- ---------- --- ---------------- ------------- ------------------- ------------ -------------------
3 0 /home/oracle/clone/redo03.log 50 YES UNUSED 0 0
2 0 /home/oracle/clone/redo02.log 50 YES UNUSED 0 0
1 1 /home/oracle/clone/redo01.log 50 NO CURRENT 2877198 2026-01-08 14:11:02 1.8447E+19
[oracle@ora19c ~]$ rman target /
Recovery Manager: Release 19.0.0.0.0 - Production on Thu Jan 8 14:19:05 2026
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to target database: CLONE (DBID=1420821941)
RMAN> report schema;
using target database control file instead of recovery catalog
Report of database schema for database with db_unique_name CLONE
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 910 SYSTEM YES /home/oracle/clone/system01.dbf
3 720 SYSAUX NO /home/oracle/clone/sysaux01.dbf
4 340 UNDOTBS1 YES /home/oracle/clone/undotbs01.dbf
7 5 USERS NO /home/oracle/clone/users01.dbf
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 32 TEMP 32767 /home/oracle/clone/temp01.dbf
RMAN> report need backup;
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
Report of files with less than 1 redundant backups
File #bkps Name
---- ----- -----------------------------------------------------
1 0 /home/oracle/clone/system01.dbf
3 0 /home/oracle/clone/sysaux01.dbf
4 0 /home/oracle/clone/undotbs01.dbf
7 0 /home/oracle/clone/users01.dbf
rman 설정
rman 백업 파일이 생성되는 위치를 수동으로 설정
SYS@clone> show parameter db_recovery_file_dest
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string
db_recovery_file_dest_size big integer 0
[oracle@ora19c ~]$ cd backup
[oracle@ora19c backup]$ ls
arch noarch
[oracle@ora19c backup]$ mkdir -p rman/clone
[oracle@ora19c backup]$ cd rman/clone
[oracle@ora19c clone]$ pwd
/home/oracle/backup/rman/clone
RMAN> show all;
RMAN configuration parameters for database with db_unique_name CLONE are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE RMAN OUTPUT TO KEEP FOR 7 DAYS; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/19.3.0/dbhome_1/dbs/snapcf_clone.f'; # default
# 수동 채널 설정
RMAN> configure channel device type disk format '/home/oracle/backup/rman/clone/%U_%T';
new RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/home/oracle/backup/rman/clone/%U_%T';
new RMAN configuration parameters are successfully stored
# 수동 채널 설정 삭제
RMAN> configure channel device type disk clear;
old RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/home/oracle/backup/rman/clone/%U_%T';
old RMAN configuration parameters are successfully deleted
%U:%u_%p_%c%u: unique, 8글자의 고유한 문자로 구성%p: backup piece number%c: 숫자
%T: YYYYMMDD (날짜)
자동 컨트롤 파일 백업시 위치를 수동으로 설정
# 자동 컨트롤 파일 백업시 위치를 수동으로 설정
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/home/oracle/backup/rman/clone/%F';
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/home/oracle/backup/rman/clone/%F';
new RMAN configuration parameters are successfully stored
# 자동 컨트롤 파일 백업시 위치를 수동으로 설정 삭제
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK CLEAR;
old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/home/oracle/backup/rman/clone/%F';
RMAN configuration parameters are successfully reset to default value
RMAN> show all;
RMAN configuration parameters for database with db_unique_name CLONE are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON; # default
**CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/home/oracle/backup/rman/clone/%F';**
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
**CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/home/oracle/backup/rman/clone/%U_%T';**
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE RMAN OUTPUT TO KEEP FOR 7 DAYS; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/19.3.0/dbhome_1/dbs/snapcf_clone.f'; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/19.3.0/dbhome_1/dbs/snapcf_clone.f'; # default- 스냅샷 생성 위치
- 기본은 $ORACLE_HOME/dbs
특정한 백업셋 삭제
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1 Full 10.48M DISK 00:00:00 08-JAN-26
BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20260108T141107
Piece Name: /u01/app/oracle/product/19.3.0/dbhome_1/dbs/c-1420821941-20260108-00
Control File Included: Ckp SCN: 2877336 Ckp time: 08-JAN-26
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
2 Full 1.26G DISK 00:00:05 08-JAN-26
BP Key: 2 Status: AVAILABLE Compressed: NO Tag: TAG20260108T143659
Piece Name: /home/oracle/backup/rman/clone/024dcn0c_1_1_20260108
List of Datafiles in backup set 2
File LV Type Ckp SCN Ckp Time Abs Fuz SCN Sparse Name
---- -- ---- ---------- --------- ----------- ------ ----
1 Full 2881239 08-JAN-26 NO /home/oracle/clone/system01.dbf
3 Full 2881239 08-JAN-26 NO /home/oracle/clone/sysaux01.dbf
4 Full 2881239 08-JAN-26 NO /home/oracle/clone/undotbs01.dbf
7 Full 2881239 08-JAN-26 NO /home/oracle/clone/users01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3 Full 10.48M DISK 00:00:00 08-JAN-26
BP Key: 3 Status: AVAILABLE Compressed: NO Tag: TAG20260108T143707
Piece Name: /home/oracle/backup/rman/clone/c-1420821941-20260108-01
Control File Included: Ckp SCN: 2881250 Ckp time: 08-JAN-26
# 1번 백업셋 삭제
RMAN> delete backupset 1;
using channel ORA_DISK_1
List of Backup Pieces
BP Key BS Key Pc# Cp# Status Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
1 1 1 1 AVAILABLE DISK /u01/app/oracle/product/19.3.0/dbhome_1/dbs/c-1420821941-20260108-00
Do you really want to delete the above objects (enter YES or NO)? yes
deleted backup piece
backup piece handle=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/c-1420821941-20260108-00 RECID=1 STAMP=1222006267
Deleted 1 objects
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
2 Full 1.26G DISK 00:00:05 08-JAN-26
BP Key: 2 Status: AVAILABLE Compressed: NO Tag: TAG20260108T143659
Piece Name: /home/oracle/backup/rman/clone/024dcn0c_1_1_20260108
List of Datafiles in backup set 2
File LV Type Ckp SCN Ckp Time Abs Fuz SCN Sparse Name
---- -- ---- ---------- --------- ----------- ------ ----
1 Full 2881239 08-JAN-26 NO /home/oracle/clone/system01.dbf
3 Full 2881239 08-JAN-26 NO /home/oracle/clone/sysaux01.dbf
4 Full 2881239 08-JAN-26 NO /home/oracle/clone/undotbs01.dbf
7 Full 2881239 08-JAN-26 NO /home/oracle/clone/users01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3 Full 10.48M DISK 00:00:00 08-JAN-26
BP Key: 3 Status: AVAILABLE Compressed: NO Tag: TAG20260108T143707
Piece Name: /home/oracle/backup/rman/clone/c-1420821941-20260108-01
Control File Included: Ckp SCN: 2881250 Ckp time: 08-JAN-26
압축해서 백업
RMAN> backup as compressed backupset database;
Starting backup at 08-JAN-26
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/home/oracle/clone/system01.dbf
input datafile file number=00003 name=/home/oracle/clone/sysaux01.dbf
input datafile file number=00004 name=/home/oracle/clone/undotbs01.dbf
input datafile file number=00007 name=/home/oracle/clone/users01.dbf
channel ORA_DISK_1: starting piece 1 at 08-JAN-26
channel ORA_DISK_1: finished piece 1 at 08-JAN-26
piece handle=/home/oracle/backup/rman/clone/064dconq_1_1_20260108 tag=TAG20260108T150634 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
Finished backup at 08-JAN-26
Starting Control File Autobackup at 08-JAN-26
piece handle=/home/oracle/backup/rman/clone/c-1420821941-20260108-03 comment=NONE
Finished Control File Autobackup at 08-JAN-26
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3 Full 10.48M DISK 00:00:00 08-JAN-26
BP Key: 3 Status: AVAILABLE Compressed: NO Tag: TAG20260108T143707
Piece Name: /home/oracle/backup/rman/clone/c-1420821941-20260108-01
Control File Included: Ckp SCN: 2881250 Ckp time: 08-JAN-26
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
4 Full 1.26G DISK 00:00:06 08-JAN-26
BP Key: 4 Status: AVAILABLE Compressed: NO Tag: TAG20260108T150510
Piece Name: /home/oracle/backup/rman/clone/044dcol6_1_1_20260108
List of Datafiles in backup set 4
File LV Type Ckp SCN Ckp Time Abs Fuz SCN Sparse Name
---- -- ---- ---------- --------- ----------- ------ ----
1 Full 2882780 08-JAN-26 NO /home/oracle/clone/system01.dbf
3 Full 2882780 08-JAN-26 NO /home/oracle/clone/sysaux01.dbf
4 Full 2882780 08-JAN-26 NO /home/oracle/clone/undotbs01.dbf
7 Full 2882780 08-JAN-26 NO /home/oracle/clone/users01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
5 Full 10.48M DISK 00:00:01 08-JAN-26
BP Key: 5 Status: AVAILABLE Compressed: NO Tag: TAG20260108T150517
Piece Name: /home/oracle/backup/rman/clone/c-1420821941-20260108-02
Control File Included: Ckp SCN: 2882791 Ckp time: 08-JAN-26
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
6 Full 310.58M DISK 00:00:33 08-JAN-26
BP Key: 6 Status: AVAILABLE Compressed: YES Tag: TAG20260108T150634
Piece Name: /home/oracle/backup/rman/clone/064dconq_1_1_20260108
List of Datafiles in backup set 6
File LV Type Ckp SCN Ckp Time Abs Fuz SCN Sparse Name
---- -- ---- ---------- --------- ----------- ------ ----
1 Full 2882891 08-JAN-26 NO /home/oracle/clone/system01.dbf
3 Full 2882891 08-JAN-26 NO /home/oracle/clone/sysaux01.dbf
4 Full 2882891 08-JAN-26 NO /home/oracle/clone/undotbs01.dbf
7 Full 2882891 08-JAN-26 NO /home/oracle/clone/users01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
7 Full 10.48M DISK 00:00:00 08-JAN-26
BP Key: 7 Status: AVAILABLE Compressed: NO Tag: TAG20260108T150710
Piece Name: /home/oracle/backup/rman/clone/c-1420821941-20260108-03
Control File Included: Ckp SCN: 2882911 Ckp time: 08-JAN-26
- 1.26G → 310.58M 백업 용량이 줄음
- 백업 시간은 오래 걸림
필요한 테이블스페이스만 가지도록 데이터베이스 복제
테이블스페이스 생성
SYS@ora19c> select a.file#, a.creation_change#, to_char(a.creation_time, 'yyyy-mm-dd hh24:mi:ss') creation_time, b.name tbs_name, a.name file_name, a.checkpoint_change#, a.status
from v$datafile a, v$tablespace b
where a.ts# = b.ts#; 2 3
FILE# CREATION_CHANGE# CREATION_TIME TBS_NAME FILE_NAME CHECKPOINT_CHANGE# STATUS
---------- ---------------- ------------------- ------------------------------ -------------------------------------------------- ------------------ -------
3 5480 2019-04-17 00:56:21 SYSAUX /u01/app/oracle/oradata/ORA19C/sysaux01.dbf 2862425 ONLINE
1 9 2019-04-17 00:56:09 SYSTEM /u01/app/oracle/oradata/ORA19C/system01.dbf 2862425 SYSTEM
4 1920446 2019-04-17 02:11:02 UNDOTBS1 /u01/app/oracle/oradata/ORA19C/undotbs01.dbf 2862425 ONLINE
7 32876 2019-04-17 00:57:08 USERS /u01/app/oracle/oradata/ORA19C/users01.dbf 2862425 ONLINE
SYS@ora19c> create tablespace insa_tbs datafile '/u01/app/oracle/oradata/ORA19C/insa_tbs01.dbf' size 10m;
Tablespace created.
SYS@ora19c> select a.file#, a.creation_change#, to_char(a.creation_time, 'yyyy-mm-dd hh24:mi:ss') creation_time, b.name tbs_name, a.name file_name, a.checkpoint_change#, a.status
from v$datafile a, v$tablespace b
where a.ts# = b.ts#; 2 3
FILE# CREATION_CHANGE# CREATION_TIME TBS_NAME FILE_NAME CHECKPOINT_CHANGE# STATUS
---------- ---------------- ------------------- ------------------------------ -------------------------------------------------- ------------------ -------
3 5480 2019-04-17 00:56:21 SYSAUX /u01/app/oracle/oradata/ORA19C/sysaux01.dbf 2862425 ONLINE
1 9 2019-04-17 00:56:09 SYSTEM /u01/app/oracle/oradata/ORA19C/system01.dbf 2862425 SYSTEM
4 1920446 2019-04-17 02:11:02 UNDOTBS1 /u01/app/oracle/oradata/ORA19C/undotbs01.dbf 2862425 ONLINE
7 32876 2019-04-17 00:57:08 USERS /u01/app/oracle/oradata/ORA19C/users01.dbf 2862425 ONLINE
5 2864018 2026-01-08 15:16:45 INSA_TBS /u01/app/oracle/oradata/ORA19C/insa_tbs01.dbf 2864019 ONLINE
테이블 생성
SYS@ora19c> create table hr.insa tablespace insa_tbs as select * from hr.employees;
Table created.
SYS@ora19c> select count(*) from hr.insa;
COUNT(*)
----------
107
백업
SYS@ora19c> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@ora19c ~]$ rman target /
Recovery Manager: Release 19.0.0.0.0 - Production on Thu Jan 8 15:27:34 2026
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORA19C (DBID=1271306228)
RMAN> backup as compressed backupset database;
Starting backup at 08-JAN-26
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=36 device type=DISK
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/ORA19C/system01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/ORA19C/sysaux01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/ORA19C/undotbs01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/ORA19C/insa_tbs01.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/ORA19C/users01.dbf
channel ORA_DISK_1: starting piece 1 at 08-JAN-26
channel ORA_DISK_1: finished piece 1 at 08-JAN-26
piece handle=/u01/app/oracle/fast_recovery_area/ORA19C/backupset/2026_01_08/o1_mf_nnndf_TAG20260108T152824_noymn9s2_.bkp tag=TAG20260108T152824 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
Finished backup at 08-JAN-26
Starting Control File and SPFILE Autobackup at 08-JAN-26
piece handle=/u01/app/oracle/fast_recovery_area/ORA19C/autobackup/2026_01_08/o1_mf_s_1222010950_noymopcs_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 08-JAN-26
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1 Full 10.20M DISK 00:00:00 08-JAN-26
BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20260108T152445
Piece Name: /u01/app/oracle/fast_recovery_area/ORA19C/autobackup/2026_01_08/o1_mf_s_1222010685_noymffdk_.bkp
SPFILE Included: Modification time: 08-JAN-26
SPFILE db_unique_name: ORA19C
Control File Included: Ckp SCN: 2864230 Ckp time: 08-JAN-26
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
2 Full 313.86M DISK 00:00:35 08-JAN-26
BP Key: 2 Status: AVAILABLE Compressed: YES Tag: TAG20260108T152824
Piece Name: /u01/app/oracle/fast_recovery_area/ORA19C/backupset/2026_01_08/o1_mf_nnndf_TAG20260108T152824_noymn9s2_.bkp
List of Datafiles in backup set 2
File LV Type Ckp SCN Ckp Time Abs Fuz SCN Sparse Name
---- -- ---- ---------- --------- ----------- ------ ----
1 Full 2865696 08-JAN-26 NO /u01/app/oracle/oradata/ORA19C/system01.dbf
3 Full 2865696 08-JAN-26 NO /u01/app/oracle/oradata/ORA19C/sysaux01.dbf
4 Full 2865696 08-JAN-26 NO /u01/app/oracle/oradata/ORA19C/undotbs01.dbf
5 Full 2865696 08-JAN-26 NO /u01/app/oracle/oradata/ORA19C/insa_tbs01.dbf
7 Full 2865696 08-JAN-26 NO /u01/app/oracle/oradata/ORA19C/users01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3 Full 10.20M DISK 00:00:00 08-JAN-26
BP Key: 3 Status: AVAILABLE Compressed: NO Tag: TAG20260108T152910
Piece Name: /u01/app/oracle/fast_recovery_area/ORA19C/autobackup/2026_01_08/o1_mf_s_1222010950_noymopcs_.bkp
SPFILE Included: Modification time: 08-JAN-26
SPFILE db_unique_name: ORA19C
Control File Included: Ckp SCN: 2865722 Ckp time: 08-JAN-26
필요 없는 파일 삭제
RMAN> report obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
Report of obsolete backups and copies
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Archive Log 2 08-JAN-26 /home/oracle/arch2/arch_1_29_1218118200.arc
Archive Log 1 08-JAN-26 /home/oracle/arch1/arch_1_29_1218118200.arc
Backup Set 1 08-JAN-26
Backup Piece 1 08-JAN-26 /u01/app/oracle/fast_recovery_area/ORA19C/autobackup/2026_01_08/o1_mf_s_1222010685_noymffdk_.bkp
RMAN> delete obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
using channel ORA_DISK_1
Deleting the following obsolete backups and copies:
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Archive Log 2 08-JAN-26 /home/oracle/arch2/arch_1_29_1218118200.arc
Archive Log 1 08-JAN-26 /home/oracle/arch1/arch_1_29_1218118200.arc
Backup Set 1 08-JAN-26
Backup Piece 1 08-JAN-26 /u01/app/oracle/fast_recovery_area/ORA19C/autobackup/2026_01_08/o1_mf_s_1222010685_noymffdk_.bkp
Do you really want to delete the above objects (enter YES or NO)? yes
deleted archived log
archived log file name=/home/oracle/arch2/arch_1_29_1218118200.arc RECID=2 STAMP=1222010092
deleted archived log
archived log file name=/home/oracle/arch1/arch_1_29_1218118200.arc RECID=1 STAMP=1222010092
deleted backup piece
backup piece handle=/u01/app/oracle/fast_recovery_area/ORA19C/autobackup/2026_01_08/o1_mf_s_1222010685_noymffdk_.bkp RECID=1 STAMP=1222010685
Deleted 3 objects
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
2 Full 313.86M DISK 00:00:35 08-JAN-26
BP Key: 2 Status: AVAILABLE Compressed: YES Tag: TAG20260108T152824
Piece Name: /u01/app/oracle/fast_recovery_area/ORA19C/backupset/2026_01_08/o1_mf_nnndf_TAG20260108T152824_noymn9s2_.bkp
List of Datafiles in backup set 2
File LV Type Ckp SCN Ckp Time Abs Fuz SCN Sparse Name
---- -- ---- ---------- --------- ----------- ------ ----
1 Full 2865696 08-JAN-26 NO /u01/app/oracle/oradata/ORA19C/system01.dbf
3 Full 2865696 08-JAN-26 NO /u01/app/oracle/oradata/ORA19C/sysaux01.dbf
4 Full 2865696 08-JAN-26 NO /u01/app/oracle/oradata/ORA19C/undotbs01.dbf
5 Full 2865696 08-JAN-26 NO /u01/app/oracle/oradata/ORA19C/insa_tbs01.dbf
7 Full 2865696 08-JAN-26 NO /u01/app/oracle/oradata/ORA19C/users01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3 Full 10.20M DISK 00:00:00 08-JAN-26
BP Key: 3 Status: AVAILABLE Compressed: NO Tag: TAG20260108T152910
Piece Name: /u01/app/oracle/fast_recovery_area/ORA19C/autobackup/2026_01_08/o1_mf_s_1222010950_noymopcs_.bkp
SPFILE Included: Modification time: 08-JAN-26
SPFILE db_unique_name: ORA19C
Control File Included: Ckp SCN: 2865722 Ckp time: 08-JAN-26
current redo log 아카이빙
RMAN> alter system archive log current;
Statement processed
RMAN> list archivelog all;
List of Archived Log Copies for database with db_unique_name ORA19C
=====================================================================
Key Thrd Seq S Low Time
------- ---- ------- - ---------
4 1 30 A 08-JAN-26
Name: /home/oracle/arch2/arch_1_30_1218118200.arc
3 1 30 A 08-JAN-26
Name: /home/oracle/arch1/arch_1_30_1218118200.arc
SYS@ora19c> select sequence#, name, first_change#, to_char(first_time, 'yyyy-mm-dd hh24:mi:ss') first_time, next_change#, to_char(next_time, 'yyyy-mm-dd hh24:mi:ss') next_time
from v$archived_log; 2
SEQUENCE# NAME FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME
---------- -------------------------------------------------- ------------- ------------------- ------------ -------------------
29 2850110 2025-12-23 10:12:10 2863827 2026-01-08 15:14:51
29 2850110 2025-12-23 10:12:10 2863827 2026-01-08 15:14:51
30 /home/oracle/arch1/arch_1_30_1218118200.arc 2863827 2026-01-08 15:14:51 2866931 2026-01-08 15:32:23
30 /home/oracle/arch2/arch_1_30_1218118200.arc 2863827 2026-01-08 15:14:51 2866931 2026-01-08 15:32:23
SYS@ora19c> select a.group#, a.sequence#, b.member, a.bytes/1024/1024 mb, a.archived, a.status, a.first_change#, to_char(first_time, 'yyyy-mm-dd hh24:mi:ss') first_time, a.next_change#, to_char(next_time, 'yyyy-mm-dd hh24:mi:ss') next_time
from v$log a, v$logfile b
where a.group# = b.group#; 2 3
GROUP# SEQUENCE# MEMBER MB ARC STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME
---------- ---------- -------------------------------------------------- ---------- --- ---------------- ------------- ------------------- ------------ -------------------
3 31 /u01/app/oracle/oradata/ORA19C/redo03.log 50 NO CURRENT 2866931 2026-01-08 15:32:23 1.8447E+19
2 30 /u01/app/oracle/oradata/ORA19C/redo02.log 50 YES ACTIVE 2863827 2026-01-08 15:14:51 2866931 2026-01-08 15:32:23
1 29 /u01/app/oracle/oradata/ORA19C/redo01.log 50 YES INACTIVE 2850110 2025-12-23 10:12:10 2863827 2026-01-08 15:14:51
SYS@ora19c> ! ls arch*
arch1:
arch_1_30_1218118200.arc arch_1_32_1218118200.arc
arch2:
arch_1_30_1218118200.arc arch_1_32_1218118200.arc
장애 유발
SYS@ora19c> select systimestamp from dual;
SYSTIMESTAMP
---------------------------------------------------------------------------
08-JAN-26 03.35.28.611721 PM +09:00
SYS@ora19c> drop table hr.insa purge;
Table dropped.
current redo log file 아카이빙
SYS@ora19c> select a.group#, a.sequence#, b.member, a.bytes/1024/1024 mb, a.archived, a.status, a.first_change#, to_char(first_time, 'yyyy-mm-dd hh24:mi:ss') first_time, a.next_change#, to_char(next_time, 'yyyy-mm-dd hh24:mi:ss') next_time
from v$log a, v$logfile b
where a.group# = b.group#; 2 3
GROUP# SEQUENCE# MEMBER MB ARC STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME
---------- ---------- -------------------------------------------------- ---------- --- ---------------- ------------- ------------------- ------------ -------------------
3 31 /u01/app/oracle/oradata/ORA19C/redo03.log 50 NO CURRENT 2866931 2026-01-08 15:32:23 1.8447E+19
2 30 /u01/app/oracle/oradata/ORA19C/redo02.log 50 YES INACTIVE 2863827 2026-01-08 15:14:51 2866931 2026-01-08 15:32:23
1 29 /u01/app/oracle/oradata/ORA19C/redo01.log 50 YES INACTIVE 2850110 2025-12-23 10:12:10 2863827 2026-01-08 15:14:51
SYS@ora19c> alter system archive log current;
System altered.
SYS@ora19c> select a.group#, a.sequence#, b.member, a.bytes/1024/1024 mb, a.archived, a.status, a.first_change#, to_char(first_time, 'yyyy-mm-dd hh24:mi:ss') first_time, a.next_change#, to_char(next_time, 'yyyy-mm-dd hh24:mi:ss') next_time
from v$log a, v$logfile b
where a.group# = b.group#; 2 3
GROUP# SEQUENCE# MEMBER MB ARC STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME
---------- ---------- -------------------------------------------------- ---------- --- ---------------- ------------- ------------------- ------------ -------------------
3 31 /u01/app/oracle/oradata/ORA19C/redo03.log 50 YES ACTIVE 2866931 2026-01-08 15:32:23 2867090 2026-01-08 15:36:17
2 30 /u01/app/oracle/oradata/ORA19C/redo02.log 50 YES INACTIVE 2863827 2026-01-08 15:14:51 2866931 2026-01-08 15:32:23
1 32 /u01/app/oracle/oradata/ORA19C/redo01.log 50 NO CURRENT 2867090 2026-01-08 15:36:17 1.8447E+19
clone 데이터베이스 생성
1. 백업 데이터파일, 컨트롤파일, 아카이브파일 복사
- 데이터파일 : /u01/app/oracle/fast_recovery_area/ORA19C/backupset/2026_01_08/o1_mf_nnndf_TAG20260108T152824_noymn9s2_.bkp
- 컨트롤파일 : /u01/app/oracle/fast_recovery_area/ORA19C/autobackup/2026_01_08/o1_mf_s_1222010950_noymopcs_.bkp
- 아카이브파일: /home/oracle/arch1/*
[oracle@ora19c ~]$ cd clone
[oracle@ora19c clone]$ cp -v /u01/app/oracle/fast_recovery_area/ORA19C/backupset/2026_01_08/o1_mf_nnndf_TAG20260108T152824_noymn9s2_.bkp .
‘/u01/app/oracle/fast_recovery_area/ORA19C/backupset/2026_01_08/o1_mf_nnndf_TAG20260108T152824_noymn9s2_.bkp’ -> ‘./o1_mf_nnndf_TAG20260108T152824_noymn9s2_.bkp’
[oracle@ora19c clone]$ cp -v /u01/app/oracle/fast_recovery_area/ORA19C/autobackup/2026_01_08/o1_mf_s_1222010950_noymopcs_.bkp .
‘/u01/app/oracle/fast_recovery_area/ORA19C/autobackup/2026_01_08/o1_mf_s_1222010950_noymopcs_.bkp’ -> ‘./o1_mf_s_1222010950_noymopcs_.bkp’
[oracle@ora19c clone]$ cp -v /home/oracle/arch1/* .
‘/home/oracle/arch1/arch_1_30_1218118200.arc’ -> ‘./arch_1_30_1218118200.arc’
‘/home/oracle/arch1/arch_1_31_1218118200.arc’ -> ‘./arch_1_31_1218118200.arc’
‘/home/oracle/arch1/arch_1_32_1218118200.arc’ -> ‘./arch_1_32_1218118200.arc’
[oracle@ora19c clone]$ ls
arch_1_30_1218118200.arc arch_1_32_1218118200.arc o1_mf_s_1222010950_noymopcs_.bkp
arch_1_31_1218118200.arc o1_mf_nnndf_TAG20260108T152824_noymn9s2_.bkp
2. pfile 생성
[oracle@ora19c clone]$ vi initclone.ora
[oracle@ora19c clone]$ cat initclone.ora
*.compatible='19.0.0'
*.control_files='/home/oracle/clone/control01.ctl'#Restore Controlfile
*.db_name='clone'
*.log_archive_dest_1='location=/home/oracle/clone/ mandatory'
*.log_archive_format='arch_%t_%s_%r.arc'
*.undo_tablespace='UNDOTBS1'
*.shared_pool_size=300m
db_file_name_convert=(/u01/app/oracle/oradata/ORA19C/,/home/oracle/clone/)
log_file_name_convert=(/u01/app/oracle/oradata/ORA19C/,/home/oracle/clone/)
3. 오라클 환경설정
[oracle@ora19c clone]$ cd
[oracle@ora19c ~]$ . oraenv
ORACLE_SID = [ora19c] ? clone
ORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/19.3.0/dbhome_1
The Oracle base remains unchanged with value /u01/app/oracle
4. nomount
[oracle@ora19c ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Thu Jan 8 15:44:00 2026
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to an idle instance.
SYS@clone> startup pfile=/home/oracle/clone/initclone.ora nomount
ORACLE instance started.
Total System Global Area 385872048 bytes
Fixed Size 8896688 bytes
Variable Size 318767104 bytes
Database Buffers 50331648 bytes
Redo Buffers 7876608 bytes
SYS@clone> select instance_name, status from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
clone STARTED
5. 목표 시간을 기준으로 복제 데이터베이스 생성(08-JAN-26 03.35.28.611721 PM +09:00)
SYS@clone> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@ora19c ~]$ rman auxiliary /
Recovery Manager: Release 19.0.0.0.0 - Production on Thu Jan 8 15:44:59 2026
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to auxiliary database: CLONE (not mounted)
RMAN> run {
duplicate target database to 'clone'
tablespace insa_tbs
# 또는 skip tablespace users
pfile='/home/oracle/clone/initclone.ora'
nofilenamecheck
backup location '/home/oracle/clone'
until time "to_date('2026-01-08 15:35:28','yyyy-mm-dd hh24:mi:ss')";
}
...
RMAN> report schema;
Report of database schema for database with db_unique_name CLONE
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 910 SYSTEM *** /home/oracle/clone/system01.dbf
3 720 SYSAUX *** /home/oracle/clone/sysaux01.dbf
4 340 UNDOTBS1 *** /home/oracle/clone/undotbs01.dbf
5 10 INSA_TBS *** /home/oracle/clone/insa_tbs01.dbf
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 32 TEMP 32767 /home/oracle/clone/temp01.dbf
RMAN> select count(*) from hr.insa;
COUNT(*)
----------
107
image copy backup
- 백업 대상 파일을 1:1로 받는 백업을 의미
RMAN> report schema;
using target database control file instead of recovery catalog
Report of database schema for database with db_unique_name ORA19C
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 910 SYSTEM YES /u01/app/oracle/oradata/ORA19C/system01.dbf
3 720 SYSAUX NO /u01/app/oracle/oradata/ORA19C/sysaux01.dbf
4 340 UNDOTBS1 YES /u01/app/oracle/oradata/ORA19C/undotbs01.dbf
7 5 USERS NO /u01/app/oracle/oradata/ORA19C/users01.dbf
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 32 TEMP 32767 /u01/app/oracle/oradata/ORA19C/temp01.dbf
backup as copy database
데이터파일 image copy 백업
RMAN> backup as copy database;
Starting backup at 08-JAN-26
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=35 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u01/app/oracle/oradata/ORA19C/system01.dbf
output file name=/u01/app/oracle/fast_recovery_area/ORA19C/datafile/o1_mf_system_noyq3ods_.dbf tag=TAG20260108T162749 RECID=1 STAMP=1222014472
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/u01/app/oracle/oradata/ORA19C/sysaux01.dbf
output file name=/u01/app/oracle/fast_recovery_area/ORA19C/datafile/o1_mf_sysaux_noyq3wk8_.dbf tag=TAG20260108T162749 RECID=2 STAMP=1222014479
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/u01/app/oracle/oradata/ORA19C/undotbs01.dbf
output file name=/u01/app/oracle/fast_recovery_area/ORA19C/datafile/o1_mf_undotbs1_noyq3zmv_.dbf tag=TAG20260108T162749 RECID=3 STAMP=1222014481
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
input datafile file number=00007 name=/u01/app/oracle/oradata/ORA19C/users01.dbf
output file name=/u01/app/oracle/fast_recovery_area/ORA19C/datafile/o1_mf_users_noyq42r5_.dbf tag=TAG20260108T162749 RECID=4 STAMP=1222014482
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 08-JAN-26
Starting Control File and SPFILE Autobackup at 08-JAN-26
piece handle=/u01/app/oracle/fast_recovery_area/ORA19C/autobackup/2026_01_08/o1_mf_s_1222014483_noyq442x_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 08-JAN-26
컨트롤파일 image copy 백업
RMAN> backup as copy current controlfile;
Starting backup at 08-JAN-26
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=/u01/app/oracle/fast_recovery_area/ORA19C/controlfile/o1_mf_TAG20260108T162858_noyq5tww_.ctl tag=TAG20260108T162858 RECID=5 STAMP=1222014539
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 08-JAN-26
Starting Control File and SPFILE Autobackup at 08-JAN-26
piece handle=/u01/app/oracle/fast_recovery_area/ORA19C/autobackup/2026_01_08/o1_mf_s_1222014540_noyq5w30_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 08-JAN-26
list copy : image copy 백업 조회
RMAN> list copy;
List of Datafile Copies
=======================
Key File S Completion Time Ckp SCN Ckp Time Sparse
------- ---- - --------------- ---------- --------------- ------
1 1 A 08-JAN-26 2864132 08-JAN-26 NO
Name: /u01/app/oracle/fast_recovery_area/ORA19C/datafile/o1_mf_system_noyq3ods_.dbf
Tag: TAG20260108T162749
2 3 A 08-JAN-26 2864136 08-JAN-26 NO
Name: /u01/app/oracle/fast_recovery_area/ORA19C/datafile/o1_mf_sysaux_noyq3wk8_.dbf
Tag: TAG20260108T162749
3 4 A 08-JAN-26 2864138 08-JAN-26 NO
Name: /u01/app/oracle/fast_recovery_area/ORA19C/datafile/o1_mf_undotbs1_noyq3zmv_.dbf
Tag: TAG20260108T162749
4 7 A 08-JAN-26 2864140 08-JAN-26 NO
Name: /u01/app/oracle/fast_recovery_area/ORA19C/datafile/o1_mf_users_noyq42r5_.dbf
Tag: TAG20260108T162749
List of Control File Copies
===========================
Key S Completion Time Ckp SCN Ckp Time
------- - --------------- ---------- ---------------
5 A 08-JAN-26 2864190 08-JAN-26
Name: /u01/app/oracle/fast_recovery_area/ORA19C/controlfile/o1_mf_TAG20260108T162858_noyq5tww_.ctl
Tag: TAG20260108T162858
List of Archived Log Copies for database with db_unique_name ORA19C
=====================================================================
Key Thrd Seq S Low Time
------- ---- ------- - ---------
2 1 29 A 23-DEC-25
Name: /home/oracle/arch2/arch_1_29_1218118200.arc
1 1 29 A 23-DEC-25
Name: /home/oracle/arch1/arch_1_29_1218118200.arc
특정 image copy 조회
# 데이터파일만 조회
RMAN> list copy of database;
List of Datafile Copies
=======================
Key File S Completion Time Ckp SCN Ckp Time Sparse
------- ---- - --------------- ---------- --------------- ------
1 1 A 08-JAN-26 2864132 08-JAN-26 NO
Name: /u01/app/oracle/fast_recovery_area/ORA19C/datafile/o1_mf_system_noyq3ods_.dbf
Tag: TAG20260108T162749
2 3 A 08-JAN-26 2864136 08-JAN-26 NO
Name: /u01/app/oracle/fast_recovery_area/ORA19C/datafile/o1_mf_sysaux_noyq3wk8_.dbf
Tag: TAG20260108T162749
3 4 A 08-JAN-26 2864138 08-JAN-26 NO
Name: /u01/app/oracle/fast_recovery_area/ORA19C/datafile/o1_mf_undotbs1_noyq3zmv_.dbf
Tag: TAG20260108T162749
4 7 A 08-JAN-26 2864140 08-JAN-26 NO
Name: /u01/app/oracle/fast_recovery_area/ORA19C/datafile/o1_mf_users_noyq42r5_.dbf
Tag: TAG20260108T162749
# 특정 테이블스페이스만
RMAN> list copy of tablespace system;
List of Datafile Copies
=======================
Key File S Completion Time Ckp SCN Ckp Time Sparse
------- ---- - --------------- ---------- --------------- ------
1 1 A 08-JAN-26 2864132 08-JAN-26 NO
Name: /u01/app/oracle/fast_recovery_area/ORA19C/datafile/o1_mf_system_noyq3ods_.dbf
Tag: TAG20260108T162749
# 특정 데이터파일만
RMAN> list copy of datafile 1;
List of Datafile Copies
=======================
Key File S Completion Time Ckp SCN Ckp Time Sparse
------- ---- - --------------- ---------- --------------- ------
1 1 A 08-JAN-26 2864132 08-JAN-26 NO
Name: /u01/app/oracle/fast_recovery_area/ORA19C/datafile/o1_mf_system_noyq3ods_.dbf
Tag: TAG20260108T162749
# 컨트롤파일만
RMAN> list copy of controlfile;
List of Control File Copies
===========================
Key S Completion Time Ckp SCN Ckp Time
------- - --------------- ---------- ---------------
5 A 08-JAN-26 2864190 08-JAN-26
Name: /u01/app/oracle/fast_recovery_area/ORA19C/controlfile/o1_mf_TAG20260108T162858_noyq5tww_.ctl
Tag: TAG20260108T162858
특정 데이터 파일 손상 image copy로 복구
장애 유발 : users01.dbf 삭제
RMAN> shutdown immediate
database closed
database dismounted
Oracle instance shut down
[oracle@ora19c ~]$ rm /u01/app/oracle/oradata/ORA19C/users01.dbf
[oracle@ora19c ~]$ ls /u01/app/oracle/oradata/ORA19C/users01.dbf
ls: cannot access /u01/app/oracle/oradata/ORA19C/users01.dbf: No such file or directory
RMAN> startup
connected to target database (not started)
Oracle instance started
database mounted
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of startup command at 01/08/2026 16:36:31
ORA-01157: cannot identify/lock data file 7 - see DBWR trace file
ORA-01110: data file 7: '/u01/app/oracle/oradata/ORA19C/users01.dbf'
RMAN> list failure;
Database Role: PRIMARY
List of Database Failures
=========================
Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------- -------
122 HIGH OPEN 07-JAN-26 One or more non-system datafiles are missing
288 HIGH OPEN 07-JAN-26 One or more non-system datafiles need media recovery
RMAN> list failure 122 detail;
Database Role: PRIMARY
List of Database Failures
=========================
Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------- -------
122 HIGH OPEN 07-JAN-26 One or more non-system datafiles are missing
Impact: See impact for individual child failures
List of child failures for parent failure ID 122
Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------- -------
10525 HIGH OPEN 08-JAN-26 Datafile 7: '/u01/app/oracle/oradata/ORA19C/users01.dbf' is missing
Impact: Some objects in tablespace USERS might be unavailable
RMAN> list failure 288 detail;
Database Role: PRIMARY
List of Database Failures
=========================
Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------- -------
288 HIGH OPEN 07-JAN-26 One or more non-system datafiles need media recovery
Impact: See impact for individual child failures
List of child failures for parent failure ID 288
Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------- -------
9420 HIGH OPEN 07-JAN-26 Datafile 7: '/u01/app/oracle/oradata/ORA19C/users01.dbf' needs media recovery
Impact: Some objects in tablespace USERS might be unavailable
복구 수행
# 백업본 조회
RMAN> list copy of datafile 7;
List of Datafile Copies
=======================
Key File S Completion Time Ckp SCN Ckp Time Sparse
------- ---- - --------------- ---------- --------------- ------
4 7 A 08-JAN-26 2864140 08-JAN-26 NO
Name: /u01/app/oracle/fast_recovery_area/ORA19C/datafile/o1_mf_users_noyq42r5_.dbf
Tag: TAG20260108T162749
# 백업본으로 restore
RMAN> restore datafile 7;
Starting restore at 08-JAN-26
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=149 device type=DISK
channel ORA_DISK_1: restoring datafile 00007
input datafile copy RECID=4 STAMP=1222014482 file name=/u01/app/oracle/fast_recovery_area/ORA19C/datafile/o1_mf_users_noyq42r5_.dbf
destination for restore of datafile 00007: /u01/app/oracle/oradata/ORA19C/users01.dbf
channel ORA_DISK_1: copied datafile copy of datafile 00007, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/ORA19C/users01.dbf RECID=0 STAMP=0
Finished restore at 08-JAN-26
# 백업 이후 리두 적용
RMAN> recover datafile 7;
Starting recover at 08-JAN-26
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:00
Finished recover at 08-JAN-26
# 데이터베이스 open
RMAN> alter database open;
Statement processed
모든 데이터파일 손상 image copy로 복구
장애 유발
[oracle@ora19c ~]$ rm /u01/app/oracle/oradata/ORA19C/*.dbf
[oracle@ora19c ~]$ ls /u01/app/oracle/oradata/ORA19C/
control01.ctl redo01.log redo02.log redo03.log
장애 확인
RMAN> startup
connected to target database (not started)
Oracle instance started
database mounted
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of startup command at 01/08/2026 17:07:12
ORA-01157: cannot identify/lock data file 1 - see DBWR trace file
ORA-01110: data file 1: '/u01/app/oracle/oradata/ORA19C/system01.dbf'
RMAN> list failure;
Database Role: PRIMARY
List of Database Failures
=========================
Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------- -------
10882 CRITICAL OPEN 08-JAN-26 System datafile 1: '/u01/app/oracle/oradata/ORA19C/system01.dbf' is missing
288 HIGH OPEN 07-JAN-26 One or more non-system datafiles need media recovery
122 HIGH OPEN 07-JAN-26 One or more non-system datafiles are missing
RMAN> list failure 10882 detail;
Database Role: PRIMARY
List of Database Failures
=========================
Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------- -------
10882 CRITICAL OPEN 08-JAN-26 System datafile 1: '/u01/app/oracle/oradata/ORA19C/system01.dbf' is missing
Impact: Database cannot be opened
RMAN> list failure 288 detail;
Database Role: PRIMARY
List of Database Failures
=========================
Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------- -------
288 HIGH OPEN 07-JAN-26 One or more non-system datafiles need media recovery
Impact: See impact for individual child failures
List of child failures for parent failure ID 288
Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------- -------
10634 HIGH OPEN 08-JAN-26 Datafile 4: '/u01/app/oracle/oradata/ORA19C/undotbs01.dbf' needs media recovery
Impact: Some objects in tablespace UNDOTBS1 might be unavailable
10628 HIGH OPEN 08-JAN-26 Datafile 3: '/u01/app/oracle/oradata/ORA19C/sysaux01.dbf' needs media recovery
Impact: Some objects in tablespace SYSAUX might be unavailable
9420 HIGH OPEN 07-JAN-26 Datafile 7: '/u01/app/oracle/oradata/ORA19C/users01.dbf' needs media recovery
Impact: Some objects in tablespace USERS might be unavailable
RMAN> list failure 122 detail;
Database Role: PRIMARY
List of Database Failures
=========================
Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------- -------
122 HIGH OPEN 07-JAN-26 One or more non-system datafiles are missing
Impact: See impact for individual child failures
List of child failures for parent failure ID 122
Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------- -------
10594 HIGH OPEN 08-JAN-26 Datafile 4: '/u01/app/oracle/oradata/ORA19C/undotbs01.dbf' is missing
Impact: Some objects in tablespace UNDOTBS1 might be unavailable
10588 HIGH OPEN 08-JAN-26 Datafile 3: '/u01/app/oracle/oradata/ORA19C/sysaux01.dbf' is missing
Impact: Some objects in tablespace SYSAUX might be unavailable
10525 HIGH OPEN 08-JAN-26 Datafile 7: '/u01/app/oracle/oradata/ORA19C/users01.dbf' is missing
Impact: Some objects in tablespace USERS might be unavailable
복구 수행
백업본으로 restore
RMAN> restore database;
Starting restore at 08-JAN-26
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=142 device type=DISK
rchannel ORA_DISK_1: restoring datafile 00001
input datafile copy RECID=1 STAMP=1222016457 file name=/u01/app/oracle/fast_recovery_area/ORA19C/datafile/o1_mf_system_noys1pqy_.dbf
destination for restore of datafile 00001: /u01/app/oracle/oradata/ORA19C/system01.dbf channel ORA_DISK_1: copied datafile copy of datafile 00001, elapsed time: 00:00:03
output file name=/u01/app/oracle/oradata/ORA19C/system01.dbf RECID=0 STAMP=0
channel ORA_DISK_1: restoring datafile 00003
input datafile copy RECID=2 STAMP=1222016465 file name=/u01/app/oracle/fast_recovery_area/ORA19C/datafile/o1_mf_sysaux_noys1z2j_.dbf
destination for restore of datafile 00003: /u01/app/oracle/oradata/ORA19C/sysaux01.dbf
channel ORA_DISK_1: copied datafile copy of datafile 00003, elapsed time: 00:00:03
output file name=/u01/app/oracle/oradata/ORA19C/sysaux01.dbf RECID=0 STAMP=0
channel ORA_DISK_1: restoring datafile 00004
input datafile copy RECID=3 STAMP=1222016472 file name=/u01/app/oracle/fast_recovery_area/ORA19C/datafile/o1_mf_undotbs1_noys26pk_.dbf
destination for restore of datafile 00004: /u01/app/oracle/oradata/ORA19C/undotbs01.dbf
channel ORA_DISK_1: copied datafile copy of datafile 00004, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/ORA19C/undotbs01.dbf RECID=0 STAMP=0
channel ORA_DISK_1: restoring datafile 00007
input datafile copy RECID=4 STAMP=1222016475 file name=/u01/app/oracle/fast_recovery_area/ORA19C/datafile/o1_mf_users_noys2cxw_.dbf
destination for restore of datafile 00007: /u01/app/oracle/oradata/ORA19C/users01.dbf
channel ORA_DISK_1: copied datafile copy of datafile 00007, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/ORA19C/users01.dbf RECID=0 STAMP=0
Finished restore at 08-JAN-26
백업 이후 리두 적용
RMAN> recover database;
Starting recover at 08-JAN-26
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:01
Finished recover at 08-JAN-26
RMAN> alter database open;
Statement processed
RMAN> report schema;
Report of database schema for database with db_unique_name ORA19C
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 910 SYSTEM YES /u01/app/oracle/oradata/ORA19C/system01.dbf
3 720 SYSAUX NO /u01/app/oracle/oradata/ORA19C/sysaux01.dbf
4 340 UNDOTBS1 YES /u01/app/oracle/oradata/ORA19C/undotbs01.dbf
7 5 USERS NO /u01/app/oracle/oradata/ORA19C/users01.dbf
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 20 TEMP 32767 /u01/app/oracle/oradata/ORA19C/temp01.dbf
데이터베이스 open
RMAN> alter database open;
Statement processed
Image copy로 switch
테이블스페이스 생성
RMAN> create tablespace data_tbs datafile '/home/oracle/data_tbs01.dbf' size 5m;
Statement processed
RMAN> report schema;
Report of database schema for database with db_unique_name ORA19C
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 910 SYSTEM YES /u01/app/oracle/oradata/ORA19C/system01.dbf
3 720 SYSAUX NO /u01/app/oracle/oradata/ORA19C/sysaux01.dbf
4 340 UNDOTBS1 YES /u01/app/oracle/oradata/ORA19C/undotbs01.dbf
5 5 DATA_TBS NO /home/oracle/data_tbs01.dbf
7 5 USERS NO /u01/app/oracle/oradata/ORA19C/users01.dbf
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 20 TEMP 32767 /u01/app/oracle/oradata/ORA19C/temp01.dbf
테이블 생성
RMAN> create table hr.data_emp tablespace data_tbs as select * from hr.employees;
Statement processed
RMAN> select count(*) from hr.data_emp;
COUNT(*)
----------
107
RMAN> report need backup;
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
Report of files with less than 1 redundant backups
File #bkps Name
---- ----- -----------------------------------------------------
5 0 /home/oracle/data_tbs01.dbf
RMAN> list copy of datafile 5;
specification does not match any datafile copy in the repository
data_tbs 다른 위치로 image copy 백업
RMAN> backup as copy datafile 5 format '/u01/app/oracle/oradata/ORA19C/data_tbs01.dbf';
Starting backup at 08-JAN-26
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=/home/oracle/data_tbs01.dbf
output file name=/u01/app/oracle/oradata/ORA19C/data_tbs01.dbf tag=TAG20260108T171752 RECID=6 STAMP=1222017472
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 08-JAN-26
Starting Control File and SPFILE Autobackup at 08-JAN-26
piece handle=/u01/app/oracle/fast_recovery_area/ORA19C/autobackup/2026_01_08/o1_mf_s_1222017473_noyt1ktk_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 08-JAN-26
[oracle@ora19c ~]$ ls -l /u01/app/oracle/oradata/ORA19C/*.dbf
-rw-r-----. 1 oracle oinstall 5251072 Jan 8 17:17 /u01/app/oracle/oradata/ORA19C/data_tbs01.dbf
-rw-r-----. 1 oracle oinstall 754982912 Jan 8 17:19 /u01/app/oracle/oradata/ORA19C/sysaux01.dbf
-rw-r-----. 1 oracle oinstall 954212352 Jan 8 17:19 /u01/app/oracle/oradata/ORA19C/system01.dbf
-rw-r-----. 1 oracle oinstall 20979712 Jan 8 17:14 /u01/app/oracle/oradata/ORA19C/temp01.dbf
-rw-r-----. 1 oracle oinstall 356524032 Jan 8 17:19 /u01/app/oracle/oradata/ORA19C/undotbs01.dbf
-rw-r-----. 1 oracle oinstall 5251072 Jan 8 17:13 /u01/app/oracle/oradata/ORA19C/users01.dbf
RMAN> report schema;
Report of database schema for database with db_unique_name ORA19C
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 910 SYSTEM YES /u01/app/oracle/oradata/ORA19C/system01.dbf
3 720 SYSAUX NO /u01/app/oracle/oradata/ORA19C/sysaux01.dbf
4 340 UNDOTBS1 YES /u01/app/oracle/oradata/ORA19C/undotbs01.dbf
5 5 DATA_TBS NO /home/oracle/data_tbs01.dbf
7 5 USERS NO /u01/app/oracle/oradata/ORA19C/users01.dbf
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 20 TEMP 32767 /u01/app/oracle/oradata/ORA19C/temp01.dbf
장애 유발 : data_tbs01.dbf 삭제
RMAN> shutdown immediate
database closed
database dismounted
Oracle instance shut down
[oracle@ora19c ~]$ ls
arch1 arch2 backup clone create_2026.txt data_pump data_tbs01.dbf
[oracle@ora19c ~]$ rm data_tbs01.dbf
RMAN> startup
connected to target database (not started)
Oracle instance started
database mounted
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of startup command at 01/08/2026 17:22:55
ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
ORA-01110: data file 5: '/home/oracle/data_tbs01.dbf'
복구 수행
백업본 확인
RMAN> list copy of datafile 5;
List of Datafile Copies
=======================
Key File S Completion Time Ckp SCN Ckp Time Sparse
------- ---- - --------------- ---------- --------------- ------
6 5 A 08-JAN-26 2866713 08-JAN-26 NO
Name: /u01/app/oracle/oradata/ORA19C/data_tbs01.dbf
Tag: TAG20260108T171752
image copy 백업본으로 switch
RMAN> switch datafile 5 to copy;
datafile 5 switched to datafile copy "/u01/app/oracle/oradata/ORA19C/data_tbs01.dbf"
RMAN> report schema;
Report of database schema for database with db_unique_name ORA19C
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 910 SYSTEM *** /u01/app/oracle/oradata/ORA19C/system01.dbf
3 720 SYSAUX *** /u01/app/oracle/oradata/ORA19C/sysaux01.dbf
4 340 UNDOTBS1 *** /u01/app/oracle/oradata/ORA19C/undotbs01.dbf
5 5 DATA_TBS *** /u01/app/oracle/oradata/ORA19C/data_tbs01.dbf
7 5 USERS *** /u01/app/oracle/oradata/ORA19C/users01.dbf
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 20 TEMP 32767 /u01/app/oracle/oradata/ORA19C/temp01.dbf
백업 이후 리두 적용
RMAN> recover datafile 5;
Starting recover at 08-JAN-26
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=148 device type=DISK
starting media recovery
media recovery complete, elapsed time: 00:00:00
Finished recover at 08-JAN-26
데이터베이스 open
RMAN> alter database open;
Statement processed
RMAN> report need backup;
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
Report of files with less than 1 redundant backups
File #bkps Name
---- ----- -----------------------------------------------------
5 0 /u01/app/oracle/oradata/ORA19C/data_tbs01.dbf
data_tbs 테이블스페이스 삭제
RMAN> drop tablespace data_tbs including contents and datafiles;
Statement processed
RMAN> report schema;
Report of database schema for database with db_unique_name ORA19C
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 910 SYSTEM YES /u01/app/oracle/oradata/ORA19C/system01.dbf
3 720 SYSAUX NO /u01/app/oracle/oradata/ORA19C/sysaux01.dbf
4 340 UNDOTBS1 YES /u01/app/oracle/oradata/ORA19C/undotbs01.dbf
7 5 USERS NO /u01/app/oracle/oradata/ORA19C/users01.dbf
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 20 TEMP 32767 /u01/app/oracle/oradata/ORA19C/temp01.dbf'Courses > 아이티윌 오라클 DBA 과정' 카테고리의 다른 글
| [아이티윌 오라클 DBA 과정 91기] 260112 TIL (0) | 2026.01.13 |
|---|---|
| [아이티윌 오라클 DBA 과정 91기] 260109 TIL (0) | 2026.01.11 |
| [아이티윌 오라클 DBA 과정 91기] 260107 TIL (1) | 2026.01.07 |
| [아이티윌 오라클 DBA 과정 91기] 260106 TIL (1) | 2026.01.07 |
| [아이티윌 오라클 DBA 과정 91기] 260105 TIL (0) | 2026.01.05 |