DATABASE(oracleDB 11g)/DBA

[Oracle DBA]ArchiveMode 에서의 Backup & Recovery-Recovery Catalog

SEUNGSAMI 2019. 5. 3. 09:43
ArchiveMode 에서의 Backup & Recovery-Recovery Catalog




-- 백업 전략
SYS@orcl2> show parameter control_file_record_keep_time;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time        integer     7



Recovery Catalog
  • 컨트롤 파일보다 많은 기록 정보 저장
      • control_file_record_keep_time의 기록보다 이전 기록까지 저장이 가능하다.
  • script를 저장 할 수 있다.
[orcl2:~]$ rman target / catalog rcatowner/oracle@orcl

RMAN> create script weekend_backup{
      backup as compressed backupset database; }

RMAN> run {
      execute script weekend_backup;}

RCATOWNER@orcl> select * from rc_stored_script_line;

    DB_KEY DB_NAME  SCRIPT_NAME          SCRIPT_COMMENT
---------- -------- -------------------- --------------------
       221 ORCL2    weekend_backup


RCATOWNER@orcl> select * from rc_stored_script_line;

    DB_KEY SCRIPT_NAME                LINE TEXT
---------- -------------------- ---------- ---------------------------------------------
       221 weekend_backup                1 { backup as compressed backupset database; }


  • 다양한 조회 -  view를 제공(RC_view)
  • BACKUP 명령의 KEEP FOREVER 절 사용가능
      • ARCHIVE BACKUP(백업을 보관한다는 뜻)
      • FRA에는 저장이 불가하다.
[orcl2:~]$ rman target / catalog rcatowner/oracle@orcl


RMAN> backup tablespace users format '/home/oracle/backup/rman/df_%d_users_%s_%p.bus' tag='Q1 end';
RMAN> list backup;

List of Backup Sets
===================
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
435     Full    4.10M      DISK        00:00:00     24-APR-19      
        BP Key: 438   Status: AVAILABLE  Compressed: NO  Tag: Q1 END
        Piece Name: /home/oracle/backup/rman/df_ORCL2_users_93_1.bus
  List of Datafiles in backup set 435
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  4       Full 1452708    24-APR-19 /u01/app/oracle/orcl2/users01.dbf


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
444     Full    9.73M      DISK        00:00:01     24-APR-19      
        BP Key: 446   Status: AVAILABLE  Compressed: NO  Tag: TAG20190424T140710
        Piece Name: /u01/app/oracle/flash_recovery_area/ORCL2/autobackup/2019_04_24/o1_mf_s_1006438030_gczvqyyz_.bkp
  SPFILE Included: Modification time: 24-APR-19
  SPFILE db_unique_name: ORCL2
  Control File Included: Ckp SCN: 1452724      Ckp time: 24-APR-19


RMAN> change backup tag 'Q1 end' keep forever;

using channel ORA_DISK_1
keep attributes for the backup are changed
backup will never be obsolete
backup set key=435 RECID=74 STAMP=1006438029
-- retention 정책과는 무관하게 가져가겠다는 말


RMAN> list backup of tablespace users;

List of Backup Sets
===================
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
435     Full    4.10M      DISK        00:00:00     24-APR-19      
        BP Key: 438   Status: AVAILABLE  Compressed: NO  Tag: Q1 END
        Piece Name: /home/oracle/backup/rman/df_ORCL2_users_93_1.bus
        Keep: BACKUP_LOGS        Until: FOREVER        
  List of Datafiles in backup set 435
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  4       Full 1452708    24-APR-19 /u01/app/oracle/orcl2/users01.dbf


RMAN> change backup tag 'Q1 end' keep until time 'sysdate+30';
using channel ORA_DISK_1
keep attributes for the backup are changed
backup will be obsolete on date 24-MAY-19
backup set key=435 RECID=74 STAMP=1006438029


RMAN> list backup of tablespace users;

