Home » Developer & Programmer » Precompilers, OCI & OCCI » OCISessionBegin failes for OS authentication (OCISessionBegin failes for OS authentication when ORACLE_SID is not set)
OCISessionBegin failes for OS authentication [message #273359] Wed, 10 October 2007 02:31
Messages: 1
Registered: October 2007
Junior Member
We do the following to connect to the database using the OS authentication:

1) Initialize the OCI using OCIInitialize

2) Initialize the environment using OCIEnvInit

3) We create four handles for error, server and service context and a user session.

4) Then we do a server attach using OCIServerAttach by passing the allocated server handle.

5) We then set the server attribute (OCI_ATTR_SERVER) of the service context using OCIAttrSet.

6) We then execute OCISessionBegin and pass the mode as OCI_CRED_EXT.

The above sequence works fine if ORACLE_SID is set in the environment and if we pass an empty string for the parameter "dblink" in OCIServerAttach.

But we fail to authenticate (OCISessionBegin fails with ORA-01017) if we pass in the "dblink" parameter with the same value as set in ORACLE_SID environment variable or a different value.

[Updated on: Wed, 10 October 2007 02:34]

Report message to a moderator

Previous Topic: Have problem when compiling OCI program on HP IA64
Next Topic: PCC-S-02322, found undefined identifier compiling under Fedora 6
Goto Forum:

Current Time: Sun Feb 19 08:28:06 CST 2017

Total time taken to generate the page: 0.03710 seconds