본문 바로가기

리눅스

Oracle 리스너를 설정하는 방법

반응형

Oracle 리스너를 설정하는 방법

Oracle 리스너 설정은 Oracle 데이터베이스와 클라이언트 간의 통신을 관리하는 중요한 부분입니다. 리스너는 클라이언트 요청을 받아들이고, 데이터베이스 서비스로 전달하며, 데이터베이스에서의 응답을 클라이언트로 다시 보냅니다.

1. 리스너 구성 파일 수정

리스너를 설정하려면 listener.ora 파일을 수정해야 합니다.

cd $ORACLE_HOME/network/admin
cat listener.ora
# listener.ora Network Configuration File: /DATA/oracle/dbhome/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
#      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.102)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.202.245.106)(PORT = 1521))
    )
  )

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
        (SID_NAME = ORCL)
        (ORACLE_HOME = /DATA/oracle/dbhome)
    )
  )

ADR_BASE_LISTENER = /DATA/oracle

2. 리스너 시작 및 재시작

리스너를 시작하거나 재시작하려면 명령 프롬프트 또는 터미널에서 lsnrctl 명령을 사용합니다.

lsnrctl start
$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 29-SEP-2014 13:55:41

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

Starting /DATA/oracle/dbhome/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /DATA/oracle/dbhome/network/admin/listener.ora
Log messages written to /DATA/oracle/diag/tnslsnr/e-vm02/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.102)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.202.245.106)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.102)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                29-SEP-2014 13:55:41
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /DATA/oracle/dbhome/network/admin/listener.ora
Listener Log File         /DATA/oracle/diag/tnslsnr/e-vm02/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.102)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.202.245.106)(PORT=1521)))
Services Summary...
Service "ORCL" has 1 instance(s).
  Instance "ORCL", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

또는

lsnrctl restart
728x90

3. 리스너 상태 확인

리스너가 올바르게 시작되었는지 확인하려면 다음 명령을 사용합니다.

lsnrctl status
$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 29-SEP-2014 13:55:19

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.102)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                29-SEP-2014 13:52:12
Uptime                    0 days 0 hr. 3 min. 6 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /DATA/oracle/dbhome/network/admin/listener.ora
Listener Log File         /DATA/oracle/diag/tnslsnr/e-vm02/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.102)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.202.245.106)(PORT=1521)))
Services Summary...
Service "ORCL" has 1 instance(s).
  Instance "ORCL", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

4. 현재 리스너에 등록된 서비스들의 목록과 관련된 정보를 표시

lsnrctl services
$ lsnrctl services

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 29-SEP-2014 13:55:29

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.102)(PORT=1521)))
Services Summary...
Service "ORCL" has 1 instance(s).
  Instance "ORCL", status UNKNOWN, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0
         LOCAL SERVER
The command completed successfully

5. 리스너 중지

lsnrctl stop
$ lsnrctl stop

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 29-SEP-2014 13:55:33

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.102)(PORT=1521)))
The command completed successfully

 

기본적인 단계를 통해 Oracle 리스너를 설정할 수 있습니다. 실제 환경에 따라 추가 구성이 필요할 수 있으며, Oracle 공식 문서나 관련 문서를 참조하는 것이 좋습니다.

 

728x90
반응형