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 Best Practices

All Versions
  • Deploy
    • Configuration guide for read-write splitting in AP scenarios
    • Best practices for read-write splitting
  • Migrate
    • Data transfer solutions in OceanBase Database
    • Overview on data migration
    • Best practices for importing data files to OceanBase Database
    • Best practice for migrating data from other databases to OceanBase Database
    • Massive data migration strategy
    • Best practices for migrating data from MyCat to OceanBase Database
    • Best practices for migrating PostgreSQL to OceanBase MySQL-compatible mode
  • Route
    • ODP routing best practices
  • Table Design
    • Best practices for table design and index optimization
    • Best practices for creating indexes on large tables
    • Best practices for database development
  • Develop
    • Best practices for connecting Java applications to OceanBase Database
    • Best practices for integrating Spark Catalog with OceanBase Database
    • Best practices for achieving optimal performance in batch DML using JDBC and OBServer
    • Best practices for bulk data cleanup in OceanBase Database
    • Best practices for PDML processing in OceanBase Database
    • Best practices for hot tables in OceanBase Database
    • Best practices for auto-increment columns and sequences in OceanBase Database
  • Manage
    • Best practices for resource throttling
    • Best practices for data load balancing
    • Best practices for security certification
    • Best practices for access control
    • Best practices for data encryption
  • Diagnose
    • Best practices for log interpretation in common scenarios
    • Best practices for end-to-end tracing
    • Best practices for using obdiag to collect performance information
    • Best practices for using obdiag to collect diagnostic information of parallel and slow SQL statements
    • Best practices for troubleshooting OceanBase Database performance issues
  • Performance Tuning
    • Best practices for handling slow queries
    • Best practices for collecting statistics to generate an efficient execution plan
    • Best practices for updating hotspot rows
    • Best practices for large object storage performance
    • Best practices for semi-structured storage performance
    • Best practices for OceanBase materialized views
  • Cloud Database
    • Best practices for achieving high availability through cross-cloud active-active deployment
    • High availability through primary and standby databases across clouds
    • High host CPU usage
    • Best practices for read/write splitting in OceanBase Cloud

Download PDF

Document Feedback
  1. Documentation Center
  2. OceanBase Best Practices
  3. master

Best practices for access control

Last Updated:2026-09-04 09:31:59

MySQL tenant
Grant the CREATE USER privilege only to the administrator account
Grant database-level metadata access privilege only to the administrator account
Oracle tenant
Revoke the EXECUTE privilege on system packages from the PUBLIC role
Revoke '% ANY %' privileges from non-administrator grantees

As data security governance becomes an increasingly important global concern, ensuring the security of databases, foundational software for storing and managing critical data assets, has become a key challenge that requires collaboration between database vendors and customers. OceanBase has always prioritized product security. Over the years, it has actively complied with regulatory requirements, established a comprehensive security management system, and focused on building stable, reliable, secure, and open data infrastructure. Through continuous technological innovation, OceanBase helps customers protect the confidentiality, integrity, and availability of their data, earning its reputation as a trusted provider of foundational software. However, ensuring database security is not just the responsibility of vendors—it also requires close collaboration with customers.

Security is a key factor in evaluating the performance of a database. A database management system must prevent unauthorized access to safeguard the files and data it contains.

This topic provides the best practices for achieving access control.

MySQL tenant

Grant the CREATE USER privilege only to the administrator account

In a MySQL tenant, the CREATE USER privilege allows you to modify the password of any account and to delete any users. Therefore, make sure that only the administrator has this privilege.

Related operations

  • Self-check

    Query non-root users that have the CREATE USER privilege.

    SELECT * FROM information_schema.user_privileges WHERE GRANTEE NOT LIKE ("'root'%") AND PRIVILEGE_TYPE = "CREATE USER"\G
    
  • Security hardening

    Revoke the CREATE USER privilege of normal users.

    REVOKE CREATE USER ON *.* FROM '<user>';
    

Grant database-level metadata access privilege only to the administrator account

The metadata of a MySQL tenant is stored in the internal tables or views of the databases named mysql and oceanbase. The metadata includes sensitive information such as hashed passwords and account privileges. Therefore, the metadata access privilege must be limited and configured for normal users on demand. Only the administrator account has the global access privilege on metadata.

Related operations

  • Self-check

    Query non-root users that have the access privilege on the oceanbase or mysql database.

    SELECT u.* FROM DBA_OB_USERS AS u INNER JOIN DBA_OB_DATABASE_PRIVILEGE as db WHERE (database_name = "oceanbase" OR database_name = "mysql") AND u.USER_NAME= db.USERNAME AND u.user_name != "root"\G
    
  • Security hardening

    Revoke the database-level metadata access privilege of normal users and enable on-demand configuration of the table-level access privilege.

    REVOKE ALL ON database_name.* FROM username;
    GRANT SELECT, INSERT, UPDATE ON database_name.table_name TO username;
    GRANT DELETE ON database_name.another_table TO username
    

Oracle tenant

Revoke the EXECUTE privilege on system packages from the PUBLIC role

You can revoke the EXECUTE privilege of the PUBLIC role to restrict the system package access and execution capabilities of all users. This way, only authorized users can use highly risky system packages, thereby improving system security.

Related operations

  • Self-check

    Check whether the EXECUTE privilege on any highly risky system package has been granted to the PUBLIC role.

    SELECT grantee, privilege FROM dba_tab_privs WHERE grantee = 'PUBLIC' AND privilege = 'EXECUTE';
    
  • Security hardening

    Revoke the EXECUTE privilege on highly risky system packages from the PUBLIC role.

    REVOKE EXECUTE ON DBMS_LOB FROM PUBLIC;
    REVOKE EXECUTE ON UTL_FILE FROM PUBLIC;
    REVOKE EXECUTE ON DBMS_SCHEDULER FROM PUBLIC;
    REVOKE EXECUTE ON DBMS_SQL FROM PUBLIC;
    REVOKE EXECUTE ON DBMS_XMLGEN FROM PUBLIC;
    

Revoke '% ANY %' privileges from non-administrator grantees

In Oracle mode, the ANY keyword allows a user to modify any database object in the database directories, leading to unauthorized access among users. Therefore, non-administrator grantees should not be granted '% ANY %' privileges.

Related operations

  • Self-check

    Query users with the privilege to access sensitive information.

    SELECT GRANTEE, PRIVILEGE FROM DBA_SYS_PRIVS WHERE PRIVILEGE LIKE '% ANY %' AND GRANTEE NOT IN ('SYS', 'DBA','ORAAUDITOR');
    
  • Security hardening

    Revoke '% ANY %' privileges from non-administrator grantees. Here is an example of revoking the EXECUTE ANY PROCEDURE privilege:

    REVOKE EXECUTE ANY PROCEDURE FROM <grantee>;
    

Previous topic

Best practices for security certification
Last

Next topic

Best practices for data encryption
Next
on this page
MySQL tenant
Grant the CREATE USER privilege only to the administrator account
Grant database-level metadata access privilege only to the administrator account
Oracle tenant
Revoke the EXECUTE privilege on system packages from the PUBLIC role
Revoke '% ANY %' privileges from non-administrator grantees