Unfortunately, Oracle did not design a good interrupt scheme for SQL*Plus. Although a <ctrl-C> can eventually cause an interrupt, it usually is too late to do any good since SQL*Plus does not detect the <ctrl-C> until it has finished outputting its current result-set package from the server.
When I wish to interrupt a long-running query (and if the <ctrl-C> does not respond before I have lost patience), I just kill the client SQL*Plus window that is running the query. The Oracle PMON (Process MONitor) process cleans up your interrupted server process.
If I have an untested query that could run indefinitely, I typically test the query initially with this condition temporarily as part of the WHERE clause:
Code:
WHERE ROWNUM <= 10
This allows only the first ten rows that Oracle encounters in the FROM clause to be part of the result set. This prevents a query from becoming a "run-away" query.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.