OB運維命令

一、統(tǒng)計信息

1.查看合并后表的統(tǒng)計信息。
select * from __all_virtual_meta_table where table_id=111111;

2.查看合并后列的統(tǒng)計信息。
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.手工收集統(tǒng)計信息。

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

4.查看手工收集后的表的統(tǒng)計信息。
select NUM_ROWS,EMPTY_BLOCKS,AVG_SPACE,AVG_ROW_LEN from all_tab_statistics where table_name='CHAP41';

5.查看手工收集后的列的統(tǒng)計信息。
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';

二、只讀事務參數(shù)對執(zhí)行性能影響

  • 修改租戶參數(shù)
    alter system set ob_proxy_readonly_transaction_routing_policy=false tenant=all;
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
【社區(qū)內容提示】社區(qū)部分內容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內容

友情鏈接更多精彩內容