What Happens If Recursive Calls Get Out of Control?
Submitted by: AdministratorWhat happens if your code has bug on recursive procedure calls, which causes an infinite number nested procedure calls? The answer is so good. Oracle server seems to offer no protection calling stack limit. The script below shows you a badly coded recursive procedure. If you run it on an Oracle 10g XE server on Windows, your server will out of control and keep using virtual memory to satisfy the growing calling stack. You have to reboot your server to control back.
SQL> CREATE OR REPLACE PROCEDURE STACK_TEST AS
2 --Warning: do not run this procedure on your server
3 PROCEDURE STACK AS
4 BEGIN
5 STACK;
6 END;
7 BEGIN
8 STACK;
9 END;
10 /
SQL> EXECUTE STACK_TEST;
(your server keep running with 100% CPU and memory usage)
Submitted by: Administrator
SQL> CREATE OR REPLACE PROCEDURE STACK_TEST AS
2 --Warning: do not run this procedure on your server
3 PROCEDURE STACK AS
4 BEGIN
5 STACK;
6 END;
7 BEGIN
8 STACK;
9 END;
10 /
SQL> EXECUTE STACK_TEST;
(your server keep running with 100% CPU and memory usage)
Submitted by: Administrator
Read Online Oracle Database Job Interview Questions And Answers
Top Oracle Database Questions
☺ | What Happens to Indexes If You Drop a Table? |
☺ | How To Recover a Dropped Table in Oracle? |
☺ | How To Create Tables for ODBC Connection Testing? |
☺ | How To Retrieve Data from an Explicit Cursor? |
☺ | What Is a Table Index in Oracle? |
Top DB Oracle Categories
☺ | Oracle PL-SQL Interview Questions. |
☺ | Oracle DBA Interview Questions. |
☺ | Oracle D2K Interview Questions. |
☺ | OCI Interview Questions. |
☺ | Oracle RMAN Interview Questions. |