- 浏览: 978641 次
- 性别:
- 来自: 杭州
文章分类
最新评论
-
孤星119:
好熟悉的数据库字段啊, 上家公司做的项目每天都跟这些字段打招呼 ...
Oracle exp compress参数引起的空间浪费 -
itspace:
quxiaoyong 写道遇到个问题,网上一搜,全他妈这篇文章 ...
数据库连接错误ORA-28547 -
quxiaoyong:
遇到个问题,网上一搜,全他妈这篇文章。你转来转去的有意思吗?
数据库连接错误ORA-28547 -
hctech:
关于version count过高的问题,不知博主是否看过ey ...
某客户数据库性能诊断报告 -
itspace:
invalid 写道写的不错,我根据这个来安装,有点理解错误了 ...
AIX 配置vncserver
本文章主要研究cursor_sharing参数不同设置,histograms收集与否对SQL version count 产生的影响。
一、cursor_sharing参数与SQL version count
数据库研究版本:
创建测试脚本
将cursor_sharing参数改为similar,可以看出谓词连接采用>(还有>, <, >=, <=, LIKE)时,SQL在共享parent cursor时不能共享child cursor
将谓词连接改为=时,SQL在共享parent cursor时能共享child cursor
将cursor_sharing参数改为force,我们看到cursor实现了共享。
进一步将cursor_sharing改为exact,cursor甚至不能在parent级别实现共享
二、cursor_sharing参数histogram与SQL version count
在table t1所有列上收集直方图(J列除外)
将cursor_sharing改为similar,发现在有直方图的列上不能实现child cursor共享。
将cursor_sharing改为force时,无论在有直方图或无直方图的列上都实现了游标共享。
将cursor_sharing改为exact,并使用绑定变量,经测试实现了游标共享,但是需要注意的是如果使用绑定变量由于BIND PEEKING,会导致执行计划不稳定
一、cursor_sharing参数与SQL version count
数据库研究版本:
引用
SQL> select * from v$version where rownum<2;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
创建测试脚本
引用
create table t1( i number, j number, k number);
begin
for i in 1..10000 loop
insert into t1 values( i, i, i);
end loop;
end;
/
begin
for i in 1..10000 loop
insert into t1 values( i, i, i);
end loop;
end;
/
将cursor_sharing参数改为similar,可以看出谓词连接采用>(还有>, <, >=, <=, LIKE)时,SQL在共享parent cursor时不能共享child cursor
引用
SQL> alter session set cursor_sharing=similar
2 ;
Session altered.
SQL> select count(*) from t1 where i > 10;
COUNT(*)
----------
9990
SQL>select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i > :"SYS_B_0"
1
SQL> select count(*) from t1 where i > 20;
COUNT(*)
----------
9980
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i > :"SYS_B_0"
2
SQL> select count(*) from t1 where i > 30;
COUNT(*)
----------
9970
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i > :"SYS_B_0"
3
2 ;
Session altered.
SQL> select count(*) from t1 where i > 10;
COUNT(*)
----------
9990
SQL>select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i > :"SYS_B_0"
1
SQL> select count(*) from t1 where i > 20;
COUNT(*)
----------
9980
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i > :"SYS_B_0"
2
SQL> select count(*) from t1 where i > 30;
COUNT(*)
----------
9970
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i > :"SYS_B_0"
3
将谓词连接改为=时,SQL在共享parent cursor时能共享child cursor
引用
SQL> select count(*) from t1 where i=100;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i > :"SYS_B_0"
3
select count(*) from t1 where i=:"SYS_B_0"
1
SQL> select count(*) from t1 where i=200;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i > :"SYS_B_0"
3
select count(*) from t1 where i=:"SYS_B_0"
1
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i > :"SYS_B_0"
3
select count(*) from t1 where i=:"SYS_B_0"
1
SQL> select count(*) from t1 where i=200;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i > :"SYS_B_0"
3
select count(*) from t1 where i=:"SYS_B_0"
1
将cursor_sharing参数改为force,我们看到cursor实现了共享。
引用
SQL> alter session set cursor_sharing=force;
Session altered.
SQL> select count(*) from t1 where i > 40;
COUNT(*)
----------
9960
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i > :"SYS_B_0"
4
select count(*) from t1 where i=:"SYS_B_0"
1
SQL> select count(*) from t1 where i > 50;
COUNT(*)
----------
9950
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i > :"SYS_B_0"
4
select count(*) from t1 where i=:"SYS_B_0"
1
Session altered.
SQL> select count(*) from t1 where i > 40;
COUNT(*)
----------
9960
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i > :"SYS_B_0"
4
select count(*) from t1 where i=:"SYS_B_0"
1
SQL> select count(*) from t1 where i > 50;
COUNT(*)
----------
9950
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i > :"SYS_B_0"
4
select count(*) from t1 where i=:"SYS_B_0"
1
进一步将cursor_sharing改为exact,cursor甚至不能在parent级别实现共享
引用
SQL> alter session set cursor_sharing=exact;
Session altered.
SQL> select count(*) from t1 where i > 70;
COUNT(*)
----------
9930
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i > :"SYS_B_0"
4
select count(*) from t1 where i >:"SYS_B_0"
1
select count(*) from t1 where i=:"SYS_B_0"
1
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i > 70
1
SQL> select count(*) from t1 where i > 80;
COUNT(*)
----------
9920
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i > :"SYS_B_0"
4
select count(*) from t1 where i >:"SYS_B_0"
1
select count(*) from t1 where i=:"SYS_B_0"
1
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i > 80
1
select count(*) from t1 where i > 70
1
Session altered.
SQL> select count(*) from t1 where i > 70;
COUNT(*)
----------
9930
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i > :"SYS_B_0"
4
select count(*) from t1 where i >:"SYS_B_0"
1
select count(*) from t1 where i=:"SYS_B_0"
1
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i > 70
1
SQL> select count(*) from t1 where i > 80;
COUNT(*)
----------
9920
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i > :"SYS_B_0"
4
select count(*) from t1 where i >:"SYS_B_0"
1
select count(*) from t1 where i=:"SYS_B_0"
1
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i > 80
1
select count(*) from t1 where i > 70
1
二、cursor_sharing参数histogram与SQL version count
在table t1所有列上收集直方图(J列除外)
引用
SQL> exec DBMS_STATS.GATHER_TABLE_STATS(ownname=>'sys',tabname=>'t1',method_opt=>'FOR ALL COLUMNS SIZE 10');
PL/SQL procedure successfully completed.
SQL> exec DBMS_STATS.GATHER_TABLE_STATS(ownname=>'sys',tabname=>'t1',method_opt=>'FOR COLUMNS J SIZE 1');
PL/SQL procedure successfully completed.
SQL> select COLUMN_NAME,NUM_BUCKETS,HISTOGRAM from dba_tab_columns where OWNER='SYS' and TABLE_NAME='T1';
COLUMN_NAME NUM_BUCKETS HISTOGRAM
------------------------------ ----------- ---------------
I 10 HEIGHT BALANCED
J 1 NONE
K 10 HEIGHT BALANCED
PL/SQL procedure successfully completed.
SQL> exec DBMS_STATS.GATHER_TABLE_STATS(ownname=>'sys',tabname=>'t1',method_opt=>'FOR COLUMNS J SIZE 1');
PL/SQL procedure successfully completed.
SQL> select COLUMN_NAME,NUM_BUCKETS,HISTOGRAM from dba_tab_columns where OWNER='SYS' and TABLE_NAME='T1';
COLUMN_NAME NUM_BUCKETS HISTOGRAM
------------------------------ ----------- ---------------
I 10 HEIGHT BALANCED
J 1 NONE
K 10 HEIGHT BALANCED
将cursor_sharing改为similar,发现在有直方图的列上不能实现child cursor共享。
引用
SQL> alter session set cursor_sharing = similar;
Session altered.
SQL> select count(*) from t1 where i = 10;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i = :"SYS_B_0"
1
SQL> select count(*) from t1 where i = 20;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i = :"SYS_B_0"
2
SQL> select count(*) from t1 where i = 30;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i = :"SYS_B_0"
3
SQL> alter system flush shared_pool;
System altered.
SQL> select count(*) from t1 where j = 10;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where j = :"SYS_B_0"
1
SQL> select count(*) from t1 where j = 20;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where j = :"SYS_B_0"
1
SQL> select count(*) from t1 where j = 30;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where j = :"SYS_B_0"
1
Session altered.
SQL> select count(*) from t1 where i = 10;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i = :"SYS_B_0"
1
SQL> select count(*) from t1 where i = 20;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i = :"SYS_B_0"
2
SQL> select count(*) from t1 where i = 30;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i = :"SYS_B_0"
3
SQL> alter system flush shared_pool;
System altered.
SQL> select count(*) from t1 where j = 10;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where j = :"SYS_B_0"
1
SQL> select count(*) from t1 where j = 20;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where j = :"SYS_B_0"
1
SQL> select count(*) from t1 where j = 30;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where j = :"SYS_B_0"
1
将cursor_sharing改为force时,无论在有直方图或无直方图的列上都实现了游标共享。
引用
SQL> alter system flush shared_pool;
System altered.
SQL> alter session set cursor_sharing=force;
Session altered.
SQL> select count(*) from t1 where i = 10;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i = :"SYS_B_0"
1
SQL> select count(*) from t1 where i = 20;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i = :"SYS_B_0"
1
SQL> select count(*) from t1 where i = 30;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i = :"SYS_B_0"
1
SQL> select count(*) from t1 where j = 10;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i = :"SYS_B_0"
1
select count(*) from t1 where i = :"SYS_B_0"
1
SQL> select count(*) from t1 where j = 20;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i = :"SYS_B_0"
1
select count(*) from t1 where i = :"SYS_B_0"
1
SQL> select count(*) from t1 where j = 30;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i = :"SYS_B_0"
1
select count(*) from t1 where i = :"SYS_B_0"
1
System altered.
SQL> alter session set cursor_sharing=force;
Session altered.
SQL> select count(*) from t1 where i = 10;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i = :"SYS_B_0"
1
SQL> select count(*) from t1 where i = 20;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i = :"SYS_B_0"
1
SQL> select count(*) from t1 where i = 30;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i = :"SYS_B_0"
1
SQL> select count(*) from t1 where j = 10;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i = :"SYS_B_0"
1
select count(*) from t1 where i = :"SYS_B_0"
1
SQL> select count(*) from t1 where j = 20;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i = :"SYS_B_0"
1
select count(*) from t1 where i = :"SYS_B_0"
1
SQL> select count(*) from t1 where j = 30;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i = :"SYS_B_0"
1
select count(*) from t1 where i = :"SYS_B_0"
1
将cursor_sharing改为exact,并使用绑定变量,经测试实现了游标共享,但是需要注意的是如果使用绑定变量由于BIND PEEKING,会导致执行计划不稳定
引用
SQL> alter system flush shared_pool;
System altered.
SQL> alter session set cursor_sharing=exact;
Session altered.
SQL> variable i number;
SQL> exec :i:=10
PL/SQL procedure successfully completed.
SQL> select count(*) from t1 where i = :i;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i = :i
1
SQL> exec :i:=20
PL/SQL procedure successfully completed.
SQL> select count(*) from t1 where i = :i;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i = :i
1
SQL> exec :i:=0
PL/SQL procedure successfully completed.
SQL> select count(*) from t1 where i = :i;
COUNT(*)
----------
0
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i = :i
1
SQL> variable j number;
SQL> exec :j:=10
PL/SQL procedure successfully completed.
SQL> select count(*) from t1 where j = :j;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i = :i
1
SQL> exec :j:=100
PL/SQL procedure successfully completed.
SQL> select count(*) from t1 where j = :j;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where j = :j
1
select count(*) from t1 where i = :i
1
SQL> exec :j:=1000
PL/SQL procedure successfully completed.
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where j = :j
1
select count(*) from t1 where i = :i
1
System altered.
SQL> alter session set cursor_sharing=exact;
Session altered.
SQL> variable i number;
SQL> exec :i:=10
PL/SQL procedure successfully completed.
SQL> select count(*) from t1 where i = :i;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i = :i
1
SQL> exec :i:=20
PL/SQL procedure successfully completed.
SQL> select count(*) from t1 where i = :i;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i = :i
1
SQL> exec :i:=0
PL/SQL procedure successfully completed.
SQL> select count(*) from t1 where i = :i;
COUNT(*)
----------
0
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i = :i
1
SQL> variable j number;
SQL> exec :j:=10
PL/SQL procedure successfully completed.
SQL> select count(*) from t1 where j = :j;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where i = :i
1
SQL> exec :j:=100
PL/SQL procedure successfully completed.
SQL> select count(*) from t1 where j = :j;
COUNT(*)
----------
1
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where j = :j
1
select count(*) from t1 where i = :i
1
SQL> exec :j:=1000
PL/SQL procedure successfully completed.
SQL> select sql_text,version_count from v$sqlarea where
2 sql_text like 'select count(*) from t1 where%';
SQL_TEXT
--------------------------------------------------------------------------------
VERSION_COUNT
-------------
select count(*) from t1 where j = :j
1
select count(*) from t1 where i = :i
1
发表评论
-
buffer cache 的内部结构
2020-03-18 14:21 576BUFFER CACHE作为数据块的 ... -
Oracle OMC介绍
2020-03-18 13:19 484Oracle管理云服务(OMC)的大数据平台,自动收集的企业 ... -
参加Oracle勒索病毒防范专题培训会议
2019-09-27 17:15 5112019年7月22日,受邀参加Oracle勒索病毒防范专题培训 ... -
记一次内存换IO的Oracle优化
2019-09-27 16:50 826某客户数据库从P595物理 ... -
如何定位Oracle SQL执行计划变化的原因
2019-07-03 14:49 1458性能优化最难的是能够 ... -
如何定位Oracle SQL执行计划变化的原因
2018-10-30 09:24 1185性能优化最难的是能够 ... -
数据库性能优化目标
2018-10-08 10:59 518从数据库性能优化的场 ... -
数据库无法打开的原因及解决办法
2018-10-05 20:45 2117数据库的启动是一个相当复杂的过程。比如,Oracle在启动之前 ... -
怎么样彻底删除数据库?
2018-09-18 11:10 598Oracle提供了drop database命令用来删除数据库 ... -
Oracle减少日志量的方法
2018-09-10 10:17 865LGWR进程将LOG BUFFER中的 ... -
如何快速关闭数据库
2018-09-09 13:14 1231“一朝被蛇咬,十年怕井绳”。在没被“蛇”咬之前,很多DBA喜欢 ... -
关于《如何落地智能化运维》PPT
2018-05-17 10:19 1128在DTCC 2018发表《如何落地智能化运维》演讲,主要内容如 ... -
记录在redhat5.8平台安装oracle11.2容易忽视的几个问题
2018-05-11 19:58 577问题一:ping不通问题 在虚拟机上安装好linux系统后, ... -
《Oracle DBA实战攻略》第一章
2018-05-11 10:42 945即日起,不定期更新《OracleDBA实战攻略》一书电子版,请 ... -
Oracle 12c新特性
2018-05-11 10:33 898查询所有pdb [oracle@gj4 ~]$ sqlplu ... -
关于修改memory_target的值后数据库无法启动的问题
2017-02-28 12:24 3981操作系统:RHEL6.5 数据库版本:11.2.0.4 ... -
10g rac安装error while loading shared libraries libpthread.so.0 问题
2017-02-28 12:22 69311g rac安装在二节点跑脚本一般会报此错误: 解决这个问 ... -
记一次Oracle会话共享模式故障处理过程
2017-02-27 19:16 798故障简述 XXX第八人民医院HIS数据库7月13日11点左右从 ... -
RESMGR:cpu quantum等待事件处理过程
2017-02-27 18:23 2615由于数据库上线过程中出现大量的RESMGR:cpu quant ... -
谈谈log file sync
2014-03-19 14:18 1757数据库中的log file sync等待事件指的是,当user ...
相关推荐
《基于MetaTrader 5的CCI_Histogram交易系统详解》 在金融市场的交易世界里,智能交易系统(Expert Advisor,简称EA)是自动化交易策略的重要工具,它能够帮助交易者实现无需人工干预的自动买卖。本文将详细介绍名...
标题中的"LBPH_Sub_Functions.rar_lbph_lbph matlab_sub_sub histogram"暗示了这是一个与局部二值模式(Local Binary Patterns, LBP)相关的MATLAB代码库,特别关注的是子函数和直方图处理。LBP是一种简单而有效的...
在"local_histogram_eq.rar_local histogram "这个压缩包中,包含了两个关键的MATLAB脚本文件:`local_histo_eq.m`和`neighbor.m`。`local_histo_eq.m`应该是实现局部直方图均衡化的主程序,而`neighbor.m`则可能...
Histogram Equalization and Local Histogram Equalization of Images
《DRAW_COLOR_HISTOGRAM2 - MetaTrader 5 脚本详解》 在金融交易领域,MetaTrader 5(MT5)是一个广泛使用的交易平台,它提供了丰富的技术分析工具和编程语言MQL5,用于创建自定义指标和交易机器人。本篇文章将详细...
《基于ATR_Normalize_Histogram指标的MetaTrader 5 EA交易系统详解》 在金融交易领域,自动交易系统(Expert Advisor,简称EA)已经成为许多投资者的首选工具,它能够根据预设的策略进行自动化交易,大大提升了交易...
二、《Oracle数据库SQL执行计划的取得和解析》PPT(附SQL文件) 三、Oracle 常用脚本 2pc_clean.txt ash_sql_line_id.txt ash_top_sql_event.txt ash_used awr_db_time.txt awr_event_histogram.txt awr_metric_...
《MetaTrader 5 EA:Exp_BalanceOfPower_Histogram 智能交易系统解析》 在金融交易领域,自动化交易系统已经成为许多投资者和交易者的首选工具。MetaTrader 5(MT5)作为一款强大的外汇交易平台,提供了丰富的技术...
《MetaTrader 5 EA——基于XWPR_Histogram_Vol_Direct指标的交易系统》 在金融交易领域,自动交易系统(Expert Advisor,简称EA)是利用编程技术实现的智能化交易策略,它能够根据预设的规则自动进行买入、卖出等...
同时,由于EA依赖于特定的振荡指标,因此,对RAVI_Histogram的理解和市场趋势的判断也会影响交易效果。 总结来说,"Exp_RAVI_Histogram" EA是基于RAVI_Histogram振荡指标的自动化交易策略,通过MT5平台执行。它利用...
《基于XRSI_Histogram_Vol_Direct指标的MetaTrader 5 EA交易系统详解》 在金融交易领域,自动交易系统(Expert Advisor,简称EA)是利用编程语言编写的一种智能化交易程序,它能够根据预设的规则自动执行买卖操作。...
本文将详细解析"xxx.zip_HSV histogram_video"中的知识点,包括HSV色彩空间以及如何生成视频的HSV直方图。 HSV,全称Hue(色调)、Saturation(饱和度)、Value(明度),是一种色彩模型,与我们常见的RGB色彩空间...
《基于XDeMarker_Histogram_Vol_Direct指标的MetaTrader 5 EA交易系统详解》 在金融交易领域,自动交易系统已经成为许多投资者和交易者的首选工具。MetaTrader 5(MT5)作为一款强大的外汇、期货和股票交易平台,...
《XCCI_Histogram_Vol_Direct - MetaTrader 5脚本》是一款专为MetaTrader 5交易平台设计的技术分析工具。该脚本的核心是XRSI_Histogram_Vol指标,它结合了RSI(相对强弱指数)和成交量的特征,通过在直方图上用彩色...
"DIB.rar_DIB_projection histogram_垂直投影_灰度直方图_鍨傜洿 鎶曞奖"这个压缩包文件显然包含了与图像处理相关的源代码,特别是关于水平投影、垂直投影、灰度直方图和平滑处理的算法。让我们逐一深入探讨这些概念...
《基于XDPO_Histogram指标信号的MetaTrader 5 EA交易系统详解》 在外汇交易领域,智能化交易系统(Expert Advisor,简称EA)扮演着至关重要的角色。MetaTrader 5(MT5)作为一款广泛使用的交易平台,提供了丰富的...
《MetaTrader 5中的ColorSTD_Histogram_HTF脚本详解》 MetaTrader 5(MT5)是一款全球广泛使用的外汇交易和分析平台,其强大的功能和丰富的技术指标库深受交易者喜爱。今天我们将深入探讨一个名为"ColorSTD_...
《基于WPR_Histogram指标的MetaTrader 5 EA交易系统详解》 在金融交易领域,自动交易系统(Expert Advisor,简称EA)已经成为一种常见的工具,它允许投资者在无需人工干预的情况下进行交易。本文将深入探讨名为"Exp...
《基于MetaTrader 5 EA的XWPR_Histogram_Vol交易系统详解》 在金融交易领域,自动交易系统,特别是Expert Advisors(EA),已经成为许多交易者的首选工具。本文将深入探讨一个名为"Exp_XWPR_Histogram_Vol - ...
本次提到的"DRAW_COLOR_HISTOGRAM - MetaTrader 5脚本.zip"是一个与MetaTrader 5相关的脚本,用于创建一种特殊的图表元素——彩色直方图。 首先,我们需要理解什么是直方图。直方图是一种统计图表,它将数据分布...