Oracle11新特性——備份恢復功能增強(十一)

yangtingkun發表於2007-12-29

打算寫一系列的文章介紹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 TRACKINGSTANDBY資料庫中才真正起作用。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/4227/viewspace-69564/,如需轉載,請註明出處,否則將追究法律責任。

相關文章