메뉴 건너뛰기

조회 수 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
번호 제목 날짜 조회 수
41 스키마 조회 쿼리 모음 2016.09.12 10036
40 시퀀스 초기화 프로시저 2016.09.12 8925
39 실수로 지운 데이터 복구 쿼리 (TIMESTAMP) 2016.12.08 11166
38 아카이브 백업 / 복구 2016.09.12 6968
37 엑셀데이타를 DB 에 저장. Excel => oracle db restore 2016.12.08 8744
36 여러개(다중) LIKE 검색 방법 (REGEXP_LIKE 함수) file 2016.12.08 12822
35 오늘을 기준으로 해당주(week)의 모든 일자조회 2016.12.08 7029
34 오늘을 기준으로 해당주(week)의 모든 일자조회 2017.01.20 8329
33 오라클 (Oracle) 11g 를 위한 토드(Toad) 무료 버전 다운받기 file 2016.08.30 16019
32 오라클 (Oracle) 쿼리 구간별 시간 체크 하기 file 2016.08.30 7974
31 오라클 10, 16진수(Decimal, Hex) 변환 2018.10.27 4287
30 오라클 12c (Oracle) 에서 테스트를 위해 샘플 스키마 설치하기 file 2016.08.30 8929
29 오라클 25가지 SQL 작성법 2016.12.08 7706
28 오라클 DB 백업과 복원 2016.12.08 9926
27 오라클 DB 생성 후 설정 Listener.ora & Tnsnames.ora (윈도우) file 2016.12.08 23308
26 오라클 NULL : 값이 존재하지 않는 상태 2017.01.20 7201
25 오라클 ORDER BY : 정렬 2017.01.20 8241
24 오라클 계정 lock 해제 2016.12.08 8444
23 오라클 랜덤함수 2018.10.27 2149
22 오라클 백업 및 복구(Export, Import) file 2016.12.08 9762
Board Pagination Prev 1 2 3 4 5 6 7 Next
/ 7

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

© k2s0o1d4e0s2i1g5n. All Rights Reserved