메뉴 건너뛰기

조회 수 25393 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

* 오라클 리스너

다른 컴퓨터에서 오라클에 접속하려면 리스너가 동작해야 한다. 리스너는 네트워크를 이용하여 클라이언트에서 오라클 서버로 연결하기 위한 오라클 네트워크 관리자 이다. 오라클 서버에서 리스너를 시작시켜 주어야 클라이언트들이 접속 할 수 있다.


 Listener는 필요에 따라 여러 개가 동시에 구성 되고 실행될 수 있으며, 각각의 Listener는 서비스 목록을 동적 또는 수동으로 등록할 수 있다. 기본 포트 (1521)를 사용하는 Listener는 PMON 으로 부터 현재 실행 중인 디스패처의 정보도 함께 등록하고 있음을 확인 할 수 있다. 하지만 기본 포트를 사용하지 않는 Listener(로컬 리스너 설정을 변경한 다른 리스너)는 동적으로 서비스의 정보를 등록 받을 수 없다.



테스트 설정 및 확인 사항


SQL PLUS 같은 터미널 접속일 경우 .bash_profile 을 수정 -> 


/home/oracle/.bash_profile


* 예시


export ORACLE_BASE=/usr/local/app/oracle

export ORACLE_SID=orcl

export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1

export ORA_NLS10=$ORACLE_HOME/nls/data

export TNS_ADMIN=$ORACLE_HOME/network/admin

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib

export NLS_LANG=AMERICAN_AMERICA.KO16KSC5601

export PATH=$PATH:.:$ORACLE_HOME/bin:/usr/ccs/bin:/usr/sbin:/sbin:/usr/bin:/bin:/usr/X11R6/bin:/usr/bin/X11

export EDITOR=vi

export PS1='$LOGNAME@`hostname`:$PWD>'



리스너 구성 파일은 $ORACLE_HOME/network/admin 아래에 있는 listener.ora 파일이며, 오라클 서버에서 클라이언트의 요청을 듣고 클라이언트와의 통신 환경을 설정한다.


listener.ora 파일이 없다면, console 창에서

oracle$ lsnrctl start   라고 치면 자동으로 만들어진다.


만들어진 리스너는 서비스로 등록되는데, 윈도우 같은 경우 서비스 관리자에서 Oracle....TNSListener라는 이름이 바로 리스너 서비스다.

이 서비스의 시작 유형을 "자동" 으로 변경.




# cd $ORACLE_HOME/network/admin

# ls


listener.ora samples  shrept.lst  sqlnet.ora  tnsnames.ora



[root@dev admin]# cat listener.ora

** 공백 주의!!

# listener.ora Network Configuration File: /usr/local/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 = xxx.xxx.xxx.xxx)(PORT = 1521))

   (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))

  )

 )


SID_LIST_LISTENER = 

  (SID_LIST = 

   (SID_DESC = 

    (ORACLE_HOME = /usr/local/app/oracle/product/11.2.0/dbhome_1)

    (SID_NAME = orcl)

 )

)


ADR_BASE_LISTENER = /usr/local/app/oracle


* tnsnames.ora 파일은 오라클 서버로 접속할 때 필요한 프로토콜 및 포트번호, 서버주소, 인스턴스 등을 설정해 주는 파일이다.



[root@dev admin]# cat tnsnames.ora

# tnsnames.ora Network Configuration File: /usr/local/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora

# Generated by Oracle configuration tools.


orcl =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = xxx.xxx.xxx.xxx)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = orcl)

(SID = orcl)

)

)



[root@dev admin]# cat sqlnet.ora 

# sqlnet.ora Network Configuration File: /usr/local/app/oracle/product/11.2.0/dbhome_1/network/admin/sqlnet.ora

# Generated by Oracle configuration tools.


NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)


ADR_BASE = /usr/local/app/oracle



[root@dev admin]# su - oracle

oracle@dev.xxxxxxxxxxxx.com:/home/oracle>lsnrctl reload


LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 03-DEC-2014 07:30:52


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


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xxx.xxx.xxx.xxx)(PORT=1521)))

The command completed successfully

oracle@dev.goodbyenote.com:/home/oracle>



oracle@dev.xxxxxxxxxxxx.com:/home/oracle>lsnrctl status


LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 03-DEC-2014 07:31:14


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


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xxx.xxx.xxx.xxx6)(PORT=1521)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production

Start Date                03-DEC-2014 06:22:15

Uptime                    0 days 1 hr. 8 min. 59 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /usr/local/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora

Listener Log File         /usr/local/app/oracle/diag/tnslsnr/dev/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=2xxx.xxx.xxx.xxx)(PORT=1521)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

Services Summary...

Service "orcl" has 2 instance(s).

  Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...

  Instance "orcl", status READY, has 1 handler(s) for this service...

Service "orclXDB" has 1 instance(s).

  Instance "orcl", status READY, has 1 handler(s) for this service...

The command completed successfully

oracle@dev.xxxxxxxxxxxx.com:/home/oracle>


