The Network Adapter could not establish the connection.
라는 오류가 나는 이유는 여러가지가 있겠지만,
가장 먼저 확인 해볼것은 오라클 서버에서 listener 가 잘 작동하고 있는지를 확인하는 것이다.
리스너(Listener)의 상태를 확인하고,
no listerner 라는 메시지가 있다면 리스너가 작동하지 않는 것이므로 리스너(Listener)를 시작해준다.
# 리스너(Listener)의 상태 확인 - centosme(호스트네임)
lsnrctl status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 2: No such file or directory
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=centosme)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
# 리스너(Listener) 시작 - centosme(호스트네임)
lsnrctl start
...
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=centosme)(PORT=1521)))
The listener supports no services
The command completed successfully
# 리스너(Listener)의 상태를 다시 확인, - centosme(호스트네임), MYDB(서비스네임)
lsnrctl status
...
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=centosme)(PORT=1521)))
Services Summary...
Service "MYDB" has 1 instance(s).
Instance "MYDB", status READY, has 1 handler(s) for this service...
Service "MYDBXDB" has 1 instance(s).
Instance "MYDB", status READY, has 1 handler(s) for this service...
The command completed successfully
# 다시 Sql Developer 에서 접속테스트를 해본다.
# 리스너(Listener) 멈추고 싶을때
lsnrctl stop
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 19-JAN-2020 06:16:01
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
The command completed successfully
광고>