选出有行连接(row chain)或者是行迁移(row migeration)的表
来源:互联网 发布:房地产数据来源 编辑:程序博客网 时间:2024/06/06 00:49
该脚本的主要功能是选出有行迁移或者行连接的表,并且按照行迁移/行连接降序输出OWNER.TABLE_NAME,该脚本没有统计ORACLE系统内置的表,如果表的索引状态为unusable,也不能统计,请在数据库空闲的时候运行该脚本。
严重警告:请别在生产环境中乱用该脚本,后果自负
set serveroutput on
set linesize 200
set pagesize 100
declare
TYPE tablename IS RECORD
( owner dba_tables.owner%TYPE,
table_name dba_tables.table_name%TYPE,
chain_cnt dba_tables.chain_cnt%TYPE
);
dbatables tablename;
cursor table_name is
select owner,table_name from dba_tables where owner not in
('SYS','SYSMAN','SYSTEM','MDSYS','OLAPSYS','DMSYS','ORDSYS','EXFSYS','XDB','CTXSYS','WMSYS','OUTLN','ISMSYS','DBSNMP','TSMSYS') and owner not in (select owner from dba_indexes where status='UNUSABLE');
cursor table_name2 is
select owner,table_name,chain_cnt from dba_tables where owner not in
('SYS','SYSMAN','SYSTEM','MDSYS','OLAPSYS','DMSYS','ORDSYS','EXFSYS','XDB','CTXSYS','WMSYS','OUTLN','ISMSYS','DBSNMP','TSMSYS')
and chain_cnt>0 order by chain_cnt desc;
cursor spetial is select owner,table_name from dba_indexes where status='UNUSABLE';
begin
for tablename in table_name loop
execute immediate 'analyze table '|| tablename.owner ||'.'||tablename.table_name || ' compute statistics ';
end loop;
for c_spetial in spetial loop
dbms_output.put_line('UNUSABLE index in ' || c_spetial.owner ||'.' ||c_spetial.table_name || ' , Can not analyze this table');
end loop;
open table_name2;
loop
fetch table_name2 into dbatables;
if(table_name2%ROWCOUNT=0) then
dbms_output.put_line('No Chained Rows Found !!!');
else
dbms_output.put_line(dbatables.chain_cnt || ' chained rows found in ' || dbatables.owner ||'.'|| dbatables.table_name);
end if;
exit when table_name2%NOTFOUND;
end loop;
end;
/
- 选出有行连接(row chain)或者是行迁移(row migeration)的表
- 选出有行连接(row chain)或者是行迁移(row migeration)的表
- row migeration and row chain
- oracle row migration行迁移
- 行链接(Row chaining) 与行迁移(Row Migration)
- 行链接(Row chaining) 与行迁移(Row Migration)
- 行链接(Row chaining) 与行迁移(Row Migration)
- 行迁移和行链接(row chaining or row migration)
- 行链接(Row chaining) 与行迁移(Row Migration)
- Oracle 行链接(Row chaining) 与行迁移(Row Migration)
- 模拟并消除行迁移(Row Migration)
- 分析和测试行链接(Row Chaining)及行迁移(Row Migrating)
- Row Chaining and Migrating--行连接
- 获取row chain and row Migration
- UITableView刷新指定的row或者section
- Row
- enable row movement 何时需要打开表的行移动
- row-chains:行链接的解决办法
- Python爬虫学习
- SharePoint 2013 图文开发系列之InfoPath入门
- CentOS下Hyrax安装及配置
- Properties
- 【汇编语言/底层开发】11、标识寄存器
- 选出有行连接(row chain)或者是行迁移(row migeration)的表
- 检索方法
- 应用框架的设计与实现.net平台--应用框架解析(框架分层)
- ZOJ Problem Set - 1037 Gridland
- 我的2014--大局观、匆忙、蓄势
- 2.13 子数组的最大乘积
- Tomcat 双向证书配置
- 游戏中如何实现GameCenter的应用
- 电脑文件整理思路