这个标题又够长的,可是不这么长无法将意思表达清楚。11.1.0.6上的bug,导致11g的物理STANDBY只读打开且应用日志的时候是无法进行备份的。
STANDBY数据库的两种工作状态:应用日志状态和只读打开状态,都是可以进行备份的,而只读打开且同时应用日志状态备份报错:
[oracle@yangtk2 ~]$ sqlplus "/ as sysdba"
SQL*Plus: Release 11.1.0.6.0 - Production on Wed Dec 19 08:44:50 2007
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startupmount ORACLE instance started.
Total System Global Area 267825152 bytes
Fixed Size 1299316 bytes
Variable Size 167775372 bytes
Database Buffers 96468992 bytes
Redo Buffers 2281472 bytes
Database mounted.
SQL> alter database recover managed standby database disconnect from session;
Database altered.
SQL> host
[oracle@yangtk2 ~]$ rman target /
Recovery Manager: Release 11.1.0.6.0 - Production on Wed Dec 19 08:45:33 2007
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: ORA11G (DBID=4026820313, not open)
RMAN> backup tablespace users;
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=140 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=/data/oracle/oradata/ora11g/ORA11G_P/datafile/o1_mf_users_3d37bq45_.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/1sj3vru6_1_1 tag=TAG20071219T084558 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 19-DEC-07
RMAN> exit
Recovery Manager complete.
[oracle@yangtk2 ~]$ exit
exit
SQL> alter database recover managed standby database cancel;
Database altered.
SQL> alter database open;
Database altered.
SQL> host
[oracle@yangtk2 ~]$ rman target /
Recovery Manager: Release 11.1.0.6.0 - Production on Wed Dec 19 08:47:10 2007
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: ORA11G (DBID=4026820313)
RMAN> backup tablespace users;
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=145 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=/data/oracle/oradata/ora11g/ORA11G_P/datafile/o1_mf_users_3d37bq45_.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/1tj3vs0m_1_1 tag=TAG20071219T084717 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 19-DEC-07
RMAN> exit
Recovery Manager complete.
[oracle@yangtk2 ~]$ exit
exit
SQL> alter database recover managed standby database disconnect from session;
Database altered.
SQL> host;
[oracle@yangtk2 ~]$ rman target /
Recovery Manager: Release 11.1.0.6.0 - Production on Wed Dec 19 08:47:42 2007
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: ORA11G (DBID=4026820313)
RMAN> backup tablespace users;
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=137 device type=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 12/19/2007 08:47:47
ORA-01153: an incompatible media recovery is active
从原理上考虑,只读打开状态不会对备份产生影响,既然应用日志的时候可以进行备份,那么只读打开状态下应用日志应该也是可以进行备份。
怀疑是Oracle的bug,查询Metalink,发现果然是bug:Bug No. 6454190,Oracle计划在11.1.0.7fixed这个bug。