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

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

Related

Oracle XE 18c, on every connect attempt, Oracle listener OracleOraDB18Home1TNSListener stops, and I am unable to connect to any connection

For the purpose of learning, I have installed Oracle 18c XE v18.4.0.0 and Oracle SQL Developer v21.4.2. I have no previous experience with Oracle database.
Command LSNRCTL stat seems to show correct results:
LSNRCTL stat output
I am trying to connect to XEPDB1 Plugin database by using sqlplus command:
sqlplus system/oracle#192.168.1.102:1521/XEPDB1
(192.168.1.102 is my local IP)
but everytime I tried so, service OracleOraDB18Home1TNSListener (and listener also) stops.
Then I start it again manually and try again to connect to XEPDB1 but the same thing happen again.
Respond to connection command after few minutes is: ERROR: ORA-12537: TNS:connection closed.
Files listener.ora and tnsnames.ora are not modified after fresh installation of Oracle 18c XE.
Much appreciate if anybody can help me.

"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.

Error while restoring oracle 10g .dmp file in oracle database 12c

I've got a .dmp file created with Oracle 10g containing the database of one of my clients. I can't for the life of me get it set up with my 12c installation. I can connect to my db using https://localhost:5500/em
I've created a user 'BOB' in my desired PDB and granted import, read and write permissions. Next I try to import using the following command:
impdp BOB/password#//localhost:1521/pdbname full=y directory=dpdump_dir dumpfile=BOB.dmp
However this gives me the following errors:
UDI-12541: operation generated ORACLE error 12541
ORA-12541: TNS:listener does not currently know of service requested in connect descriptor
In the listener.ora and tnsnames.ora i have EZCONNECTOR and ports 1521. Does anyone know how to get this to work?
Many thanks in advance,
Bob
First ensure that you can do tnsping for pdbname to ensure db connect :- $ tnsping bdbname
If you get details of connection string by tnsping, you can try command with following format:
impdp bob/password#127.0.0.1:1521/pdbname directory=dpdump_dir dumpfile=BOB.dmp
I have removed "full=y" as it's not required if you are not restoring full database, specially it used apply with imp/exp utility.
You should remember that pdbname is being specified as a dbname/service_name in your example. You can confirm service_name by following command:
$ lsnrctl services; /* You can get service name and put it on your impdp command. */
In addition, you can try without specifying ip,port and dbname as you are working in localhost itself:
$ impdp bob/password directory=dpdump_dir dumpfile=BOB.dmp
First of all, you should check the connection
sqlplus> BOB/password#localhost:1521/pdbname
If you cannot connect, please connect with sys / as sysdba
Then using command:
SQL> alter session set container=pdbname
SQL> alter pluggable database pdbname open
Then quit and try to your command again. :)

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

Error in Toad - ora 12154

I am trying to make a connection using Toad to a database (xe10 free edition) and it givea me a error:
ORA-12154
I tried changing the sqlnetORA to:
SQLNET.AUTHENTICATION_SERVICES= (NONE)
and still the same error.
1st check to make sure you can ping the database, if yes move to next step if not resolve firewall/network issues.
2nd check to see if you can connect via SQL*plus. If you can connect with SQL+ then your TNS is fine and Toad seems to be the issue, if you cannot then there is an issue with your TNS file.
Be sure to try and connect directly using the following method:
In Toad click "Session" > "New Connection"
There are 3 options TNS, Direct, LDAP (Shown as Tabs) . Select "Direct"
User: sys
Password : <passwd>
Host: 127.0.0.1
Port: 1521
Service Name: XE
Connect as: SYSDBA
If you are unable to connect via SQL+ or Toad then fix your .tns, I have attached a few helpful links below which should help resolve your problem.
http://www.dba-oracle.com/t_ora_12154_tns_resolve_service_name.htm
http://www.orafaq.com/wiki/Tnsnames.ora
try to comment the following line in sqlnet.ora
#names.default_domain = world
otherwise, Oracle will append .world to your host string
Often, it's a typographical error in your connexion string or in your tnsnames.ora file. More information here : 11g/ORA-12154.

Resources