oracle@dev.xxxxxxxxxxxx.com:/home/oracle>tnsping xxx.xxx.xxx.xxx


TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 03-DEC-2014 07:32:03


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


Used parameter files:

/usr/local/app/oracle/product/11.2.0/dbhome_1/network/admin/sqlnet.ora


Used EZCONNECT adapter to resolve the alias

Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=TCP)(HOST=xxx.xxx.xxx.xxx)(PORT=1521)))

OK (0 msec)

oracle@dev.xxxxxxxxxxx.com:/home/oracle>tnsping dev.xxxxxxxxxx.com 10           // 10을 붙이면 10번 테스트


TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 03-DEC-2014 07:32:13


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


Used parameter files:

/usr/local/app/oracle/product/11.2.0/dbhome_1/network/admin/sqlnet.ora


Used EZCONNECT adapter to resolve the alias

Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=TCP)(HOST=xxx.xxx.xxx.xxx)(PORT=1521)))

OK (0 msec)

OK (0 msec)

OK (0 msec)

OK (0 msec)

OK (0 msec)

OK (0 msec)

OK (0 msec)

OK (0 msec)

OK (0 msec)

OK (0 msec)

oracle@dev.xxxxxxxxxxxx.xxx:/home/oracle>



윈도우 PC에서 테스트


1. > telnet xxx.xxx.xxx.xxx 1521


2. toad for oracle 프로그램 이용


http://www.toadworld.com/ -> 다운로드


*************************************************************************************************************************


listener 및 tnsping 테스트 시 에러가 계속 발생하여 구글링한 것 중 하나.


########### 리스너.ora 파일입니다.

LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = IP주소)(PORT = 1521))
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = ORA9)<----- SID,DB_NAME는 대문자입니다.
(ORACLE_HOME = /home/oracle/product/9.0)
(SID_NAME = ORA9)<----- SID,DB_NAME는 대문자입니다.
)
)

########### tnsnames.ora 파일입니다.

ORA9 =<--- alias도 대문자로 넣으시구여..
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 본컴퓨터ip적었음)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ORA9)<----- SID,DB_NAME는 대문자입니다.
)
)


---> 옵션은 위와 같이 하였으며, listener.ora 파일 같은 경우 공백 때문에 오류가 발생하여 공백을 주어 설정 하였으며, SID_NAME, SERVICE_NAME, alias 같은 경우 .bash_profile에 소문자로 설정하였기 때문에 소문자로 통일하였다. 


참고 URL : http://oukr.tistory.com/54   --> 오라클 네트워크 환경 구성, 여러개의 리스너 구성

참고 URL : http://blog.daum.net/slime9/19  --> 오라클 10G XE 설치 후 리스너 및 tns 설정


List of Articles
번호 제목 날짜 조회 수
41 스키마 조회 쿼리 모음 2016.09.12 10031
40 oracle user 관리 2016.09.11 8013
39 oracle db 백업(full) 2016.09.11 9662
38 Oracle DB 언어셋 설정 2016.09.11 8047
» linux 오라클 리스너 설정(오라클 원격접속) 2016.09.11 25393
36 linux oracle 서비스 시작 및 확인 ( 간단 ) 2016.09.11 12296
35 oracle log 보기 - alert, trace 2016.09.11 10650
34 oracle 10g - log, trc 관리 정책 스크립트 2016.09.11 10088
33 oracle listener 로그 형식 - oracle 11g 이전 versioin의 형식으로 변경 2016.09.11 7492
32 oracle 구동 방법 및 재부팅 시 oracle 자동 시작 설정 ( /etc/rc.local ) 2016.09.11 8526
31 Oracle DB 에서 Toad 를 사용하여 Procedure 디버깅 하기 file 2016.08.30 11416
30 오라클(Oracle) SUBSTR 함수로 문자열을 다양하게 자르는 방법 file 2016.08.30 7806
29 오라클(Oracle) 에서 varchar 와 varchar2 의 차이점은 무엇인가 file 2016.08.30 8029
28 오라클 12c (Oracle) 에서 테스트를 위해 샘플 스키마 설치하기 file 2016.08.30 8929
27 오라클 (Oracle) 쿼리 구간별 시간 체크 하기 file 2016.08.30 7974
26 오라클 (Oracle) 11g 를 위한 토드(Toad) 무료 버전 다운받기 file 2016.08.30 16015
25 oracle 특수문자 입력시 Substitution Variable 변수치환을 없애는 방법 file 2016.08.30 9024
24 Oracle 에서 테이블과 리소스의 존재 여부를 알아보는 쿼리 file 2016.08.30 8949
23 Oracle XDB 리스너 포트 바꾸기 file 2016.08.30 7938
22 Toad 에서 생성한 테이블의 컬럼위치를 변경하고 싶을 때 Rebuild Table 사용 file 2016.08.30 7604
Board Pagination Prev 1 2 3 4 5 6 7 Next
/ 7

하단 정보를 입력할 수 있습니다

© k2s0o1d4e0s2i1g5n. All Rights Reserved