List of Backup Sets
===================
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
435     Full    4.10M      DISK        00:00:00     24-APR-19      
        BP Key: 438   Status: AVAILABLE  Compressed: NO  Tag: Q1 END
        Piece Name: /home/oracle/backup/rman/df_ORCL2_users_93_1.bus
        Keep: BACKUP_LOGS        Until: 24-MAY-19      
  List of Datafiles in backup set 435
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  4       Full 1452708    24-APR-19 /u01/app/oracle/orcl2/users01.dbf


RMAN> change backup tag 'Q1 end' nokeep;

using channel ORA_DISK_1
keep attributes for the backup are deleted
backup set key=435 RECID=74 STAMP=1006438029
  • 특정 시점에 Target Database에 있거나 있었던 데이터 파일 및 테이블스페이스 나열 가능
RMAN> report schema;

Report of database schema for database with db_unique_name ORCL2

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    680      SYSTEM               YES     /u01/app/oracle/orcl2/system01.dbf
2    530      SYSAUX               NO      /u01/app/oracle/orcl2/sysaux01.dbf
3    105      UNDOTBS1             YES     /u01/app/oracle/orcl2/undotbs01.dbf
4    6        USERS                NO      /u01/app/oracle/orcl2/users01.dbf
5    100      EXAMPLE              NO      /u01/app/oracle/orcl2/example01.dbf

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
2    20       TEMP                 32767       /u01/app/oracle/orcl2/temp01.dbf
-- 현재의 스키마


SYS@orcl2> select checkpoint_change# from v$database;

CHECKPOINT_CHANGE#
------------------
           1438333
-- 현재의 checkpoint number


RMAN> report schema at scn 1437999;
[report schema at {scn|time|logseq}]

Report of database schema for database with db_unique_name ORCL2

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    680      SYSTEM               YES     /u01/app/oracle/orcl2/system01.dbf
2    530      SYSAUX               YES     /u01/app/oracle/orcl2/sysaux01.dbf
3    105      UNDOTBS1             YES     /u01/app/oracle/orcl2/undotbs01.dbf
4    6        USERS                YES     /u01/app/oracle/orcl2/users01.dbf
5    100      EXAMPLE              YES     /u01/app/oracle/orcl2/example01.dbf

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
2    20       TEMP                 32767       /u01/app/oracle/orcl2/temp01.dbf
-- 과거 scn 시점의 스키마

  • Catalog 생성
  1. recovery catalog를 저장할 데이터베이스를 구성
  2. Recovery Catalog 소유자를 생성
  3. recovery catalog를 생성
-- 현재 orcl DB는 생성되어있는 상황, 만약 없다면 Catalog DB로 사용할 DB를 만들어줘야한다.
-- 아래 실습은 orcl2와 orcl을 잘 구분해야한다.

[orcl:~]$ echo $ORACLE_SID
orcl


SYS@orcl> startup force
ORACLE instance started.
Total System Global Area  577511424 bytes
Fixed Size                  1338000 bytes
Variable Size             390071664 bytes
Database Buffers          180355072 bytes
Redo Buffers                5746688 bytes
Database mounted.
Database opened.



SYS@orcl> select username, account_status from dba_users;

USERNAME                       ACCOUNT_STATUS
------------------------------ --------------------------------
MGMT_VIEW                      OPEN
SYS                            OPEN
SYSTEM                         OPEN
DBSNMP                         OPEN
SYSMAN                         OPEN
SCOTT                          OPEN
HR                             OPEN
OUTLN                          EXPIRED & LOCKED
FLOWS_FILES                    EXPIRED & LOCKED
MDSYS                          EXPIRED & LOCKED
ORDSYS                         EXPIRED & LOCKED
EXFSYS                         EXPIRED & LOCKED
WMSYS                          EXPIRED & LOCKED
APPQOSSYS                      EXPIRED & LOCKED
APEX_030200                    EXPIRED & LOCKED
OWBSYS_AUDIT                   EXPIRED & LOCKED
ORDDATA                        EXPIRED & LOCKED
CTXSYS                         EXPIRED & LOCKED
ANONYMOUS                      EXPIRED & LOCKED
XDB                            EXPIRED & LOCKED
ORDPLUGINS                     EXPIRED & LOCKED
OWBSYS                         EXPIRED & LOCKED
SI_INFORMTN_SCHEMA             EXPIRED & LOCKED
OLAPSYS                        EXPIRED & LOCKED
ORACLE_OCM                     EXPIRED & LOCKED
XS$NULL                        EXPIRED & LOCKED
BI                             EXPIRED & LOCKED
PM                             EXPIRED & LOCKED
MDDATA                         EXPIRED & LOCKED
IX                             EXPIRED & LOCKED
SH                             EXPIRED & LOCKED
DIP                            EXPIRED & LOCKED
OE                             EXPIRED & LOCKED
APEX_PUBLIC_USER               EXPIRED & LOCKED
SPATIAL_CSW_ADMIN_USR          EXPIRED & LOCKED
SPATIAL_WFS_ADMIN_USR          EXPIRED & LOCKED


