OB运维命令

一、统计信息

1.查看合并后表的统计信息。
select * from __all_virtual_meta_table where table_id=111111;

2.查看合并后列的统计信息。
select
b.table_name,
a.tenant_id,
a.partition_id,
c.column_name,
a.num_distinct,
a.num_null,
a.gmt_modified
from
__all_virtual_column_statistic a
join gv$table b on a.table_id = b.table_id
join __all_virtual_column c on a.table_id = c.table_id
and a.column_id = c.column_id
where
b.table_name = 'CHAP41'
and b.tenant_id = 1001
and b.database_name = 'tpcc';

3.手工收集统计信息。

  • 收集所有列的统计信息
    call dbms_stats.gather_table_stats('tpcc','chap41', method_opt=>'for all columns size 128');
  • 收集指定列的统计信息
    call dbms_stats.gather_table_stats('tpcc','chap41', method_opt=>'for columns c3 size auto');

4.查看手工收集后的表的统计信息。
select NUM_ROWS,EMPTY_BLOCKS,AVG_SPACE,AVG_ROW_LEN from all_tab_statistics where table_name='CHAP41';

5.查看手工收集后的列的统计信息。
select LOW_VALUE,HIGH_VALUE,DENSITY,NUM_BUCKETS,LAST_ANALYZED from all_tab_col_statistics where table_name='CHAP41';

6.查看手工收集后的表的直方图。
select ENDPOINT_NUMBER,ENDPOINT_VALUE,ENDPOINT_ACTUAL_VALUE,scope from all_tab_histograms where table_name='CHAP41';

二、只读事务参数对执行性能影响

  • 修改租户参数
    alter system set ob_proxy_readonly_transaction_routing_policy=false tenant=all;
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容