Consultor Eletrônico



Kbase 16961: Connect to > 1 Oracle db or the same Oracle db twice? - 1259
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/10/1998
Connect to > 1 Oracle db or the same Oracle db twice? - 1259

There are cases where customer wants to connect to either more than 1
Oracle database or connect to the same Oracle database twice.

Connecting as a LOCAL client to more than 1 Oracle instance (database)
from a single session is not possible because Oracle OCI calls looks
at the ORACLE_SID environment variable for connection information.
What happen if you shell out to unix to change the ORACLE_SID after
connecting to 1 oracle database? The answer is new value in the
ORACLE_SID is not inherited by the parent process and hence only the
child's process is affected.

Even if we have a command to change the ORACLE_SID value in the parent
process the Oracle RDMS will get confused. Internally Oracle itself
uses SQL*NET when Oracle Link is used to connect to more than 1
database.

So if you tried to connect to more 1 Oracle database from a local
Progress client session or connect to the same Oracle database from
the same local Progress client session you will get:

You can NOT connect to more than one local ORACLE database for updates
at a time. (1259)

The ORACLE gateway does not support simultaneous connection to more
than one local ORACLE database. Only one may be local, all the other
ORACLE databases may be connected via SQL*Net.

The recommended way to connect to multiple Oracle databases is to use
SQL*NET or Progress networking (tcp/ip). Below are some examples:

Example 1 (connecting twice to the same Oracle database):
connect schemaholder1 -RO -db oradb -dt oracle -U userid -P password
connect schemaholder2 -RO -db anotheroradb -dt oracle
-U userid/password@oracleservicename
NOTE: using different schemaholder to connect to the same Oracle db.

Example 2 (connecting to 2 different Oracle databases)
connect holder -RO -db oradb1 -dt oracle -U userid/password@ezo_aix
connect holder -RO -db oradb2 -dt oracle -U userid/password@ezo7hpux
Note: using the same schemaholder to connect to 2 Oracle databases.

Example 3 (connecting to 2 different Oracle database using tcp/ip)
connect holder -RO /* Read only local schemaholder */
connect oradb1 -S demosv -H papis -N tcp -U userid -P password
connect holder2 -S demosv2 -H themis -N tcp /* Remote schemaholder */
connect oradb2 -S demosv2 -H papis -N tcp -U userid -P password
Note: using 1 local and 1 remote schemaholder.

Progress Software Technical Support Note # 16961