1.查看当前是否开启了块跟踪
SQL> select * from v$block_change_tracking;
STATUS FILENAME BYTES
---------- ------------------------------ ----------
DISABLED
2.开户块跟踪
SQL> alter database enable block change tracking;
Database altered.
或加文件名
SQL> alter database enable block change tracking using file'/opt/oracle/oradata/blktrace/blk_trace.dbf';
4. 改变change tracking file的位置
1) 不关闭数据库的方式
SQL> ALTER DATABASE DISABLE BLOCK CHANGE TRACKING;
SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING USING FILE 'new_location';
注意:这种方式会丢失change tracking file的内容
2) 关闭数据库的方式
SQL> SELECT FILENAME FROM V$BLOCK_CHANGE_TRACKING;(确定当前的文件名)
SQL> SHUTDOWN IMMEDIATE
用操作系统命令将文件move到新路径
SQL> ALTER DATABASE RENAME FILE
'/disk1/changetracking/o1_mf_2f71np5j_.chg' TO
'/disk2/changetracking/o1_mf_2f71np5j_.chg';
SQL> ALTER DATABASE OPEN;