TNSNames.ora error - oracle

Set OraDatabase1 = OraSession.DbOpenDatabase(strLocation, "test/test_test", 0&)
I am trying to connect my oracle from my VB applicaton.
I have Oracle 9i and Oracle 11g installed in my computer.
I have problem in connecting in. I am getting tnsnams.ora error.

You need the "test/test_test" entry in your tnsnames.ora file. This file is typically found in the oracle install DIR under (ORACLE_VERSION)/NETWORK/ADMIN/ folder

Related

Connect to Oracle 19C Cloud from sqlplus

I am not able to connect to my Oracle 19C Cloud DB, I have downloaded the wallet and placed it in a secured place in my machine(windows).
I have installed Oracle 19C Client in my machine,
and updated tnsnames.ora(network/admin) with connection strings from wallet zip,
Not sure how whether I have missed any config like Environment variables
Getting below error from sqlplus
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
Note: I am able to connect to Cloud from Sql developer using the wallet file.
And I have Oracle 18c XE running in my machine.
Any help will be appreciated, thanks in advance.
Your problem seems to be related with the issue that you have an Oracle XE database version installed in your own laptop.
When you run sqlplus or any other OCI tool to connect to Oracle, no matter whether the database is a remote host or in the cloud, sqlplus evaluates the TNS_ADMIN environment variable to identify where your sqlnet and tnsnames files are located. If there is no variable, it uses the default values of your main Oracle registry entries, that for sure point to your XE version, as it was installed before.
When you get ORA-12154: TNS:could not resolve the connect identifier specified , your session is not finding any information regarding the target in your configuration files, probably because the session is evaluating the files in your XE installation
Try to do the following
Copy the wallet files provided by your Oracle Cloud to a location different to your XE installation.
Export the TNS_ADMIN variable in your sqlplus cmd session to this new path
Run sqlplus using wallet
Example ( I believe you did points 1 and 2 )
Install Oracle Client software on your computer. Use either the full
Oracle Database Client 11.2.0.4 (or higher) or the Oracle Instant
Client 12.1.0.2 (or higher). The Instant Client contains the minimal
software needed to make an Oracle Call Interface connection. The
Instant Client 12.1.0.2 (or higher) is sufficient for most
applications.
Download client credentials and store the file in a secure folder on
your client computer. See Download Client Credentials (Wallets).
Unzip/uncompress the credentials file into a secure folder on your client computer.
Edit the sqlnet.ora file in the folder where you unzip the
credentials file, replacing "?/network/admin" with the name of the
folder containing the client credentials.
Example
WALLET_LOCATION = (SOURCE = (METHOD = file) (METHOD_DATA = (DIRECTORY="/my_new_path")))
SSL_SERVER_DN_MATCH=yes
cmd> set tns_admin = my_new_path
cmd> sqlplus /#yourtnsentry
I don't know whether your cloud database is using a Public IP address or not, or if you want to use SSH tunneling to connect to the database. Take a look here, because then you might want to use SQLcl ( Sql Developer Command Line )
https://docs.cloud.oracle.com/en-us/iaas/Content/Database/Tasks/connectingDB.htm

Don't have Oracle folder in HKEY_LOCAL_MACHINE\SOFTWARE

I'm installing Oracle 11g R2 and when I log in in SQL PLUS, It have error ORA-12560: TNS:protocol adapter error, and I think because I don't have Oracle folder in HKEY_LOCAL_MACHINE\SOFTWARE, how to create Oracle folder
If you are trying to connect to a database locally on the computer, ensure that you have set ORACLE_SID environment variable:
SET ORACLE_SID=ORCL
SQLPLUS user/password

Oracle database connectivity issue

I have a oracle database instance on my local machine , which i try to connect to .
Using SQL Developer , i can connect to it . But when i use sqlplus i cannot connect to the instance.
The error message i get is
ORA-28547:connection to server failed,probable oracle net admin error.
I tried restarting my TNS service but still the issue persists.
And i need to connect to sqlplus because i need to import the dumps using
impdp system/***** schemas=abcd dumpfile=DUMP_500.dmp
Please let me know what other information is needed , so that i can post
Thanks
Are you using the same tnsnames.ora file for your SQL*Plus that your SQL Developer is using?
Also try adding SQL_AUTHENTICATION_SERVICES = (NONE) to your sqlnet.ora file.
i added SQL_AUTHENTICATION_SERVICES = (NONE) to my sqlnet.ora file and it worked

Oracle tns listener error

I've just installed Oracle 10g When I try to connect to oracle db i get an error:
could not start OracleOraHome92TNSListener
when i got to services and try to start it, it says that the file doesnt exist. the service file is C:\oracle\ora92\BIN\TNSLSNR (TNSLSNR is a file not a directory)
C:\oracle\ora92\BIN\TNSLSNR doesn't exist on my machine at all. do you know how to get it?
Could not start the Oracle Ora92 Listener service on Local Computer.Error 2: The system cannot find the file specified
Here's a couple of issues I see. You say you installed 10g but the error is a 9.2 error. It could be that your computer already had an Oracle 9i on it that was mis-configured or uninstalled and that is leading to the error.
You need to check your disk and find the ORACLE_HOME (directory) where Oracle 10g was installed. Once you find that you can adjust the PATH and ORACLE_HOME and TNS_ADMIN environment variables to point to the right place. This should allow you to start the database and the listener.
If you need to install the Oracle Client for 10g then this information below will be helpful as well.
The Oracle client can be installed separately. Just go to this address, download the client and unzip it into a subdirectory and then run the Oracle Universal Installer by running setup.exe from the directory.
Oracle Downloads Page

ODBC Oracle Connection error from MS Access

I currently support an MS Access database that has linked connections using the Microsoft ODBC Driver for Oracle. I can connect to the current linked tables without any issues, but we are required for security reasons to change the password on the account accessing the Server.
I have changed the password successfully but now when I attempt to relink the tables I get the error:
ODBC--call failed
Microsoft ODBC driver for ORacle ORA-12154: TNS could not resolve service name
These tables are part of a critical application and now we can't connect. Any suggestions on how to resolve this?
The ORA-12154 error indicates that you are specifying a TNS alias that is not resolving. Are you using a DSN for your connection to Oracle? If so, what is the TNS alias you're specifying there? Does that alias exist in your tnsnames.ora file? Are there multiple tnsnames.ora files on the client?
The tnsnames.ora file is on the client machine where Access is installed. Without knowing what version of the Oracle client is installed, the simplest way to find out which tnsnames.ora file is being used is probably to open up a DOS prompt and type "tnsping service_name" where `service_name" is whatever TNS alias is specified in your DSN. You'll get something like
C:\Users\jcave>tnsping fuddy_duddy
TNS Ping Utility for 64-bit Windows: Version 11.2.0.1.0 - Production on 07-OCT-2
010 08:10:51
Copyright (c) 1997, 2010, Oracle. All rights reserved.
Used parameter files:
C:\oracle\product\11.1.0\db_1\NETWORK\ADMIN\sqlnet.ora
TNS-03505: Failed to resolve name
The "Used parameter files" line tells you the directory where the TNS related files are stored. There should be a tnsnames.ora and a sqlnet.ora file in that directory.

Resources