메뉴 건너뛰기

조회 수 25396 추천 수 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 CentOS 6.5 에 Oracle Database 11g Release 2 설치하기 file 2016.12.08 12409
120 CentOS 6.5 에 Oracle Database 11g Release 2 설치하기 file 2016.12.08 10855
119 CLOB TEXT 데이타를 저장하고, 조회하는 예제 2016.12.08 13058
118 Create SYNONYM 2016.09.12 7409
117 cron을 이용한 Oracle 백업 2016.09.12 8045
116 Database link, Synonym How to 2016.09.12 7500
115 DB Link How-To 2016.09.12 7015
114 IMP-00010: 엑스포트 파일이 유효하지 않고, 헤더가 검증에 실패했습니다 file 2016.12.08 8807
113 INSTR 문자열의 뒤(마지막)에서 부터 문자 찾기 (right to left, last) file 2016.12.08 14853
112 linux oracle 서비스 시작 및 확인 ( 간단 ) 2016.09.11 12296
» linux 오라클 리스너 설정(오라클 원격접속) 2016.09.11 25396
110 Merge into를 이용해서 insert나 update를 자동으로 실행하자. 2016.08.29 7572
109 ORA-01652 128(으)로 테이블 공간 ***에서 임시 세그먼트를 확장할 수 없습니다. file 2016.12.08 9248
108 ORA-28001: the password has expired - 추천 실적용 실전 2016.12.08 7078
107 ORA-39142 덤프 버전이 틀려서 넣지 못할 때 2016.12.08 8967
106 oracle 10g - log, trc 관리 정책 스크립트 2016.09.11 10088
105 Oracle 11g Client Install 및 외부 클라이언트 도구의 사용 file 2016.12.08 70664
104 Oracle 11g Database에 외부 접속 허용하도록 설정하기 file 2016.12.08 24905
103 Oracle Batch Processing 2016.12.08 6822
102 oracle db 백업(full) 2016.09.11 9662
Board Pagination Prev 1 2 3 4 5 6 7 Next
/ 7

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

© k2s0o1d4e0s2i1g5n. All Rights Reserved