How can I solve "Got minus one from a read call" in oracle sql developer?

108.6k views Asked by At

When I run the sql developer and set the all data,click the connect but i get this error:

Status : Failure -Test failed: IO Error: Got minus one from a read call

I am beginner in Oracle. How can I solve that error?

I use 64-bit Windows7 and oracle 12c.

enter image description here

12

There are 12 answers

0
Artem On

Try to do what the link , or check listener directory permission, or use command /dbhome/bin/relink all

7
starguy On

In my case the error is connected to a problem about the client's (SQL Developer) ojdbc8 driver and the Oracle 19.3 docker container. The solution for me was to set a system property on the client -- you can do it within the JDBC connection string):

jdbc:oracle:thin:@tcp://host:port/service?oracle.net.disableOob=true

This is the thread that lead me to the answer.

The cause of the error is described here:

https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=357910144923387

You can also solve this problem by dissabling OOB on server side in the sqlnet.ora:

DISABLE_OOB=ON

Another workaround is to use the ojdbc7 driver.

Hope this helps some of us.

1
Gaurav Singh On

Actually, It is not database specific issue. it is related to port value generated by database during your installation. To overcome on this issue, please follow below.

  1. Go to the folder where you have installed the database (Like: F:\app)
  2. Here you will be able to see many folders, go to product\11.2.0("your databse version")\dbhome_1\NETWORK\ADMIN
  3. find listener.ora file and open as text file
  4. Check for the port number in that file
  5. Now provide that port number while doing connection in sql developer.

Hope it will resolve your issue.

1
Popeye On

You need set "tcp.validnode_checking = no" or comment this parameter in sqlnet.ora file then restart listener on db server and test again.

Try it.

0
Programming learner On

Try Connection name: HR_ORCL Username: HR , Password: hr , Connection type : local, Role: SYSDBA Click on connect. It will work.

1
Marcin On

Most of the answers out there for this problem point to using the wrong PORT number in your connection options, or similar. In my case, after a couple hours of searching, the reason showed to be something else.

Mind which user you are using when starting Oracle listener. You should do it with the oracle user, not as root. Otherwise you end up with listener files being created as e.g. user deamon group root instead of user oracle group dba. This in turn leads to:

TNS-12555: TNS:permission denied
 TNS-12560: TNS:protocol adapter error
  TNS-00525: Insufficient privilege for operation
   Linux Error: 1: Operation not permitted

To check whether this is the case, go to

/var/tmp/.oracle

and list all files (ls -la). If you find out some of the s#* files being created by a root-group user, stop the listener (lsnrctl stop), delete the above files as root and restart the listener as oracle user.

Unfortunately sqldeveloper doesn't show the full stack-trace when reading "Got minus one from a read call". I could find the problem thanks to switching to SQL-Squirrel.

0
Rogerio Coelho On

Ensure the DB is up and running and you can connect locally AS SYSDBA to the database using Oracle binaries owner (usually oracle:oinstall Unix / Linux user). If it does not work, probably you encounter a different problem. Check privileges of an Oracle file on Unix / Linux host where database is running:

cd $ORACLE_HOME/bin
ls -ltr oracle
-rwxr-xr-x    1 oracle   oinstall       136803483 Mar 16 20:32 oracle

Change permissions as below:

chmod 6751 oracle
ls -ltr oracle
-rwsr-s--x    1 oracle   oinstall       136803483 Mar 16 20:32 oracle
0
Kris Rice On

From your inputs in the dialog, you are using port 5500. That port is what is used for EM Express. It answers to HTTPs traffic only. So in this case the -1 error message means the protocol negotiation failed. SQLDEV is trying to talk SQL*NET to something listening for HTTPs.

The port you are looking for is 1521 if it wasn't altered. If it was check the $ORACLE_HOME/network/admin/listener.ora for the proper port number.

0
Janet On

In my case, I was given wrong host and port. I typed "tnsping yourServiceName" in command line in window 10. It returns a different host and port, then I used the correct one in sql developer and it worked.

0
AudioBubble On

In my case, it happened when I was using Docker with Oracle 19C. The workaround is to find the listener.ora file, change 'PORT' and restart the container, ORACLE DB, listener.

It is presumed to be an error that occurred when the host tried to access TCP because it was already LISENT (HOST) by another process. (When accessing Docker, consider that in most cases, you are accessing localhost.)

enter image description here

I changed the port to 1523, and all the problems were solved.

0
Aditi Mane On

I got the same issue but following steps worked for me, it seems Gaurav also has shared it already:

1.Go to the folder where you have installed the database (Like: F:\app)
2.Here you will be able to see many folders, go to product\11.2.0("your databse version")\dbhome_1\NETWORK\ADMIN
3.find listener.ora file and open as text file
4.Check for the port number in that file
5.Now provide that port number while doing connection in sql developer.
0
viv kumar On

Seems you have enabled ACL on the listener.

You can follow these steps to avoid the error:

1. Go to directory $ORACLE_HOME/network/admin
2. Modify sqlnet.ora file with following parameter: 
tcp.validnode_checking = no

3. If you don't want to disable this, you can put the machine names as follows:
tcp.invited_nodes=(machine1, machine2)

3. Bounce the listener.

Hope that helps