ORA-12154: Nagios checks - oracle

I have got Oracle DB`s version 18 and version 19 and they all work fine but the Nagios monitoring checks for v19 all give me: CRITICAL - ORA-12154: TNS:could not resolve the connect identifier specified. I even have got on one server both versions but monitoring checks for v19 not working. They are all set the same way (tnsnames.ora, and .cfg in monitoring serv.) but I still missing something for v19 only.
Tried to find the same issue on the internet but I didn`t. Also checked the connection and is DB work and is OK. Compared to the conf. files from v18 and v19 looks OK.

Be sure that you use correct credentials when it comes to user and password in -l and -a
I also experienced this kind of errors in past, during creation of checks but proper USER solve it.

Related

Cannot connect to Oracle database via TCPS

We have an Oracle server set up and are using TCP with SSL as connection. This setup was made with the assistant wizard and we used the default settings pretty much everywhere (which also means that no tnsnames.ora or listener.ora exist). lsnrctl status shows that the correct ports are listening.
We are trying to connect to this database via DBeaver and SQuirrel SQL but cannot get it to work. We have set the vmargs for the programs to contain the certificate of the server (e.g. dbeaver.exe -vmargs -Djavax.net.ssl.trustStore=C:/...keystore.jks -Djavax.net.ssl.trustStorePassword=password -Djavax.net.ssl.trustStoreType=JKS), which works fine.
Connecting to the database with a concrete JDBC URL string (jdbc:oracle:thin:#(DESCRIPTION=(ADDRESS=(PROTOCOL=TCPS)(HOST=IP)(PORT=5500))(CONNECT_DATA=(SERVICE_NAME=testdb)))) does not work and times out after 60 seconds without a proper error (IO Error: Got minus one from a read call). We have tried pretty much everything and cannot get it to work.
The ports are correctly assigned, the database can successfully get accessed with the normal TCP protocol and port 1521.jdbc:oracle:thin:#(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=IP)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=testdb)))
Are we missing steps? There don't seem to be any firewall issues. The certificates seem to be working fine as well, but we cannot connect with any of the programs (or sqlplus via command line).
Anyone know what could be the problem? Thanks!
Can you check out the SSL blog or our OTN page for step-by-step instructions? If you are using TLSv1.2 then the JDK version and JDBC driver versions are very important.
In the end I got it to work. There are various sites online that show you how it's done. I used this one:
https://database.edorex.ch/blog/database-connection-with-a-certificate/
Getting the wallets set up, certificates set up and the user set up in the database were the most important steps. Additionally, I had to separate the server and client machines. The server is now on a VM and it works that way, I couldn't get it to work having both on the same machine.

ORA-12541 TNS :no listener on 1 specific remote database, but not on others

Some context: I'm setting up an environment to run some Ruby code our Lead wrote to connect to some remote Databases. I'm using Win10 and have WSL installed. I have installed SQL*Plus, docker, and Ruby, and am sure I have installed all the dependent gems (actually at this point I know for a fact its not a ruby problem). I'm using Docker to use a pre-built image of an Oracle Database, and I have populated it with data.
Obfuscated company DB information:
'Broken' DB (TNS no listener)
Username: W-WORK-DEV
Password: password
Host: host1
Port: 999
SID: W-WORK-DB.tech.company
'Working' DB (can connect just fine)
Username: C-OLD-DEV
Password: password
Host: host2
Port: 999
SID: C-OLD-DB.tech.company
Please note the names I have provided here are purely for obfuscation, they do not represent anything about age or even config. They are essentially the same, just different databases on different hosts. Also note this is a corporate company and would have a lot of base infrastructure for their internal network.
The issue I am having is that with the specific database I am working on, I cannot connect to it. I connect to the company intranet via a VPN (I work offsite) and have issues connecting to WORK-DB.tech.company, though I can connect to C-OLD-DB.tech.company. Methods I have tried to connect with:
Oracle SQL Developer
I have inputted all the correct jdbc strings and username / password. Have even asked other people to attempt to connect (at least 3 others). They can all access C-OLD-DB as well as W-WORK-DB. When using this method, I get The network adapter could not establish the connection.
Side note: I'm fairly sure I have connected to the DB just fine in the past, though I can't be certain because I'm fairly new to this team and have only accessed it once, if that.
SQL*Plus via WSL
I installed SQL*Plus because I think Ruby was accessing it in some capacity when running the script. I got to the point where the script was able to connect to my local docker Database, but when it tried to connect to the remote database, it would return TNS: no listener. I attempted this using sqlplus as well and got the same error.
Example:
sqlplus C-OLD-DEV/password#host2:999/C-OLD-DB.tech.company
This command works and connected to the DB jsut fine.
sqlplus W-WORK-DEV/password#host1:999/W-WORK-DB.tech.company
This command gave me TNS: no listener.
During my research I had found mentions about tnsnames.ora, sqlnet.ora, and listener.ora. I have found relevant files around the company intranet and attempted to use them in my own personal environment to no avail (one of the sqlnet.ora files actually stopped me from being able to connect to any) I found mention about a config/database.yml file related to ruby, but our code already has the database information set up and I seem to be getting to the same solution as the script when trying to manually connect via sqlplus.
Here are some relevant environment variables I have set up when doing these installs. I'm thinking that at some point when trying to set up my environment, I messed up some config that changed the way sqldeveloper or sql plus would connect to that database.
$ echo $ORACLE_HOME: /usr/lib/oracle/12.2/client64/
$ echo $TNS_ADMIN: /usr/lib/oracle/12.2/client64/network/admin
$ echo $LD_LIBRARY_PATH: /usr/lib/oracle/12.2/client64/lib
I hope I have provided all the information I have come across and have explained clearly what my issue is, if you have any questions feel free to comment about it so I can clear it up. Thank you for any and all your help.
So my problem ended up being a 'firewall/port' issue. In the end i found out that specific port I was connecting to was blocked, but I thought it was only on my system. Turns out the VPN I'm using was the issue blocking that port. Company has a Primary Data Center and a Secondary one, and apparently the SDC VPN was blocking that port from me. I switched to using the PDC VPN and it worked.
Are you using the 64 bit jdbc drivers?

SQL Developer error: got minus one from a read call [duplicate]

I connect to a database with read only access using SQL developer. It's a TNS connection. I use a tnsnames.ora, forwarding port script and SQL Developer.
In the past, occasionally, when connecting, I get a error message
Got a minus one from a read call.
Vendor Code 0
If I do a reboot, it goes away. Another friend suggested changed the forwarding port which worked for him.
I recently upgraded to a new computer and now it seems that I am getting the error message consistently. Reboot or changing forwarding port does not help at all.
The port forwarding script contains something like this
putty -L (port):(machine name):1521
Does anybody have any idea? Thanks.
My port forwarding script forwards multiple ports. Somehow separating them into 2 smaller file, this error went away.
Check your sqlnet.ora file and comment if there is any entry like the below.
tcp.validnode_checking = yes
tcp.invited_nodes=(<hostname_1>, <hostname_2>)
Now reload your listener and check the connectivity from SQL Developer.
lsnrctl reload <SID>

Connect to server via FTP with Notepad++?

I'm trying to log into my FTP account through Notepad++ but I cant get it to connect for the life of me. I know the password and hostname are correct because it works fine in filezilla.
I get the following info in the output:
-> TYPE I
Connecting
-> Quit
Unable to connect
Disconnected
I'm using
NPPv6.5.4
NppFTPv0.24.1
Incase it matters, the hostname is through awardspace.net dck.dx.am connection mode is passive, transfer mode is binary, everything else is default...
Thanks in advance for the help,
Dave
I'm getting the same results. The plugin worked before, it looks it is now broken. Starting as admin doesn't help, too. Maybe you can downgrade it to some older version and retry. If someone has time, he can fill a support request directly at NPP FTP homepage. As problems with this plugin are frequent, I switched to a different solution - see the second paragraph of that post.
EDIT: I've made some plugin diagnostics, please follow here.
Connecting
-> Quit
Unable to connect
No more explanation of the error.
The reason was, remote machine doesn’t allow FTP connections at all!
So Use sftp (select from connetion type)
this will work

Cannot access ODBC DB with MS Access2007

I'm having problems accessing an Oracle database via ODBC in Access and hope someone has some advice. I've spent a fair time trying to find a solution, but nothing useful has come up.
I have a connection setup in ODBC that access an Oracle 9 database. I can use the Test option on ODBC administrator and receive a Test Successful message. I can also connect to the DB using SQL*PLUS. However, when I try to create a new linked table in Access 2007 and use the ODBC option, I get the following error when it tries to connect:
ODBC--Call failed.
[Oracle][ODBC][Ora]ORA-12154: TNS:could not resolve service name
(#12154)[Microsoft][ODBC Driver Manager]Driver's SQLSetConnectAttr failed IM006 0 [Microsoft][ODBC Driver Manager]Driver's SQLSetConnectAttr failed (#0)
I know the TNS lookup is working because ODBC Admin tool works as does tnsping. The question is, why does it work outside Access but Access can't do it?
EDIT (2012-02-22 15:05): Just tried on a different PC and the same thing occurs, although another user logged in and the connection worked for them, so it appears to be linked to my WinXP profile. Does this help any?
Any advice would be greatly appreciated.
BBz
I think I've resolved the issue, but it took some digging. Using Process Monitor from Sysinternals, I discovered that Access had found a sqlnet.ora file in the "My Documents" folder of my profile and was using this in preference to the global tnsnames.ora file.
We had previously disabled sqlnet.ora (renamed the file in the Oracle folder) but Access obvisouly checks other locations for it. I've renamed the file and can now access the DB as expected via ODBC.
Interesting what you can learn!
Hope somebody finds this useful one day.
Thanks for reading
BBz

Resources