Chittaranjan Kotian
Answered On : May 16th, 2012
A query is first checked for semantics, and is then parsed. Parse can be hard parse or soft parse. Oracle will check if the parsed statement exists in the library cache. If it exists the existing statement is used, If not, the query statement will be hard parsed and placed in the library cache. The optimized then decides on the best execution plan and executes the statement. The data to be retrieved is fetched from the buffer cache if it already exists, if not the data blocks are read, data fetched and stored in the buffer cache and presented to the session requesting the data
Login to rate this answer.
himanshu
Answered On : Sep 27th, 2012
1. RDBMS checks if a copy of the parsed SQL statement exists in the library cache. If parsed copy exists, then steps 2 to 6 are skipped.
2. RDBMS validates the syntax of the statement.
3. RDBMS ensures that all the columns and tables referenced in the statement exist.
4. RDBMS acquires parse locks on objects referenced in the statement so that their definitions do not change while statement is parsed.
5. RDBMS ensures that the user has sufficient privileges.
6. Statement is parsed and execution plan is created.
7. Statement is executed.
8. Values are fetched.
Login to rate this answer.