java.sql.SQLException: Cannot read more data from the socket

problem:

Use Java code to connect to Oracle to execute SQL statements, and an error is reported:

SQL state [null]; error code [17410]; 无法从套接字读取更多的数据;nested exception is java.sql.SQLException: 无法从套接字读取更多的数据

But putting the SQL statement on Navicat or plsql for execution did not report an error.

Question exploration:

I checked related articles on the Internet, and some said that the table space was insufficient; some said that the oracle driver package had problems; some said that there were problems with the jdbc driver, which was solved after replacing it with odbc, but it was ineffective for the problems encountered.
The error is nothing more than two directions: one is the Oracle database, and the other is the Java code.

First, let’s check the Oracle logs:
Oracle logs are placed in the /oracle/oracle/diag/rdbms/rac/rac1/trac and /oracle/oracle/diag/rdbms/rac/rac1/alert directories. You can also use select name ,value from v$diag_info command to query.
Insert picture description here
View log:
Insert picture description here
by looking at the log.xml file, we can see the detailed log information:
Insert picture description here
enter /home/oracle/app/oracle/diag/rdbms/helowin/helowin/trace/ path:

more helowin_ora_28085.trc

Insert picture description here
Here we clearly see the error message of ORA-07445.

problem solved:

ORA-07445 is said to be caused by a bug in Oracle.
Under normal circumstances, ORA-600 is proven to be an internal error of oracle, which is usually caused by a bug in oracle, and the corresponding patch of oracle is required. When the oracle server process receives a fatal error message from the operating system, the ora-07445 error will be thrown. This error can be triggered by the oracle background process or the user process. When an error is thrown, the system will first write an error log to the alert.log file, then write the trace file to user_dump_dest or background_dump_dest; finally, dump the main memory information to core_dump_dest.
The operating system has a lot of illegal operation designs. A situation often encountered is that a fatal error will occur when a process accesses an illegal address (such as an address reserved by the system).
The Ora-07445 error is a very common error, which may occur in any code in oracle. A more detailed description of the error code requires further tracking of its trace file.

The next solution is simple, execute the following sql at the database level to set implicit parameters to avoid this problem:

alter system set "_optimizer_connect_by_cost_based" = false scope=both;

Or execute the following SQL at the session level:

alter session set "_optimizer_connect_by_cost_based" = false scope=both;

Restart Oracle after modification, the original error will disappear.

Guess you like

Origin blog.csdn.net/weixin_44455388/article/details/108343020