LEONEL ROCHA
asked on
Oracle connection string in vb .net
This is my connection string:
ordSelCon.ConnectionString = "Data Source=test.world;Integrat ed Security=no;User ID=GLF;Password=PRIMERA1"
ordSelCon.Open()
This work fine in my windows form proyect.
Now, I'm developing a windows service inside the same solution. When I use the same connection string inside the service I get the follwing error: ORA-12154 TNS:could not resolve the connect identifier specified.
The TNSNAMES.ORA is on local machine.
It seems to be a permissions problem, I guess but I'm not sure. Also was tested using another account (with administrator privileges) and fails again.
Need help to solve this issue. Thanks
ordSelCon.ConnectionString
ordSelCon.Open()
This work fine in my windows form proyect.
Now, I'm developing a windows service inside the same solution. When I use the same connection string inside the service I get the follwing error: ORA-12154 TNS:could not resolve the connect identifier specified.
The TNSNAMES.ORA is on local machine.
It seems to be a permissions problem, I guess but I'm not sure. Also was tested using another account (with administrator privileges) and fails again.
Need help to solve this issue. Thanks
What user are you running the service as?
ASKER
Local System account, but also I've used my personal account. Both with the same problem...
Do you have multiple home folders?
Please follow the below comments
Comments: 1
===========
Execute lnsrctl services on DR database
The error which you get means that it cannot resolve the connect string given in log_archive_dest_2, have you set NAMES.DEFAULT_DOMAIN in your sqlnet.ora ?
1) ensure that you are checking the correct tnsnames.ora, should be in $ORACLE_HOME/network/admin unless TNS_ADMIN is defined.
2) try suffixing the tns_alias with a domain name in log_archive_dest_2 and tnsnames.ora.
3) you can directly specify the connect string instead of alias in the parameter log_archive_dest_2, something like below ( if this works then you can confirm that the the issue is with tnsnames.ora)
alter system set log_archive_dest_2='SERVIC E="(descri ption=(add ress_list= (address=( protocol=T CP)(host=r 00979)(por t=1521)))( connect_da ta=(servic e_name=des k_std)))", LGWR ASYNC NOAFFIRM' scope=both;
Another Try :
==========
Check if "tnsping <SID>" works from primary (HA) to standby and vica versa.
Sometimes a trailing 'space' in SQL NET configuration (listener.ora,tnsnames.ora ) can cause this issue. You may try to check the listener.ora and tnsnames.ora with an expert text editor like notepad++.
Or you may to correct and configuration via netca and netmgr tools.
Also refer the below links.
http://stackoverflow.com/questions/20361325/this-is-error-ora-12154-tnscould-not-resolve-the-connect-identifier-specified
http://kb.tableausoftware.com/articles/knowledgebase/oracle-connection
Hope it may helpful to you.
Thanks
Guvera
Comments: 1
===========
Execute lnsrctl services on DR database
The error which you get means that it cannot resolve the connect string given in log_archive_dest_2, have you set NAMES.DEFAULT_DOMAIN in your sqlnet.ora ?
1) ensure that you are checking the correct tnsnames.ora, should be in $ORACLE_HOME/network/admin
2) try suffixing the tns_alias with a domain name in log_archive_dest_2 and tnsnames.ora.
3) you can directly specify the connect string instead of alias in the parameter log_archive_dest_2, something like below ( if this works then you can confirm that the the issue is with tnsnames.ora)
alter system set log_archive_dest_2='SERVIC
Another Try :
==========
Check if "tnsping <SID>" works from primary (HA) to standby and vica versa.
Sometimes a trailing 'space' in SQL NET configuration (listener.ora,tnsnames.ora
Or you may to correct and configuration via netca and netmgr tools.
Also refer the below links.
http://stackoverflow.com/questions/20361325/this-is-error-ora-12154-tnscould-not-resolve-the-connect-identifier-specified
http://kb.tableausoftware.com/articles/knowledgebase/oracle-connection
Hope it may helpful to you.
Thanks
Guvera
ASKER
Guvera, remember that the same ConnectionString works fine in the same solution in a ORACLETEST windows forms project.
1) I don't have NAMES.DEFAULT_DOMAIN parameter set in SQLNET.ORA (what value should I out there?
2) TNS_ADMIN is defined: C:\oracle\product\10.2.0\c lient_1\NE TWORK\ADMI N
3) Error ORA-06413 with this connection string:
ordSelCon.ConnectionString = "Data Source=(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.1.9)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = TEST)));Integrated Security=no;User ID=GLF;Password=PRIMERA1"
I've checked, it's the same i've in TNSNAMES.ORA
1) I don't have NAMES.DEFAULT_DOMAIN parameter set in SQLNET.ORA (what value should I out there?
2) TNS_ADMIN is defined: C:\oracle\product\10.2.0\c
3) Error ORA-06413 with this connection string:
ordSelCon.ConnectionString
I've checked, it's the same i've in TNSNAMES.ORA
ASKER
kaufmed, I don't understand your question.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
kaufmed, yes I've ORACLE\PRODUCT\10.2.0\CLIE NT_1 .... (the client I'm using to connect to a external database) and ORACLEXE\APP\ORACLE... (my XE Oracle Server for development).
Leonel
Leonel
ASKER
slightwv, considering your comment about "32Bit issue on 64Bit...." I've changed the DefaultLocation property of the Application Folder in "File System on Target Machine" of the service setup project (the default was "Program Files (x86)"), and all works fine.
Thanks,
Leonel
Thanks,
Leonel
Glad it worked for you.
Oracle has issues in the Microsoft world from time to time.
Oracle has issues in the Microsoft world from time to time.