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 - V3.2.4Enterprise Edition

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogLive 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. V3.2.4
    iconOceanBase Database
    SQL - V 3.2.4Enterprise Edition
    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

    Security audit

    Last Updated:2023-10-24 09:23:03  Updated
    Share
    What is on this page
    Enable AuditTrail
    Set audit rules
    Audit process
    Audit records

    folded

    Share

    Data encryption and access control greatly reduce security risks. However, OceanBase Database still needs to record the behaviors of authorized users to prevent risks due to the leakage of user logon information or the abuse of access permissions. AuditTrail is an effective tool for tracking user behaviors. It allows enterprises to meet higher data security and compliance requirements.

    Enable AuditTrail

    To enable AuditTrail, you can set the audit_trail parameter as needed. The parameter takes effect immediately after you specify the value. Valid values:

    • NONE: disables AuditTrail.

    • OS: writes audit records to local files.

    • DB: writes audit records to internal tables.

    • DB,EXTENDED: writes records to internal tables and the records include the executed SQL statements.

    The administrator has the highest authority and can perform many operations. Therefore, OceanBase Database provides separate audit configurations for the administrator. The tenant-level audit_sys_operations parameter determines whether to record the behaviors of the administrator.

    Set audit rules

    You must log on as the built-in user ORAAUDITOR to set audit rules, which are divided into the following two types:

    • Statement audit: the audit of specific operations. You do not specify the objects, but you can specify whether the audit rules apply to specific or all users.

    • Object audit: the audit of the operations that are performed on specified objects. You can specify whether the audit rules apply to specific or all users.

    An audit rule is also a schema object. To configure each rule, AUDIT and NOAUDIT statements are executed.

    Audit process

    AuditTrail works after an SQL statement is executed but before the return of data packets. The audit process is divided into the following steps:

    1. Check whether the current user is auditable based on the tenant, username, and parameters.

    2. Parse auditable operations specified in SQL statements. An SQL statement can contain multiple operations. For example, insert into t1 select * from t2, t3 contains the following three operations: (insert, t1), (select, t2), and (select t3).

    3. Check whether each operation hits an audit rule.

    4. Generate an audit record for each operation that hit an audit rule. Save the audit records in internal tables or files based on the parameters.

    Audit records

    Audit files are stored in the audit/ directory, and the file name follows the observer_${pid}_${timestamp}.aud format. The API provided by ObLogger is used to write audit files. Other features are the same as other system logs. For example, an audit file is split when its size reaches 256 MB.

    Characteristics of writing audit records to internal tables:

    • When the audit_trail parameter is set to DB, SQL statements executed by the user are not recorded. To record SQL statements executed by the user, set the audit_trail parameter to DB,EXTENDED.

    • The insertion of audit records is independent of user transactions. This means that audit records are retained even if user transactions are rolled back.

    • If AuditTrail fails to write audit records to internal tables, it saves audit records to audit files.

    Previous topic

    Monitoring and alerts
    Last

    Next topic

    Structure of the OBServer installation directory
    Next
    What is on this page
    Enable AuditTrail
    Set audit rules
    Audit process
    Audit records