打算写一系列的文章介绍11g的新特性和变化。
Oracle11g在备份和恢复方面新增了很多的功能,无论是性能、功能性、安全性和可操作性方面都有了不同程度的提高。
这一篇介绍11g的block change tracking功能的增强。
Oracle11新特性——备份恢复功能增强(一):http://yangtingkun.itpub.net/post/468/412991
Oracle11新特性——备份恢复功能增强(二):http://yangtingkun.itpub.net/post/468/414647
Oracle11新特性——备份恢复功能增强(三):http://yangtingkun.itpub.net/post/468/414834
Oracle11新特性——备份恢复功能增强(四):http://yangtingkun.itpub.net/post/468/414941
Oracle11新特性——备份恢复功能增强(五):http://yangtingkun.itpub.net/post/468/416015
Oracle11新特性——备份恢复功能增强(六):http://yangtingkun.itpub.net/post/468/423531
Oracle11新特性——备份恢复功能增强(七):http://yangtingkun.itpub.net/post/468/426943
Oracle11新特性——备份恢复功能增强(八):http://yangtingkun.itpub.net/post/468/427877
Oracle11新特性——备份恢复功能增强(九):http://yangtingkun.itpub.net/post/468/429571
Oracle11新特性——备份恢复功能增强(十):http://yangtingkun.itpub.net/post/468/432720
11g增强了数据库的数据块变化跟踪功能使得物理STANDBY数据库也可以使用这个功能。
在10g中,虽然物理STANDBY数据库也可以设置ENABLE BLOCK CHANGE TRACKING,但是实际上并不起作用:
$ sqlplus "/ as sysdba"
SQL*Plus: Release 10.2.0.3.0 - Production on 星期四 12月 27 16:41:50 2007
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> select database_role from v$database;
DATABASE_ROLE
----------------
PHYSICAL STANDBY
SQL> alter database enable block change tracking using file '/data1/track.trc';
数据库已更改。
SQL> exit;从 Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options 断开
$ rman target /
恢复管理器: Release 10.2.0.3.0 - Production on 星期四 12月 27 16:44:31 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
已连接到目标数据库: TESTRAC (DBID=4291216984, 未打开)
RMAN> backup incremental level 0 tablespace gpo;
启动 backup 于 27-12月-07使用目标数据库控制文件替代恢复目录忽略 DISK 通道 2 的配置分配的通道: ORA_DISK_1通道 ORA_DISK_1: sid=324 devtype=DISK通道 ORA_DISK_1: 启动增量级别 0 数据文件备份集通道 ORA_DISK_1: 正在指定备份集中的数据文件输入数据文件 fno=00015 name=/data1/oradata/testrac/gpo.367.624623443通道 ORA_DISK_1: 正在启动段 1 于 27-12月-07通道 ORA_DISK_1: 已完成段 1 于 27-12月-07段句柄=/data1/0bj4lr29_1_1 标记=TAG20071227T164600 注释=NONE通道 ORA_DISK_1: 备份集已完成, 经过时间:00:01:15完成 backup 于 27-12月-07
启动 Control File and SPFILE Autobackup 于 27-12月-07段 handle=/data/oracle/product/10.2/database/dbs/c-4291216984-20071227-02 comment=NONE完成 Control File and SPFILE Autobackup 于 27-12月-07
RMAN> host;
$ sqlplus gpo/gpo@testrac
SQL*Plus: Release 10.2.0.3.0 - Production on 星期四 12月 27 16:48:44 2007
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL> select default_tablespace from user_users;
DEFAULT_TABLESPACE
------------------------------
GPO
SQL> create table t_test (id number);
表已创建。
SQL> conn sys/test@testrac as sysdba已连接。
SQL> alter system archive log current;
系统已更改。
SQL> exit从 Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options 断开
$ exit主机命令完成
RMAN> backup incremental level 1 tablespace gpo;
启动 backup 于 27-12月-07使用通道 ORA_DISK_1通道 ORA_DISK_1: 启动增量级别 1 数据文件备份集通道 ORA_DISK_1: 正在指定备份集中的数据文件输入数据文件 fno=00015 name=/data1/oradata/testrac/gpo.367.624623443通道 ORA_DISK_1: 正在启动段 1 于 27-12月-07通道 ORA_DISK_1: 已完成段 1 于 27-12月-07段句柄=/data1/0ej4lrfr_1_1 标记=TAG20071227T165314 注释=NONE通道 ORA_DISK_1: 备份集已完成, 经过时间:00:02:35完成 backup 于 27-12月-07
启动 Control File and SPFILE Autobackup 于 27-12月-07段 handle=/data/oracle/product/10.2/database/dbs/c-4291216984-20071227-03 comment=NONE完成 Control File and SPFILE Autobackup 于 27-12月-07
而在11g中,物理STANDBY可以正常的使用这个功能了:
[oracle@yangtk2 ~]$ sqlplus "/ as sysdba"
SQL*Plus: Release 11.1.0.6.0 - Production on Wed Dec 19 05:19:43 2007
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select database_role from v$database;
DATABASE_ROLE
----------------
PHYSICAL STANDBY
SQL> alter database enable block change tracking using file '/data1/track.trc';
Database altered.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@yangtk2 ~]$ rman target /
Recovery Manager: Release 11.1.0.6.0 - Production on Wed Dec 19 05:33:11 2007
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: ORA11G (DBID=4026820313, not open)
RMAN> backup incremental level 0 tablespace yangtk;
Starting backup at 19-DEC-07
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=135 device type=DISK
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=00005 name=/data/oracle/oradata/ora11g/ORA11G_P/datafile/o1_mf_yangtk_3d3kn7k4_.dbf
input datafile file number=00006 name=/data/oracle/oradata/ora11g/ORA11G_P/datafile/o1_mf_yangtk_3g73q02m_.dbf
channel ORA_DISK_1: starting piece 1 at 19-DEC-07
channel ORA_DISK_1: finished piece 1 at 19-DEC-07
piece handle=/data1/backup/1aj3vgl5_1_1 tag=TAG20071219T053325 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:27
Finished backup at 19-DEC-07
Starting Control File and SPFILE Autobackup at 19-DEC-07
piece handle=/data1/c-4026820313-20071219-00 comment=NONE
Finished Control File and SPFILE Autobackup at 19-DEC-07
RMAN>
RMAN> host;
[oracle@yangtk2 ~]$ sqlplus "yangtk/yangtk@172.25.0.68/ora11g_p.ytk-thinkpad"
SQL*Plus: Release 11.1.0.6.0 - Production on Wed Dec 19 05:52:38 2007
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> create table t_test3(id number);
Table created.
SQL> alter system archive log current;
System altered.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@yangtk2 ~]$ exit
exit
host command complete
RMAN> backup incremental level 1 tablespace yangtk;
Starting backup at 19-DEC-07
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=00005 name=/data/oracle/oradata/ora11g/ORA11G_P/datafile/o1_mf_yangtk_3d3kn7k4_.dbf
input datafile file number=00006 name=/data/oracle/oradata/ora11g/ORA11G_P/datafile/o1_mf_yangtk_3g73q02m_.dbf
channel ORA_DISK_1: starting piece 1 at 19-DEC-07
channel ORA_DISK_1: finished piece 1 at 19-DEC-07
piece handle=/data1/backup/1cj3vhr4_1_1 tag=TAG20071219T055340 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 19-DEC-07
Starting Control File and SPFILE Autobackup at 19-DEC-07
piece handle=/data1/c-4026820313-20071219-01 comment=NONE
Finished Control File and SPFILE Autobackup at 19-DEC-07
无论是对比LEVEL 0备份时间和LEVEL 1备份时间,还是对比10g与11g,都可以看到,11g中BLOCK CHANGE TRACKING在STANDBY数据库中才真正起作用。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/4227/viewspace-69564/,如需转载,请注明出处,否则将追究法律责任。