데이터베이스/ORACLE

[ORACLE] 오라클 리스너(Listener)

서울 유생 2025. 6. 19. 22:35
반응형
반응형

오라클 리스너는 네트워크를 이용해서 클라이언트에서 오라클 서버로 연결하기 위한 오라클 네트워크 관리자로 즉, 오라클에서 네트워크를 통한 연결은 리스너가 담당하는 역할을 한다. 클라이언트에서 오라클  NET8이 설치되어 있어야 오라클 서비스명 (Alias)를 통해 접속을 한다. 리스너가 있어야 클라이언트로부터 오라클로 외부로 부터 접속이 가능합니다.
 
오라클 리스너는 명령어에 기반해서 실행 및 종료를 할 수 있다.
 

[oraprod@dbtod]$ lsnrctl

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 19-JUN-2025 11:14:33

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

Welcome to LSNRCTL, type "help" for information.


--- start 명령어
LSNRCTL> start

--- ser 명령어
LSNRCTL> ser
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
Services Summary...
Service "oraprod" has 1 instance(s).
  Instance "oraprod", status UNKNOWN, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:2 refused:0
         LOCAL SERVER
The command completed successfully

--- reload 명령어
LSNRCTL> reload
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
The command completed successfully

--- status
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                17-JUN-2025 16:45:16
Uptime                    1 days 21 hr. 15 min. 28 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /DATA/oraprod/11g/network/admin/listener.ora
Listener Log File         /DATA/oraprod/diag/tnslsnr/neods02/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
Services Summary...
Service "oraprod" has 1 instance(s).
  Instance "oraprod", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

--- help 명령어
LSNRCTL> help
The following operations are available
An asterisk (*) denotes a modifier or extended command:

start               stop                status
services            version             reload
save_config         trace               spawn
change_password     quit                exit
set*                show*

 
리스너에 관한 명령어는 다음과 같습니다.

명령어비고
lsnrctl리스너 제어 유틸리티 시작
exit리스너 제어 유틸리티 종료
help리스너 제어 유틸리티 help
startstart <리스너명>: 리스너 시작
ex) lsnrctl start [리스너명]
reloadlistener.ora 파일 재읽기

* reload를 하더라도 리스너는 종료가 되지 않습니다. 
save_config리스너 설정을 listener.ora 파일에 저장
change_password비밀번호 설정 변경
status리스너의 정보 표시

* lsnrctl status 생성한 리스너 명
services연결 요청을 하는 데이터베이스 정보를 표시

* lsnrctl service 생성한 리스너 명

 
오라클 리스너는 실행 시 lsnrctl start 만 실행하게 되면 ORACLE 기본 리스너만 적용됩니다.

명령어비고
SET_PASSWORD비밀번호 설정
SET_LOG_STATUS로깅 설정(유효화/비활성화)
SET_LOG_DIRECTORY로그 파일의 경로 및 디렉토리 설정
SET_TRACE_DIRECTORY트레이스 파일의 출력처 디렉토리 설정
SET_CURRENT_LISTENER현재 리스너 설정
SET_LOG_FILE로그 파일 이름 설정
SET_TRACE_FILE트레이스 파일의 이름 설정
SET_TRACE_LEVEL트레이스 레벨 설정

 
sqlplus에서 리스너 등록하기

alter system register;