36 rows selected.


SYS@orcl> select name from v$datafile;

NAME
---------------------------------------------
+DATA/orcl/datafile/system.256.1002622777
+DATA/orcl/datafile/sysaux.257.1002622777
+DATA/orcl/datafile/undotbs1.258.1002622777
+DATA/orcl/datafile/users.259.1002622777
+DATA/orcl/datafile/example.265.1002622931


1. recovery catalog 정보를 저장할 테이블 스페이스 생성
SYS@orcl> create tablespace rcat_tbs
          datafile '+DATA/rcat01.dbf' size 15m;

Tablespace created.



2. recovery catalog 데이터를 소유할 catalog owner user를 생성하고 권한(recovery_catalog_owner)을 부여
SYS@orcl> create user rcatowner identified by oracle
          default tablespace rcat_tbs
          quota unlimited on rcat_tbs;

User created.


SYS@orcl> grant recovery_catalog_owner to rcatowner;
Grant succeeded.



3. catalog DB에 catalog schema를 생성
[orcl2:~]$ rman catalog rcatowner/oracle@orcl
Recovery Manager: Release 11.2.0.1.0 - Production on Wed Apr 24 11:56:47 2019
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
connected to recovery catalog database


SYS@orcl> conn rcatowner/oracle
Connected.


RCATOWNER@orcl> select * from user_tables;
no rows selected


RCATOWNER@orcl> select * from user_objects;
no rows selected


-- rcatowner
RMAN> create catalog; -- 252개 objects를 생성
recovery catalog created

RMAN> exit

RCATOWNER@orcl> select object_name from user_objects;

OBJECT_NAME
-----------------------------------------------------
.......
DB_INSERT_TRIGGER
SCR_TRIGGER
SCRL_TRIGGER
RC_DATABASE -- 여러 데이터베이스의 백업 리커버리 정보
RC_DATABASE_INCARNATION
RC_RESYNC
RC_CHECKPOINT
RC_TABLESPACE
RC_DATAFILE
RC_TEMPFILE -- 데이터베이스의 컨트롤 파일 저장
RC_REDO_THREAD
RC_REDO_LOG
RC_LOG_HISTORY
.......
252 rows selected.


RCATOWNER@orcl> select * from rc_database;
no rows selected


5. target DB를 catalog DB에 등록한다.
[orcl2:~]$ rman target / catalog rcatowner/oracle@orcl

Recovery Manager: Release 11.2.0.1.0 - Production on Wed Apr 24 12:03:53 2019
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
connected to target database: ORCL2 (DBID=986068470)
connected to recovery catalog database
-- target 과 catalog DB에 동시에 연결된다.


RMAN> register database;

database registered in recovery catalog
starting full resync of recovery catalog
full resync complete


RCATOWNER@orcl> select * from rc_database;

    DB_KEY  DBINC_KEY       DBID NAME                 RESETLOGS_CHANGE# RESETLOGS
---------- ---------- ---------- -------------------- ----------------- ---------
         2          4  986068470 ORCL2                          1395143 23-APR-19


RMAN> unregister database;
database name is "ORCL2" and DBID is 986068470

