OceanBase常用运维脚本

OceanBase常用运维脚本

查找表物理存储空间大小

select /*+parallel(32) query_timeout(10000000000000000)*/
  b.database_name,
  round(sum(a.data_size) /1024/1024/1024,6) data_size ,round(sum(a.REQUIRED_SIZE)/1024/1024/1024,6) disk_size
from
  CDB_OB_TABLET_REPLICAS a,
  CDB_OB_TABLE_LOCATIONS b
where
  1 = 1
  and a.SVR_IP = b.SVR_IP
  and a.SVR_PORT = b.SVR_PORT
  and a.LS_ID = b.LS_ID
  and a.TABLET_ID = b.TABLET_ID
  and b.table_name='xxx'
group by   
  b.database_name
order by 
  data_size desc
;

查看表的统计信息历史执行情况

select * from oceanbase.dba_ob_table_opt_stat_gather_history where table_name='xxx'
Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