查看最近用户使用过的sql语句

  1  select /* recetsql */ sql_id,child_number,hash_value,address,executions,sql_text
  2  from v$sql
  3  where parsing_user_id =(select  user_id from all_users
  4  where username=upper('&uname'))
  5  and command_type in (2,3,6,7,189)
  6* and upper(sql_text)  not like upper('%rece%')

对于v$sql字段的

SQL_TEXTVARCHAR2(1000)First thousand characters of the SQL text for the current cursor --返回当前游标的sql 文本
SQL_IDVARCHAR2(13)SQL identifier of the parent cursor in the library cache--返回在库缓存中父游标的id号
EXECUTIONSNUMBERNumber of executions that took place on this object since it was brought into the library cache --返回当前对象在库缓存中被执行的次数
PARSING_USER_IDNUMBERUser ID of the user who originally built this child cursor  --生成这个子游标的用户iD
CHILD_NUMBERNUMBERNumber of this child cursor  ---子游标的个数
HASH_VALUENUMBERHash value of the parent statement in the library cache  --当前语句在库缓存中的哈希值
COMMAND_TYPENUMBEROracle command type definition 
关于command_type的几种类型:

Insert 2
Select 3
Update 6
Delete 7
Lock Table 26
Alter Database 35
Alter Session 42
Commit 44
Rollback 45
Savepoint 46
Begin/Declare 47







评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值