Do you really want to unregister the database (enter YES or NO)? yes
database unregistered from the recovery catalog
-- 더이상 관리를 하지 않겠다 라는 뜻.


RCATOWNER@orcl> select * from rc_database;
no rows selected


RMAN> register database;

database registered in recovery catalog
starting full resync of recovery catalog
full resync complete


Image Copy Recovery

RMAN> recover copy of database with tag 'daily_inc';

RMAN> backup incremental level 1 for recover of copy
      with tag 'daily_inc' database;
  • 지속적으로 incremetal level 1으로 백업을 수행한다.
  • 그 이유는 첫번째 명령어를 실행할경우 incremental level1 backup은 기존의 Image copy에 합쳐져서 level 0상태가 된다.
  • 실습
1. 실습에 필요한 테이블 스페이스 생성
SYS@orcl2> create tablespace app
           datafile '/home/oracle/app01.dbf' size 25m;
Tablespace created.


SYS@orcl2> create table hr.emp tablespace app as select * from hr.employees;
Table created.


SYS@orcl2> select count(*) from hr.emp;

  COUNT(*)
----------
       107


SYS@orcl2> @switch
System altered.


2. app 테이블스페이스 백업
[orcl2:~]$ rman target / catalog rcatowner/oracle@orcl


RMAN> backup as copy tablespace app;

Starting backup at 24-APR-19
starting full resync of recovery catalog
full resync complete
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=145 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00006 name=/home/oracle/app01.dbf
output file name=/u01/app/oracle/flash_recovery_area/ORCL2/datafile/o1_mf_app_gczzr0z3_.dbf tag=TAG20190424T151528 RECID=5 STAMP=1006442130
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 24-APR-19

Starting Control File and SPFILE Autobackup at 24-APR-19
piece handle=/u01/app/oracle/flash_recovery_area/ORCL2/autobackup/2019_04_24/o1_mf_s_1006442132_gczzr4lz_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 24-APR-19


3. DB작업 수행
SYS@orcl2> delete hr.emp where department_id = 60;
5 rows deleted.


SYS@orcl2> commit;
Commit complete.


SYS@orcl2> @switch
System altered.


SYS@orcl2> /
System altered.


SYS@orcl2> /
System altered.


SYS@orcl2> select count(*) from hr.emp;

  COUNT(*)
----------
       102


SYS@orcl2>exit


4. 장애 발생
[orcl2:~]$ ls /home/oracle/app01.dbf
/home/oracle/app01.dbf


[orcl2:~]$ rm /home/oracle/app01.dbf


[orcl2:~]$ ls /home/oracle/app01.dbf
ls: /home/oracle/app01.dbf: No such file or directory


SYS@orcl2> alter system flush buffer_cache;
System altered.
-- 버퍼캐시를 비워내는 작업


SYS@orcl2> select count(*) from hr.emp;
select count(*) from hr.emp
*
ERROR at line 1:
ORA-01116: error in opening database file 6
ORA-01110: data file 6: '/home/oracle/app01.dbf'
ORA-27041: unable to open file
Linux Error: 2: No such file or directory
Additional information: 3


5. 복구 (switch tpo copy)
SYS@orcl2> alter tablespace app offline immediate;
Tablespace altered.


RMAN> report schema;

Report of database schema for database with db_unique_name ORCL2

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    680      SYSTEM               YES     /u01/app/oracle/orcl2/system01.dbf
2    530      SYSAUX               NO      /u01/app/oracle/orcl2/sysaux01.dbf
3    105      UNDOTBS1             YES     /u01/app/oracle/orcl2/undotbs01.dbf
4    6        USERS                NO      /u01/app/oracle/orcl2/users01.dbf
5    100      EXAMPLE              NO      /u01/app/oracle/orcl2/example01.dbf
6    25       APP                  NO      /home/oracle/app01.dbf

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
2    20       TEMP                 32767       /u01/app/oracle/orcl2/temp01.dbf


RMAN> list copy of datafile 6;

List of Datafile Copies
=======================

