欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

standby_file_management 参数为manual 导致ORA-01111问题

程序员文章站 2022-07-04 19:42:47
情景: Dataguard 物理备库执行恢复报错: Errors in file /home/u01/app/diag/rdbms/rzorcl11g/ORCL/trace/ORCL_pr00_35893.trc:ORA-01111: name for data file 20 is unknown ......

情景:

Dataguard 物理备库执行恢复报错:

Errors in file /home/u01/app/diag/rdbms/rzorcl11g/ORCL/trace/ORCL_pr00_35893.trc:
ORA-01111: name for data file 20 is unknown - rename to correct file
ORA-01110: data file 20: '/home/u01/app/oracle/product/11.2.0/db_1/dbs/UNNAMED00020'
ORA-01157: cannot identify/lock data file 20 - see DBWR trace file
ORA-01111: name for data file 20 is unknown - rename to correct file
ORA-01110: data file 20: '/home/u01/app/oracle/product/11.2.0/db_1/dbs/UNNAMED00020'
Recovery Slave PR00 previously exited with exception 1111
MRP0: Background Media Recovery process shutdown (ORCL)


原因:参数standby_file_management 值是manual,导致主库增加数据文件时候备库没有自动增加。


SQL> show parameter standby_file_management


NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
standby_file_management     string          MANUAL

 

SQL> select file#,name from v$datafile where file#=20;


FILE#    NAME
---------- ----------------------------------------------------------------------------------------
20          /home/u01/app/oracle/product/11.2.0/db_1/dbs/UNNAMED00020

 

解决方法: 将该文件rename到正确的目录中,然后设置standby_file_management参数的值为auto。


SQL> alter database create datafile '/home/u01/app/oracle/product/11.2.0/db_1/dbs/UNNAMED00020' as '/home/u01/app/oradata/orcl11g/fsownbox04.dbf';

 

SQL> alter system set standby_file_management = auto;


再执行恢复:

SQL> alter database recover managed standby database disconnect from session;