메뉴 건너뛰기

조회 수 25399 추천 수 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
번호 제목 날짜 조회 수
121 피봇(Pivot)을 이용하여 행(Row)을 열(Column)로 바꾸기 file 2016.12.08 12675
120 테이블 생성(다중 PK) 2016.09.12 7936
119 쿼리 파싱 시간 측정 - query parsing time 2016.12.08 7704
118 컬럼의 값 만큼 행(Row)을 늘리기 file 2016.12.08 14092
117 초 이하 단위 시간 얻어오기 2016.09.12 7906
116 조건절에 WHERE 1=1, WHERE 1=0 사용하여 쿼리 간편하게 사용하기 file 2016.08.29 9612
115 제로보드 reg_date 필드 date 형으로 변환하기 2016.09.12 7168
114 자동증가 SEQUENCE 생성 2016.09.12 7249
113 오라클에서 레코드 값이 없을때 2016.12.08 13469
112 오라클] 숫자 체크 방법 (IS_NUMBER, IS_NUMERIC) file 2017.01.20 8620
111 오라클11g DB 생성 file 2016.12.08 9727
110 오라클(PL/SQL) 미리 정의된 예외처리 2016.12.08 7215
109 오라클(Oracle) 에서 varchar 와 varchar2 의 차이점은 무엇인가 file 2016.08.30 8029
108 오라클(Oracle) 대용량 데이터 토드(Toad)를 이용해서 넣기 file 2016.08.30 8031
107 오라클(Oracle) SUBSTR 함수로 문자열을 다양하게 자르는 방법 file 2016.08.30 7827
106 오라클 해당 월 의 맨첫날 ~ 마지막 일 가져 오는 쿼리 2016.12.08 8417
105 오라클 테이블 생성 스크립트 DDL 추출 - 깔끔하게 Table 전부 추출(Export)하기 file 2016.12.08 12522
104 오라클 인스턴스 클라이언트(oracle instant client) 2016.09.12 10980
103 오라클 웹로직 12.1.3 설치 방법 file 2016.09.21 9902
102 오라클 암호를 분실한 경우 접속 방법 2016.09.21 7274
Board Pagination Prev 1 2 3 4 5 6 7 Next
/ 7

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

© k2s0o1d4e0s2i1g5n. All Rights Reserved