0

Via Oracle SQL Developer as well as JMeter, able to connect Database.

But, when we try to connect DB via load runner(Vugen), getting below error:

Replay Error From Vugen:

"DB Connection failed {"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"}"

LR code used to connect DB:

lr_db_connect("StepName=DatabaseConnection", 
    "ConnectionString=Data Source=XXXXXX;Initial Catalog=InvDatabase;Persist Security Info=True;User ID=XXXXX;Password=XXXXX", 
    "ConnectionName=XXXXX", 
    "ConnectionType=SQL", 
    LAST );

Any help on this is much appreciated.

Benjamin Buch
  • 4,752
  • 7
  • 28
  • 51
Yasir
  • 81
  • 1
  • 3
  • 20

2 Answers2

0

OK, you are connecting via ODBC it looks like. Your ODBC driver is configured as Named Pipes. Use ODBC Query from MS Office as a test app tyo see if you can connect across the same ODBC Driver

James Pulley
  • 5,606
  • 1
  • 14
  • 14
  • I am not sure/clear on the above comment.. Can you suggest any valid solution to fix the error addressed/occurring via load runner when I connect to DB – Yasir Apr 10 '23 at 19:23
  • I did. Validate your ODBC driver with a different ODBC client. IN this case I recommended MSQuery from Microsoft Office, a fairly ubiquitous solution in most enterprises. You have your ODBC driver configured for a named pipe connection. That usually works inside of the same host, but across hosts you should be looking at something more routable such as a TCP/IP connection with a FQDN or IP address as the target – James Pulley Apr 11 '23 at 19:20
  • Your error is not coming from LoadRunner. IT is coming from the ODBC driver and the named pipes interface. It cannot connect over a named pipe. – James Pulley Apr 11 '23 at 19:21
  • i updated solution. thank you any how :-) – Yasir Apr 28 '23 at 14:59
0

The issue is fixed, once followed below:

Need to update tnsnames.ora file to have DB connection details.

tnsnames.ora file path in oracle installed folder below: C:\ORACLE\product\19.0.0\client_1\network\admin\tnsnames.ora

If you dont have tnsnames.ora file, you can copy the same file from below path, update it to have your DB connection details and place it under admin folder.

C:\ORACLE\product\19.0.0\client_1\network\admin\sample

Yasir
  • 81
  • 1
  • 3
  • 20