OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Database

SQL - V4.3.1

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogWhite PaperLive DemosTraining & CertificationTicket
    Company
    About OceanBaseTrust CenterLegalPartnerContact Us
    Follow Us

    © OceanBase 2026. All rights reserved

    Cloud Service AgreementPrivacy PolicySecurity
    Contact Us
    Document Feedback
    1. Documentation Center
    2. OceanBase Database
    3. SQL
    4. V4.3.1
    iconOceanBase Database
    SQL - V 4.3.1
    Databases
    • OceanBase Database
    • OceanBase Cloud
    • OceanBase Tugraph
    • Interactive Tutorials
    • OceanBase Best Practices
    Tools
    • OceanBase Cloud Platform
    • OceanBase Migration Service
    • OceanBase Developer Center
    • OceanBase Migration Assessment
    • OceanBase Admin Tool
    • OceanBase Loader and Dumper
    • OceanBase Deployer
    • Kubernetes operator for OceanBase
    • OceanBase Diagnostic Tool
    • OceanBase Binlog Service
    Connectors and Middleware
    • OceanBase Database Proxy
    • Embedded SQL in C for OceanBase
    • OceanBase Call Interface
    • OceanBase Connector/C
    • OceanBase Connector/J
    • OceanBase Connector/ODBC
    • OceanBase Connector/NET
    SQL
    KV
    • V 4.6.0
    • V 4.4.2
    • V 4.3.5
    • V 4.3.3
    • V 4.3.1
    • V 4.3.0
    • V 4.2.5
    • V 4.2.2
    • V 4.2.1
    • V 4.2.0
    • V 4.1.0
    • V 4.0.0
    • V 3.1.4 and earlier

    Access control

    Last Updated:2026-04-15 08:25:14  Updated
    Share
    What is on this page
    Privileges in Oracle mode
    Privilege types
    Privilege delegation
    Roles
    Indirect privileges
    Privilege check
    Privileges in MySQL mode
    Comparison with Oracle mode
    Privilege types
    Network security access control
    Row-level access control

    folded

    Share

    A well-developed database system requires an administrator to manage it and general users to operate on database objects in it. To access and operate on database objects, the general users must have the corresponding privileges.

    Privileges in Oracle mode

    Privilege types

    The Oracle mode of OceanBase Database supports the following two types of privileges:

    • Object privileges: the privileges to operate on specific objects, such as the ALTER, SELECT, and UPDATE privileges on a table.

    • System privileges: the privileges that allow users to perform specific database operations on one or all schemas.

    System privileges provide much broader permissions than object privileges.

    Privilege delegation

    Privilege delegation addresses the challenge of centralized authorization. By specifying with admin option or with grant option during the granting process, grantors allow users to delegate those same privileges to other users. When revoking object privileges, the corresponding privileges that the user has delegated to other users will also be revoked. For example, if user A grants privilege to user B and user B grants privilege to user C, when user A revokes privilege from user B, privilege of user C will also be revoked. Revoking system privileges does not revoke delegated privileges.

    Roles

    You can manage privileges by role. A role is a set of system and object privileges. A role can contain other roles. If you grant a role to a user, the user has all the privileges of the role. When a new tenant is created, it has three built-in roles by default:

    • DBA role: This role has most system privileges.

    • RESOURCE role: Users with the RESOURCE role can only create database objects in their own schema.

    • CONNECT role: Users with the CONNECT role have the privilege to connect to databases.

    • PUBLIC role: This role applies to all users in a tenant. By default, no privilege is granted to the role.

    • STANDBY_REPLICATION: This role applies to network-based Physical Standby Database scenarios.

    Indirect privileges

    User privileges are divided into direct and indirect privileges. Direct privileges are the system or object privileges that are granted to a user. Indirect privileges are those that are granted to roles of a user. Most operations can be performed with direct or indirect privileges. Direct privileges are required to perform the following operations:

    • When creating a view, the user needs privileges to access the objects in the view.

    • Privileges required to execute statements in a named PL block with the definers' rights.

    Privilege check

    Resolver parses all the privileges required to execute an SQL statement and checks whether you have the corresponding privileges. When you attempt to perform a system operation but you do not have sufficient privileges, an error is returned indicating that you have insufficient privileges. When you attempt to access an object on which you do not have any privilege, an error is returned indicating that the object does not exist. If you have privileges other than the required ones on the object that you want to access, an error is returned indicating that you have insufficient privileges.

    Privileges in MySQL mode

    Comparison with Oracle mode

    The MySQL mode of OceanBase Database supports roles but does not provide any built-in roles. The privilege check logic is consistent with that in Oracle mode.

    Privilege types

    OceanBase Database supports the following three levels of privileges in MySQL mode:

    • Global privileges: the privileges to manage the entire tenant, such as modifying system settings and accessing all tables.

    • Database privileges: the privileges to manage all objects in a database, such as creating or deleting tables in the database, and accessing those tables.

    • Object privileges: the privileges to manage a specific object, such as accessing a specific table, view, or index.

    Network security access control

    OceanBase Database allows you to implement network access control based on allowlist strategies. The tenant allowlist is specified by the ob_tcp_invited_nodes variable. You can specify a list of values for the system variable and separate them with commas (,). For example, you can specify the values in the A,B,C,D format.

    When a user logs on to an OBServer node, the OBServer node matches the IP address of the user against the four values. If the IP address of the user matches none of them, the access is denied. If the IP address of the user matches any one of them, access is allowed.

    You can specify the values in the following formats:

    • A regular IP address such as 192.168.1.1. Access is allowed only when the IP address of the client is identical to the specified value.

    • An IP address that contains percent signs (%) or underscores (__), such as 192.168.1.% or 192.168.1_. In this case, fuzzy matching is used, which is similar to the LIKE operator.

    • An IP address that contains netmasks, for example, 192.168.x.x/24 or 192.168.x.x/255.255.xxx.x. In this case, mask matching is used. The access is allowed only when the client IP address and netmask equals the specified value.

    Row-level access control

    OceanBase Database is compatible with Oracle's label security feature, which provides row-level access control to ensure the security of reading and writing data.

    Label security is a forcible access control strategy. It records the label value of each row by adding a label column to the table, and compares the user label and data label to constrain the access.

    OceanBase Database provides a built-in security administrator LBACSYS to manage and use Label Security. The security administrator can create customized security strategies by defining labels in the strategies and setting user labels. A security strategy can be applied to multiple tables, and multiple security strategies can be applied to one table. When a security strategy is applied to a table, a column is automatically added to the table to control the table access.

    Notice

    The label security feature is supported only in Oracle mode.

    Previous topic

    Authentication
    Last

    Next topic

    Data transmission encryption
    Next
    What is on this page
    Privileges in Oracle mode
    Privilege types
    Privilege delegation
    Roles
    Indirect privileges
    Privilege check
    Privileges in MySQL mode
    Comparison with Oracle mode
    Privilege types
    Network security access control
    Row-level access control