檢查 tns的日誌資訊 檢視具體報錯詳情
/u01/app/oracle/diag/tnslsnr/<hostname>/listener/alert/log.xml
修改litener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 124.220.13.28)(PORT = 1524))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(SID_NAME = orcl)
)
)
ADR_BASE_LISTENER = /u01/app/oracle
重啟監聽
[oracle@VM-4-17-centos admin]$ lsnrctl stop LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 09-JUL-2024 09:44:01 Copyright (c) 1991, 2009, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=124.220.13.28)(PORT=1524))) The command completed successfully [oracle@VM-4-17-centos admin]$ lsnrctl start LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 09-JUL-2024 09:44:09 Copyright (c) 1991, 2009, 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.1.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/VM-4-17-centos/listener/alert/log.xml Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=124.220.13.28)(PORT=1524))) Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=124.220.13.28)(PORT=1524))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production Start Date 09-JUL-2024 09:44:09 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/VM-4-17-centos/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=124.220.13.28)(PORT=1524))) Services Summary... Service "orcl" has 1 instance(s). Instance "orcl", status UNKNOWN, has 1 handler(s) for this service... The command completed successfully
tnsnames.ora 參考
[oracle@VM-4-17-centos admin]$ more tnsnames.ora # tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora # Generated by Oracle configuration tools. #LISTENER_ORCL = # (ADDRESS = (PROTOCOL = TCP)(HOST = VM-4-17-centos)(PORT = 1524)) #LISTENER = # (DESCRIPTION_LIST = # (DESCRIPTION = # (ADDRESS = (PROTOCOL = TCP)(HOST = VM-4-17-centos)(PORT = 1524)) # ) # ) ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 124.220.13.28)(PORT = 1524)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) )