Oracle database connectivity issue - oracle

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

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

Oracle 11g XE - Can't login and database is down

Just installed Oracle 11g XE (Windows), but can't connect in SQL Developer or run any command in CLI.
When try to connect in CLI using SYS or SYSTEM with password defined during the install, get the following error:
ORA-12638: credential retrieval failed
When I tray to connect via SQL Developer (tried via SID and Service Name, hostname=localhost, port=1521, SID=xe), get this error:
Status : Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in
connect descriptor
Already tried change SQLNET.AUTHENTICATION_SERVICES = (NTS) to (NONE) in sqlnet.ora file. When I do this, get the following error when try to connect with the SYS or SYSTEM user and password:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Already tried every solution in Google results, like reinstall, stop and start services... Mostly ask for first connect in CLI to make some changes, but even this I can't accomplish.
Any suggestions on how connect to the database?
Found the solution:
I was installing in my company Windows user domain.
First uninstall any instance of Oracle XE 11g.
Switch to a local administrator Windows user and install Oracle XE 11g.
Sign off and back to company Windows user.
Edit the file C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN\sqlnet.ora (or equivalent to your installation path). Change SQLNET.AUTHENTICATION_SERVICES = (TNS) to SQLNET.AUTHENTICATION_SERVICES = (NONE).
This change will allow you connect to database from you company Windows user.
As seen here: Error ORA-12638 in Oracle Database 11g
Try the following: Open command window, cd to Oracle bin directory, enter sqlplus /nolog. If you get a prompt enter connect / as sysdba. If you get connected then you can try "startup".
- -
Did you try to start the Oracle RDBMS service via Services (services.msc)?
Do you use an spfile? Check the registry for ORA_SID_NAME_PFILE that is different from default location of $ORACLE_HOME/dbs. Also check the default location. Use only the default location or the registry entry removing either the registry entry or the file in the default location depending on which you want to use.

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.

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