Key     File S Completion Time Ckp SCN    Ckp Time
------- ---- - --------------- ---------- ---------------
506     6    A 24-APR-19       1456122    24-APR-19
        Name: /u01/app/oracle/flash_recovery_area/ORCL2/datafile/o1_mf_app_gczzr0z3_.dbf
        Tag: TAG20190424T151528


RMAN> switch datafile 6 to copy;

datafile 6 switched to datafile copy "/u01/app/oracle/flash_recovery_area/ORCL2/datafile/o1_mf_app_gczzr0z3_.dbf"
starting full resync of recovery catalog -- DB구조의 변화가 일어났기에 이런것이 출력
full resync complete


RMAN> report schema;

Report of database schema for database with db_unique_name ORCL2

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    680      SYSTEM               YES     /u01/app/oracle/orcl2/system01.dbf
2    530      SYSAUX               NO      /u01/app/oracle/orcl2/sysaux01.dbf
3    105      UNDOTBS1             YES     /u01/app/oracle/orcl2/undotbs01.dbf
4    6        USERS                NO      /u01/app/oracle/orcl2/users01.dbf
5    100      EXAMPLE              NO      /u01/app/oracle/orcl2/example01.dbf
6    25       APP                  NO      /u01/app/oracle/flash_recovery_area/ORCL2/datafile/o1_mf_app_gczzr0z3_.dbf -- 바뀐 것을 확인

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
2    20       TEMP                 32767       /u01/app/oracle/orcl2/temp01.dbf


6. switch 된 데이터파일에 대한 복구 시작
RMAN> recover datafile 6;

Starting recover at 24-APR-19
using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 8 is already on disk as file /home/oracle/arch1/arch_1_8_1006362834.arc
archived log for thread 1 with sequence 9 is already on disk as file /home/oracle/arch1/arch_1_9_1006362834.arc
archived log for thread 1 with sequence 10 is already on disk as file /home/oracle/arch1/arch_1_10_1006362834.arc
archived log file name=/home/oracle/arch1/arch_1_8_1006362834.arc thread=1 sequence=8
media recovery complete, elapsed time: 00:00:00
Finished recover at 24-APR-19


SYS@orcl2> alter tablespace app online;
Tablespace altered.


SYS@orcl2>  select count(*) from hr.emp;

  COUNT(*)
----------
       102

-- 정상적으로 복구가 된 것을 확인



RMAN> backup incremental level 1 for recover of copy with tag 'app_incr' database;

Starting backup at 24-APR-19
using channel ORA_DISK_1
no parent backup or copy of datafile 1 found
no parent backup or copy of datafile 2 found
no parent backup or copy of datafile 3 found
no parent backup or copy of datafile 5 found
no parent backup or copy of datafile 6 found
no parent backup or copy of datafile 4 found
-- parent가 없으면 자동적으로 copy가 생성된다.
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u01/app/oracle/orcl2/system01.dbf
output file name=/u01/app/oracle/flash_recovery_area/ORCL2/datafile/o1_mf_system_gd01tnnl_.dbf tag=APP_INCR RECID=6 STAMP=1006444282
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/u01/app/oracle/orcl2/sysaux01.dbf
output file name=/u01/app/oracle/flash_recovery_area/ORCL2/datafile/o1_mf_sysaux_gd01vfq3_.dbf tag=APP_INCR RECID=7 STAMP=1006444305
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/u01/app/oracle/orcl2/undotbs01.dbf
output file name=/u01/app/oracle/flash_recovery_area/ORCL2/datafile/o1_mf_undotbs1_gd01w6sf_.dbf tag=APP_INCR RECID=8 STAMP=1006444314
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=/u01/app/oracle/orcl2/example01.dbf
output file name=/u01/app/oracle/flash_recovery_area/ORCL2/datafile/o1_mf_example_gd01wfvq_.dbf tag=APP_INCR RECID=9 STAMP=1006444321
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00006 name=/u01/app/oracle/flash_recovery_area/ORCL2/datafile/o1_mf_app_gczzr0z3_.dbf
output file name=/u01/app/oracle/flash_recovery_area/ORCL2/datafile/o1_mf_app_gd01wnxb_.dbf tag=APP_INCR RECID=10 STAMP=1006444325
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/u01/app/oracle/orcl2/users01.dbf
output file name=/u01/app/oracle/flash_recovery_area/ORCL2/datafile/o1_mf_users_gd01woz3_.dbf tag=APP_INCR RECID=11 STAMP=1006444326
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 24-APR-19

