LoadRunner Practitioners Forum
Showing results for 
Search instead for 
Do you mean 

not able to connect to Oracle DB using lr_db_connect.

SOLVED
Go to Solution
Highlighted
Occasional Contributor

not able to connect to Oracle DB using lr_db_connect.

Hi All,

 

I am trying to connect to Oracle DB using lr_db_connect but getting following error.

my code

vuser_init()
{
lr_db_connect("StepName=ConnectionToDB",
"ConnectionName=DB1",
"ConnectionString=Provider=OraOLEDB.Oracle.1;Data Source=<TNS name from TNSNames.ora file>;User ID=<MyUID>;Password=<mYPassword>",
"ConnectionType=OLEDB",
LAST);
return 0;
}

 

ReplyLog:

Virtual User Script started at : 2014-03-26 15:51:25
Starting action vuser_init.
vuser_init.c(16): DB Connection "ConnectionToDB" started ... Wait ....
vuser_init.c(16): Error: DB Connection failed {"The 'OraOLEDB.Oracle.1' provider is not registered on the local machine."}
vuser_init.c(16): Error: DB Connection failed {"ConnectionToDB"}
Abort was called from an action.

 

Debugging done so far:
1. Verified the Oracle client path. This is set correctly.
C:\app\<myName>\product\11.2.0\client_1;C:\app\<myName>\product\11.2.0\client_1\bin

2. Registered the OraOLEDB11.dll correctly.

3.TNSname.ora file is upto date.

4. Created function in Web Services scripts protocol using Insert -> New Step -> Database: Connect

5. Oracle Home is also set

C:\Users\[myName]>echo Oracle_home %ORACLE_HOME%

Oracle_home C:\app\[myName]\product\11.2.0\client_1

 

my environment information: 

 

HP LoadRunner Software 11.04
Product Version: 11.04.0.0
Product Build: Build 9409

Installed Components:
Analysis :11.04.0.0 
Online Documentation: 11.04.0.0 
Samples: 11.04.0.0 
Vuser Generator: 11.04.0.0

 

Installed Patches:
LRVUG_00002 for HP Vugen SA 11.00 QFE 
HP Virtual User Generator 11.00 Patch 4 
LRVUG_00045 for HP LoadRunner 11.00 
HP Analysis 11.00 Patch 4

Protocol used: Web Service Protocl

 

Any pointer would be really helpful.

 

2 REPLIES
Occasional Contributor

Re: not able to connect to Oracle DB using lr_db_connect.

I was able to reslove this.

 

I initially had 64-bit Oracle version and registered OraOLEDB11.dll using regsvr32. But was not able to connect it to DB. Then uninstalled 64-bit Oracle client and  installed 32-bit Oracle version and registered OraOLEDB11.dll using regsvr32. But on 64-bit windows regsvr32 starts in 64-bit version by default. I had to re-register OraOLEDB11.dll with 32-bit version of regsvr32 using following.

 

C:\Windows\system32>%systemroot%\SysWoW64\regsvr32 "C:\app\<myName>\product\11.2.0\client_1\BIN\OraOLEDB11.dll"

 

After this was done I was able to connect it to DB.

 

 

Visitor

Re: not able to connect to Oracle DB using lr_db_connect.

It doesnt solve my problem.

 

Here is my code generation log :

rd.c/fjInitDB: Cannot load the ORACLE library (DLL), "ora805.dll", specified after a "+"  in the "805" entry in section [ORACLE_WINNT] in the "lrd.ini" file.  - Das angegebene Modul wurde nicht gefunden.
Processing continues


lrd.c/fjInitDB: Cannot load the ORACLE library (DLL), "oci.dll", specified after a "+"  in the "816" entry in section [ORACLE_WINNT] in the "lrd.ini" file.  - (null)Processing continues


lrd.c/fjInitDB: Cannot load the ORACLE library (DLL), "oraclient8.dll", specified after a "+"  in the "815" entry in section [ORACLE_WINNT] in the "lrd.ini" file.  - Das angegebene Modul wurde nicht gefunden.
Processing continues


lrd.c/fjInitDB: Cannot load the ORACLE library (DLL), "ora804.dll", specified after a "+"  in the "804" entry in section [ORACLE_WINNT] in the "lrd.ini" file.  - Das angegebene Modul wurde nicht gefunden.
Processing continues


lrd.c/fjInitDB: Cannot load the ORACLE library (DLL), "ora803.dll", specified after a "+"  in the "803" entry in section [ORACLE_WINNT] in the "lrd.ini" file.  - Das angegebene Modul wurde nicht gefunden.
Processing continues


lrd.c/fjInitDB: Cannot load the ORACLE library (DLL), "ora73.dll", specified after a "+"  in the "73" entry in section [ORACLE_WINNT] in the "lrd.ini" file.  - Das angegebene Modul wurde nicht gefunden.
Processing continues


lrd.c/fjInitDB: Cannot load the ORACLE library (DLL), "ora72.dll", specified after a "+"  in the "72" entry in section [ORACLE_WINNT] in the "lrd.ini" file.  - Das angegebene Modul wurde nicht gefunden.
Processing continues


lrd.c/fjInitDB: Cannot load the ORACLE library (DLL), "orant71.dll", specified after a "+"  in the "71" entry in section [ORACLE_WINNT] in the "lrd.ini" file.  - Das angegebene Modul wurde nicht gefunden.
Processing continues


lrd.c/fjInitDB: None of the library combinations specified in section [ORACLE_WINNT] in the "lrd.ini" file could be loaded.  Initializing for ORACLE failed


lrd_to_printable: ERROR, return-code=LRDE2015.   


lrd_to_printable: Warning: continuing after error, return-code=LRDE2015.   


LRD error 2015 when generating value for lrd_assign(&MaxCharLength_D1,...) -
    The generated lrd_assign is commented out, with a value of ???.
    It can be found by searching "lrd_assign(&MaxCharLength_D1".

        value passed to lrd_assign may be invalid for MaxCharLength_D1:
        lrd_error=2015

        value passed to lrd_assign may be invalid for MaxCharLength_D1:
        lrd_error=2015

Code generation failed: Database client binaries were not found.
Install the same Oracle Client Library that was installed on the machine on which this Vuser script was originally recorded.

 

 

I know the Vugen don't find the Oracle binaries. I looked for the binaries in the Oracle folder but i cant find them. Maybe the oracle.dlls in the lrd.ini has the wrong names because its a newer version of oracle client ? Can someone post his Oracle Winnt part of the lrd.ini for compare with mine.