How do I kill long-running queries in sqlplus, Pro*C, and JDBC?
Sometimes it is necessary to stop long-running queries, either because they take longer to run than you’d like, or because you realize you’ve made a mistake. It is important kill off such queries properly so that they don’t take up extra computational resources and prevent others from using the system, especially near project deadlines when resources are most strained. As a general precautionary measure, please be sure to test your queries under sqlplus prompt before running them through CGI or JDBC. It is much easier to kill a query in sqlplus than in CGI or JDBC. If your test query takes a long time to run under sqlplus, you can simply hit Ctrl-C to terminate it. Never close an ssh or telnet or xterm window without properly logging out. Always quit your programs (including sqlplus), stop Java servlets, and type “exit” or “logout” to quit. If you force-close your ssh/telnet/xterm window, there may still be processes running in the background, and you may be taking up system resources