某书载在备份控制文件的时候,也会自动的备份初始化参数文件,抱着愚钝的
完事亲力亲为的态度,做了如下的小验证。
RMAN> list backup of controlfile;
specification does not match any backup in the repository
RMAN> list backup of spfile;
specification does not match any backup in the repository
现在开始备份控制文件。
RMAN> backup current controlfile;
查看刚才备份的控制文件。
RMAN> list backup of controlfile;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
34 Full 9.42M DISK 00:00:05 07-JUN-12
BP Key: 42 Status: AVAILABLE Compressed: NO Tag: TAG20120607T213934
Piece Name: E:ORACLEENGPRODUCT11.2.0DBHOME_1DATABASE12NCVGGM_1_1
Control File Included: Ckp SCN: 3278250 Ckp time: 07-JUN-12
查看是否同时备份了spfile 。结果是没有。
RMAN> list backup of spfile;
specification does not match any backup in the repository
开启controlfile 的自动备份功能。
RMAN> configure controlfile autobackup on;
现在开始备份datafile 编号为4 的数据文件(users表空间中的数据文件)。
RMAN> backup datafile 4;
备份输出日志中有这么一段。
Starting Control File and SPFILE Autobackup at 07-JUN-12
piece handle=E:ORACLEENGPRODUCT11.2.0DBHOME_1DATABASEC-1654872695-20120607-00 comment=NONE
Finished Control File and SPFILE Autobackup at 07-JUN-12
由上面的输出我们可以知道这时候rman 不仅备份了控制文件也同时备份了spfile。
查看备份后的,备份集信息。
RMAN> list backup of controlfile;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
34 Full 9.42M DISK 00:00:05 07-JUN-12
BP Key: 42 Status: AVAILABLE Compressed: NO Tag: TAG20120607T213934
Piece Name: E:ORACLEENGPRODUCT11.2.0DBHOME_1DATABASE12NCVGGM_1_1
Control File Included: Ckp SCN: 3278250 Ckp time: 07-JUN-12
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
36 Full 9.45M DISK 00:00:03 07-JUN-12
BP Key: 44 Status: AVAILABLE Compressed: NO Tag: TAG20120607T214743
Piece Name: E:ORACLEENGPRODUCT11.2.0DBHOME_1DATABASEC-1654872695-20120607-00
Control File Included: Ckp SCN: 3279100 Ckp time: 07-JUN-12
RMAN> list backup of spfile;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
36 Full 9.45M DISK 00:00:03 07-JUN-12
BP Key: 44 Status: AVAILABLE Compressed: NO Tag: TAG20120607T214743
Piece Name: E:ORACLEENGPRODUCT11.2.0DBHOME_1DATABASEC-1654872695-20120607-00
SPFILE Included: Modification time: 07-JUN-12
SPFILE db_unique_name: ORACLE
现在再来尝试下。使用下面这种方式来顺带备份控制文件的时候,也会同时备份spfile。
RMAN> backup datafile 4 include current controlfile;
Starting Control File and SPFILE Autobackup at 07-JUN-12
piece handle=E:ORACLEENGPRODUCT11.2.0DBHOME_1DATABASEC-1654872695-20120607-01 comment=NONE
Finished Control File and SPFILE Autobackup at 07-JUN-12
查看备份后的,备份集信息。
RMAN> list backup of spfile;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
36 Full 9.45M DISK 00:00:03 07-JUN-12
BP Key: 44 Status: AVAILABLE Compressed: NO Tag: TAG20120607T214743
Piece Name: E:ORACLEENGPRODUCT11.2.0DBHOME_1DATABASEC-1654872695-20120607-00
SPFILE Included: Modification time: 07-JUN-12
SPFILE db_unique_name: ORACLE
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
39 Full 9.45M DISK 00:00:03 07-JUN-12
BP Key: 47 Status: AVAILABLE Compressed: NO Tag: TAG20120607T215540
Piece Name: E:ORACLEENGPRODUCT11.2.0DBHOME_1DATABASEC-1654872695-20120607-01
SPFILE Included: Modification time: 07-JUN-12
SPFILE db_unique_name: ORACLE
如果你把controlfile autobackup 配置成on 的情况下。
RMAN> backup current controlfile;也会自动的备份spfile。
现在把controlfile autobackup 配置成off。
RMAN> configure controlfile autobackup off;
RMAN> backup datafile 4 include current controlfile;表现就不同了不会自动的备份spfile.
小结:
不要试图总结出什么情况下备份控制文件的时候会自动备份spfile。也不要相信备份控制文件
的时候会自动备份spfile 。你有备份spfile 的需要那就显式的使用RMAN> backup spfile;备份吧。