Starting Control File and SPFILE Autobackup at 24-APR-19
piece handle=/u01/app/oracle/flash_recovery_area/ORCL2/autobackup/2019_04_24/o1_mf_s_1006444327_gd01wqql_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 24-APR-19
-- 백업되는 것은 결국엔 copy이다.


SYS@orcl2> insert into hr.emp select * from hr.emp;
102 rows created.


SYS@orcl2> commit;
Commit complete.


SYS@orcl2> select count(*) from hr.emp;

  COUNT(*)
----------
       204


RMAN> list copy of tablespace app;

List of Datafile Copies
=======================

Key     File S Completion Time Ckp SCN    Ckp Time
------- ---- - --------------- ---------- ---------------
665     6    A 24-APR-19       1457618    24-APR-19
        Name: /u01/app/oracle/flash_recovery_area/ORCL2/datafile/o1_mf_app_gd01wnxb_.dbf
        Tag: APP_INCR


SYS@orcl2> insert into hr.emp select * from hr.emp;
204 rows created.


SYS@orcl2> commit;
Commit complete.


SYS@orcl2> select count(*) from hr.emp;

  COUNT(*)
----------
       408


RMAN> backup incremental level 1 for recover of copy with tag 'app_incr' database;

Starting backup at 24-APR-19
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/orcl2/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/orcl2/sysaux01.dbf
input datafile file number=00003 name=/u01/app/oracle/orcl2/undotbs01.dbf
input datafile file number=00005 name=/u01/app/oracle/orcl2/example01.dbf
input datafile file number=00006 name=/u01/app/oracle/flash_recovery_area/ORCL2/datafile/o1_mf_app_gczzr0z3_.dbf
input datafile file number=00004 name=/u01/app/oracle/orcl2/users01.dbf
channel ORA_DISK_1: starting piece 1 at 24-APR-19
channel ORA_DISK_1: finished piece 1 at 24-APR-19
piece handle=/u01/app/oracle/flash_recovery_area/ORCL2/backupset/2019_04_24/o1_mf_nnnd1_APP_INCR_gd027dqk_.bkp tag=APP_INCR comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
-- 위와 똑같은 명령어지만, 결과가 다르다(backup set으로만 받을 수 있다.)
Finished backup at 24-APR-19

Starting Control File and SPFILE Autobackup at 24-APR-19
piece handle=/u01/app/oracle/flash_recovery_area/ORCL2/autobackup/2019_04_24/o1_mf_s_1006444684_gd027wct_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 24-APR-19


RMAN> list copy of tablespace app;

List of Datafile Copies
=======================

Key     File S Completion Time Ckp SCN    Ckp Time
------- ---- - --------------- ---------- ---------------
665     6    A 24-APR-19       1457618    24-APR- 19
        Name: /u01/app/oracle/flash_recovery_area/ORCL2/datafile/o1_mf_app_gd01wnxb_.dbf
        Tag: APP_INCR


RMAN> list backup of tablespace app;

List of Backup Sets
===================

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
748     Incr 1  440.00K    DISK        00:00:10     24-APR-19
        BP Key: 751   Status: AVAILABLE  Compressed: NO  Tag: APP_INCR
        Piece Name: /u01/app/oracle/flash_recovery_area/ORCL2/backupset/2019_04_24/o1_mf_nnnd1_APP_INCR_gd027dqk_.bkp
  List of Datafiles in backup set 748
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  6    1  Incr 1457832    24-APR-19 /u01/app/oracle/flash_recovery_area/ORCL2/datafile/o1_mf_app_gczzr0z3_.dbf