ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 揭秘ORACLE备份之----RMAN之四(块跟踪)

揭秘ORACLE备份之----RMAN之四(块跟踪)

原创 Linux操作系统 作者:wailon 时间:2013-11-16 22:13:04 0 删除 编辑

Block Change Tracking(块跟踪)主要用于RMAN备份的增量备份,记录自从上一次备份以来数据块的变化,相关后台进程CTWR(Change Tracking Writer)
改善增量备份性能,RMAN可以不再扫描整个文件以查找变更数据。从10g开始提供此功能。

le@vmrac1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Mon Oct 28 18:31:47 2013

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


 Connected to:
 Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
 With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
 Data Mining and Real Application Testing options

SQL> -- 增量备份的数据块跟踪
SQL> select * from v$block_change_tracking;

STATUS     FILENAME                            BYTES
 ---------- ------------------------------ ----------
 DISABLED

SQL> -- 开启数据块跟踪功能
 SQL> alter database enable block change tracking;

Database altered.

SQL> select * from v$block_change_tracking;

STATUS     FILENAME                                                           BYTES
 ---------- --------------------------------------------------------------- ----------
 ENABLED    +DATA/rac/changetracking/ctf.279.830025153   11599872
            

SQL> -- 数据块跟踪进程CTWR
 SQL> host ps -ef | grep ctwr
 oracle   11886     1  0 18:32 ?        00:00:00 ora_ctwr_rac1
 oracle   11894 11875  0 18:32 pts/2    00:00:00 /bin/bash -c ps -ef | grep ctwr
 oracle   11896 11894  0 18:32 pts/2    00:00:00 grep ctwr

SQL> -- 关闭数据块更改跟踪功能
 SQL> alter database disable block change tracking;

Database altered.

SQL> select * from v$block_change_tracking;

STATUS     FILENAME                            BYTES
 ---------- ------------------------------ ----------
 DISABLED

SQL> -- 开启跟踪功能,并使用指定文件记录数据块更改
 SQL> alter database enable block change tracking using file '/home/oracle/ctf';

Database altered.

SQL> select * from v$block_change_tracking;

STATUS     FILENAME                          BYTES
 ---------- ------------------------------------ ----------
 ENABLED    /home/oracle/ctf               11599872

SQL> alter database disable block change tracking;

Database altered.

SQL> select * from v$block_change_tracking;

STATUS     FILENAME                            BYTES
 ---------- ------------------------------ ----------
 DISABLED

SQL> alter database enable block change tracking;

Database altered.
-- 自动生成跟踪文件

SQL> select * from v$block_change_tracking;

STATUS     FILENAME                                                            BYTES
 ---------- ----------------------------------------------------------------- ----------
 ENABLED    +DATA/rac/changetracking/ctf.280.830025283     11599872

SQL> exit
 Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
 With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
 Data Mining and Real Application Testing options
 [oracle@vmrac1 ~]$ su - grid
 Password:
[grid@vmrac1 ~]$ rlwrap asmcmd -p
 ASMCMD [+] > ls
 DATA/
 ASMCMD [+] > cd data
 ASMCMD [+data] > ls
 RAC/
 vmrac/
 ASMCMD [+data] > cd rac
 ASMCMD [+data/rac] > ls
 ARCHIVELOG/
 BACKUPSET/
 CHANGETRACKING/
 CONTROLFILE/
 DATAFILE/
 ONLINELOG/
 PARAMETERFILE/
 TEMPFILE/
 spfilerac.ora
 ASMCMD [+data/rac] > cd changetracking
 ASMCMD [+data/rac/changetracking] > ls
 ctf.279.830025153
 ctf.280.830025283
 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/429786/viewspace-776767/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2013-11-08

  • 博文量
    51
  • 访问量
    292199