standby数据库参数
SQL> show parameter standby

NAME TYPE VALUE
———————————— ———– ——————————
standby_archive_dest string ?/dbs/arch
standby_file_management string MANUAL

在主库新建表空间后,备库alert报错,并且mrp进程终止
主库执行的命令:
create tablespace tbs_test datafile ‘/u01/app/oracle/oradata/prod/tbs_test01.dbf’ size 10m;
备库alert:

File #8 added to control file as ‘UNNAMED00008’ because
the parameter STANDBY_FILE_MANAGEMENT is set to MANUAL
The file should be manually created to continue.
MRP0: Background Media Recovery terminated with error 1274
Errors in file /u01/app/oracle/diag/rdbms/prodadg/prodadg/trace/prodadg_mrp0_5349.trc:
ORA-01274: cannot add datafile ‘/u01/app/oracle/oradata/prod/tbs_test01.dbf’ – file could not be created
Managed Standby Recovery not using Real Time Apply
Recovery interrupted!
Recovered data files to a consistent state at change 2985040
MRP0: Background Media Recovery process shutdown (prodadg)
尝试在备库直接重建表空间,创建失败
SQL> create tablespace tbs_test datafile ‘/u01/app/oracle/oradata/prod/tbs_test01.dbf’ size 10m;
create tablespace tbs_test datafile ‘/u01/app/oracle/oradata/prod/tbs_test01.dbf’ size 10m
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-16000: database open for read-only access
正确处理方法:
1.备库shutdown immediate

2.备库startup mount

3.备库查询
SQL> select file#,name from v$datafile where name like ‘%UNNAMED%’;

FILE# NAME
———– ———————————————————————
8 /u01/app/oracle/product/11.2.0/db1/dbs/UNNAMED00008

执行语句:
alter database create datafile ‘/u01/app/oracle/product/11.2.0/db1/dbs/UNNAMED00008’ as ‘/u01/app/oracle/oradata/prod/tbs_test01.dbf’;

alter system set standby_file_management = ‘AUTO’;

4.打开备库alter database open

备库操作时间的日志
Thu Sep 25 11:38:50 2014
db_recovery_file_dest_size of 10240 MB is 0.00% used. This is a
user-specified limit on the amount of space that will be used by this
database for recovery-related files, and does not reflect the amount of
space available in the underlying filesystem or ASM diskgroup.
Thu Sep 25 13:41:35 2014
alter database create datafile ‘/u01/app/oracle/product/11.2.0/db1/dbs/UNNAMED00008’ as ‘/u01/app/oracle/oradata/prod/tbs_test01.dbf’
Completed: alter database create datafile ‘/u01/app/oracle/product/11.2.0/db1/dbs/UNNAMED00008’ as ‘/u01/app/oracle/oradata/prod/tbs_test01.dbf’
Thu Sep 25 13:42:22 2014
ALTER SYSTEM SET standby_file_management=’AUTO’ SCOPE=BOTH;
Thu Sep 25 13:42:58 2014
alter database open
Signalling error 1152 for datafile 8!
Beginning standby crash recovery.
Serial Media Recovery started
Managed Standby Recovery starting Real Time Apply
Media Recovery Log /u01/app/oracle/arch2/1_312_852658663.dbf
Incomplete Recovery applied until change 2985040 time 09/25/2014 11:17:06
Completed standby crash recovery.
Thu Sep 25 13:43:00 2014
SMON: enabling cache recovery
Dictionary check beginning
File #8 in the controlfile not found in data dictionary.
Removing file from controlfile.
data file 8: ‘/u01/app/oracle/oradata/prod/tbs_test01.dbf’
Tablespace ‘TBS_TEST’ #8 found in controlfile,
but not in the data dictionary. Deleting from controlfile.
Dictionary check complete
Database Characterset is ZHS16GBK
No Resource Manager plan active
replication_dependency_tracking turned off (no async multimaster replication found)
Physical standby database opened for read only access.
Completed: alter database open
开启mrp进程恢复备库后,standby恢复正常。