Re: [cx-oracle-users] connect from a remote box
Brought to you by:
atuining
From: Marcos P. <ma...@bu...> - 2005-03-09 13:24:22
|
Is ORACLE_HOME defined? El mi=C3=A9, 09-03-2005 a las 14:06 +0100, Klaus Boehm escribi=C3=B3: > ama...@ub... wrote: > > Klaus Boehm wrote: > >=20 > >>i try to connect to a oracle db. > >>this db runs on another server. > >>now i have problem with the connect string. > >> > >>connect([user, password, dsn, mode, handle, pool, threaded, twophase]= ) > >> > >>how looks the dsn if i try to connect from a remote box? > >=20 > >=20 > > If you know how to connect with sql*plus, you've already typed a > > connection string like "<user>/<password>@<dsn>". So it's easy. > >=20 > >=20 > > Else, you must know the name of the server, and the name of the datab= ase > > on the server (the service name). > >=20 > > If you installed the Oracle client version 10g, the dsn is simply > > dsn =3D "<server>/<service>" > >=20 > > With a 8i or 9i Oracle client, it's more complicated: > > dsn =3D "(DESCRIPTION=3D(ADDRESS=3D(PROTOCOL=3DTCP)(HOST > > =3D<server>)(PORT=3D1521))(CONNECT_DATA=3D(SERVICE_NAME=3D<service>))= )" > > (All in one string, you may add spaces if you want) > > You may want to have a (short) alias for this long string, in this ca= se > > you must edit the tnsnames.ora file. But this is another story. > >=20 > > Hope this helps, > >=20 > > -- > > Amaury Forgeot d'Arc > >=20 > >=20 > >=20 > >=20 > > ------------------------------------------------------- > > SF email is sponsored by - The IT Product Guide > > Read honest & candid reviews on hundreds of IT Products from real use= rs. > > Discover which products truly live up to the hype. Start reading now. > > http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick > > _______________________________________________ > > cx-oracle-users mailing list > > cx-...@li... > > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > >=20 > Now i have the correct dsn. >=20 >=20 > dsn =3D=20 > "(DESCRIPTION=3D(ADDRESS_LIST=3D(ADDRESS=3D(PROTOCOL=3DTCP)(HOST=3D'db-= os.dmg.ewt.de')(PORT=3D1521)))(CONNECT_DATA=3D(SID=3DOSPROD)))" >=20 > connection =3D cx_Oracle.connect("xxxx", "yyyy", dsn) >=20 > i get the following error: >=20 > RuntimeError: Unable to acquire Oracle environment handle >=20 > have anyone a idea? >=20 >=20 > Klaus >=20 |