not able to connect to Oracle DB using lr_db_connect. (376 Views)
Reply
Occasional Visitor
mav2cool
Posts: 2
Registered: ‎04-02-2012
Message 1 of 2 (376 Views)
Accepted Solution

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.

 

Please use plain text.
Occasional Visitor
mav2cool
Posts: 2
Registered: ‎04-02-2012
Message 2 of 2 (320 Views)

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.

 

 

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation