查看表空间、统计信息

SELECT a.tablespace_name, round( a.bytes/ (1024 * 1024*1024), 2 ) total, round( (b.bytes * 100) / a.bytes, 2 ) "% USED " FROM sys.sm$ts_avail a, sys.sm$ts_used b WHERE a.tablespace_name = b.tablespace_name and a.tablespace_name = 'BLSEA'

Select * FROM DBA_DATA_FILES where tablespace_name = 'BLSEA' ;

ALTER TABLESPACE "BLSEA" ADD DATAFILE '/u02/app/ora11g/users03.dbf' SIZE 32G;

统计信息

select * from dba_tables where table_name = 

select table_name, partition_name, last_analyzed from dba_tab_partitions where table_name

select last_analyzed,sample_size,num_rows,round(sample_size/num_rows*100,2) "%" from dba_tables t where table_name = upper('BUSI_LOGS')

exec dbms_stats.gather_table_stats(ownname => 'BLSEA',tabname => 'KAFKA_COMM',estimate_percent => 10,method_opt=> 'for all indexed columns', degree=>32);

分区表

exec dbms_stats.gather_table_stats(ownname=>'SEA',tabname=>'CJ_RDJDNL',partname=>'PART_201907', method_opt=> 'for all indexed columns', degree=>32, estimate_percent => 10);

##统计信息联合查询

select * from (
select '0' table_type, table_name, sample_size, num_rows,round( sample_size/num_rows, 6 ) radio, last_analyzed from dba_tables where 
       table_name = upper('cj_rdjdnl' ) 
       and owner = 'SEA' 
union
select '1', partition_name, sample_size, num_rows, round( sample_size/num_rows, 3 ) radio, last_analyzed 
       from dba_tab_partitions where table_name = upper('cj_rdjdnl' ) 
       and partition_name = 'PART_201909' 
       and table_owner = 'SEA' 
union       
select '2', subpartition_name, sample_size, num_rows, round( sample_size/num_rows, 3 ) radio, last_analyzed 
       from dba_tab_subpartitions where table_name = upper('cj_rdjdnl' ) 
       and partition_name like 'PART_201909%'
       and table_owner = 'SEA'  
       order by last_analyzed 
       )
       order by 1, 2

转载于:https://my.oschina.net/sqhua/blog/3067710

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值