반응형
/*
-- [Ora21c] Listener 및 Tnsnames.ora 샘플
*/
■ listener.ora 파일 수정
- Oracle 21c XE 경로 확인 후 적용
[oracle@oracle ~]$ vi /opt/oracle/homes/OraDBHome21cXE/network/admin/listener.ora DEFAULT_SERVICE_LISTENER = XE LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.103.122)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) ) SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = XE) (ORACLE_HOME = /opt/oracle/product/21c/dbhomeXE) (SID_NAME = XE) ) ) [oracle@oracle ~]$ |
■ tnsnames.ora 파일 수정
- 필요시 localhost 대신 IP 기입
[oracle@oracle ~]$ vi /opt/oracle/homes/OraDBHome21cXE/network/admin /tnsnames.ora XE = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.103.122)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XE) ) ) LISTENER_XE = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.103.122)(PORT = 1521)) [oracle@oracle ~]$ |
■ tnsping 테스트
[oracle@oracle ~]$ tnsping xe TNS Ping Utility for Linux: Version 21.0.0.0.0 - Production on 10-APR-2024 11:08:12 Copyright (c) 1997, 2021, Oracle. All rights reserved. Used parameter files: /opt/oracle/homes/OraDBHome21cXE/network/admin/sqlnet.ora Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.103.122)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XE))) OK (30 msec) [oracle@oracle ~ ]$ [oracle@oracle ~]$ tnsping 192.168.103.122 TNS Ping Utility for Linux: Version 21.0.0.0.0 - Production on 10-APR-2024 11:09:03 Copyright (c) 1997, 2021, Oracle. All rights reserved. Used parameter files: /opt/oracle/homes/OraDBHome21cXE/network/admin/sqlnet.ora Used EZCONNECT adapter to resolve the alias Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.103.122)(PORT=1521))) OK (0 msec) [oracle@oracle ~]$ |
■ DBeaver 연결 테스트
- VM 내에서 리눅스용 DBeaver를 설치해서 테스트 진행
- Host PC에서는 다른 포스트에서 소개
ㅁ 연결 설정
- system 계정 접근
- 암호에 특수문자가 있었는데 접속이 안되어 특수문자 제거
- SYSDBA가 아닌 Normal 선택
ㅁ 테스트 쿼리
※ References:
- viewa.tistory.com/23
- blog.naver.com/lovepilia1/140107282892
- sarc.io/index.php/oracledatabase/186-2014-06-10-01-33-05
반응형