alter database enable block change tracking using file '/oradata/block_track.log';
alter database enable block change tracking using file ‘+data’;
alter database enable block change tracking using file ‘/dev/rlvbct’;
通过查询v$block_change_tracking视图查询bct的使用情况。
禁用bct:
alter database disable block change tracking;
修改块修改跟踪文件路径修改块修改跟踪文件可以通过alter database rename file命令,但是只能在mount状态下操作。
查看当前块修改跟踪文件路径:
SQL> select filename from v$block_change_tracking;FILENAME--------------------------------------------------------------------------------------E:/ORACLE/PRODUCT/10.2.0/DB_1/DATABASE/RMAN_INC.TRKShutdown 数据库并启动到mount状态:
SQL> shutdown immediateDatabase closed.Database dismounted.ORACLE instance shut down.SQL> startup mountORACLE instance started.Total System Global Area 167772160 bytesFixed Size 1295608 bytesVariable Size 88083208 bytesDatabase Buffers 71303168 bytesRedo Buffers 7090176 bytesDatabase mounted.手工复制块修改文件到新路径下,然后执行alter database命令:
SQL> alter database rename file 'E:/ORACLE/PRODUCT/10.2.0/DB_1/DATABASE/RMAN_INC.TRK'2 to 'E:/oracle/oradata/jssweb/rman_inc.trk';Database altered.SQL> alter database open;Database altered.查看当前块修改跟踪文件路径:
SQL> select filename from v$block_change_tracking;FILENAME-----------------------------------------------------E:/ORACLE/ORADATA/JSSWEB/RMAN_INC.TRK如果你的数 据库无法shutdown , 其实也无所谓,先disable,然后执行enable时指定一个新路径也可以的:),只不过,原来文件中记录的块修改的跟踪信息也就没有了。
3.How To Size the Block Change Tracking File [ID 306112.1]
In this Document
Goal
SolutionPlatforms: 1-914CU;
This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process and therefore has not been subject to an independent technical review. |
1. 通过位图跟踪两次备份间变化的数据块;
2. 每次备份前进行位图切换;
3. 开发增量备份策略时,要考虑到8个位图的限制;
4. 在RAC环境中,change tracking file需要放在共享存储上;
5. Change tracking file的大小和数据库的大小和enabled的redo thread的个数成正比;
6. Change tracking file的大小和数据更新的频率无关;
7. 在mount或open状态下enable change tracking;
8.Enable change tracking
ALTER DATABASE ENABLE BLOCK CHANGE TRACKING USING FILE '/mydir/rman_change_track.f' REUSE;
9.Disable change tracking
ALTER DATABASE DISABLE BLOCK CHANGE TRACKING;
10. 检查change tracking状态
SELECT STATUS, FILENAME FROM V$BLOCK_CHANGE_TRACKING;
11. 改变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;