SQL 解析过程


1> Parse phase:
  --Searches for the statement in the shared pool
  -- check syntax
  --check semantics and privileges
  --Merges view definitions and subqueries
  --Determines execution plan
  There are two types of parse operations:
  --Hard Parsing: A SQL statement is submitted for the 1st time, and no shareable match is found .in the shared pool. Hard parses are very expensive.
  --Soft Parsing: A SQL statement is submitted, and a match is found in the shared pool. It is really .good for performance. However, soft parsed still require syntax and security checking.


2> Bind Phase
  During the bind phase:
  --The Oracle DB checks the statement for references of bind variables.
  --The Oracle DB assigns or reassigns a value to each variable.


3> Execute phase:
  --Executes the sql statement
  --Performs necessary I/O and sorts for data(Manipulation language DML statements)


4>Fetch phase:
  --Retrieves rows for a query
  --Sorts for queries when needed
  --Uses an array fetch mechanism

 

你可能感兴趣的:(oracle,sql,Security,performance)