Oracle ODBC Connection failed - oracle

While trying to connect to a database server via ODBC from a windows console program the connection is successful and getting data.
But when i try to use same code in a windows service and at
odbc_connection.open();
I am getting this error
odbcERROR [08004] [Oracle][ODBC][Ora]ORA-12154: TNS:could not resolve the connect identifier specified
ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed
Any idea what configuration is missing on my machine. Some idea might be helpful

Your service runs as some user. Usually, when you create service, it sets some default account there. When you run the code manually, it is executed under your privileges. When service runs the code, privileges are from the account under which service runs. Just go to this service and try to run as yourself

Related

unable to start the oracle TNSListener service(Oracle19c) - "OracleOraDB19Home1TNSListenerGLDB"

Initially Oracle 19c(Database and Client64) was installed and TNS Listener was configured under "Net Configuration Assistant" from the following path "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Oracle - OraDB19Home1\Configuration and Migration Tools". It was running fine for more than 6 months.
2 days before we got TNSListner error and unable to connect to the database. We are able to re-start all the Oracle services except TNSLISTENER service. While restarting the service getting following error "The oracleoradb19home1tnllistenerGLDB service on local computer started and stopped. some services stop automatically if they are not in use by other services or programs."
When we tried to check the Listener configuration, unable to invoke the "Net Configuration Assistant" application from the following path "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Oracle - OraDB19Home1\Configuration and Migration Tools".
In Net Manager window also, we could not see the Listener.
After restarting the system also , unable to restart the Listener service.
Note: Oracle server is under domain user.
Getting "ORA-12154 TNS could not resolve the correct identifier specified" error while loading data into Oracle Database.

How to connect an oracle database in visual studio

I already downloaded the oracle developer tools for VS, then I tried connecting HR to Visual studio with this configuration:
my configuration
but gives me this error:
ORA-12514, TNS:listener does not currently know of service requested in
connect descriptor
how do i resolve it?
Your configuration specifies to request a connection to service 'orcl'. But the error message says the database listener (the process responsible for handling the connection request) does not know of any database services 'orcl'. To fully debug, we'd need to see the output of the command 'lsnrctl status', as executed on the database server machine. Most like cause is that the database itself is not started, and thus is not registered to the listener.

Informatica Domain Configuration database connection during Powercenter installation

I am trying to install Informatica Server.
During domain configuration repository database information I get database connectivity error.
Error: Test Connection Failed. Correct the database connection information and test the connection again.
But when I connect using same details through Oracle SQL Developer to this database, it works fine.
I am using service name and port number field from the TNS File, still getting this error.
I think you can check tomcat log, catalina.out logs. This will help on finding out real issue.
Go to command prompt and type ping localhost and see if its responding anything. May be you can use IP and check host file.

Error Ora-12545 on APEX_WEB_SERVICE.make_request

I have an error when i try to connect to a web service using apex , it always gives error ORA-12545: Connect failed because target host or object does not exist i cant even connect to google, when i check dba_host_aces i have the permission to resolve and connect. the problem is that i am not sure if i need to do something with the oracle server to allow the apex to run or open ports or something, i have been using this guide oracle-base to make the function that calls the webservice

[Oracle][ODBC][Ora]ORA-12170: TNS:Connect timeout occurred ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed

I created a SSIS package to pull data from Oracle database to SQL server database. I have set up ODBC connection successfully on my local machine and on the server, I can connect to Oracle database using sqlplus on both environments.
And my package run fine on my local machine. it also executed successfully when I run it from Package store on the server but the problem is when I run the package as sql job I got this error:
Description:
System.Data.Odbc.OdbcException: ERROR [HY000] [Oracle][ODBC][Ora]ORA-12170: TNS:Connect timeout occurred ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed ERROR [HY000] [Oracle][ODBC][Ora]ORA-12170: TNS:Connect timeout occurred at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle RetCode retcode) at System.Data.Odbc.OdbcConnectionHandle..ctor(OdbcConnection connection OdbcConnectionString constr OdbcEnvironmentHandle environmentHandle) at System.Data.Odbc.OdbcConnectionOpen..ctor(OdbcConnection outerConnection OdbcConnectionString connectionOptions) at System.Data.Odbc.OdbcConnectionFactory.CreateConnection(DbConnectionOptions options Object poolGroupProviderInfo DbConnectionPool pool DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection DbConnectionPoolGroup poolGroup) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection DbConnectionFactory connectionFactory) at System.Data.Odbc.OdbcConnection.Open()
Does it make any senses?
ORA-12170 indicates that the TCP connection to the database listener failed.
If this is an error that happens all the time, then check your connection strings (particularly port numbers), firewalls and network ACLs.
If this is a transient error that doesn't always occur, or it the firewalls and network ACLs seen okay, then check for correct ARP behaviour. I've recently had this problem myself, and have blogged about it at http://distracted-it.blogspot.co.nz/2014/04/ora-12170-tnsconnect-timeout-resolved.html
Hope it helps.
ORA-12170 can result due to a lack of permissions. The Sql Server Agent Service Account must have access to the Oracle Client folder. You can test if this is the problem by logging in to the server as an administrator and trying to run the job manually, if it works this way, then it could be permissions. To change the permissions:
Browse to the Oracle folder, e.g. C:\Oracle64
Right Click the folder, click Properties, Security Tab, Click Edit, Click Add
Change "Locations" to be the machine name that you are on.
Enter the name “NT Service\SqlServerAgent” (this must be exactly right) and click Check Names.
Click OK, Apply, OK to get back to the security tab, you should see that “SQLSERVERAGENT” has a tick for Read & Allow, Read, List folder contents
.
Sometimes this happens when you are accesing to a DBLINK in one of your querys, and the database pointed on the dblink is down, so you have to check that too.

Resources