概述

因UPS意外跳闸导致服务器宕机,将各服务恢复后,发现LIMS系统无法正常访问,通过报错提示发现监听有问题,处理方法见下文:

报错提示

处理

1.登陆到oracle数据库服务器

[root@lzdk ~]# su - oracle

2.查看监听状态

[oracle@lzdk ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 22-FEB-2021 18:06:29

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.91.116)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused

3.发现监听状态异常,先尝试手动启动监听

[oracle@lzdk ~]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 22-FEB-2021 18:06:38

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

Starting /u01/app/oracle/product/11.2.0/dbhome_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/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/lzdk/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.91.116)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.91.116)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                22-FEB-2021 18:06:38
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/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/lzdk/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.91.116)(PORT=1521)))
The listener supports no services
The command completed successfully

4.尝试访问系统,发现依旧报错,再回到数据库服务器,尝试使用sqlplus 命令连接数据库

[oracle@lzdk ~]$ sqlplus system/lzdkoracle@192.168.91.116:1521/LZDK

SQL*Plus: Release 11.2.0.4.0 Production on Mon Feb 22 18:24:14 2021

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

ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
Enter user-name: 

5.发现报错ORA-12514,尝试重启数据库
6.连接数据库

[oracle@lzdk ~]$ sqlplus /nolog
SQL> connect / as sysdba

7.关闭数据库

SQL> shutdown abort
ORACLE instance shut down.

8.启动数据库

SQL> startup
ORACLE instance started.

Total System Global Area 4008546304 bytes
Fixed Size                  2259440 bytes
Variable Size            1442842128 bytes
Database Buffers         2550136832 bytes
Redo Buffers               13307904 bytes
Database mounted.
Database opened.

9.最后发现系统访问成功,果然还是重启包治百病23333...

访问恢复正常