Oracle 12C 块修改跟踪(Block chage tracking) 功能
分类: Oracle
2015-10-21 14:51:47
在使用RMAN备份数据库的时候,无论是全备还是增量备份都要全部扫描所有的块,如果开启块修改跟踪功能的话,便可记录从上一次备份之后内容有变化的块,避免全部扫描块,从而节省备份时间,对于数据量大而且备份窗口相对较紧张的系统,是个不错的功能,该功能有一定的性能开销。该功能是从10G开始有的。
开启快跟踪功能:
需要在CDB层面开启该功能,在PDB开启会报错:
SQL> alter session set container=tea;
Session altered.
SQL> alter database enable block
change tracking using
file'/oracle/app/oradata/CUP/0CAEA15F428B1C4DE0537EE0A8C05257/datafile/btc.bt';
alter database enable block change tracking using file'/oracle/app/oradata/CUP/0CAEA15F428B1C4DE0537EE0A8C05257/datafile/btc.bt'
*
ERROR at line 1:
ORA-65040: operation not allowed from within a pluggable database
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
[oracle@cafe ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Mon Oct 19 14:13:27 2015
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> alter database enable block change tracking using file'/oracle/app/oradata/CUP/datafile/btc.bt'; ---可以指定文件,也可以不指定,
在关闭块修改跟踪后 文件会自动清除。
Database altered.
查看该功能是否开启:
SQL> col filename for a39
SQL> select * from v$block_change_tracking;
STATUS FILENAME BYTES CON_ID
---------- --------------------------------------- ---------- ----------
ENABLED /oracle/app/oradata/CUP/datafile/btc.bt 11599872 1
关闭块跟踪:
SQL> alter database disable block change tracking;
Database altered.
SQL> select * from v$block_change_tracking;
STATUS FILENAME BYTES CON_ID
---------- --------------------------------------- ---------- ----------
DISABLED
操作很简单,不是嘛~