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...
重建索引可能带来的问题(一)
问题一;重建后索引使用空间增大,如下测试:SQL> desc bowie Name &nb...
使用dbms_space.space_usage
记在这里,方便查找:set serveroutput on size 10000;declarev_unformatted_blocks number;v_unformatted_bytes number;v_fs1_blocks number;v_fs1_bytes number;v_fs2_blocks number;v_fs2_bytes number;v_fs3_bl...
timestamp类型转换导致不走索引的测试
在生产库上遇到一个sql走的是FTS,在一个选择性比较好的列上创建了索引后,但一直没有走索引,经过检查发现在执行计划里始终有个内部的数据类型转换的操作,(INTERNAL_FUNCTION("B")=.........,基本可以判定是由于这...
何为buffer sort?
buffer sort is an optimization -- in this case, it is buffering the resultsofthat full scan so as to avoid having to perform. LIOS on the data over andoverand over in the cartesian join. the data may ...
latch 获取失败时为什么要spin(转)
3.3.1.1 Why spin? The idea of spinning is that another process executing on another CPU may release the latch, thereby allowing the spinning process to proceed. Of course, it makes no sense to spin o...
关于一致性读的一个疑问
有个疑问,当一个session a 对block中的一行数据update后,没有commit,此时另外一个session b去读取该行数据,则session b应该是去回滚段中读取,那么这个session b是如何定位该block中是哪一行被update且没有被提...
模拟试验--延迟块清除
1.何为延迟块清除: 简单的说,在oracle的block上都有活动事务的标志的,如果一个事务commit后,由于某些block在commit之前已经写回datafile, 或者事务影响到的block数过多,则commi的时候...
限制rman备份速度
生产库在备份时占用了大量的IO资源,导致业务受到部分影响,考虑对rman的备份速度进行限制,查了一下文档,如下:I/O Read Rate of BackupsBy default, RMAN uses all available I/O bandwidth to read/write to d...
关于v$session_longops的一篇好文章(转)
在网上看到一篇介绍此视图的文章,学习一下:http://www.gplivna.eu/papers/v$session_longops.htm