Chinaunix首页 | 论坛 | 博客
  • 博客访问: 97242
  • 博文数量: 45
  • 博客积分: 2500
  • 博客等级: 少校
  • 技术积分: 395
  • 用 户 组: 普通用户
  • 注册时间: 2010-09-15 10:29
文章分类

全部博文(45)

文章存档

2011年(15)

2010年(30)

我的朋友

分类: Oracle

2010-11-10 16:43:19

Column Datatype Description

SQL_ID VARCHAR2(13) SQL identifier of the parent cursor in the library cache

HASH_VALUE NUMBER Hash value of the parent statement in the library cache

ADDRESS RAW(4 | 8) Address of the handle to the parent for this cursor
 

Well the address can’t be part of a SQL lookup mechanism as the whole point of the library cache hash table is that you can look up a cursor using hash value fast *when you don’t know its address*

But yep, SQL_ID is just the lowest 64 bits of MD5 hash of the object name. Hash value is 32 lowest bits. The MD5 hash value is stored in X$KGLOB.KGLNAHSV as well so its possible to compare them.

I guess SQL_ID looks more human readable to people who don’t like numbers :)

I still use hash_value wherever possible but in some views they’ve left only SQL_ID in (like v$sql_shared_cursor for example).

 

The address is useful for rare cases where two different SQL statements hash to the same hash value (so the cursors have same hash but different address in shared pool).

However, as the sql_address points to a parent cursor (which may have multiple child cursors under it), then as of 10g+ you should also use sql_child_number from v$session and match it to child_number in v$sql to find the actual child cursor executed.

阅读(929) | 评论(0) | 转发(0) |
0

上一篇:Unicode详解

下一篇:v$session.command 取值含义

给主人留下些什么吧!~~