dbms_stats包不收集long字段长度信息
测试如下:SQL> create table test(a char(1),b long) tablespace users;Table created.SQL> insert into test values('1','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
等待事件--read by other session
最近一个生产库里出现大量db file scattered read和read by other session的等待,看了一下相关sql,都是对一个大表做全表扫描,10g官方文档里关于read by other session的解释如下:read by other sessionThis ev...
统计信息有误导致B-tree to Bitmap Conversions
生产库cpu使用率增加,查看awr报告可见如下sql的cpu time较高: 条sql 的执行计划是一样的,查看其执行计划:SQL> select child_number from v$sql where sql_id='cdp2vwt31665p'; &nb...
execute和fetch
关于execute和fetch这两个阶段,到底是怎么区分的,一直感到迷惑,做个测试,可以大概看个明白:SQL> alter session set events '10046 trace name context forever,level 12';Session altered.SQL> select count...
对表的shrink都做了些什么
SQL> truncate table rate;Table truncated.SQL> insert into rate values('a',1);1 row created.SQL> insert into rate values('b',2);1 row created.SQL> insert into rate values('c',3);1 row created.S...
捕捉尝试登陆失败的用户信息
最近一个应用的用户被锁,查了一下发现在profile里设置了100次尝试登陆的限制,为了定位具体尝试登陆的时间及ip等相关信息,需要写一个trigger进行捕捉,以下来自网上:create or replace trigger logon_denied_to_...
optimizer_index_caching在何时生效
关于optimizer_index_caching,在《基于成本的oracle优化法则》一书中作者提到过:optimizer_index_caching is used to adjust the cost calculation for index blocks of the inner table innested loops and for ...
索引的pctfree什么时候有效?
tom曰:pctfree only counts when BUILDING an index. It reserves X% of the block for subsequent inserts into that block (inserts into the block can arise from inserts or UPDATES to the base table)...
等待事件模拟(二)cursor: pin S wait on X
这是10.2版本提出的mutex(互斥)机制用来解决library cache bin latch争夺问题引入的新事件,是否使用这种机制受到隐含参数_kks_use_mutex_pin的限制,从10.2.0.2开始该参数default为true,使用这种机制oracle是为了解决...
等待事件模拟(一)latch:library cache
1,创建2个sequence.create sequence seq_0;create sequence seq_1;2.创建过程,循环打开并关闭游标,模拟大量的parse。create or replace procedure p( p_n in number )as &n...
重建索引可能带来的问题(二)
1.测试思想: 分别创建两个相同的表rebuild和norebuild,在每个表的id列上创建索引,对两个表进行同样的delete操作,然后对rebuild表上的索引进行重建,norebuild表上的索引保持不变。开启2个sess...