LoadRunner Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Getting ORA-12154: TNS:could not resolve service name while using lr_db_connect

AviNachman
Acclaimed Contributor

Getting ORA-12154: TNS:could not resolve service name while using lr_db_connect

Hey

i am try to connect to oracle DB with this command:

lr_db_connect("StepName=example",
         "ConnectionName=example",
         "ConnectionString=Provider=OraOLEDB.Oracle.1;Data Source=SPROU14;Password=sa ;User ID=sa",
         "ConnectionType=OLEDB",
 LAST);

 

and getting Error: DB Connection failed {"ORA-12154: TNS:could not resolve service name"}

i did TNSPING from command line and its pass:

 tnsping SPROU14

Used TNSNAMES adapter to resolve the alias
Attempting to contact (description=(address=(protocol=tcp)(host=illin267)(port=1
521))(connect_data=(sid=SPROU14)))
OK (120 msec) 

 

any idea what can be the issue?

2 REPLIES
Highlighted
leobor
Occasional Visitor

Re: Getting ORA-12154: TNS:could not resolve service name while using lr_db_connect

Please try to connect to your Oracle instance using SQLPLUS with the service name and credentials like in your LR statement. You may discover some problems there too.

AviNachman
Acclaimed Contributor

Re: Getting ORA-12154: TNS:could not resolve service name while using lr_db_connect

Hey

SQLplus is working :( ,i currently have oracle client of 9i on Load Runner Machine  and i am running on DB with oracle 11i can it be the issue?

can u please advice any other suggestions?

//Add this to "OnDomLoad" event