When I use cx_Oracle.makedsn for a remote connection, the host is replaced with my own local hostname and not that of the system running the Oracle engine. I also tried "@TRAIN" for the SID with no effect. Am I doing something incorrectly. Please advise.
C:\src\python\db\cx_Oracle>python
Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import cx_Oracle
>>> cx_Oracle.version
'HEAD'
>>> cx_Oracle.buildtime
'January 26, 2005 14:37:48'
>>> dsn = cx_Oracle.makedsn("pwatson", 1521, "TRAIN")
>>> dsn
'(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=pwatson)(PORT=1521)))(CONNECT_DATA=(SID=TRAIN)))'
>>> ^Z
C:\src\python\db\cx_Oracle>cat \oracle\ora81\network\admin\tnsnames.ora
# TNSNAMES.ORA Network Configuration File: C:\oracle\ora81\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
TRAIN.ADOMAIN.COM =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.0.80)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = train)
)
)
|