052-014題解析

pxbibm發表於2014-03-31
 

14.

These are points that describe the contents of different memory components:

1: Descriptive information or metadata about schema objects that are queried by using SQL statements

2: The run-time area for data manipulation language (DML) or data definition language (DDL) statements

3: Results of SQL queries and PL/SQL functions

4: Executable forms of SQL cursors, PL/SQL programs, and Java classes

5: The information necessary to reconstruct changes made to the database by a transaction

Which of these will be stored in the Shared Pool if the necessary configurations are done?

A.1 and 2

B.2 and 5

C.1, 3, and 4

D.3, 4, and 5

E.1, 2, 3, and 4

Answer: C  

答案解析:

本題考得是Shared Pool 記憶體作用。
理解的SQL的軟解析與硬解析的區別,該題就簡單了。
Hard Parse 就是上面提到的對提交的Sql完全重新從頭進行解析(當在Shared Pool中找不到時候將會進行此操作),總共有一下5個執行步驟:

    1:語法分析

    2:許可權與物件檢查

    3 在共享池中檢查是否有完全相同的之前完全解析好的如果存在,直接跳過45,執行Sql此時算soft parse.

    4:選擇執行計劃

    5:產生執行計劃

注:建立解析樹、生成執行計劃對於sql的執行來說是開銷昂貴的動作,所以,應當極力避免硬解析,儘量使用軟解析。這就是在很多專案中,倡導開發設計人員對功能相同的程式碼要努力保持程式碼的一致性,以及要在程式中多使用繫結變數的原因。
Soft Parse 就如果是在Shared Pool中找到了與之完全相同的Sql解析好的結果後會跳過Hard Parse中的後面的兩個步驟。


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/12798004/viewspace-1133312/,如需轉載,請註明出處,否則將追究法律責任。