본문 바로가기

Database/Oracle

13 - [Oracle 19C] Listener

 

 

 

# listener.ora

# listener.ora Network Configuration File: /u01/app/oracle/product/19/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = test.com)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

 

 

 

# tnsname.ora

# tnsnames.ora Network Configuration File: /u01/app/oracle/product/19/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

LISTENER_ORCL =
  (ADDRESS = (PROTOCOL = TCP)(HOST = test.com)(PORT = 1521))


ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = test.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl.com)
    )
  )

 

 

 


SQL> select instance_name from v$instance;

INSTANCE_NAME
----------------
orcl

SQL>

 

 

 

 

위와 같은 오류가 발생한 경우, 네트워크가 문제이거나 또는 리스너가 동작하지 않는 경우가 대부분이다.

 

[oracle@test ~]$ lsnrctl start

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 14-NOV-2023 16:43:56

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

Starting /u01/app/oracle/product/19/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /u01/app/oracle/product/19/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/test/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test.com)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                14-NOV-2023 16:43:57
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/19/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/test/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test.com)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully
[oracle@test ~]$

 

 

 

60초 이후에 상태를 확인하면 모든 서비스가 실행되고 있음을 알 수 있다.

 

[oracle@test ~]$ lsnrctl status

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 14-NOV-2023 16:46:35

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                14-NOV-2023 16:43:57
Uptime                    0 days 0 hr. 2 min. 37 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/19/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/test/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test.com)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=test.com)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/admin/orcl/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "09d7302c9140311ce0639802a8c09c66.com" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
Service "86b637b62fdf7a65e053f706e80a27ca.com" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orcl.com" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB.com" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclpdb.com" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@test ~]$

 

orcl.com - the container database ORCL which is my main database, and I have a services name called

orclpdb.com - another pluggable database called Orcl PDB.

 

 

sys, system 비번을 초기화하고 진행하였다.

 

[oracle@test ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Nov 14 16:58:14 2023
Version 19.3.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> ALTER USER sys identified by "Manager123#";
ALTER USER system identified by "Manager123#";
User altered.

SQL>

 

 

 

리스너를 정상 동작시키면 아래와 같이 접속이 된다.