Changing Oracle home on the fly...

ieris

Member
Hello!
Is it possible to change Oracle Home when program is ruunig?
I do following:
OracleSession.LogOff;
OracleCI.DLLExit;
OracleCI.OracleHomeName := 'ORA920';
OracleCI.InitOCI;
//ShowMessage(OracleCI.OCIDLL);
//ShowMessage(OracleCI.OCIVersion);
OracleSession.LogIn;

But when I attempt to login, I get error "Access violation at address 01AFD6AC in module 'OraClient9.Dll'. Read of address 00001008."

I'm trying to change Oracle home from 10g to 9i.

OCIDLL & OCIVersion shows right versions and path..

Thanks.
 
This should be possible. The error indicates that one or more sessions are still connected when you call DLLExit. If this does not apply, then please send me a little demo project that produces this error.
 
I would like to know the resolution of this issue. (an example using OracleCI using C++ also)

but I cant even get Instant Oracle to work with DOA

Borland BDS 2006, c++ personality

I downloaded Instant Oracle put the contents in a single directory (c:\oracle) I set the environment variables
Path = c:\oracle ....................
TNS_ADMIN=c:\oracle

tried to connect my DOA application.
Initialization Error ... sqlnet not properly installed
no OracleHomeKey
no OracleHomeDir

I set both of these in HKEY_LOCAL_MACHINE\Software\Oracle
(just as a test ... will not be able to do in real environment since we are using embeded oracle and cannot impact existing environments)

It still didn't work
thanks in advance
 
Do you want to change Oracle Homes on the fly, or do you want to use an Instant Client?

The requirement to use the Instant Client is that the Instant Client directory (where oci.dll is located) must be listed in the PATH, and that there is no other registered Oracle Client on the PC.
 
Both.
1) Change on the fly. (My product uses embedded oracle, and must be unaccessable to the client -- oracle's requirement for embedded oracle. My clients are large banks, Health insurance co's. Many PC's have oracle client on them, but require my product. Therefore, I need the "change on the fly solution".

2) I have set the path and the TNS_ADMIN environment variables (My Computer/Properties/Advanced/Environmnet

no oracle product has ever been installed on this machine (clean windows load)
it still dosent work
 
yes,
1) Evironment
TNS_ADMIN=c:\perfectiv
PATH=C:\Perfectiv

2) Registry (only added after environment didnt work)
HKEY_Local_Machine\Software\Oracle
OracleHomeDir=c:\perfectiv
OracleHomeKey=c:\perfectiv

c:\perfectiv (contents)
oci.dll
ocijdbc10.dll
ociw32.dll
ojdbc.dll
ojdbc14.jar
orannzsbb10.dll
oraocci10.dll
oraociicus10.dll
_p_configure.exe (my program which connects using DOA)

I get sqlnet not configured
thanks again for you help
doug
 
Can you remove the Software\Oracle registry? This is not correct, and will conflict with the Instant Client detection. All that is needed is the PATH.
 
The Oracle registery is deleted
still dosent work.

I droped both the SQLNet.ora and TNSNames.ora (from a connecting machine)in the directory specified by TNS_ADMIN and it dosent work. I don't even get a drop down of the database combo box.

Is there a way (in C++ personality) to get around this by using the OracleCI and setting the name of the TNSNames.ora?
 
Try moving your .exe to another folder and then run again. This worked for me when I got the same error message.
 
Can you create a little test application that does the following?

1. Include the OracleCI unit.
2. Call InitOCI;
3. Display the OracleHomeDit variable value.
4. Display the OCIDLL variable value.
5. Display the TNSNames variable value.

If the PATH environment is set correctly, and if the TNS_ADMIN envirnoment variable is set correctly, and if oci.dll is present in the PATH, and is accessible, then these things should be okay.
 
I wrote the little pgm and ran it

InitOCI();
Memo1->Clear();
Memo1->Lines->Add("OracleHomeDir: "+OracleHomeDir);
Memo1->Lines->Add("OCIDLL: "+OCIDLL);
Memo1->Lines->Add("TNSNames(): "+TNSNames());
Memo1->Lines->Add("OracleHomeKey: "+OracleHomeKey);
Memo1->Lines->Add("OracleHomeName: "+OracleHomeName);

-------------with the following results:

OracleHomeDir: c:\Perfectiv
OCIDLL: c:\Perfectiv\oci.dll
TNSNames(): c:\Perfectiv\tnsnames.ora
OracleHomeKey:
OracleHomeName:

It all appears as I would expect, but it still gives me the error.
thanks in advance
 
Apology to TommyN. This worked. I reinstalled Oracle Instant client to another directory changed my env variables and it connected. Thanks all for your support
 
Back
Top