OceanBase
English日本語简体中文
Docs Home
Products
Integrations
Release Notes

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog Service

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog Service
OceanBase DatabaseOceanBase Cloud ToolsConnectors and MiddlewareLifecycle Support Policy

OceanBase Database

KV - V4.3.5
  • OBKV overview
  • Architecture
  • OBKV-Table
    • Introduction to OBKV-Table
      • Overview
      • OBKV-Table operation types
      • Core features of OBKV-Table
      • Differences between replace and insert_or_update
      • Supported value types
      • OBKV-Table data models
    • Use the OBKV-Table Java client
      • Java development guide for OBKV-Table
      • Prepare for development with OBKV-Table
      • Use the OBKV-Table Java client to connect to a cluster
      • Set client parameters
      • Supported client interfaces
      • Use the OBKV-Table Java client
    • Use the OBKV-Table GO client
      • Use the OBKV-Table Go client to connect to a cluster
      • Overview of the Go client
      • Individual API operations
      • Batch operations
      • About queries
      • Aggregation API
      • Filters
    • FAQ
  • OBKV-HBase
    • Overview
    • OBKV-HBase core features
    • Compatibility with HBase
    • Deployment
    • Application development with OBKV-HBase
      • Overview of OBKV-HBase application development
      • Data model
      • Data model design
      • Connect to a cluster using the OBKV-HBase client
      • Migrate HBase business code to OBKV-HBase
      • Data operation examples
      • Delete expired data
    • OBKV-HBase migration guide
    • OBKV-HBase management
      • Overview
      • High availability
      • Security and permissions
      • Monitoring metrics
    • Performance test
    • OBKV-HBase integrations
      • Flink
        • Synchronize data to OBKV-HBase by using Flink
    • Views
    • FAQ

Download PDF

Document Feedback
  1. Documentation Center
  2. OceanBase Database
  3. KV
  4. V4.3.5

Prepare for development with OBKV-Table

Last Updated:2026-09-29 10:40:08

General preparations
Create a tenant
Create a database
Create a table
Create a user
Additional preparations for direct connection mode
Create a system tenant user and grant access privileges to the routing table

This topic explains the essential steps required before you start development with OBKV-Table. Before you use the OBKV-Table client to access a cluster, you need to create a tenant, database, table, and user. OBKV-Table supports two connection modes: direct connection and OceanBase Database Proxy (ODP). Additional setup requirements vary depending on the connection mode you choose.

Notice

OBKV-Table supports only Java clients.

General preparations

Create a tenant

For more information, see Create a tenant.

Create a database

For more information, see Create a database.

Create a table

For more information, see Create a table.

Create a user

For more information, see Create a user.

Additional preparations for direct connection mode

Create a system tenant user and grant access privileges to the routing table

In direct connection mode, the OBKV-Table client retrieves partition routing information for user tables by accessing the routing table. In OceanBase, only users under the SYS tenant have privileges to access the routing table. You need to create a user under the SYS tenant and grant this user the necessary privileges. The root user has routing table access by default.

Create a user

For more information, see Create a user.

Here is an example of how to create a user named test_sys_user with minimal database privileges.

  1. Use the root user to connect to the SYS tenant by using obclient.

    -h specifies the host address.
    -u specifies the username.
    -P specifies the port.
    -p specifies the password.
    -c specifies not to use the auto-completion feature, which can improve the connection speed and reduce unnecessary system resource consumption.
    -A specifies to connect to the cluster.
    -D specifies to connect to the SYS tenant.
    obclient -h10.10.10.1 -uroot@$obkvcluster -P2883 -p****** -c -A -D SYS
    
  2. Create a user.

    CREATE USER 'test_sys_user'@'%' IDENTIFIED BY 'test_sys_password';
    

Grant access privileges to the routing table

The user needs SELECT privilege on the following routing tables:

  • __all_virtual_table
  • __all_virtual_proxy_schema
  • __all_tenant
  • __all_virtual_proxy_partition_info
  • __all_virtual_proxy_partition
  • __all_server
  • __all_virtual_proxy_sub_partition
  • __all_virtual_proxy_server_stat
  • DBA_OB_SERVERS
  • DBA_OB_ZONES
  • CDB_OB_TABLEGROUP_TABLES
  • DBA_OB_TENANTS
  • CDB_OB_TABLET_TO_LS

After you connect to the database as the SYS tenant, grant the SELECT privilege on the specified routing tables to the test_sys_user user.

GRANT SELECT ON oceanbase.__all_virtual_table TO test_sys_user;
GRANT SELECT ON oceanbase.__all_virtual_proxy_schema TO test_sys_user;
GRANT SELECT ON oceanbase.__all_tenant TO test_sys_user;
GRANT SELECT ON oceanbase.__all_virtual_proxy_partition_info TO test_sys_user;
GRANT SELECT ON oceanbase.__all_virtual_proxy_partition TO test_sys_user;
GRANT SELECT ON oceanbase.__all_server TO test_sys_user;
GRANT SELECT ON oceanbase.__all_virtual_proxy_sub_partition TO test_sys_user;
GRANT SELECT ON oceanbase.__all_virtual_proxy_server_stat TO test_sys_user;
GRANT SELECT ON oceanbase.DBA_OB_SERVERS TO test_sys_user;
GRANT SELECT ON oceanbase.DBA_OB_ZONES TO test_sys_user;
GRANT SELECT ON oceanbase.CDB_OB_TABLEGROUP_TABLES TO test_sys_user;
GRANT SELECT ON oceanbase.DBA_OB_TENANTS TO test_sys_user;
GRANT SELECT ON oceanbase.CDB_OB_TABLET_TO_LS TO test_sys_user;

Previous topic

Java development guide for OBKV-Table
Last

Next topic

Use the OBKV-Table Java client to connect to a cluster
Next
on this page
General preparations
Create a tenant
Create a database
Create a table
Create a user
Additional preparations for direct connection mode
Create a system tenant user and grant access privileges to the routing table