After the successful deployment, OceanBase Database creates a tenant named sys by default. This tenant is used to manage OceanBase Database. We recommend that you do not store business data in the sys tenant. Therefore, you must create a business tenant before you use OceanBase Database. This topic describes how to view resources available for a business tenant.
Procedure
Log on to the sys tenant.
$obclient -h10.10.10.1 -P2881 -uroot@sys -p -A Enter password: Welcome to the OceanBase. Commands end with ; or \g. Your OceanBase connection id is 3221583668 Server version: OceanBase 3.2.4.0 (r100000072022102819-2a28da9e758e2d232c41fa1a1b0070a08b77dd7d) (Built Oct 28 2022 19:46:38) Copyright (c) 2000, 2018, OceanBase Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.Note
For more information about how to connect to OceanBase Database, see Overview.
View the remaining resources of OBServers.
Select the oceanbase database and execute the following SQL statement to view the current resource configurations of OBServers. The
__all_servertable records the status of each OBServer, and the__all_virtual_server_stattable records the CPU utilization, memory usage, and disk usage of each OBServer.obclient> USE oceanbase; Database changed obclient> SELECT a.zone, concat(a.svr_ip,':',a.svr_port) observer, cpu_total, (cpu_total-cpu_max_assigned) cpu_free, round((mem_total-mem_max_assigned)/1024/1024/1024) mem_free_gb, b.status FROM __all_virtual_server_stat a JOIN __all_server b ON (a.svr_ip=b.svr_ip AND a.svr_port=b.svr_port) ORDER BY a.zone, a.svr_ip; +-------+-----------------+-----------+----------+-------------+--------+ | zone | observer | cpu_total | cpu_free | mem_free_gb | status | +-------+-----------------+-----------+----------+-------------+--------+ | zone1 | 10.10.10.1:2882 | 62 | 56 | 26 | active | | zone2 | 10.10.10.2:2882 | 62 | 56 | 26 | active | | zone3 | 10.10.10.3:2882 | 62 | 56 | 26 | active | +-------+-----------------+-----------+----------+-------------+--------+ 3 rows in setParameters are as follows:
Parameter Description zone The name of the zone. observer The IP address and port of an OBServer. cpu_total The total CPU resources. cpu_free The available CPU resources. mem_free_gb The available memory space. status The status of an OBServer. Valid values: - active: The server is running properly.
- inactive: The server failed.
- deleting: The server is being deleted.