【 使用环境 】测试环境
【 OB or 其他组件 】observer
【 使用版本 】4.3.0
【问题描述】
obclient [oceanbase]> select svr_ip,SVR_port,cast(data_disk_in_use/1024/1024/1024 as DECIMAL(15,2)) from GV$OB_SERVERS;
+---------------+----------+--------------------------------------------------------+
| svr_ip | SVR_port | cast(data_disk_in_use/1024/1024/1024 as DECIMAL(15,2)) |
+---------------+----------+--------------------------------------------------------+
| 172.16.130.38 | 2882 | 13.50 |
| 172.16.130.37 | 2882 | 13.27 |
+---------------+----------+--------------------------------------------------------+
2 rows in set (0.004 sec)
select a.svr_ip,a.svr_port,a.tenant_id,b.tenant_name, CAST(a.data_disk_in_use/1024/1024/1024 as DECIMAL(15,2)) data_disk_use_G, CAST(a.log_disk_size/1024/1024/1024 as DECIMAL(15,2)) log_disk_size, CAST(a.log_disk_in_use/1024/1024/1024 as DECIMAL(15,2)) log_disk_use_G, sum(CAST(a.data_disk_in_use/1024/1024/1024 as DECIMAL(15,2))) data_disk_in_use_G,1 from __all_virtual_unit a,dba_ob_tenants b where a.tenant_id=b.tenant_id and tenant_type='USER' group by svr_ip,svr_port;
+---------------+----------+-----------+-------------+-----------------+---------------+----------------+--------------------+---+
| svr_ip | svr_port | tenant_id | tenant_name | data_disk_use_G | log_disk_size | log_disk_use_G | data_disk_in_use_G | 1 |
+---------------+----------+-----------+-------------+-----------------+---------------+----------------+--------------------+---+
| 172.16.130.37 | 2882 | 1002 | pyhmy | 8.48 | 5.40 | 3.14 | 16.15 | 1 |
| 172.16.130.38 | 2882 | 1002 | pyhmy | 8.48 | 5.40 | 3.14 | 16.14 | 1 |
+---------------+----------+-----------+-------------+-----------------+---------------+----------------+--------------------+---+
2 rows in set (0.008 sec)
如题所示,通过GV$OB_SERVER 查出data_in_use 是13.50G,然后我通过__all_virtual_unit 把所有的租户数据相加就有16G,
就算加上meta 租户的数据后就有17G
obclient [oceanbase]> select SVR_IP,SVR_PORT,sum(cast(DATA_DISK_IN_USE/1024/1024/1024 as DECIMAL(15,2))) data_disk_in_use_G from GV$OB_UNITS group by SVR_IP,SVR_PORT;
+---------------+----------+--------------------+
| SVR_IP | SVR_PORT | data_disk_in_use_G |
+---------------+----------+--------------------+
| 172.16.130.37 | 2882 | 17.50 |
| 172.16.130.38 | 2882 | 17.53 |
+---------------+----------+--------------------+
2 rows in set (0.003 sec)
这个对比是哪里不一样?有大佬知道的吗?