天天看點

ORA-10458 ORA-01196 ORA-01110

公司erp系統,通過Oracle Dataguard實作主從同步,已經運作一年多,近期巡檢發現主從資料庫的資料不一緻了,從庫無法啟動,報ORA-10458 ORA-01196 ORA-01110

處理思路:檢視狀态發現資料庫在mount狀态,嘗試啟庫

SQL> select status from v$instance;

STATUS
------------
MOUNTED

SQL> alter database open;

alter database open
*
ERROR at line 1:
ORA-10458: standby database requires recovery
ORA-01196: file 1 is inconsistent due to a failed media recovery session
ORA-01110: data file 1: '/u01/app/oracle/oradata/ncdb/system01.dbf'      

檢查資料庫發現從庫監聽未啟動,啟動從庫監聽

[[email protected]_standby ~]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 15-JUN-2018 10:11:10

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Starting /u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.4.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/ncdb_standby/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.xx.xx)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.xx.xx)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                15-JUN-2018 10:11:10
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/ncdb_standby/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.xx.xx)(PORT=1521)))
Services Summary...
Service "standby" has 1 instance(s).
  Instance "NCDB", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully      

再次開庫成功,然後開啟實時應用

[[email protected]_standby ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Fri Jun 15 10:11:27 2018

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> alter database open;

Database altered.
SQL> recover managed standby database using current logfile disconnect;
Media recovery complete.
SQL> select open_mode,database_role from v$database;

OPEN_MODE         DATABASE_ROLE
-------------------- ----------------
READ ONLY WITH APPLY PHYSICAL STANDBY      

檢查日志是否正常引用

SQL> select max(sequence#) from v$archived_log where applied='YES';

MAX(SEQUENCE#)
--------------
     37594

SQL> /

MAX(SEQUENCE#)
--------------
     37595

SQL> /

MAX(SEQUENCE#)
--------------
     37595

SQL> /

MAX(SEQUENCE#)
--------------
     37595

SQL> /

MAX(SEQUENCE#)
--------------
     37596      

總結:當遇到的故障不影響業務運作時,切記不要盲目操作修改資料庫,首先應該檢視資料庫、作業系統以及存儲等基礎環境健康狀态,然後檢視資料庫自身問題!!!

版權聲明:本文為CSDN部落客「weixin_34319111」的原創文章,遵循CC 4.0 BY-SA版權協定,轉載請附上原文出處連結及本聲明。

原文連結:https://blog.csdn.net/weixin_34319111/article/details/92389256