Technote (FAQ)
Question
How to configure the connection string for Oracle Database Extended Agent version 6.3.1
Answer
There are three kinds of connection string for agent configuration.
1) easy connect path as "//<host>:<port>/<service>", for example:
//tivp56.cn.ibm.com:1521/oradb
Note: this requires the easy connection mode(ezconnect) is enabled in the listener configure file sqlnet.ora.
NAMES.DIRECTORY_PATH=(ezconnect, tnsnames)
2) full description path as "(DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=<servicename>))(ADDRESS=(PROTOCOL=TCP)(HOST=<hostname or ip>)(PORT=1521)))"
for example:
(DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=oradb))(ADDRESS=(PROTOCOL=TCP)(HOST=9.123.98.85)(PORT=1521)))
3) TNS service name like ORCL.
The service name entry should be defined in the file tnsnames.ora and user need to set environment variable TNS_ADMIN to specify the path of tnsnames.ora before starting agent.
User can also verify if the connection string is valid by Oracle utility $ORACLE_HOME/bin/tnsping.
Command: tnsping <connection string>
for example:
#su - oracle
[oracle@tivpc027 ~]$ tnsping "//tivpc027:1521/oradb"
TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 19-SEP-2012 22:43:08
Copyright (c) 1997, 2009, Oracle. All rights reserved.
Used parameter files:
Used HOSTNAME adapter to resolve the alias
Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=oradb))(ADDRESS=(PROTOCOL=TCP)(HOST=9.123.98.85)(PORT=1521)))
OK (10 msec)
[oracle@tivpc027 ~]$ tnsping "(DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=oradb))(ADDRESS=(PROTOCOL=TCP)(HOST=9.123.98.85)(PORT=1521)))"
TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 19-SEP-2012 22:44:37
Copyright (c) 1997, 2009, Oracle. All rights reserved.
Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=oradb))(ADDRESS=(PROTOCOL=TCP)(HOST=9.123.98.85)(PORT=1521)))
OK (0 msec)
[oracle@tivpc027 ~]$ tnsping ORADB
TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 19-SEP-2012 22:44:41
Copyright (c) 1997, 2009, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias Attempting to contact
(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = tivpc027.cn.ibm.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = oradb)))
OK (0 msec)
Rate this page:
Copyright and trademark information
IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.