Trying to connect to database, getting error ORA-12154: TNS:could not resolve the connect identifier specified - oracle

I am new to oracle, I just installed oracle when I am trying to connect to the database I got this error.ORA-12154: TNS: could not resolve the connect identifier specified.

To connect onn Oracle DB you should configure the file tnsnames.ora wich define DNS to your oracle server.
After configure file, you can test your connection with tnsping DNS_NAMED_SERVER
if you never heard about tns names, you can read more on Oracle Docs https://docs.oracle.com/database/121/NETRF/tnsnames.htm#NETRF260

Related

I am able to connect to Oracle Db using Toad but connection using sqlplus is not working. Getting TNS timeout error

I am able to connect to Oracle DB using Toad with Datasource name and username/password. Oracle client 12 as Oracle driver. oracle database path is set properly in the environment variables. sqlnet.ora, listener.ora and tnsnames.ora is present in ORACLE\ORANT\NETWORK\ADMIN folder and configured properly. I tried to query using Sqlplus in cmd prompt using following command:
connect User/pass#dw-prod.server.int:1527/pdw1s_servicename
I am getting ORA-12170: TNS Connect timeout error. Please help.
In SQL*Plus, just need to connect using the TNS alias.
connect user/password#tns_alias
If your password contains specific characters like # or ! probably you are getting the error for this

"ORA-12154:TNS:could not resolve the connect identifier specified" on Mac in SQL Developer

Connecting through Oracle SQL Developer(version 18.2.0.183) using wallet files(cwallet.sso and ewallet.p12) we are getting the following error “ORA-12154:TNS:could not resolve the connect identifier specified “when we test the connection via Advanced connection type in SQL Developer. We are using “jdbc:oracle:oci:/#NAME”. We are able to connect using SQLPLUS using “sqlplus /#NAME”. This is on a Mac(High Sierra) with the Instant Client Version 12.2.0.1.0.
https://www.oracle.com/technetwork/topics/intel-macsoft-096467.html
We have the TNSNAMES.ora and SQLNET.ora files configured and the wallet is set and working fine with SQLPLUS.
Is there anything we should look at to troubleshoot this further? Or any workarounds you might suggest?
Thanks,
Tom
Same advice I gave on the OTN forums -
make sure SQL Developer is reading the TNSNAMES file you think it is.
show tns
connect hr/oracle#orcl -- execute in a sqlworksheet with F5
TNS Lookup locations
--------------------
1. USER Home dir
C:\Users\jdsmith
Location used:
-------------
C:\Users\jdsmith
Available TNS Entries
---------------------
LISTENER_ORCL12C
ORCL
ORCL12C
Connected.
Connection created by CONNECT script command disconnected
If that fails, try EZCONNECT syntax
connect hr/oracle#server:port/SID
Also, there is a TNS connection type you can use. If OCI is enabled in preferences, your connection will be 'thick' and use sqlnet and tnsnames ora files.

JDBC Connection from MAC OS(EL Capitan) to Prebuilt Oracle VM

I must have searched the entire net for a solution but no success.
I have installed a DeveloperDay prebuilt Oracle Linux 7.3 form the following site: http://www.oracle.com/technetwork/database/enterprise-edition/databaseappdev-vm-161299.html
I am able to connect to the database through SQL Developer using configurations like
Connection type : Basic
Username : scott
Password : oracle
hostname : localhost
Port : 1521
Service name : orcl
Connection is successful and I am able to query properly.
But while trying to connect from jdbc from eclipse I am unable to connect. I am getting various errors for various attempts like
jdbc:oracle:thin:#localhost:1521:orcl
Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
jdbc:oracle:thin:#localhost:1521:orcl12c
java.sql.SQLException: ORA-01017: invalid username/password; logon denied
(username and password is entered as scott and oracle respectively)
jdbc:oracle:thin:#127.0.0.1:1521:orcl12c
java.sql.SQLException: ORA-01017: invalid username/password; logon denied
Please help to resolve this issue.
Because you try to access to a distance database, you consider VM like it is localhost and this is wrong, in fact it is another machine.
To solve this problem you should to use the IP Address of this VM not localhost, and this not easy you should to make some configuration of your VM you can follow this manuals here:
How to access Oracle DB in VirtualBox from Host (windows) and How to access localhost on Virtualbox host machine
and here
Connecting to Oracle from Your Host to a VirtualBox Guest
Hope this can help you.

oracle to postgresql connectivity

I'm using postgresql 9.1 and oracle 11gR2 64 bit windows.
I'm trying Heterogeneous DB Connection Between Oracle 11gR2 And Postgresql 9.1.
here the info:
I configured by reading these links
http://dbaspot.wordpress.com/2013/05/29/how-to-access-postgresql-from-oracle-database/
http://manojadinesh.blogspot.in/2012/05/heterogeneous-db-connection-between.html
When I tried this command
select * from "testtable"#PG_LINK;
I got an error like
ORA-12154: TNS:could not resolve the connect identifier specified

on using oracle database link theres an error "ORA-12154 TNS Could not resolve the connect identifier specified"

I'm trying to define a database link on oracle 10.2 with connection identifier that throws the error in the question header.
I have the connection identifier (service name) in my tnsnames.ora file.
I can connect with sqlplus using this service name. no problem.
This is the creation sql:
create database link dev1.REGRESS.RDBMS.DEV.US.ORACLE.COM
connect to user1 identified by pass1
using 'dev1';
select using the link:
select * from t_users#dev1;
I get: ORA-12154: TNS:could not resolve the connect identifier specified
connecting to oracle with sqlplus to the 'unidentified' service (with no problem):
sqlplus user1/pass1#dev1
I defined another link to the same database I'm woking in (loopback) - works OK.
I read and tried anything I could find about the subject but did not solve this.
Any suggestions?
Try:
create database link dev1 connect to user1 identified by pass1 using 'dev1';
Also note that a tnsnames.ora entry for dev1 has to exist on the database server that you're linking from.

Resources