March 08, 2009

What is Parsing

Two type of Parsing: Hard Parse and Soft Parse

Hard Parse:
If a session executes SQL statement that does not exist in the shared pool. A hard parse is expensive in both terms of CPU used and number of shared pool latch and library cache latch, it needs to release.

Oracle SQL is parsed before execution and hard parse includes these steps:

1. Load into Shared Pool: The sql source code is loaded into RAM for parsing.

2. Syntax Parse: To check any missspelled sql keywards

3. Semantic Parse: Oracle verifies all tables and column names for the dictionary and checks privileges to access the data

4. Optimization: Creates an execution plan based on your schema statistics.

5. Create executable: Oracle build executable files with negative files calls to service sql query.

Soft Parse:
If a session executes SQL statements, that exists in the Shared Pool (i.e : does not require a shared pool reload again).

0 comments: