oracle SQL的HASH_VALUE 理解
来源:互联网 发布:淘宝衣服的宣传海报 编辑:程序博客网 时间:2024/05/22 05:56
To explain how this can happen: When a SQLstatement is executed, we find the matching text in the shared pool, if itexists. Then we try to reexecute an existing child cursor if possible. If allof the already existing children for that parent cursor cannot be reused (i.e.cannot be shared), Oracle needs to hard parse and thereby creates another childcursor. If we continue not-sharing existing child cursors, at the point when aparent has 1024 child cursors, the next time a user attempts to execute thatSQL text and there is a failure to share any of these cursors, the parent with1024 cursors is marked as obsolete, and a new parent is created.
sql_address
sql_hash_value
V$SQLTEXT
V$SQLTEXT
displays the text of SQL statements belonging to shared SQL cursors in the SGA.
ADDRESS
RAW(4 | 8)
Used with HASH_VALUE
to uniquely identify a cached cursorHASH_VALUE
NUMBER
Used with ADDRESS
to uniquely identify a cached cursorSQL_ID
VARCHAR2(13)
SQL identifier of a cached cursorCOMMAND_TYPE
NUMBER
Code for the type of SQL statement (SELECT
, INSERT
, and so on)PIECE
NUMBER
Number used to order the pieces of SQL textSQL_TEXT
VARCHAR2(64)
A column containing one piece of the SQL textV$SQL
V$SQL
lists statistics on shared SQL areas without the GROUP BY
clause and contains one row for each child of the original SQL text entered. Statistics displayed in V$SQL
are normally updated at the end of query execution. However, for long running queries, they are updated every 5 seconds. This makes it easy to see the impact of long running SQL statements while they are still in progress.
SQL_TEXT
VARCHAR2(1000)
First thousand characters of the SQL text for the current cursorSQL_FULLTEXT
CLOB
Full text for the SQL statement exposed as a CLOB
column. The full text of a SQL statement can be retrieved using this column instead of joining with the V$SQLTEXT
dynamic performance view.SQL_ID
VARCHAR2(13)
SQL identifier of the parent cursor in the library cacheSHARABLE_MEM
NUMBER
Amount of shared memory used by the child cursor (in bytes)PERSISTENT_MEM
NUMBER
Fixed amount of memory used for the lifetime of the child cursor (in bytes)RUNTIME_MEM
NUMBER
Fixed amount of memory required during the execution of the child cursorSORTS
NUMBER
Number of sorts that were done for the child cursorLOADED_VERSIONS
NUMBER
Indicates whether the context heap is loaded (1
) or not (0
)OPEN_VERSIONS
NUMBER
Indicates whether the child cursor is locked (1
) or not (0
)USERS_OPENING
NUMBER
Number of users executing the statementFETCHES
NUMBER
Number of fetches associated with the SQL statementEXECUTIONS
NUMBER
Number of executions that took place on this object since it was brought into the library cachePX_SERVERS_EXECUTIONS
NUMBER
Total number of executions performed by parallel execution servers (0
when the statement has never been executed in parallel)END_OF_FETCH_COUNT
NUMBER
Number of times this cursor was fully executed since the cursor was brought into the library cache. The value of this statistic is not incremented when the cursor is partially executed, either because it failed during the execution or because only the first few rows produced by this cursor are fetched before the cursor is closed or re-executed. By definition, the value of the END_OF_FETCH_COUNT
column should be less or equal to the value of the EXECUTIONS
column.USERS_EXECUTING
NUMBER
Number of users executing the statementLOADS
NUMBER
Number of times the object was either loaded or reloadedFIRST_LOAD_TIME
VARCHAR2(19)
Timestamp of the parent creation timeINVALIDATIONS
NUMBER
Number of times this child cursor has been invalidatedPARSE_CALLS
NUMBER
Number of parse calls for this child cursorDISK_READS
NUMBER
Number of disk reads for this child cursorDIRECT_WRITES
NUMBER
Number of direct writes for this child cursorBUFFER_GETS
NUMBER
Number of buffer gets for this child cursorAPPLICATION_WAIT_TIME
NUMBER
Application wait time (in microseconds)CONCURRENCY_WAIT_TIME
NUMBER
Concurrency wait time (in microseconds)CLUSTER_WAIT_TIME
NUMBER
Cluster wait time (in microseconds)USER_IO_WAIT_TIME
NUMBER
User I/O Wait Time (in microseconds)PLSQL_EXEC_TIME
NUMBER
PL/SQL execution time (in microseconds)JAVA_EXEC_TIME
NUMBER
Java execution time (in microseconds)ROWS_PROCESSED
NUMBER
Total number of rows the parsed SQL statement returnsCOMMAND_TYPE
NUMBER
Oracle command type definitionOPTIMIZER_MODE
VARCHAR2(10)
Mode under which the SQL statement was executedOPTIMIZER_COST
NUMBER
Cost of this query given by the optimizerOPTIMIZER_ENV
RAW(2000)
Optimizer environmentOPTIMIZER_ENV_HASH_VALUE
NUMBER
Hash value for the optimizer environmentPARSING_USER_ID
NUMBER
User ID of the user who originally built this child cursorPARSING_SCHEMA_ID
NUMBER
Schema ID that was used to originally build this child cursorPARSING_SCHEMA_NAME
VARCHAR2(30)
Schema name that was used to originally build this child cursorKEPT_VERSIONS
NUMBER
Indicates whether this child cursor has been marked to be kept pinned in the cache using the DBMS_SHARED_POOL
packageADDRESS
RAW(4 | 8)
Address of the handle to the parent for this cursorTYPE_CHK_HEAP
RAW(4)
Descriptor of the type check heap for this child cursorHASH_VALUE
NUMBER
Hash value of the parent statement in the library cacheOLD_HASH_VALUE
NUMBER
Old SQL hash valuePLAN_HASH_VALUE
NUMBER
Numeric representation of the SQL plan for this cursor. Comparing one PLAN_HASH_VALUE
to another easily identifies whether or not two plans are the same (rather than comparing the two plans line by line).CHILD_NUMBER
NUMBER
Number of this child cursorSERVICE
VARCHAR2(64)
Service nameSERVICE_HASH
NUMBER
Hash value for the name listed in the SERVICE
columnMODULE
VARCHAR2(64)
Contains the name of the module that was executing at the time that the SQL statement was first parsed, which is set by calling DBMS_APPLICATION_INFO.SET_MODULE
MODULE_HASH
NUMBER
Hash value of the module listed in the MODULE
columnACTION
VARCHAR2(64)
Contains the name of the action that was executing at the time that the SQL statement was first parsed, which is set by calling DBMS_APPLICATION_INFO.SET_ACTION
ACTION_HASH
NUMBER
Hash value of the action listed in the ACTION
columnSERIALIZABLE_ABORTS
NUMBER
Number of times the transaction failed to serialize, producing ORA-08177
errors, per cursorOUTLINE_CATEGORY
VARCHAR2(64)
If an outline was applied during construction of the cursor, then this column displays the category of that outline. Otherwise the column is left blank.CPU_TIME
NUMBER
CPU time (in microseconds) used by this cursor for parsing, executing, and fetchingELAPSED_TIME
NUMBER
Elapsed time (in microseconds) used by this cursor for parsing, executing, and fetchingOUTLINE_SID
NUMBER
Outline session identifierCHILD_ADDRESS
RAW(4 | 8)
Address of the child cursorSQLTYPE
NUMBER
Denotes the version of the SQL language used for this statementREMOTE
VARCHAR2(1)
Indicates whether the cursor is remote mapped (Y
) or not (N
)OBJECT_STATUS
VARCHAR2(19)
Status of the cursor:VALID
- Valid, authorized without errorsVALID_AUTH_ERROR
- Valid, authorized with authorization errorsVALID_COMPILE_ERROR
- Valid, authorized with compilation errorsVALID_UNAUTH
- Valid, unauthorizedINVALID_UNAUTH
- Invalid, unauthorizedINVALID
- Invalid, unauthorized but keep the timestamp
LITERAL_HASH_VALUE
NUMBER
Hash value of the literals which are replaced with system-generated bind variables and are to be matched, when CURSOR_SHARING
is used. This is not the hash value for the SQL statement. If CURSOR_SHARING
is not used, then the value is 0
.LAST_LOAD_TIME
VARCHAR2(19)
Time at which the query plan was loaded into the library cacheIS_OBSOLETE
VARCHAR2(1)
Indicates whether the cursor has become obsolete (Y
) or not (N
). This can happen if the number of child cursors is too large.IS_BIND_SENSITIVE
VARCHAR2(1)
Indicates whether the cursor is bind sensitive (Y
) or not (N
). A query is considered bind-sensitive if the optimizer peeked at one of its bind variable values when computing predicate selectivities and where a change in a bind variable value may cause the optimizer to generate a different plan.IS_BIND_AWARE
VARCHAR2(1)
Indicates whether the cursor is bind aware (Y
) or not (N
). A query is considered bind-aware if it has been marked to use extended cursor sharing. The query would already have been marked as bind-sensitive.IS_SHAREABLE
VARCHAR2(1)
Indicates whether the cursor can be shared (Y
) or not (N
)CHILD_LATCH
NUMBER
Child latch number that is protecting the cursor. This column is obsolete and maintained for backward compatibility.SQL_PROFILE
VARCHAR2(64)
SQL profile used for this statement, if anySQL_PATCH
VARCHAR2(30)
SQL patch used for this statement, if anySQL_PLAN_BASELINE
VARCHAR2(30)
SQL plan baseline used for this statement, if anyPROGRAM_ID
NUMBER
Program identifierPROGRAM_LINE#
NUMBER
Program line numberEXACT_MATCHING_SIGNATURE
NUMBER
Signature calculated on the normalized SQL text. The normalization includes the removal of white space and the uppercasing of all non-literal strings.FORCE_MATCHING_SIGNATURE
NUMBER
Signature used when the CURSOR_SHARING
parameter is set to FORCE
LAST_ACTIVE_TIME
DATE
TIme at which the query plan was last activeBIND_DATA
RAW(2000)
Bind dataTYPECHECK_MEM
NUMBER
Typecheck memoryIO_CELL_OFFLOAD_ELIGIBLE_BYTES
NUMBER
Number of I/O bytes which can be filtered by the Exadata storage systemSee Also: Oracle Exadata Storage Server Software documentation for more information
IO_INTERCONNECT_BYTES
NUMBER
Number of I/O bytes exchanged between Oracle Database and the storage systemPHYSICAL_READ_REQUESTS
NUMBER
Number of physical read I/O requests issued by the monitored SQLPHYSICAL_READ_BYTES
NUMBER
Number of bytes read from disks by the monitored SQLPHYSICAL_WRITE_REQUESTS
NUMBER
Number of physical write I/O requests issued by the monitored SQLPHYSICAL_WRITE_BYTES
NUMBER
Number of bytes written to disks by the monitored SQLOPTIMIZED_PHY_READ_REQUESTS
NUMBER
Number of physical read I/O requests from Database Smart Flash Cache issued by the monitored SQLLOCKED_TOTAL
NUMBER
Total number of times the child cursor has been lockedPINNED_TOTAL
NUMBER
Total number of times the child cursor has been pinnedIO_CELL_UNCOMPRESSED_BYTES
NUMBER
Number of uncompressed bytes (that is, size after decompression) that are offloaded to the Exadata cellsSee Also: Oracle Exadata Storage Server Software documentation for more information
IO_CELL_OFFLOAD_RETURNED_BYTES
NUMBER
Number of bytes that are returned by Exadata cell through the regular I/O pathSee Also: Oracle Exadata Storage Server Software documentation for more information
下面摘抄eygle深入解析ORACLE 中关于SQL执行过程的描述
1.首先获得librarycache latch,根据SQL的HASH_VALUE在library cache中查找是否存在此HASH_VALUE,如果找到这个HASH_VALUE,称之为软解析,
Server获得改SQL执行计划转向第4步,如果找不到共享代码就进行硬解析。
2.释放librarypool cache,获得shared pool latch,查找并锁定自由空间(在bucket 中查找chunk)。如果找不到,报ORA-04031错误
3.释放shared poollatch,重新获得library cache latch,将SQL执行计划放入library cache中。
4.释放librarycache latch,保持null模式的library cache pin/lock.
5.开始执行。 Librarycache latch可以理解为硬/软解析的时候发生的,
因为解析的时候会搜索librarycache,
所以会产生librarycache latch Library cache pin 是在执行的阶段发生的
- oracle SQL的HASH_VALUE 理解
- 一次SQL_ID和HASH_VALUE转换尝试引发的误区
- oracle 分页sql语句的深入理解
- Scripts:根据sql_id和hash_value查询AWR中的执行计划dplan_awr.sql
- SQL 行转的理解(Oracle 10g)
- 15.oracle的dump理解十五 SQL命令DUMP
- 对oracle中的sql语句的理解与不解
- Oracle schema的理解
- ORACLE Schema 的理解
- oracle rowid的理解
- oracle rownum的理解
- oracle rowid的理解
- Oracle scn 的理解
- Oracle索引的理解
- Oracle实例的理解
- oracle 结构的理解~~~
- oracle锁的理解
- oracle 程序包的理解
- codeforces 174B File List 字符串 trick
- throws 和 throw 的区别
- 内存的中段
- 字符串加密
- Asp.net TreeView来构建用户选择输入的方法
- oracle SQL的HASH_VALUE 理解
- 为什么编程中发现许多时间以1970年1月1日为基准
- 无线/移动通信的发展终极目标是,实现个人通信PCN是人类通信的最高目标,它指使用各种可能的网络技术,实现任何人在任何时间、任何地点与任何人进行任何何种类的信息交换。
- 交互设计师和产品经理必读,推荐《QQ阅读 设计之路》讲述了QQ阅读的前世、今生、来世。面对这么多业界的阅读器,QQ阅读如何脱颖而出,占据市场,一起看看QQ阅读的发展过程。
- 多线程并发库高级应用 之 多个线程之间共享数据的方式探讨
- java的动态代理
- SecureCRT显示乱码解决
- 低级程序员的纠结
- PHP5.3.3源代码编译安装(Linux CentOS 5.5)