xzh2000的博客 本人提供杭州地区Oracle现场技术支持服务,包括性能调整、DataGuard、RAC等。
08 02, 2006
10gR2中绑定变量的捕获
作者 xzh2000 12:46 | Permalink 静态链接网址 | Comments 最新回复 (0) | Trackback 引用 (0) | 技术交流

在10g以前的版本,是不能捕获bind var的实参的,但在10gR2是可以捕获bind var的实际参数值.为了降低系统的压力,bind data capture与Modification Monitoring一样,都采用15min钟取样一次...


select statistics_name, description, session_status
from V$STATISTICS_LEVEL
where statistics_name = 'Bind Data Capture'

1 Bind Data Capture Enables capture of bind values used by SQL statements ENABLED

测试如下:

SQL> var vname varchar2(32);
SQL> exec :vname := '_assm_default';

PL/SQL procedure successfully completed.

Elapsed: 00:00:00.01
SQL> select count(*) from para_all where name = :vname;

COUNT(*)
----------
1

SQL> select sql_id from v$sql where sql_text = 'select count(*) from para_all where name = :vname';

SQL_ID
-------------
0dah9yd0bfuw8

SQL> select value_string
2 from V$SQL_BIND_CAPTURE
3 where sql_id = '0dah9yd0bfuw8';

VALUE_STRING
-------------------------------------------------------------------
_assm_default

Comments
博客日历
« 三月 2010 »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
搜索
最新发表
文章分类
文章归档
网站链接
新闻聚合