我在重新启动新的MySQL ODBC连接时无法使我的监听器重新启动时遇到问题。
我已经创建了一个MySQL ODBC连接器
[root@localhost:10:19 ~]# cat /home/oracle/.odbc.ini
[root@localhost:10:19 ~]# cat /etc/odbc.ini
[ODBC Data Sources]
mydb = MySQL ODBC 8.0 ANSI Driver
[mydb]
Driver = /usr/lib64/libmyodbc8a.so
DATABASE = mydb
DESCRIPTION = Liferay 7 database
PORT = 3306
SERVER = localhost
OPTION = 3
SOCKET =
[oracle@localhost:10:22 ~]$ cat $ORACLE_HOME/hs/admin/initmydb.ora
#
# HS init parameters
#
HS_FDS_CONNECT_INFO = mydb
HS_FDS_TRACE_LEVEL = 0
HS_FDS_SHAREABLE_NAME = /usr/lib64/libmyodbc8a.so
#
# ODBC specific environment variables
#
set ODBCINI=/home/oracle/.odbc.ini
set LD_LIBRARY_PATH=/usr/lib64
#
# Environment variables required for the non-Oracle system
#
set HOME=/home/oracle
[grid@localhost:10:25 ~]$ cat $ORACLE_HOME/network/admin/listener.ora
# listener.ora Network Configuration File: /u01/app/grid/12.1.0/grid/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent
VALID_NODE_CHECKING_REGISTRATION_LISTENER=SUBNET # line added by Agent
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(SID_NAME=mydb)
(ORACLE_HOME=/u01/app/oracle/12.1.0/oracle)
(PROGRAM=dg4odbc)
(ENVS="LD_LIBRARY_PATH=/usr/lib64:/u01/app/oracle/product/12.1.0/oracle/lib")
)
当我停止/重新启动监听器时,此方法正常工作
[grid@localhost:13:28 ~]$ lsnrctl stop
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 08-AUG-2018 13:28:15
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
The command completed successfully
[grid@localhost:13:28 ~]$ lsnrctl start
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 08-AUG-2018 13:28:18
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Starting /u01/app/grid/12.1.0/grid/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 12.1.0.2.0 - Production
System parameter file is /u01/app/grid/12.1.0/grid/network/admin/listener.ora
Log messages written to /u01/app/grid/diag/tnslsnr/localhost/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date 08-AUG-2018 13:28:18
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/grid/12.1.0/grid/network/admin/listener.ora
Listener Log File /u01/app/grid/diag/tnslsnr/localhost/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "mydb" has 1 instance(s).
Instance "mydb", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
此后,我可以远程连接到我的oracle模式,并查询“ mydb”数据库链接。
如果我重新启动服务器,则数据库链接将不再起作用。
lsnrctl status
显示与mydb相同的信息
Service "mydb" has 1 instance(s).
Instance "mydb", status UNKNOWN, has 1 handler(s) for this service...
我试图延迟监听器服务,以为启动监听器时MySQL服务可能无法启动并运行。 STARTUP_WAIT_TIME_LISTENER = 120
在listener.ora中,但没有任何改变。
我是否缺少一些配置属性来使其正常工作?