TechView with Kamlesh khaliya

Resources for OCP, Oracle Interviews(kamleshkhaliya@gmail.com)

Saturday 16 April 2011

what is Context Switching in Oracle while executing Stored Programs.

Oracle use two engine for execution of PL/SQL programs :
1. PL/SQL Engine
2. SQL Engine
During execution of Pl/Sql Program to execute all procedural statements (like if, for, assignments...) Oracle use Pl/Sql engine and sends all SQL statements present in the code to the SQL engine. The SQL engine will parse and execute the query or DML statement and return the expected output back to the PL/SQL engine. This switch between the two engines is called context switching.

Which impose additional overhead like maintain the state of variables and stack on every switch..... means highly expensive. Specially the cursor loops are very expensive so instead of that one should use Bulk Bind and Bulk collect features which reduce context switching.

4 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home