Physical Standby出现ORA-10458,ORA-01157,ORA-01111
今天在测试系统中启动Physical Standby,发现报错,最终查出原因是有人在测试库中创建了个tablespace而且把datafile没有放在默认path,导致db_file_name_convert没有产生作用。
系统环境:DB11.2.0.2,Primary和Standby都在同一台主机上
SQL> startup ORACLE instance started. Total System Global Area 627732480 bytes Fixed Size 1345768 bytes Variable Size 411043608 bytes DATABASE Buffers 209715200 bytes Redo Buffers 5627904 bytes DATABASE mounted. ORA-10458: standby DATABASE requires recovery ORA-01157: cannot identify/LOCK DATA file 7 - see DBWR trace file. ORA-01111:name FOR DATA file 7 IS unknown - RENAME TO correct file ORA-01110: DATA file 7: '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00007' SQL> SELECT name FROM v$datafile; NAME -------------------------------------------------------------------------------- /u01/app/oracle/oradata/orcldg/system01.dbf /u01/app/oracle/oradata/orcldg/sysaux01.dbf /u01/app/oracle/oradata/orcldg/undotbs01.dbf /u01/app/oracle/oradata/orcldg/users01.dbf /u01/app/oracle/oradata/orcldg/soe.dbf /u01/app/oracle/oradata/orcldg/soeindex.dbf /u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00007 SQL> SHOW parameter convert NAME TYPE ------------------------------------ --------------------------------- VALUE ------------------------------ db_file_name_convert string /u01/app/oracle/oradata/orcl, /u01/app/oracle/oradata/orcldg log_file_name_convert string /u01/app/oracle/oradata/orcl, /u01/app/oracle/oradata/orcldg SQL> !
[oracle@cdcjp28 ~]$ vi diag/rdbms/orcldg/orcldg/trace/alert_orcldg.log
Thu Jul 15 16:11:35 2010
WARNING: File being created with same name as in Primary
Existing file may be overwritten
Errors in file /u01/app/oracle/product/11.2.0/dbhome_1/diag/rdbms/orcldg/orcldg/trace/orcldg_pr00_5141.trc:
ORA-01119: error in creating database file ‘/u01/app/oracle/product/11.2.0/dbhome_1/dbs/sh.dbf’
ORA-27086: unable to lock file – already in use
Linux Error: 11: Resource temporarily unavailable
Additional information: 8
Additional information: 29207
File #7 added to control file as ‘UNNAMED00007′.
Originally created as:
‘/u01/app/oracle/product/11.2.0/dbhome_1/dbs/sh.dbf’
Recovery was unable to create the file as:
‘/u01/app/oracle/product/11.2.0/dbhome_1/dbs/sh.dbf’
MRP0: Background Media Recovery terminated with error 1274
Errors in file /u01/app/oracle/product/11.2.0/dbhome_1/diag/rdbms/orcldg/orcldg/trace/orcldg_pr00_5141.trc:
ORA-01274: cannot add datafile ‘/u01/app/oracle/product/11.2.0/dbhome_1/dbs/sh.dbf’ – file could not be created
Managed Standby Recovery not using Real Time Apply
Recovery interrupted!
解决方案是先把standby_file_management设置为手动,把添加的数据文件拷到备库放datafile的地方,rename到这个新位置,然后把standby_file_management设置为auto,重启备库,搞定!
[oracle@cdcjp28 ~]$ cp /u01/app/oracle/product/11.2.0/dbhome_1/dbs/sh.dbf /u01/app/oracle/oradata/orcldg/sh.dbf
SQL> ALTER system SET standby_file_management='manual'; System altered. SQL> ALTER DATABASE RENAME file '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00007' TO '/u01/app/oracle/oradata/orcldg/sh.dbf'; System altered. SQL> ALTER system SET standby_file_management='auto'; System altered. SQL> shutdown immediate SQL> startup

最近评论