Re: [cx-oracle-users] connect from a remote box
Brought to you by:
atuining
From: Klaus B. <k....@ew...> - 2005-03-09 13:09:45
|
ama...@ub... wrote: > Klaus Boehm wrote: > >>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? > > > If you know how to connect with sql*plus, you've already typed a > connection string like "<user>/<password>@<dsn>". So it's easy. > > > Else, you must know the name of the server, and the name of the database > on the server (the service name). > > If you installed the Oracle client version 10g, the dsn is simply > dsn = "<server>/<service>" > > With a 8i or 9i Oracle client, it's more complicated: > dsn = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST > =<server>)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=<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 case > you must edit the tnsnames.ora file. But this is another story. > > Hope this helps, > > -- > Amaury Forgeot d'Arc > > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > Now i have the correct dsn. dsn = "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST='db-os.dmg.ewt.de')(PORT=1521)))(CONNECT_DATA=(SID=OSPROD)))" connection = cx_Oracle.connect("xxxx", "yyyy", dsn) i get the following error: RuntimeError: Unable to acquire Oracle environment handle have anyone a idea? Klaus -- --------------------------------------------- Klaus Boehm Systemadministrator ewt gmbh D-86152 Augsburg, Volkhartstr. 4-6 Phone: +49.(0)821.3106-319 Fax: +49.(0)821.310660-319 mailto:k....@ew... http://www.ewt.de http://www.surf-club.de --------------------------------------------- |