公司erp系統,經過Oracle Dataguard實現主從同步,已經運行一年多,近期巡檢發現主從數據庫的數據不一致了,從庫沒法啓動,報ORA-10458 ORA-01196 ORA-01110sql
處理思路:查看狀態發現數據庫在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'
檢查數據庫發現從庫監聽未啓動,啓動從庫監聽session
[oracle@ncdb_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
再次開庫成功,而後開啓實時應用oracle
[oracle@ncdb_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
檢查日誌是否正常引用app
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
總結:當遇到的故障不影響業務運行時,切記不要盲目操做修改數據庫,首先應該查看數據庫、操做系統以及存儲等基礎環境健康狀態,而後查看數據庫自身問題!!!tcp