【 使用环境 】生产环境
【 OB or 其他组件 】
【 使用版本 】4.3.0.1
【问题描述】
select a.unit_id,a.zone,a.svr_ip,b.tenant_name,b.tenant_type, a.max_cpu, a.min_cpu, round(a.memory_size/1024/1024/1024,2) memory_size_gb, round(a.log_disk_size/1024/1024/1024,2) log_disk_size, round(a.log_disk_in_use/1024/1024/1024,2) log_disk_in_use, round(a.data_disk_in_use/1024/1024/1024,2) data_disk_in_use from gv$ob_units a join oceanbase.dba_ob_tenants b on a.tenant_id=b.tenant_id
where b.tenant_name=‘sys’
order by b.tenant_name;
select t1.database_name,t.tenant_name,
round(t2.data_size/1024/1024,4) as data_size_gb,
round(t2.required_size/1024/1024,4) as required_size_gb,t1.svr_ip,t1.TABLE_NAME
from dba_ob_tenants t,cdb_ob_table_locations t1,cdb_ob_tablet_replicas t2
where t.tenant_id=t1.tenant_id
and t1.svr_ip=t2.svr_ip
and t1.tenant_id=t2.tenant_id
and t1.ls_id=t2.ls_id
and t1.tablet_id=t2.tablet_id
– and t1.role=‘leader’
and t.tenant_name=‘sys’
– group by t1.database_name
order by 4 desc, 3 desc;
这差的5G的数据是什么?
ob采用的是预占用机制。可以使用show parameters like ‘%datafile%’ 和 % log_disk_size% 查看参数生效范围
剩下的5G是还有5G资源空间
可以通过select a.zone, a.SVR_IP,a.SVR_PORT, b.status,cpu_capacity,cpu_assigned_max,cpu_capacity-cpu_assigned_max as cpu_free,round(memory_limit /1024/1024/1024 ,2) as memory_total_gb,round((memory_limit-mem_capacity) /1024/1024/1024 ,2) as system_memory_gb,round(mem_assigned /1024/1024/1024 ,2) as mem_assigned_gb,round((mem_capacity-mem_assigned) /1024/1024/1024 ,2) as memory_free_gb,round(log_disk_capacity /1024/1024/1024 ,2) as log_disk_capacity_gb,round(log_disk_assigned /1024/1024/1024 ,2) as log_disk_assigned_gb,round((log_disk_capacity-log_disk_assigned) /1024/1024/1024 ,2) as log_disk_free_gb,round((data_disk_capacity /1024/1024/1024 ),2) as data_disk_gb,round((data_disk_in_use /1024/1024/1024 ),2) as data_disk_used_gb,round((data_disk_capacity-data_disk_in_use) /1024/1024/1024 ,2) as data_disk_free_gb from gv$ob_servers a join oceanbase.DBA_OB_SERVERS b on a.zone=b.zone\G;
试看看