Solved

Oracle connection string in vb .net

Posted on 2014-11-21
10
405 Views
Last Modified: 2014-11-22
This is my connection string:
            ordSelCon.ConnectionString = "Data Source=test.world;Integrated 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
0
Comment
Question by:leorocha
  • 5
  • 2
  • 2
  • +1
10 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 40458283
What user are you running the service as?
0
 

Author Comment

by:leorocha
ID: 40458322
Local System account, but also I've used my personal account. Both with the same problem...
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 40458331
Do you have multiple home folders?
0
 
LVL 8

Expert Comment

by:guvera
ID: 40458344
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='SERVICE="(description=(address_list=(address=(protocol=TCP)(host=r00979)(port=1521)))(connect_data=(service_name=desk_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
0
 

Author Comment

by:leorocha
ID: 40458437
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\client_1\NETWORK\ADMIN
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
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:leorocha
ID: 40458439
kaufmed, I don't understand your question.
0
 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 total points
ID: 40458468
The ORA-06413 appears to be a 32Bit issue on 64Bit and the "Program Files (x86)"
https://community.oracle.com/thread/2251833

Don't worry about what Guvera posted.  That was just a Google effort on the ORA-12154 error.

What kaufmed was asking is you have multiple Oracle products installed.  It might be an ORACLE_HOME issue and it was looking at the wrong tnsnames.ora file.
0
 

Author Comment

by:leorocha
ID: 40459438
kaufmed, yes I've ORACLE\PRODUCT\10.2.0\CLIENT_1 .... (the client I'm using to connect to a external database) and ORACLEXE\APP\ORACLE... (my XE Oracle Server for development).

Leonel
0
 

Author Closing Comment

by:leorocha
ID: 40459466
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
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 40460086
Glad it worked for you.

Oracle has issues in the Microsoft world from time to time.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now