General troubleshooting guidelines for "Read no more socket data."
These errors are usually caused by another serious error, such as the ORA-600 error. The problem is so serious that the server process crashed and could not even send the correct error message to the client. (Another common cause of these errors is a network outage caused by SQLNET.EXPIRE_TIME or another process that kills old sessions.)
Look at the warning log for the original error message.
Locate the alert_ [name] .log file in this directory: select value from v$parameter where name = 'background_dump_dest';
Once you find a specific error message and detailed information, go to support.oracle.com. Use the ora-600 tool, and then find the first number after the ORA-600 message.
Typically, for one type of ORA-600 error, there is usually one or more entries. Use the exact version and platform to narrow down the list of possible errors. (But don't be surprised if the "Versions affected" in this article are incorrect. Oracle's "fixed in version xy" requirements are not always true.)
Articles typically explain how this problem occurred, possible workarounds, and a solution that usually includes a fix or update.
In practice, you rarely want to solve these problems. The “typical” tip is to contact Oracle Support to make sure that you really have the same problem, get the patch, get permission and hide the environment (s), and then apply the patch. And then, probably, understand that the patch is not working. Congratulations, you just spent a lot of time.
Instead, you can usually avoid the problem of subtlely modifying a request or procedure. There are many possibilities in Oracle, there is almost always another way to do this. If the code turns out to be a little strange, add a comment to warn future programmers: "This code looks strange to avoid an X error that needs to be fixed in version Y."
Specific tip for this code
If this is really your procedure, you should replace it with something like this:
insert into local.tab3(col1, col2, col3, col4) select tab1.col1, tab1.col2, tab2.col1, tab2.col2 from tab1@dblink1 tab1 join tab2@dblink1 tab2 on tab1.col1 = tab2.col1 and tab1.col2 = tab2.col2;
In general, you should always do something in SQL, if possible. Especially if you can avoid opening many cursors. And especially if you can avoid opening many cursors in a remote database.