BCT (Block change tracking)
- 마지막 백업 이후 변경된 블록들을 tracking 이 가능하도록 file 로 저장.
- 변경된 block 들은 bct 파일의 bitmap로 관리되는데, 변경된 block 당 1bit로 계산되는것이 아니라,
데이터 block 의 32 kb 당 1개의 bit로 표현됨.
=> db_block_size 8kb 이면 => 4개의 db_block 1bit로 표현되는 것임.
BCT 비활성화
alter database disable block change tracking;
BCT 활성화 여부 확인
SYS@ORCL AS SYSDBA> select * from v$block_change_tracking;
STATUS FILENAME BYTES
---------- -------------------- ----------
DISABLED
BCT 파일 생성 (데이터의 변경사항을 아래의 마일에 저장해서 관리 : 즉 tracking 위함)
SYS@ORCL AS SYSDBA> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING USING FILE '/u01/app/oracle/oradata/orcl/rman_change_track.f';
Database altered.
BCT 활성화 여부 확인
SYS@ORCL AS SYSDBA> select * from v$block_change_tracking;
STATUS FILENAME BYTES
---------- -------------------- ----------
ENABLED /u01/app/oracle/orad 11599872
ata/orcl/rman_change
_track.f
DATABASE 전체 백업
RMAN> backup incremental level 1 database;
Starting backup at 29-MAR-16
using channel ORA_DISK_1
no parent backup or copy of datafile 2 found
no parent backup or copy of datafile 1 found
no parent backup or copy of datafile 3 found
no parent backup or copy of datafile 4 found
no parent backup or copy of datafile 21 found
no parent backup or copy of datafile 6 found
no parent backup or copy of datafile 7 found
no parent backup or copy of datafile 11 found
no parent backup or copy of datafile 14 found
no parent backup or copy of datafile 17 found
no parent backup or copy of datafile 25 found
no parent backup or copy of datafile 9 found
no parent backup or copy of datafile 10 found
no parent backup or copy of datafile 12 found
no parent backup or copy of datafile 8 found
no parent backup or copy of datafile 13 found
no parent backup or copy of datafile 26 found
no parent backup or copy of datafile 15 found
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00002 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
input datafile file number=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/orcl/users01.dbf
input datafile file number=00021 name=/u01/app/oracle/oradata/orcl/scott_idx01.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/orcl/tbs_a_01.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/orcl/tbs_a_02.dbf
input datafile file number=00011 name=/u01/app/oracle/oradata/orcl/tbs_c_01.dbf
input datafile file number=00014 name=/u01/app/oracle/oradata/orcl/pbj_temp01.dbf
input datafile file number=00017 name=/u01/app/oracle/oradata/orcl/DATA01.dbf
input datafile file number=00025 name=/u01/app/oracle/oradata/orcl/TBS_TEST01.dbf
input datafile file number=00009 name=/u01/app/oracle/oradata/orcl/undotbs02.dbf
input datafile file number=00010 name=/u01/app/oracle/oradata/orcl/undotbs02_2.dbf
input datafile file number=00012 name=/u01/app/oracle/oradata/orcl/tbs_d_01.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/orcl/tbs_b_01.dbf
input datafile file number=00013 name=/u01/app/oracle/oradata/orcl/TBS_RAMN01.dbf
input datafile file number=00026 name=/u01/app/oracle/oradata/orcl/rc_tbs.dbf
input datafile file number=00015 name=/u01/app/oracle/oradata/orcl/TBS_TEST02.dbf
channel ORA_DISK_1: starting piece 1 at 29-MAR-16
channel ORA_DISK_1: finished piece 1 at 29-MAR-16
piece handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/2016_03_29/o1_mf_nnnd0_TAG20160329T164756_chndsfck_.bkp tag=TAG20160329T164756 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 29-MAR-16
channel ORA_DISK_1: finished piece 1 at 29-MAR-16
piece handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/2016_03_29/o1_mf_ncsn1_TAG20160329T164756_chndttym_.bkp tag=TAG20160329T164756 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 29-MAR-16
레벨 1로 다시 백업. 증분된 부분만 백업하므로 금방 끝남.
RMAN> backup incremental level 1 database;
Starting backup at 29-MAR-16
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=00002 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
input datafile file number=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/orcl/users01.dbf
input datafile file number=00021 name=/u01/app/oracle/oradata/orcl/scott_idx01.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/orcl/tbs_a_01.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/orcl/tbs_a_02.dbf
input datafile file number=00011 name=/u01/app/oracle/oradata/orcl/tbs_c_01.dbf
input datafile file number=00014 name=/u01/app/oracle/oradata/orcl/pbj_temp01.dbf
input datafile file number=00017 name=/u01/app/oracle/oradata/orcl/DATA01.dbf
input datafile file number=00025 name=/u01/app/oracle/oradata/orcl/TBS_TEST01.dbf
input datafile file number=00009 name=/u01/app/oracle/oradata/orcl/undotbs02.dbf
input datafile file number=00010 name=/u01/app/oracle/oradata/orcl/undotbs02_2.dbf
input datafile file number=00012 name=/u01/app/oracle/oradata/orcl/tbs_d_01.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/orcl/tbs_b_01.dbf
input datafile file number=00013 name=/u01/app/oracle/oradata/orcl/TBS_RAMN01.dbf
input datafile file number=00026 name=/u01/app/oracle/oradata/orcl/rc_tbs.dbf
input datafile file number=00015 name=/u01/app/oracle/oradata/orcl/TBS_TEST02.dbf
channel ORA_DISK_1: starting piece 1 at 29-MAR-16
channel ORA_DISK_1: finished piece 1 at 29-MAR-16
piece handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/2016_03_29/o1_mf_nnnd1_TAG20160329T170421_chnfr64j_.bkp tag=TAG20160329T170421 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 29-MAR-16
channel ORA_DISK_1: finished piece 1 at 29-MAR-16
piece handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/2016_03_29/o1_mf_ncsn1_TAG20160329T170421_chnfr7p7_.bkp tag=TAG20160329T170421 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 29-MAR-16
확인.
[oracle@DBTEST 2016_03_29]$ ll -alh
total 2.2G
drwxr-x--- 2 oracle oinstall 4.0K Mar 29 17:04 .
drwxr-x--- 3 oracle oinstall 4.0K Mar 29 16:47 ..
-rw-r----- 1 oracle oinstall 9.7M Mar 29 16:48 o1_mf_ncsn1_TAG20160329T164756_chndttym_.bkp
-rw-r----- 1 oracle oinstall 9.7M Mar 29 17:04 o1_mf_ncsn1_TAG20160329T170421_chnfr7p7_.bkp
-rw-r----- 1 oracle oinstall 2.1G Mar 29 16:48 o1_mf_nnnd0_TAG20160329T164756_chndsfck_.bkp
-rw-r----- 1 oracle oinstall 6.6M Mar 29 17:04 o1_mf_nnnd1_TAG20160329T170421_chnfr64j_.bkp
RMAN 의 기능 사용 여부 조회
SYS@ORCL AS SYSDBA> select file#,
2 avg(datafile_blocks) "blocks",
3 avg(blocks_read) "reads",
4 round(avg(blocks_read/datafile_blocks) * 100,3)|| '%' as "Read for Backup"
5 from v$backup_datafile
6 where incremental_level > 0
7 and used_change_tracking = 'YES'
8 group by file#
9 order by file#;
FILE# blocks reads Read for Backup
---------- ---------- ---------- -----------------------------------------
1 128000 131 .102%
2 192000 3331 1.735%
3 128000 361 .282%
4 46720 1 .002%
6 12800 1 .008%
7 12800 1 .008%
8 6400 1 .016%
9 10880 1 .009%
10 10880 1 .009%
11 12800 1 .008%
12 10112 1 .01%
13 1280 1 .078%
14 12800 1 .008%
15 640 1 .156%
17 12800 1 .008%
21 25600 1 .004%
25 12800 1 .008%
26 1280 1 .078%
FILE# = DATAFILE 번호
BLOCKS = 블록 수
READS = BLOCK TRACKING 사용 시
READ FOR BACKUP = % 만큼 빨라진다.
'Oracle > backup' 카테고리의 다른 글
RMAN 완전복구/불완전복구 (0) | 2022.01.26 |
---|---|
아카이브 모드에서 완전복구/불완전복구 (0) | 2022.01.26 |
Cold Backup && Hot Backup (0) | 2022.01.26 |
RMAN (Recovery Manager) (0) | 2022.01.26 |