Home > database >  PB9 how to connect two oracle database at the same time
PB9 how to connect two oracle database at the same time

Time:10-14

Such as topic, this machine is installed two oracle8 client (hereafter call for client1 and client2 respectively), client1 is English character set, client2 is Chinese character set, PB is always the default configuration file path to the client1 to search the connection information, it is the connection client2 failed, is there any way to connect two different methods of oracle database at the same time?
Supplement: I try to install the client2 oracle9 client, the result is the same

CodePudding user response:

I pour! And PB holdouts!
PB only one default transaction object
Application object and specialized object database connection, the application only has connections with a database, it is ok to use the SQLCA directly as the transaction object, only when the application with multiple database connections, just need to create your own transaction object, transaction object is not visible, resident in memory,
Original concept and database communication steps are as follows:
1. Set the transaction object attribute values
2. Establish the connection with database
3. Perform the desired database operation
4. Disconnect the connection to the database
Among them, the transaction attributes of the object, a total of 15, the top 10 use to connect to the database, 5 is used to return the database after operating state (each interface used to connect the properties of the different attributes, such as ODBC, etc., see the page P74), after five attributes of the more important a SQLCode (0, 1, 100) SQLNRows (the last operation affects the number of rows) SQLDBCode (error code) provided by the database SQLErrText (error text) SQLReturnData (additional information)
Create your own transaction object (multiple databases, general need not)

The Transaction my_trans (note position of variable declaration, determines the scope of the variable) (note: this is just a pointer)

My_trans=Create transaction


Destory my_transaction to release the memory (don't)

CodePudding user response:

refer to the original poster jjoulejcc response:
such as topic, this machine is installed two oracle8 client (hereafter call for client1 and client2 respectively), client1 is English character set, client2 is Chinese character set, PB is always the default configuration file path to the client1 to search the connection information, it is the connection client2 failed, is there any way to connect two different methods of oracle database at the same time?
Supplement: I try to install the client2 oracle9 client, the result is the same

The old system needs to be maintained, what you said is your create a transaction object, can't solve my problem

CodePudding user response:

Try this, using odbc

CodePudding user response:

reference lzp_lrp reply: 3/f
try so, using odbc

Should be, but the client too much, too lazy to configuration or writing code configuration, and don't know use odbc connection can have what problem

CodePudding user response:

Looks like the ODBC cannot solve problems
Because the program "near" to find the environment
You two client, there are two up SQLPLUS. EXE, according to its own path first, they found the configuration file
And pb. Exe can only find in the system environment variables, and use the "recent"

CodePudding user response:

Don't is an unsolved problem

CodePudding user response:

I met this problem is to write a few batch,
Set the environment variable in a batch

Some corresponding before each use. BAT, then open the PB

1 to close the PB, points to a corresponding BAT, PB won't recognize new environment variable

What bother you?
Rather than simply use up SQLPLUS. Exe


CodePudding user response:

refer to 7th floor di74jun response:
I want to meet this problem is to write a few batch,
Set the environment variable in a batch

Some corresponding before each use. BAT, then open the PB

1 to close the PB, points to a corresponding BAT, PB won't recognize new environment variable

What bother you?
Rather than simply use up SQLPLUS. Exe

Test just now, have set the environment variable API that can be modified at any time the environment variable, it is ok, I have other problems under test again: no, I am with you said this way to open PLSQL, otherwise every time going to set the character set, but the program can not do this operation, because the operation is a group, must control them in a big transaction

CodePudding user response:

Two connections can't use the same mechanism, it is recommended that a use ODBC, another direct use

CodePudding user response:

Create two things can link

CodePudding user response:

Client1 is English character set, client2 is Chinese character set, why the two character set

CodePudding user response:

Install an oracle client and configure multiple different listening, PB connection string in the configuration (ODBC) configuration when the respective character set,

CodePudding user response:

11 references fengxiaohan211 response:
client1 is English character set, client2 is Chinese character set, why the two character set

Two database character set is different, so can only use two different characters of the client to connect

CodePudding user response:

TMX
reference 12 floor response:
install an oracle client and configure multiple different listening, PB connection string in the configuration (ODBC) configuration when the respective character set,

Using ODBC can solve, but just don't know what's the problem with using ODBC to connect to the database, has been through the client direct

CodePudding user response:

Odbc problems should not, only can lower efficiency, less database directly connected

A database directly connected, using odbc

CodePudding user response:

Must be one of two ways, because the default ora_home only one on a PC
  • Related