ORA-12170: TNS:Connect timeout occurred on CentOS 7 - oracle

I am configuring a server in CentOS 7 to connect to an Oracle database within the same network. IP ORACLE = 192.167.10.100 IP SERVER = 192.167.15.123
I have installed the Instant Client Package: Basic, SDK and SQL * Plus. Download link
Then set the environment variables:
ORACLE_HOME=/usr/lib/oracle/12.2/client64
PATH=$PATH:$ORACLE_HOME/bin
LD_LIBRARY_PATH=$ORACLE_HOME/lib
TNS_ADMIN=$ORACLE_HOME/network/admin
When entering with the SQL * Plus through the implicit connection string: With the format.
sqlplus username/password#host:port/sid
sqlplus testuser/orcltiger#192.167.10.100:1521/testdb
I get the error: ORA-12170: TNS: the connection timeout occurred
I have been able to connect with the same credentials from a Windows PC with Oracle SQL Developer but from CentOS I get an error:
Someone to help me find the solution, please.

Related

ERROR: ORA-12545: Connect failed because target host or object does not exist

I followed this steps to install Oracle 19.6.0 for Ubuntu 18.04:
https://medium.com/#TechExpertise/installing-oracle-sql-developer-on-ubuntu-16-04-lts-bfa4af959deb
Then for some reason I was not able to open sqlplus, so I followed this steps as solution:
https://gist.github.com/tcnksm/7316877
And now I want to log in sqlplus by typing sqlplus / as sysdba, but I am getting:
ERROR: ORA-12545: Connect failed because target host or object does
not exist
So I think I have to make the appropriate settings in listener.ora and tnsnames.ora,
but I am missing this files.
SQL Developer and SQL*Plus are client only tools that connect to a database that must be running somewhere: either on the same host or on another host.
If this database exists you should have its connect string to connect to it with SQL Developer or SQL*Plus
If this database does not exist, you must first create it: there are several ways to do this in addition to install Oracle Database (server - not client) and to create a database:
install Oracle XE 18c on Oracle Linux or Windows: installation will install database software and create a database at the same time (easier for non database specialist)
use a pre-installed VM such as: https://www.oracle.com/database/technologies/databaseappdev-vm.html.

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

Oracle sql developer connection - Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection

I download oracle sql developer "Windows 64-bit with JDK 8 included" from oracle website /download section. I unzipped it and tried to make a connection. I tried couple of options but I am getting "Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection" error.
Can any one help me with this. Thank you
Do you have a database?
I downloaded SQL Developer, now what?
SQL Developer is just a client, you need a database to connect to.

How to catch Sqlcmd errors without showing the error message

I am trying to find out with SQLEXPRESS is installed on a server by running the following
sqlcmd -S LT1183 -U uname -P pass123 -Q "SELECT ##servername"
If it is installed it gives out the server name but if its not, it throws the below error.
Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : TCP Provider: Error code 0x2AF9.
Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.
I am looking for a way to suppress this error and instead show a custom error message. Is that possible?
Thanks in advance.
This may not be possible with sqlcmd, since the error stems from connecting the the server, which upon error immediately terminates the sqlcmd.
if you can use powershell, you may find some luck using invoke-sqlcmd.
Powershell Try Catch invoke-sqlcmd

Oracle 11g XE Issues while Installing the database

I have installed Oracle 11g XE successfully. I have applied the bash profile from the the oracle user (source ~/.bash_profile). It applied successfully. SQL*plus can also connect connected.
But whenever I type the command lsnrctl status, it shows no listener listening.
I am getting following ORA errors. I tried it every single solution from Google
ORA-12546: TNS: permission denied
TNS -12537: TNS connection closed
TNS -12560: TNS Adapter Error
TNS-00507: connection closed
Linux Error :29(Illegal Seek)
0RA- 27369 - Operation not Permitted

Resources