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.6.0

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogLive DemosTraining & Certification
    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.6.0
    iconOceanBase Database
    SQL - V 4.6.0
    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

    oceanbase.CDB_OB_DATABASE_PRIVILEGE

    Last Updated:2026-05-07 11:26:24  Updated
    share
    What is on this page
    Purpose
    Columns
    Sample query
    References

    folded

    share

    Note

    This view is available starting with V4.0.0.

    Purpose

    This view displays the database privileges of users in each tenant.

    Columns

    Column Type Nullable Description
    TENANT_ID bigint(20) NO The tenant ID.
    USER_ID bigint(20) NO The user ID.
    USERNAME varchar(128) NO The username.
    DATABASE_NAME varchar(128) NO The database name.
    GMT_CREATE timestamp(6) NO The creation time.
    GMT_MODIFIED timestamp(6) NO The last modification time.
    PRIV_ALTER varchar(3) NO Indicates whether the user has the privilege to modify databases or tables.
    PRIV_CREATE varchar(3) NO Indicates whether the user has the privilege to create databases or tables.
    PRIV_DELETE varchar(3) NO Indicates whether the user has the privilege to delete records in databases or tables.
    PRIV_DROP varchar(3) NO Indicates whether the user has the privilege to drop databases or tables.
    PRIV_GRANT_OPTION varchar(3) NO Indicates whether the user has the privilege to grant privileges.
    PRIV_INSERT varchar(3) NO Indicates whether the user has the privilege to insert records.
    PRIV_UPDATE varchar(3) NO Indicates whether the user has the privilege to update records.
    PRIV_SELECT varchar(3) NO Indicates whether the user has the privilege to query records.
    PRIV_INDEX varchar(3) NO Indicates whether the user has the privilege to create and drop indexes.
    PRIV_CREATE_VIEW varchar(3) NO Indicates whether the user has the privilege to create views.
    PRIV_SHOW_VIEW varchar(3) NO Indicates whether the user has the privilege to query views.
    PRIV_EXECUTE varchar(3) NO Indicates whether the user has the privilege to execute procedures and functions.
    PRIV_ALTER_ROUTINE varchar(3) NO Indicates whether the user has the privilege to modify or drop procedures and functions.
    PRIV_CREATE_ROUTINE varchar(3) NO Indicates whether the user has the privilege to create procedures and functions.
    PRIV_REFERENCES varchar(3) NO Indicates whether the user has the privilege to create foreign keys.
    PRIV_TRIGGER varchar(3) NO Indicates whether the user has the privilege to activate triggers.
    PRIV_LOCK_TABLE varchar(3) NO Indicates whether the user has the privilege to lock tables.
    PRIV_EVENT varchar(3) NO Indicates whether the user has the privilege to create and manage events.

    Sample query

    Query the database privileges of users in the tenant with ID 1002.

    obclient [oceanbase]> SELECT * FROM oceanbase.CDB_OB_DATABASE_PRIVILEGE WHERE TENANT_ID=1002;
    

    The query result is as follows:

    +-----------+---------+----------+--------------------+----------------------------+----------------------------+------------+-------------+-------------+-----------+-------------------+-------------+-------------+-------------+------------+------------------+----------------+--------------+--------------------+---------------------+-----------------+--------------+-----------------+------------+
    | TENANT_ID | USER_ID | USERNAME | DATABASE_NAME      | GMT_CREATE                 | GMT_MODIFIED               | PRIV_ALTER | PRIV_CREATE | PRIV_DELETE | PRIV_DROP | PRIV_GRANT_OPTION | PRIV_INSERT | PRIV_UPDATE | PRIV_SELECT | PRIV_INDEX | PRIV_CREATE_VIEW | PRIV_SHOW_VIEW | PRIV_EXECUTE | PRIV_ALTER_ROUTINE | PRIV_CREATE_ROUTINE | PRIV_REFERENCES | PRIV_TRIGGER | PRIV_LOCK_TABLE | PRIV_EVENT |
    +-----------+---------+----------+--------------------+----------------------------+----------------------------+------------+-------------+-------------+-----------+-------------------+-------------+-------------+-------------+------------+------------------+----------------+--------------+--------------------+---------------------+-----------------+--------------+-----------------+------------+
    |      1002 |  200001 | root     | information_schema | 2025-02-05 17:45:58.925531 | 2025-02-05 17:45:58.925531 | YES        | YES         | YES         | YES       | NO                | YES         | YES         | YES         | YES        | YES              | YES            | YES          | YES                | YES                 | YES             | YES          | YES             | YES        |
    |      1002 |  200001 | root     | mysql              | 2025-02-05 17:45:58.925531 | 2025-02-05 17:45:58.925531 | YES        | YES         | YES         | YES       | NO                | YES         | YES         | YES         | YES        | YES              | YES            | YES          | YES                | YES                 | YES             | YES          | YES             | YES        |
    |      1002 |  200001 | root     | oceanbase          | 2025-02-05 17:45:58.922326 | 2025-02-05 17:45:58.922326 | YES        | YES         | YES         | YES       | NO                | YES         | YES         | YES         | YES        | YES              | YES            | YES          | YES                | YES                 | YES             | YES          | YES             | YES        |
    |      1002 |  200001 | root     | test               | 2025-02-05 17:45:58.926588 | 2025-02-05 17:45:58.926588 | YES        | YES         | YES         | YES       | NO                | YES         | YES         | YES         | YES        | YES              | YES            | YES          | YES                | YES                 | YES             | YES          | YES             | YES        |
    |      1002 |  200001 | root     | __public           | 2025-02-05 17:45:58.924476 | 2025-02-05 17:45:58.924476 | YES        | YES         | YES         | YES       | NO                | YES         | YES         | YES         | YES        | YES              | YES            | YES          | YES                | YES                 | YES             | YES          | YES             | YES        |
    |      1002 |  200001 | root     | __recyclebin       | 2025-02-05 17:45:58.924476 | 2025-02-05 17:45:58.924476 | YES        | YES         | YES         | YES       | NO                | YES         | YES         | YES         | YES        | YES              | YES            | YES          | YES                | YES                 | YES             | YES          | YES             | YES        |
    |      1002 |  500009 | test2    | infotest           | 2025-02-20 15:12:19.975322 | 2025-02-20 15:12:19.975322 | NO         | NO          | NO          | NO        | NO                | NO          | NO          | YES         | NO         | NO               | NO             | NO           | NO                 | NO                  | NO              | NO           | NO              | NO         |
    +-----------+---------+----------+--------------------+----------------------------+----------------------------+------------+-------------+-------------+-----------+-------------------+-------------+-------------+-------------+------------+------------------+----------------+--------------+--------------------+---------------------+-----------------+--------------+-----------------+------------+
    7 rows in set
    

    References

    • DBA_OB_DATABASE_PRIVILEGE

    • View user privileges

    Previous topic

    oceanbase.CDB_CKPT_HISTORY
    Last

    Next topic

    oceanbase.CDB_IND_COLUMNS
    Next
    What is on this page
    Purpose
    Columns
    Sample query
    References