Aug 20, 2024 No Comments ORA-01186、ORA-01157、ORA-01111、ORA-01110 错误处理方法 主库添加数据库文件,备库由于和主库路径不一致,而且未设置db\_file\_name\_convert参数,导致备库没有创建数据文件,从而出现报错导致MRP进程关闭,进而导致主备数据不一致 ```auto Errors in file /u01/app/oracle/diag/rdbms/hisdg/hospital/trace/hospital_dbw0_3130.trc: ORA-01186: file 136 failed verification tests ORA-01157: cannot identify/lock data file 136 - see DBWR trace file ORA-01111: name for data file 136 is unknown - rename to correct file ORA-01110: data file 136: '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00136' File 136 not verified due to error ORA-01157 MRP0: Background Media Recovery terminated with error 1111 ``` 处理方法: 将备库启动到mount状态 ```auto SQL> select name,open_mode,database_role from v$database; NAME OPEN_MODE DATABASE_ROLE --------- -------------------- ---------------- HOSPITAL MOUNTED PHYSICAL STANDBY ``` 将standby\_file\_management改为manual ```auto SQL> alter system set standby_file_management=manual; System altered. SQL> show parameter standby NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ standby_archive_dest string ?/dbs/arch standby_file_management string MANUAL ``` 主库检查136号数据文件 ```auto SQL> select file#,name from v$datafile where file#=136; FILE# ---------- NAME -------------------------------------------------------------------------------- 136 +DATA/hospital/datafile/ts_siim601.dbf ``` 备库使用create datafile as方式创建数据文件 ```auto SQL> alter database create datafile '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00136' as '/oradata/hospital/ts_siim601.dbf'; Database altered. SQL> select file#,name from v$datafile where file#=136; FILE# ---------- NAME -------------------------------------------------------------------------------- 136 /oradata/hospital/ts_siim601.dbf ``` 修改standby\_file\_management参数为auto ```auto SQL> alter system set standby_file_management=auto; System altered. SQL> show parameter standby NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ standby_archive_dest string ?/dbs/arch standby_file_management string AUTO ``` 开启MRP,检查数据同步情况 ```auto SQL> alter database recover managed standby database using current logfile disconnect from session; Database altered. SQL> select process,status,thread#,sequence#,block# from v$managed_standby; PROCESS STATUS THREAD# SEQUENCE# BLOCK# --------- ------------ ---------- ---------- ---------- ARCH CLOSING 2 159281 2048 ARCH CONNECTED 0 0 0 ARCH CLOSING 1 208304 16384 ARCH CLOSING 2 159282 8192 MRP0 APPLYING_LOG 1 208305 43222 RFS IDLE 0 0 0 RFS IDLE 0 0 0 RFS IDLE 0 0 0 RFS IDLE 1 208305 43250 RFS IDLE 0 0 0 RFS IDLE 0 0 0 PROCESS STATUS THREAD# SEQUENCE# BLOCK# --------- ------------ ---------- ---------- ---------- RFS IDLE 0 0 0 RFS IDLE 2 159283 49040 13 rows selected. SQL> select process,status,thread#,sequence#,block# from v$managed_standby; PROCESS STATUS THREAD# SEQUENCE# BLOCK# --------- ------------ ---------- ---------- ---------- ARCH CLOSING 2 159281 2048 ARCH CONNECTED 0 0 0 ARCH CLOSING 1 208304 16384 ARCH CLOSING 2 159282 8192 MRP0 APPLYING_LOG 1 208305 44453 RFS IDLE 0 0 0 RFS IDLE 0 0 0 RFS IDLE 0 0 0 RFS IDLE 1 208305 44450 RFS IDLE 0 0 0 RFS IDLE 0 0 0 PROCESS STATUS THREAD# SEQUENCE# BLOCK# --------- ------------ ---------- ---------- ---------- RFS IDLE 0 0 0 RFS IDLE 2 159283 49267 13 rows selected. SQL> select process,status,thread#,sequence#,block# from v$managed_standby; PROCESS STATUS THREAD# SEQUENCE# BLOCK# --------- ------------ ---------- ---------- ---------- ARCH CLOSING 2 159281 2048 ARCH CONNECTED 0 0 0 ARCH CLOSING 1 208304 16384 ARCH CLOSING 2 159282 8192 MRP0 APPLYING_LOG 1 208305 44515 RFS IDLE 0 0 0 RFS IDLE 0 0 0 RFS IDLE 0 0 0 RFS IDLE 1 208305 44516 RFS IDLE 0 0 0 RFS IDLE 0 0 0 PROCESS STATUS THREAD# SEQUENCE# BLOCK# --------- ------------ ---------- ---------- ---------- RFS IDLE 0 0 0 RFS IDLE 2 159283 49277 13 rows selected. ``` 最后更新于 2024-08-20 20:55:40 并被添加「」标签,已有 534 位童鞋阅读过。 本站使用「署名 4.0 国际」创作共享协议,可自由转载、引用,但需署名作者且注明文章出处
此处评论已关闭