OceanBase logo

OceanBase

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

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

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

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 - V2.2.77Enterprise Edition

  • OceanBase Introduction
    • What is OceanBase Database?
    • Benefits
    • System architecture
    • Features
    • Compatibility with Oracle
      • Compatibility with Oracle Database
      • SQL data types
      • Built-in functions
      • System views
    • Compatibility with MySQL
    • Scenarios
    • Technical standards
    • Related services
  • OceanBase Database Overview
    • Database introduction
      • Overview
      • Overall architecture
      • Basic concepts
    • Data distribution
      • Cluster management
      • Tenant and resource management
      • Data distribution
      • Replicas and services
      • Data balancing
    • Data model
      • Multi-tenant architecture
      • Compatibility modes
      • System tenant
      • General tenant
      • Table and table group
      • Secondary index
      • Tables without a primary key
      • Views
    • High availability
      • High availability solution
      • Deployment modes
      • REDO log management
    • Transaction management
      • Isolation level
      • Concurrency control
      • GTS
      • Local transaction
      • Distributed transaction
      • Distributed query
    • Storage architecture
      • Overview
      • LSM-tree architecture
      • MemTable
      • Block storage (SSTable)
      • Minor compaction and major compaction
      • Caching
      • Read and write process
      • DDL
    • SQL engine
      • Execution process of SQL queries
      • Query rewrite
        • Overview
        • Rule-based query rewrite
        • Cost-based query rewrite
      • Query optimization
        • Access path
          • Overview
          • Rule-based path selection
          • Cost-based path selection
        • Join algorithms
          • Overview
          • Join algorithms
          • Join order
      • SQL execution plan
        • Introduction to SQL execution plan
        • Execution plan operators
          • TABLE SCAN
          • TABLE LOOKUP
          • JOIN
          • COUNT
          • GROUP BY
          • WINDOW FUNCTION
          • SUBPLAN FILTER
          • DISTINCT
          • SEQUENCE
          • MATERIAL
          • SORT
          • LIMIT
          • FOR UPDATE
          • SELECT INTO
          • SUBPLAN SCAN
          • UNION
          • INTERSECT
          • EXCEPT/MINUS
          • INSERT
          • DELETE
          • UPDATE
          • MERGE
          • EXCHANGE
          • GI
        • Plan cache
        • Fast parameterization
        • Real-time execution plan display
      • Distributed execution plan
        • Distributed execution and parallel query
        • Generate a distributed plan
        • Schedule distributed execution plans
        • Manage distributed execution plans
        • Execution of parallel queries
        • Parameter tuning for a parallel query
    • Client access
      • Data link
      • ODP
      • Database driver
    • Backup and recovery
      • Overview
      • Backup architecture
      • Restoration architecture
      • Backup set
      • Archive log round
    • Primary and standby databases
      • Overview
      • Typical scenarios
      • Protection mode
      • Role switchover
      • Log transfer service
      • Primary/standby database configuration
  • Deploy OceanBase Database
    • Deployment introduction
    • Deployment process
    • Preparations before deployment
      • Prepare servers
      • Server configuration requirements
      • Prepare the installation packages
    • Configure the deployment environment
      • Configure through the CLI
        • Install OAT-CLI
        • Use OAT-CLI to configure the deployment environment
        • Configure the clock source
        • Upload the installation packages
        • Configure the host information
        • Check the environment before deployment
      • Configure through the graphical interface
        • Deploy OAT
        • Verification after deployment
        • Configure the clock source
        • Upload the installation packages
        • Add a server
        • Initialize the server
    • Deploy OCP
      • Deployment description
      • Deploy through the CLI
        • Generate a configuration file
        • Start deployment
      • Deploy through the GUI
        • Add an OCP configuration file
        • Deploy OCP
      • Check after deployment
    • Deploy the OceanBase cluster
      • Configure DNS (optional)
      • Add an OBServer to the OCP resource pool
      • Create an OceanBase cluster
    • Deploy OBProxy
      • Deployment description
      • Deploy OBProxy
    • Create an OceanBase tenant
      • View available resources of a business tenant
      • Create a tenant
      • Verification after deployment
    • Deploy OMS
      • Deployment description
      • Deploy through the CLI
        • Modify the configuration file
        • Start deployment
      • Deploy through the GUI
        • Add an OMS configuration file
        • Deploy OMS
      • Check after deployment
    • Deploy ODC
      • Deployment description
      • Deploy through the CLI
        • Modify the configuration file
        • Start deployment
      • Deploy through the GUI
        • Add an ODC configuration file
        • Deploy ODC
      • Check after deployment
  • Quick Start
    • Overview
    • Connect to OceanBase Database
      • Connect to a MySQL tenant from a MySQL client
      • Use OBClient to connect to an OceanBase Database tenant
    • Basic operations (MySQL)
      • Database operations
      • Table operations
      • Index operations
      • Insert data
      • Query data
      • Update data
      • Delete data
      • Commit a transaction
      • Roll back a transaction
    • Basic Operations (Oracle)
      • Table-level operations
      • Index operations
      • Insert data
      • Query data
      • Update data
      • Delete data
      • Commit a transaction
      • Roll back a transaction
  • Administrator Guide
    • Basic database components
    • Database management tools
      • Management tools overview
      • OBClient
      • MySQL client
      • OceanBase Cloud Platform
      • OceanBase Developer Center
    • Connect to OceanBase Database
      • Connect to a MySQL tenant from a MySQL client
      • Use OBClient to connect to an OceanBase Database tenant
    • View the database version
    • Cluster and multi-tenant management
      • Cluster management
        • Overview of cluster management
        • Cluster management operations
      • Zone management
        • Overview of zone management
        • Add or delete zones
        • Start or stop a zone
        • Modify a zone
      • OBServer management
        • Overview of OBServer management
        • View OBServer status
        • Stop an OBServer
        • Start an OBServer
        • Manage OBServer status
      • Resource management
        • Overview of resource management
        • Create a resource unit
        • View resource units
        • Modify resource units
        • Delete resource units
        • Create a resource pool
        • Check resource configurations
        • Modify a resource pool
        • Delete a resource pool
      • Tenant management
        • Overview of tenant management
        • Create a tenant
        • View tenants
        • Modify a tenant
        • Delete a tenant
        • View tenant sessions
        • Terminate a tenant session
        • Tenant management variables
      • Memory management
        • Overview of memory management
        • Memory structure of OceanBase Database
        • Maximum memory for OceanBase Database
        • Internal system memory management
        • Internal tenant memory management
        • Plan cache
        • Common memory issues
    • Database object management
      • Manage tables
        • About tables
        • Create a table
        • Define an auto-increment column
        • Define column constraints
        • View table definition
        • Modify a table
        • Empty a table
        • Drop a table
      • Manage table groups
        • About table groups
        • Table group management statements
      • Manage indexes
        • About indexes
        • Create an index
        • View an index
        • Delete an index
      • Manage views, sequences, and synonyms
        • Manage views
        • Manage sequences
        • Manage synonyms
      • Manage triggers
        • Overview
        • Create a DML trigger
        • Modify and drop a trigger
        • Disable and enable a trigger
        • Delete a trigger
        • View trigger information
    • Data distribution and path management
      • Manage partitioned tables and partitioned indexes
        • About partitions
        • Partitioning strategies
        • Create a partitioned table
          • Partitioned tables
          • Subpartitioned tables
        • Partition pruning
        • Name and query a partition
        • Create an index on a partitioned table
          • Local index
          • Global index
          • Use an index
        • Maintain partitioned tables
          • Partitioned tables
          • Subpartitioned tables
      • Manage replicas
        • Overview of replicas
        • Use table replicas
      • Locality management
        • Overview of locality management
        • Modify tenant locality
      • OBProxy management
        • OBProxy management overview
        • OBProxy management operations
          • Start and stop OBProxy
          • Slow queries in OBProxy
          • OBProxy O\&M practices
        • Routing feature
          • SQL parser
          • LDC routing
          • Read/write splitting
          • Follower-first read
          • Blacklist
        • Load-balancing
        • Manage drivers
    • Manage transactions
      • Overview of transactions
      • Commit a transaction
      • Roll back a transaction
      • Levels of transaction isolation
    • Data storage management
      • Major compaction management
        • Major compaction management overview
        • Automatically trigger a major compaction
        • Manually trigger major compaction
        • View major compactions
        • Major compaction timeout and errors
        • Major compaction control parameters
      • Minor compaction management
        • Minor compaction management overview
        • Automatically trigger a minor compaction
        • Manually trigger a minor compaction
        • View minor compactions
        • Control parameters of minor compactions
      • Data compression
        • Data compression overview
        • Data encoding and compression
    • Data migration
      • Data migration overview
      • Migrate data by using SQL scripts
      • Migrate data by using MySQLDump
      • Migrate data by using DataX
      • Migrate data by using OUTFILE statements
      • Migrate data by using OMS
    • Manage user privileges
      • Users and privileges
      • Create a user
      • Manage roles
      • Modify user privileges
      • View the whitelist
      • Lock and unlock a user
      • Delete a user
    • Data monitoring and alerts
      • Monitoring alert overview
      • Monitoring
        • Status monitoring
        • Performance monitoring
        • Common performance monitoring metrics
        • SQL monitoring
      • Alerts
        • Alert configuration
        • Alert subscription
        • Alert message management
        • Common alert item management
    • Data high availability
      • Recycle bin management
        • Objects supported by the recycle bin
        • Recycle bin for databases, tables, and indexes
        • Recycle bin for tenants
      • Flashback queries
      • Restore points
      • Manage backup and restoration
        • Introduction to physical backup and restoration
        • Deploy NFS
        • Data backup
          • Backup by using commands
          • Enable backup based on log splitting
          • Change the backup destination during backup
          • View the backup progress
          • Stop a backup
          • Automatically clear backup data
          • Manually clear backup data
          • Cancel backup clearing
        • Secondary backup (cluster level)
          • Overview of secondary backup
          • Perform secondary backup
          • Automatically clear secondary backup data
          • Manually clear secondary backup data
        • Secondary backup (tenant level)
        • Restore data
          • Perform full restoration
          • View the full restoration progress and results
          • Restore a specified table
        • Restore secondary backup data
        • Routine maintenance
          • Backup-related maintenance
          • Operations related to secondary backup
      • Primary/Standby cluster management
        • Primary/Standby cluster configuration overview
        • Deploy the primary and standby clusters
          • Configuration requirements
          • Deploy a primary cluster
          • Check the configurations of the primary cluster
          • Deploy a standby cluster by using SQL commands
        • Tenant management
        • Log transfer service
          • Overview
          • Configure log transfer parameters for a standby cluster
          • Configure log compression
        • Protection mode
          • Protection mode overview
          • Protection mode and protection level
          • Switch the protection mode
        • Role switching
          • Switchover and failover
          • Preparations for a switchover
          • Switchover
            • Switchover by using commands
          • Failover
            • Preparations for a failover
            • Lossless failover
            • Connect the original primary cluster after a lossless failover
            • Lossy failover
            • Restore the original primary cluster after a lossy failover
            • Correct the data after a failover
        • Standby cluster read service
        • Delete a standby cluster
        • Precautions and use constraints
        • Troubleshooting
          • Failover-related errors
          • Switchover errors
          • Protection mode switching errors
          • Tenant creation for a standby cluster got stuck
          • Data synchronization enablement errors
    • Exception handling
      • Exception handling overview
      • Exception handling logic
      • Handle major compaction exceptions
      • Handle load exceptions
      • Handle tenant memory overrun exceptions
    • Data security management
      • Data transmission encryption
        • Overview
        • Transmission encryption of OBServers
        • Transmission encryption of ODP
      • Set row-level access control
      • Audit databases
        • Overview
        • Enable audit
        • Audit user logon operations
        • Audit user operations
        • Audit specified database objects
  • Developer Guide (MySQL Mode)
    • Foreword
      • About OceanBase Database developers
      • Overview
      • About OceanBase Database
        • Overview of OceanBase clusters
        • Introduction to OceanBase tenants
        • Database objects in a MySQL tenant of OceanBase Database
        • About how to access OceanBase Database
          • About MySQL clients (mysql)
          • About OceanBase client OBClient
          • About SQL
          • JDBC driver
          • OceanBase Java database connection driver
      • About sample database TPCC
    • Connect to OceanBase Database
      • Connect to an OceanBase tenant through a MySQL client
      • Connect to an OceanBase tenant through OBClient
      • Connect to OceanBase Database through ODC
      • Create OceanBase sample database TPCC
      • Explore MySQL tenants of OceanBase Database through OBClient
      • Query table data
        • About query statements
        • Search for data that satisfies specified conditions in a table
        • Sort query results
        • Query data from multiple tables
        • Use operators and functions in a query
          • Use arithmetic operators in queries
          • Use numeric functions in queries
          • Use string connectors in a query
          • Use string functions in queries
          • Use date and time functions in queries
          • Use type conversion functions in queries
          • Use aggregate functions in queries
          • Use NULL-related functions in queries
          • Use CASE functions in queries
          • Use the SELECT FOR UPDATE statement to lock query results
        • View the query execution plan
        • Use SQL hints in queries
        • About query timeout design
    • DML statements and transactions
      • About DML statements
        • Overview of DML statements
        • About the INSERT statement
        • About the UPDATE statement
        • About the DELETE statement
        • About the REPLACE INTO statement
      • About transaction control statements
      • Commit a transaction
      • Roll back a transaction
      • Transaction savepoints
      • About transaction timeout
    • Create and manage database objects
      • About DDL statements
      • Create and manage tables
        • About SQL data types
        • Create a table
        • About auto-increment columns
        • About types of column constraints
        • About table indexes
        • Flash back a deleted table
      • Create and manage partitioned tables
        • Overview
        • Partition routing
        • Partitioning strategies
        • Indexing on partitioned tables
        • Recommendations for using partitioned tables
      • Create and manage table groups
        • About table groups
        • Specify a table group when creating a table
        • View information about a table group
        • Add a table to a table group
        • Delete a table group
      • Create and manage views
        • Create a view
        • Modify a view
        • Delete a view
    • Migrate data to OceanBase Database
      • About data migration and synchronization
      • DataX
      • Examples of DataX reader and writer plug-ins for different data sources
      • OceanBase data loading methods
    • Migrate data to OceanBase Database
      • Example of connecting a Java application to OceanBase Database
      • General OceanBase parameters and variables
      • General SQL hints for OceanBase
  • Developer Guide (Oracle Mode)
    • Foreword
      • About OceanBase Database developers
      • Overview
      • About OceanBase Database
        • Overview of OceanBase clusters
        • Introduction to OceanBase tenants
        • Database objects in a MySQL tenant of OceanBase
        • Database objects in an Oracle tenant of OceanBase
        • About oceanbase database access methods
          • About MySQL clients (mysql)
          • About OceanBase client OBClient
          • About ODC
          • About SQL
          • JDBC driver
          • OceanBase JDBC driver
      • About sample database TPCC
    • Connect to OceanBase Database
      • Connect to an OceanBase tenant through OBClient
      • Connect to OceanBase Database through ODC
      • Create OceanBase sample database TPCC
      • Explore Oracle tenants of OceanBase through OBClient
      • Explore Oracle tenants of OceanBase through ODC
      • Query table data
        • About query statements
        • Search for data that satisfies specified conditions in a table
        • Sort query results
        • Query data from multiple tables
        • Use operators and functions in a query
          • Use arithmetic operators in queries
          • Use numeric functions in queries
          • Use string connectors in a query
          • Use string functions in queries
          • Use date and time functions in queries
          • Use type conversion functions in queries
          • Use aggregate functions in queries
          • Use NULL-related functions in queries
          • Use CASE functions in queries
          • Use the DECODE function in queries
          • Use complex analytic functions in queries
        • View the query execution plan
        • Use SQL hints in queries
        • About query timeout design
        • About Flashback query
    • About DML statements and transactions
      • About DML statements
        • Overview of DML statements
        • About the INSERT statement
        • About the UPDATE statement
        • About the MERGE statement
        • About the DELETE statement
      • About transaction control statements
      • Commit a transaction
      • Roll back a transaction
      • Transaction savepoints
      • About transaction timeout
    • Create and manage database objects
      • About the DDL statement
      • Create and manage tables
        • About SQL data types
        • Create a table
        • About auto-increment columns
        • About types of column constraints
        • About table indexes
        • Flash back a deleted table
      • Create and manage partitioned tables
        • Overview of partitioning
        • Partition routing
        • Partitioning strategies
        • Indexing on partitioned tables
        • Recommendations for using partitioned tables
      • Create and manage table groups
        • About table groups
        • Specify a table group when creating a table
        • View information about a table group
        • Add a table to a table group
        • Delete a table group
      • Create and manage views
        • Create a view
        • Modify a view
        • Delete a view
      • Create and manage sequences
        • Overview
        • Create and use sequences
        • Modify sequence attributes
        • Delete a sequence
      • Create and manage synonyms
        • Overview
        • Create a synonym
        • Delete a synonym
    • Work in globalized environments
      • Globalization support features
      • Default NLS parameters
      • View NLS parameters
      • Modify NLS parameters
      • Use Unicode in internationalized programs
    • Build extensible applications
      • Extensible applications
      • Use bind variables to improve the extensibility
      • Use PL to improve the performance
      • Concurrency and extensibility
      • Limit the number of concurrent sessions
      • Production environment data processing techniques
    • Migrate data to OceanBase Database
      • Data migration and synchronization
      • DataX
      • Examples of DataX reader and writer plug-ins for different data sources
      • OceanBase data loading methods
    • Appendix
      • Example of connecting a Java application to OceanBase Database
      • General OceanBase parameters and variables
      • Common SQL Hints for OceanBase Database
  • SQL Reference (MySQL Mode)
    • Elements
      • Data type
        • Data type overview
        • Numeric data types
        • Date and time data types
        • Character data types
        • Large-object data types
      • Expressions
      • Type conversion
      • Character sets
      • Collations
      • Data comparison rules
      • Literals
      • Comments
    • Operators
      • Arithmetic operators
      • Bitwise operators
      • Comparison operators
      • Logical operators
      • Date and time operators
      • Concatenation operators
      • Hierarchical query operators
      • Collation operators
    • Functions
      • Single-row functions
        • Date and time functions
        • String functions
        • Conversion functions
        • Mathematical functions
        • Comparison functions
        • Process control functions
      • Aggregate functions
      • Analytic functions
      • Information functions
      • Other functions
    • Queries and subqueries
      • Overview
      • JOIN
      • Set
    • SQL statements
      • General syntax
      • ALTER DATABASE
      • ALTER OUTLINE
      • ALTER RESOURCE POOL
      • ALTER RESOURCE UNIT
      • ALTER SYSTEM
      • ALTER TABLE
      • ALTER TABLEGROUP
      • ALTER TENANT
      • ALTER USER
      • CREATE DATABASE
      • CREATE INDEX
      • CREATE OUTLINE
      • CREATE RESOURCE POOL
      • CREATE RESOURCE UNIT
      • CREATE RESTORE POINT
      • CREATE SYNONYM
      • CREATE TABLE
      • CREATE TABLEGROUP
      • CREATE TENANT
      • CREATE USER
      • CREATE VIEW
      • DELETE
      • DROP DATABASE
      • DROP INDEX
      • DROP OUTLINE
      • DROP RESOURCE POOL
      • DROP RESOURCE UNIT
      • DROP RESTORE POINT
      • DROP TABLE
      • DROP TABLEGROUP
      • DROP TENANT
      • DROP SYNONYM
      • DROP USER
      • DROP VIEW
      • EXPLAIN
      • FLASHBACK DATABASE
      • FLASHBACK TABLE
      • FLASHBACK TENANT
      • GRANT
      • INSERT
      • KILL
      • PURGE DATABASE
      • PURGE INDEX
      • PURGE RECYCLEBIN
      • PURGE TABLE
      • PURGE TENANT
      • RENAME TABLE
      • RENAME USER
      • REPLACE
      • REVOKE
      • SAVEPOINT
      • SCHEMA
      • SELECT
      • SESSION
      • SET PASSWORD
      • SHOW GRANTS
      • SHOW RECYCLEBIN
      • TRANSACTION
      • TRUNCATE TABLE
      • UPDATE
  • SQL Reference (Oracle Mode)
    • SQL overview
    • Pseudocolumns
    • Elements
      • Built-in data types
        • Overview of built-in data types
        • Character data types
          • Overview of character data types
          • CHAR data type
          • NCHAR data type
          • NVARCHAR2 data type
          • VARCHAR2 data type
          • VARCHAR data type
        • Numeric data types
          • Overview of numeric data types
          • NUMBER data type
          • FLOAT data type
          • Floating-point numbers
          • Numeric precedence
        • Date, time, and interval data types
          • Overview of datetime and interval data types
          • DATE data type
          • TIMESTAMP data type
          • TIMESTAMP WITH TIME ZONE data type
          • TIMESTAMP WITH LOCAL TIME ZONE data type
          • INTERVAL YEAR TO MONTH data type
          • INTERVAL DAY TO SECOND data type
          • Calculation of DATE and INTERVAL values
        • RAW data type
        • Large object data types
          • Overview of large object data types
          • BLOB data type
          • CLOB data type
      • Comparison rules of data types
        • Overview of data type comparison rules
        • Numeric values
        • Date values
        • Character values
        • Data type precedence
        • Data type conversion
        • Security notes for data conversions
      • Literals
        • Literal overview
        • Text literals
        • Numeric literals
        • Datetime literals
          • Date literals
          • Timestamp literals
        • Interval literals
      • Formatting
        • Formatting overview
        • Number formatting
        • Datetime formatting
        • RR datetime format element
        • String-to-date conversion rules
      • Null values
        • Null value overview
        • Null values in SQL functions
        • Null values in comparison conditions
        • Null values in conditional expressions
      • Comments
        • Overview
        • Comments in SQL statements
        • Comments on schema objects and non-schema objects
        • Hint
          • Hint overview
          • Lists of hints
            • Hints related to access paths
            • Hints related to join orders
            • Hints related to join operations
            • Hints related to parallel execution
            • Hints related to query policies
            • Hints related to query transformation
            • Other hints
      • Database objects
        • Schema objects
      • Database naming conventions
        • Overview of the naming conventions of database objects
        • Naming rules of database objects
        • Examples of schema object names
        • Rules for naming schema objects
      • Methods of referencing database objects
        • Overview of database object references
        • Reference schema objects
        • Reference partitioned tables and indexes
        • Reference object type attributes and methods
    • Operators
      • Operator overview
      • Arithmetic operators
      • Concatenation operators
      • Hierarchical query operators
      • Set operators
      • Collations
    • Functions
      • Function overview
      • Single-row functions
        • Numeric functions
          • ABS
          • ACOS
          • BITAND
          • CEIL
          • EXP
          • FLOOR
          • LN
          • LOG
          • MOD
          • POWER
          • REMAINDER
          • ROUND
          • SIGN
          • SQRT
          • TRUNC
        • String functions that return strings
          • CHR
          • CONCAT
          • INITCAP
          • LOWER
          • LPAD
          • LTRIM
          • REGEXP_REPLACE
          • REPLACE
          • RPAD
          • RTRIM
          • SUBSTR
          • TRANSLATE
          • TRIM
          • UPPER
        • String functions that return numbers
          • ASCII
          • INSTR
          • LENGTH
        • Datetime functions
          • ADD_MONTHS
          • CURRENT_DATE
          • CURRENT_TIMESTAMP
          • DBTIMEZONE
          • EXTRACT(datetime)
          • FROM_TZ
          • LAST_DAY
          • LOCALTIMESTAMP
          • MONTHS_BETWEEN
          • NEXT_DAY
          • NUMTODSINTERVAL
          • NUMTOYMINTERVAL
          • ROUND (date)
          • SESSIONTIMEZONE
          • SYS_EXTRACT_UTC
          • SYSDATE
          • SYSTIMESTAMP
          • TO_CHAR (datetime)
          • TO_DSINTERVAL
          • TO_TIMESTAMP
          • TO_TIMESTAMP_TZ
          • TO_YMINTERVAL
          • TRUNC (date)
          • TZ_OFFSET
        • General comparison functions
          • GREATEST
          • LEAST
        • Conversion functions
          • CAST
          • HEXTORAW
          • RAWTOHEX
          • TO_BINARY_DOUBLE
          • TO_BINARY_FLOAT
          • TO_CHAR (character)
          • TO_CHAR (datetime)
          • TO_CHAR (number)
          • TO_DATE
          • TO_DSINTERVAL
          • TO_NUMBER
          • TO_TIMESTAMP
          • TO_TIMESTAMP_TZ
          • TO_YMINTERVAL
        • Encoding and decoding functions
          • DECODE
          • ORA_HASH
          • VSIZE
        • Null value-related functions
          • COALESCE
          • LNNVL
          • NVL
          • NVL2
      • Aggregate functions
        • APPROX_COUNT_DISTINCT
        • AVG
        • COUNT
        • KEEP
        • LISTAGG
        • MAX
        • MIN
        • ROLLUP
        • STDDEV
        • STDDEV_POP
        • STDDEV_SAMP
        • SUM
        • VARIANCE
        • WMSYS.WM_CONCAT/WM_CONCAT
      • Analytic functions
        • Description of window functions
        • AVG
        • COUNT
        • KEEP
        • SUM
        • MAX
        • MIN
        • LISTAGG
        • STDDEV
        • STDDEV_POP
        • STDDEV_SAMP
        • VARIANCE
        • RANK
        • LEAD
        • LAG
        • FIRST_VALUE
        • LAST_VALUE
        • NTH_VALUE
        • CUME_DIST
        • DENSE_RANK
        • NTILE
        • PERCENT_RANK
        • RATIO_TO_REPORT
        • ROW_NUMBER
        • WMSYS.WM_CONCAT/WM_CONCAT
    • Expressions
      • Overview of SQL expressions
      • Simple expressions
      • Compound expressions
      • Case expressions
      • Column expressions
      • Datetime expressions
      • Function expressions
      • Interval expressions
      • Scalar subquery expressions
      • Expression lists
    • Conditions
      • Overview of SQL conditions
      • Comparison conditions
      • Logical conditions
      • Pattern-matching conditions
      • NULL conditions
      • Compound conditions
      • BETWEEN conditions
      • EXISTS conditions
      • IN conditions
    • Queries and subqueries
      • Overview of queries and subqueries
      • Simple queries
      • Hierarchical queries
      • Sets
      • Joins
      • Subqueries
    • SQL statements
      • DDL
        • ALTER KEYSTORE
        • ALTER OUTLINE
        • ALTER SEQUENCE
        • ALTER SESSION
        • ALTER TABLE
        • ALTER TABLEGROUP
        • ALTER USER
        • CREATE INDEX
        • CREATE KEYSTORE
        • CREATE OUTLINE
        • CREATE RESTORE POINT
        • CREATE SEQUENCE
        • CREATE SYNONYM
        • CREATE TABLE
        • CREATE TABLEGROUP
        • CREATE TABLESPACE
        • CREATE USER
        • CREATE VIEW
        • DROP INDEX
        • DROP OUTLINE
        • DROP RESTORE POINT
        • DROP SEQUENCE
        • DROP SYNONYM
        • DROP TABLE
        • DROP TABLEGROUP
        • DROP TABLESPACE
        • DROP USER
        • DROP VIEW
        • RENAME
        • TRUNCATE TABLE
      • DML
        • DELETE
        • INSERT
        • MERGE
        • PURGE INDEX
        • PURGE RECYCLEBIN
        • PURGE TABLE
        • SELECT
        • UPDATE
      • DCL
        • AUDIT
        • EXPLAIN
        • FLASHBACK TABLE BEFORE DROP
        • GRANT
        • KILL
        • REVOKE
        • SAVEPOINT
        • SET NAMES
        • SET PASSWORD
        • SET VARIABLE
        • SHOW
        • SHOW RECYCLEBIN
        • SHRINK
        • TRANSACTION
  • SQL Tuning Guide
    • Execution process of SQL queries
    • SQL execution plan
      • Introduction to SQL execution plan
      • Execution plan operators
        • TABLE SCAN
        • TABLE LOOKUP
        • JOIN
        • COUNT
        • GROUP BY
        • WINDOW FUNCTION
        • SUBPLAN FILTER
        • DISTINCT
        • SEQUENCE
        • MATERIAL
        • SORT
        • LIMIT
        • FOR UPDATE
        • SELECT INTO
        • SUBPLAN SCAN
        • UNION
        • INTERSECT
        • EXCEPT/MINUS
        • INSERT
        • DELETE
        • UPDATE
        • MERGE
        • EXCHANGE
        • GI
      • Plan cache
      • Fast parameterization
      • Execution plan display (EXPLAIN)
      • Real-time execution plan display
    • Distributed execution plan
      • Distributed execution and parallel query
      • Generate a distributed plan
      • Schedule distributed execution plans
      • Manage distributed execution plans
      • Execution of parallel queries
      • Parameter tuning for a parallel query
    • SQL tuning
      • Overview of SQL tuning
      • General procedure of SQL tuning
      • Monitor the SQL execution performance
        • (g)v$sql_audit introduction
        • SQL Trace
        • Plan cache view
        • Examples of SQL performance analysis
          • Use SQL Audit to analyze wait events in a query
          • Analyze SQL queries that cause an abrupt RT jitter
          • View the shape of an execution plan and analyze the plan
          • Analyze slow SQL queries
          • Query SQL traffic distribution and QPS
          • Check whether SQL queries are balanced across servers in a cluster
          • Find the TOP N SQL queries
          • Analyze whether an unusually large number of remote execution requests exist in the system or the execution of an SQL statement
          • Find full table scan SQL statements in a tenant
          • Find the TOP N queries with the longest execution time within a specified period
          • Analyze queries related to distributed plans
          • Check whether the RPC execution count of a distributed subplan is balanced across servers in a cluster
      • Query rewrite
        • Overview
        • Rule-based query rewrite
        • Cost-based query rewrite
      • Query optimization
        • Access path
          • Overview
          • Rule-based path selection
          • Cost-based path selection
        • Join algorithms
          • Overview
          • Join algorithms
          • Join order
      • Manage execution plans
        • Optimizer hints
        • Plan binding
        • SQL plan management
    • Concepts
    • FAQ about SQL tuning
  • Reference Guide (MySQL Mode)
    • System views
      • Overview
      • Dictionary views
        • mysql.help_topic
        • mysql.help_category
        • mysql.help_keyword
        • mysql.help_relation
        • mysql.db
        • mysql.proc
        • mysql.time_zone
        • mysql.time_zone_name
        • mysql.time_zone_transition
        • mysql.time_zone_transition_type
        • mysql.user
        • information_schema.CHARACTER_SETS
        • information_schema.COLLATIONS
        • information_schema.COLLATION_CHARACTER_SET_APPLICABILITY
        • information_schema.COLUMNS
        • information_schema.DBA_OUTLINES
        • information_schema.ENGINES
        • information_schema.GLOBAL_STATUS
        • information_schema.GLOBAL_VARIABLES
        • information_schema.KEY_COLUMN_USAGE
        • information_schema.PARAMETERS
        • information_schema.PARTITIONS
        • information_schema.PROCESSLIST
        • information_schema.REFERENTIAL_CONSTRAINTS
        • information_schema.ROUTINES
        • information_schema.SCHEMATA
        • information_schema.SCHEMA_PRIVILEGES
        • information_schema.SESSION_STATUS
        • information_schema.SESSION_VARIABLES
        • information_schema.STATISTICS
        • information_schema.TABLES
        • information_schema.TABLE_CONSTRAINTS
        • information_schema.TABLE_PRIVILEGES
        • information_schema.USER_PRIVILEGES
        • information_schema.USER_RECYCLEBIN
        • information_schema.VIEWS
        • oceanbase.CDB_OB_BACKUP_ARCHIVELOG_SUMMARY
        • oceanbase.CDB_OB_BACKUP_JOB_DETAILS
        • oceanbase.CDB_OB_BACKUP_SET_DETAILS
        • oceanbase.CDB_OB_BACKUP_PROGRESS
        • oceanbase.CDB_OB_BACKUP_SET_EXPIRED
        • oceanbase.CDB_OB_BACKUP_ARCHIVELOG_PROGRESS
        • oceanbase.CDB_OB_BACKUP_CLEAN_HISTORY
        • oceanbase.CDB_OB_BACKUP_TASK_CLEAN_HISTORY
        • oceanbase.CDB_OB_RESTORE_PROGRESS
        • oceanbase.CDB_OB_RESTORE_HISTORY
        • oceanbase.CDB_CKPT_HISTORY
        • oceanbase.CDB_OB_BACKUP_VALIDATION_JOB
        • oceanbase.CDB_OB_BACKUP_VALIDATION_JOB_HISTORY
        • oceanbase.CDB_OB_TENANT_BACKUP_VALIDATION_TASK
        • oceanbase.CDB_OB_BACKUP_VALIDATION_TASK_HISTORY
        • oceanbase.CDB_OB_BACKUP_BACKUP_ARCHIVELOG_SUMMARY
        • oceanbase.CDB_OB_BACKUP_BACKUPSET_TASK_HISTORY
        • oceanbase.CDB_OB_BACKUP_BACKUPSET_TASK
        • oceanbase.CDB_OB_BACKUP_BACKUPSET_JOB_HISTORY
        • oceanbase.CDB_OB_BACKUP_BACKUPSET_JOB
        • oceanbase.CDB_OB_BACKUP_SET_OBSOLETE
        • oceanbase.CDB_OB_BACKUP_ARCHIVELOG
        • oceanbase.CDB_OB_BACKUP_BACKUP_ARCHIVELOG
        • oceanbase.CDB_OB_BACKUP_PIECE_FILES
        • oceanbase.CDB_OB_BACKUP_SET_FILES
      • Performance views
        • gv$plan_cache_stat
        • gv$plan_cache_plan_stat
        • gv$session_event
        • gv$session_wait
        • gv$session_wait_history
        • gv$system_event
        • gv$sesstat
        • gv$sysstat
        • gv$sql_audit
        • gv$latch
        • gv$memory
        • gv$memstore
        • gv$memstore_info
        • gv$plan_cache_plan_explain
        • gv$obrpc_outgoing
        • gv$obrpc_incoming
        • gv$sql
        • gv$sql_plan_monitor
        • gv$outline
        • gv$concurrent_limit_sql
        • gv$sql_plan_statistics
        • gv$server_memstore
        • gv$unit_load_balance_event_history
        • gv$tenant
        • gv$database
        • gv$table
        • gv$unit
        • gv$partition
        • gv$lock_wait_stat
        • gv$session_longops
        • gv$tenant_memstore_allocator_info
        • gv$minor_merge_info
        • gv$tenant_px_worker_stat
        • gv$partition_audit
        • gv$ps_stat
        • gv$ps_item_info
        • gv$sql_workarea
        • gv$sql_workarea_histogram
        • gv$ob_sql_workarea_memory_info
        • gv$server_schema_info
        • gv$merge_info
        • gv$lock
        • v$statname
        • v$event_name
        • v$session_event
        • v$session_wait
        • v$session_wait_history
        • v$sesstat
        • v$sysstat
        • v$system_event
        • v$memory
        • v$memstore
        • v$memstore_info
        • v$plan_cache_stat
        • v$plan_cache_plan_stat
        • v$plan_cache_plan_explain
        • v$sql_audit
        • v$obrpc_outgoing
        • v$obrpc_incoming
        • v$sql
        • v$sql_plan_monitor
        • v$sql_plan_statistics
        • v$unit
        • v$partition
        • v$lock_wait_stat
        • v$session_longops
        • v$latch
        • v$tenant_memstore_allocator_info
        • v$tenant_px_worker_stat
        • v$partition_audit
        • v$ob_cluster
        • v$ob_standby_status
        • v$ob_cluster_stats
        • v$ob_cluster_event_history
        • v$ps_stat
        • v$ps_item_info
        • v$sql_workarea
        • v$sql_workarea_active
        • v$sql_workarea_histogram
        • v$ob_sql_workarea_memory_info
        • v$ob_timestamp_service
        • v$server_schema_info
        • v$merge_info
        • v$lock
        • v$sql_monitor_statname
        • v$restore_point
        • v$ob_cluster_failover_info
        • v$encrypted_tables
        • v$encrypted_tablespaces
        • v$ob_all_clusters
    • System variables
      • System variable overview
      • auto_increment_increment
      • auto_increment_offset
      • autocommit
      • character_set_client
      • character_set_connection
      • character_set_database
      • character_set_results
      • character_set_server
      • character_set_system
      • collation_connection
      • collation_database
      • collation_server
      • interactive_timeout
      • last_insert_id
      • max_allowed_packet
      • sql_mode
      • time_zone
      • tx_isolation
      • version_comment
      • wait_timeout
      • binlog_row_image
      • character_set_filesystem
      • connect_timeout
      • datadir
      • debug_sync
      • div_precision_increment
      • explicit_defaults_for_timestamp
      • group_concat_max_len
      • identity
      • lower_case_table_names
      • net_read_timeout
      • net_write_timeout
      • read_only
      • sql_auto_is_null
      • sql_select_limit
      • timestamp
      • tx_read_only
      • version
      • sql_warnings
      • max_user_connections
      • init_connect
      • license
      • net_buffer_length
      • system_time_zone
      • query_cache_size
      • query_cache_type
      • sql_quote_show_create
      • max_sp_recursion_depth
      • sql_safe_updates
      • ob_default_replica_num
      • ob_proxy_partition_hit
      • ob_log_level
      • ob_max_parallel_degree
      • ob_query_timeout
      • ob_read_consistency
      • ob_enable_transformation
      • ob_trx_timeout
      • ob_enable_plan_cache
      • ob_enable_index_direct_select
      • ob_proxy_set_trx_executed
      • ob_enable_aggregation_pushdown
      • ob_last_schema_version
      • ob_global_debug_sync
      • ob_proxy_global_variables_version
      • ob_enable_trace_log
      • ob_enable_hash_group_by
      • ob_enable_blk_nestedloop_join
      • ob_bnl_join_cache_size
      • ob_org_cluster_id
      • ob_plan_cache_percentage
      • ob_plan_cache_evict_high_percentage
      • ob_plan_cache_evict_low_percentage
      • recyclebin
      • ob_capability_flag
      • ob_stmt_parallel_degree
      • is_result_accurate
      • error_on_overlap_time
      • ob_compatibility_mode
      • ob_create_table_strict_mode
      • ob_sql_work_area_percentage
      • ob_route_policy
      • ob_enable_transmission_checksum
      • foreign_key_checks
      • ob_enable_truncate_flashback
      • ob_tcp_invited_nodes
      • sql_throttle_current_priority
      • sql_throttle_priority
      • sql_throttle_rt
      • sql_throttle_network
      • auto_increment_cache_size
      • ob_enable_jit
      • ob_temp_tablespace_size_percentage
      • ob_timestamp_service
      • plugin_dir
      • undo_retention
      • ob_sql_audit_percentage
      • ob_enable_sql_audit
      • optimizer_use_sql_plan_baselines
      • optimizer_capture_sql_plan_baselines
      • parallel_max_servers
      • parallel_servers_target
      • ob_early_lock_release
      • ob_trx_idle_timeout
      • block_encryption_mode
      • ob_reserved_meta_memory_percentage
      • ob_check_sys_variable
      • tracefile_identifier
      • transaction_isolation
      • ob_trx_lock_timeout
      • validate_password_check_user_name
      • validate_password_length
      • validate_password_mixed_case_count
      • validate_password_number_count
      • validate_password_policy
      • validate_password_special_char_count
      • default_password_lifetime
      • ob_trace_info
      • secure_file_priv
      • ob_pl_block_timeout
      • performance_schema
      • transaction_read_only
      • max_connections
    • System configuration items
      • Overview of system configuration items
      • all_cluster_list
      • enable_unit_balance_resource_weight
      • plan_cache_high_watermark
      • plan_cache_low_watermark
      • sql_audit_queue_size
      • tenant_cpu_variation_per_server
      • max_stale_time_for_weak_consistency
      • sql_work_area
      • auto_leader_switch_interval
      • auto_delete_expired_backup
      • autoinc_cache_refresh_interval
      • audit_sys_operations
      • audit_trail
      • balancer_idle_time
      • balancer_log_interval
      • balancer_timeout_check_interval
      • balancer_task_timeout
      • balancer_tolerance_percentage
      • balancer_emergency_percentage
      • balance_blacklist_failure_threshold
      • balance_blacklist_retry_interval
      • backup_concurrency
      • backup_dest
      • backup_net_limit
      • backup_recovery_window
      • backup_region
      • builtin_db_data_verify_cycle
      • bf_cache_miss_count_threshold
      • bf_cache_priority
      • cache_wash_threshold
      • clog_cache_priority
      • clog_sync_time_warn_threshold
      • clog_disk_usage_limit_percentage
      • clog_transport_compress_all
      • clog_transport_compress_func
      • clog_persistence_compress_func
      • clog_max_unconfirmed_log_count
      • cluster
      • cluster_id
      • cpu_count
      • cpu_quota_concurrency
      • cpu_reserved
      • config_additional_dir
      • data_copy_concurrency
      • data_dir
      • datafile_disk_percentage
      • dtl_buffer_size
      • datafile_size
      • default_compress_func
      • default_compress
      • default_progressive_merge_num
      • default_row_format
      • devname
      • data_disk_usage_limit_percentage
      • disk_io_thread_count
      • dead_socket_detection_timeout
      • enable_clog_persistence_compress
      • election_cpu_quota
      • enable_one_phase_commit
      • enable_sys_unit_standalone
      • enable_pg
      • enable_smooth_leader_switch
      • election_blacklist_interval
      • enable_election_group
      • enable_auto_leader_switch
      • enable_global_freeze_trigger
      • enable_manual_merge
      • enable_merge_by_turn
      • enable_perf_event
      • enable_rebalance
      • enable_record_trace_log
      • enable_record_trace_id
      • enable_early_lock_release
      • enable_rereplication
      • enable_rich_error_msg
      • enable_rootservice_standalone
      • enable_sql_audit
      • enable_sql_operator_dump
      • enable_async_syslog
      • enable_syslog_recycle
      • enable_syslog_wf
      • enable_upgrade_mode
      • enable_separate_sys_clog
      • enable_ddl
      • enable_major_freeze
      • enable_rebuild_on_purpose
      • enable_log_archive
      • enable_monotonic_weak_read
      • external_kms_info
      • freeze_trigger_percentage
      • flush_log_at_trx_commit
      • fuse_row_cache_priority
      • force_refresh_location_cache_interval
      • force_refresh_location_cache_threshold
      • get_leader_candidate_rpc_timeout
      • global_major_freeze_residual_memory
      • global_write_halt_residual_memory
      • ignore_replay_checksum_error
      • global_index_build_single_replica_timeout
      • high_priority_net_thread_count
      • ignore_replica_checksum_error
      • ignore_replay_checksum_error
      • index_cache_priority
      • index_clog_cache_priority
      • index_info_block_cache_priority
      • internal_sql_execute_timeout
      • large_query_worker_percentage
      • large_query_threshold
      • leak_mod_to_check
      • lease_time
      • location_cache_cpu_quota
      • location_cache_expire_time
      • location_cache_priority
      • location_cache_refresh_min_interval
      • location_fetch_concurrency
      • location_refresh_thread_count
      • log_archive_checkpoint_interval
      • log_archive_concurrency
      • log_restore_concurrency
      • major_freeze_duty_time
      • max_kept_major_version_number
      • max_string_print_length
      • max_syslog_file_count
      • merge_stat_sampling_ratio
      • major_compact_trigger
      • memory_chunk_cache_size
      • memory_limit
      • memory_limit_percentage
      • memory_reserved
      • merge_thread_count
      • merger_check_interval
      • merger_completion_percentage
      • merger_switch_leader_duration_time
      • merger_warm_up_duration_time
      • max_px_worker_count
      • migration_disable_time
      • min_observer_version
      • minor_deferred_gc_time
      • minor_freeze_times
      • minor_warm_up_duration_time
      • mysql_port
      • minor_merge_concurrency
      • multiblock_read_gap_size
      • multiblock_read_size
      • micro_block_merge_verify_level
      • migrate_concurrency
      • minor_compact_trigger
      • memstore_limit_percentage
      • net_thread_count
      • obconfig_url
      • ob_enable_batched_multi_statement
      • partition_table_check_interval
      • partition_table_scan_batch_count
      • plan_cache_evict_interval
      • px_task_size
      • px_workers_per_cpu_quota
      • replica_safe_remove_time
      • resource_hard_limit
      • resource_soft_limit
      • rootservice_async_task_queue_size
      • rootservice_async_task_thread_count
      • rootservice_list
      • rootservice_ready_check_interval
      • row_compaction_update_limit
      • row_purge_thread_count
      • rpc_port
      • rpc_timeout
      • restore_concurrency
      • rootservice_memory_limit
      • rebuild_replica_data_lag_threshold
      • schema_history_expire_time
      • ssl_client_authentication
      • server_check_interval
      • server_data_copy_in_concurrency
      • server_data_copy_out_concurrency
      • server_permanent_offline_time
      • server_temporary_offline_time
      • stack_size
      • server_balance_critical_disk_waterlevel
      • server_balance_disk_tolerance_percent
      • system_memory
      • server_balance_cpu_mem_tolerance_percent
      • server_cpu_quota_max
      • server_cpu_quota_min
      • sql_audit_memory_limit
      • sys_bkgd_io_high_percentage
      • sys_bkgd_io_low_percentage
      • sys_bkgd_io_timeout
      • sys_bkgd_net_percentage
      • sys_bkgd_migration_change_member_list_timeout
      • sys_bkgd_migration_retry_num
      • syslog_level
      • switchover_process_thread_count
      • system_cpu_quota
      • sys_cpu_limit_trigger
      • system_trace_level
      • syslog_io_bandwidth_limit
      • tablet_size
      • tableapi_transport_compress_func
      • tenant_task_queue_size
      • tenant_groups
      • trace_log_slow_query_watermark
      • trace_log_sampling_interval
      • trx_2pc_retry_interval
      • trx_try_wait_lock_timeout
      • trx_force_kill_threshold
      • tde_method
      • token_reserved_percentage
      • unit_balance_resource_weight
      • user_block_cache_priority
      • user_row_cache_priority
      • user_tab_col_stat_cache_priority
      • user_iort_up_percentage
      • use_large_pages
      • virtual_table_location_cache_expire_time
      • workers_per_cpu_quota
      • wait_leader_batch_count
      • writing_throttling_maximum_duration
      • writing_throttling_trigger_percentage
      • weak_read_version_refresh_interval
      • workarea_size_policy
      • zone
      • zone_merge_concurrency
      • zone_merge_order
      • zone_merge_timeout
      • ob_ssl_invited_common_names
      • ssl_external_kms_info
      • ob_event_history_recycle_interval
      • backup_backup_dest
      • plsql_ccflags
      • plsql_code_type
      • plsql_debug
      • plsql_optimize_level
      • plsql_v2_compatibility
      • plsql_warnings
      • recyclebin_object_expire_time
      • log_archive_batch_buffer_limit
      • clog_disk_utilization_threshold
      • backup_backup_archive_log_batch_count
      • backup_backup_archivelog_retry_interval
      • backup_backupset_batch_count
      • backup_backupset_retry_interval
      • open_cursors
      • location_cache_refresh_rpc_timeout
      • location_cache_refresh_sql_timeout
      • backup_dest_option
      • backup_backup_dest_option
      • backup_zone
      • backup_log_archive_option
      • enable_tcp_keepalive
      • tcp_keepidle
      • tcp_keepintvl
      • tcp_keepcnt
    • Reserved keywords
  • Reference Guide (Oracle Mode)
    • System views
      • Dictionary views
        • ALL_ALL_TABLES
        • ALL_ARGUMENTS
        • ALL_COL_COMMENTS
        • ALL_COLL_TYPES
        • ALL_COL_PRIVS
        • ALL_CONSTRAINTS
        • ALL_CONS_COLUMNS
        • ALL_DEF_AUDIT_OPTS
        • ALL_ERRORS
        • ALL_INDEXES
        • ALL_IND_COLUMNS
        • ALL_IND_EXPRESSIONS
        • ALL_IND_PARTITIONS
        • ALL_IND_SUBPARTITIONS
        • ALL_METHOD_PARAMS
        • ALL_OBJECTS
        • ALL_PART_INDEXES
        • ALL_PART_KEY_COLUMNS
        • ALL_PART_TABLES
        • ALL_PROCEDURES
        • ALL_PROFILES
        • ALL_SCHEDULER_JOB_ARGS
        • ALL_SCHEDULER_PROGRAM_ARGS
        • ALL_SEQUENCES
        • ALL_SOURCE
        • ALL_SUBPARTITION_TEMPLATES
        • ALL_SUBPART_KEY_COLUMNS
        • ALL_SYNONYMS
        • ALL_TABLES
        • ALL_TAB_COLS
        • ALL_TAB_COLUMNS
        • ALL_TAB_COMMENTS
        • ALL_TAB_PARTITIONS
        • ALL_TAB_PRIVS
        • ALL_TAB_SUBPARTITIONS
        • ALL_TRIGGERS
        • ALL_TYPES
        • ALL_TYPE_ATTRS
        • ALL_TYPE_METHODS
        • ALL_USERS
        • ALL_VIEWS
        • AUDIT_ACTIONS
        • DBA_ALL_TABLES
        • DBA_ARGUMENTS
        • DBA_AUDIT_EXISTS
        • DBA_AUDIT_OBJECT
        • DBA_AUDIT_SESSION
        • DBA_AUDIT_STATEMENT
        • DBA_AUDIT_TRAIL
        • DBA_COLL_TYPES
        • DBA_COL_COMMENTS
        • DBA_COL_PRIVS
        • DBA_CONSTRAINTS
        • DBA_CONS_COLUMNS
        • DBA_ERRORS
        • DBA_INDEXES
        • DBA_IND_COLUMNS
        • DBA_IND_EXPRESSIONS
        • DBA_IND_PARTITIONS
        • DBA_IND_SUBPARTITIONS
        • DBA_METHOD_PARAMS
        • DBA_OBJECTS
        • DBA_OBJ_AUDIT_OPTS
        • DBA_PART_INDEXES
        • DBA_PART_KEY_COLUMNS
        • DBA_PART_TABLES
        • DBA_PROCEDURES
        • DBA_PROFILES
        • DBA_ROLES
        • DBA_ROLE_PRIVS
        • DBA_SCHEDULER_JOB_ARGS
        • DBA_SCHEDULER_PROGRAM_ARGS
        • DBA_SEGMENTS
        • DBA_SEQUENCES
        • DBA_SOURCE
        • DBA_STMT_AUDIT_OPTS
        • DBA_SUBPARTITION_TEMPLATES
        • DBA_SUBPART_KEY_COLUMNS
        • DBA_SYNONYMS
        • DBA_SYS_PRIVS
        • DBA_TABLES
        • DBA_TABLESPACES
        • DBA_TAB_COLS
        • DBA_TAB_COLUMNS
        • DBA_TAB_COMMENTS
        • DBA_TAB_PARTITIONS
        • DBA_TAB_PRIVS
        • DBA_TAB_SUBPARTITIONS
        • DBA_TRIGGERS
        • DBA_TYPES
        • DBA_TYPE_ATTRS
        • DBA_TYPE_METHODS
        • DBA_USERS
        • DBA_VIEWS
        • DBA_RECYCLEBIN
        • NLS_DATABASE_PARAMETERS
        • NLS_INSTANCE_PARAMETERS
        • NLS_SESSION_PARAMETERS
        • STMT_AUDIT_OPTION_MAP
        • USER_ALL_TABLES
        • USER_ARGUMENTS
        • USER_AUDIT_OBJECT
        • USER_AUDIT_SESSION
        • USER_AUDIT_STATEMENT
        • USER_AUDIT_TRAIL
        • USER_COLL_TYPES
        • USER_COL_COMMENTS
        • USER_COL_PRIVS
        • USER_CONSTRAINTS
        • USER_CONS_COLUMNS
        • USER_ERRORS
        • USER_INDEXES
        • USER_IND_COLUMNS
        • USER_IND_EXPRESSIONS
        • USER_IND_PARTITIONS
        • USER_IND_SUBPARTITIONS
        • USER_OBJECTS
        • USER_PART_INDEXES
        • USER_PART_KEY_COLUMNS
        • USER_PART_TABLES
        • USER_PROCEDURES
        • USER_PROFILES
        • USER_ROLE_PRIVS
        • USER_SEGMENTS
        • USER_SEQUENCES
        • USER_SOURCE
        • USER_SUBPARTITION_TEMPLATES
        • USER_SUBPART_KEY_COLUMNS
        • USER_SYNONYMS
        • USER_SYS_PRIVS
        • USER_TAB_SUBPARTITIONS
        • USER_TRIGGERS
        • USER_TABLES
        • USER_TABLESPACES
        • USER_TAB_COLS
        • USER_TAB_COLUMNS
        • USER_TAB_COMMENTS
        • USER_TAB_PARTITIONS
        • USER_TYPES
        • USER_TYPE_ATTRS
        • USER_TYPE_METHODS
        • USER_VIEWS
        • USER_RECYCLEBIN
        • ROLE_TAB_PRIVS
        • ROLE_SYS_PRIVS
        • ROLE_ROLE_PRIVS
        • DICTIONARY
        • DICT
      • Performance views
        • GV$LOCK
        • GV$CONCURRENT_LIMIT_SQL
        • GV$INSTANCE
        • GV$MEMORY
        • GV$MEMSTORE
        • GV$MEMSTORE_INFO
        • GV$OB_SQL_WORKAREA_MEMORY_INFO
        • GV$OUTLINE
        • GV$PLAN_CACHE_PLAN_EXPLAIN
        • GV$PLAN_CACHE_PLAN_STAT
        • GV$PLAN_CACHE_STAT
        • GV$PS_ITEM_INFO
        • GV$PS_STAT
        • GV$SERVER_MEMSTORE
        • GV$SESSION_WAIT
        • GV$SESSION_WAIT_HISTORY
        • GV$SESSTAT
        • GV$SQL_AUDIT
        • GV$SQL_WORKAREA
        • GV$SQL_WORKAREA_ACTIVE
        • GV$SQL_WORKAREA_HISTOGRAM
        • GV$SYSSTAT
        • GV$SYSTEM_EVENT
        • GV$GLOBAL_TRANSACTION
        • V$INSTANCE
        • V$MEMORY
        • V$MEMSTORE
        • V$MEMSTORE_INFO
        • V$NLS_PARAMETERS
        • V$OB_SQL_WORKAREA_MEMORY_INFO
        • V$PLAN_CACHE_PLAN_EXPLAIN
        • V$PLAN_CACHE_PLAN_STAT
        • V$PLAN_CACHE_STAT
        • V$PS_ITEM_INFO
        • V$PS_STAT
        • V$SESSION_WAIT
        • V$SESSION_WAIT_HISTORY
        • V$SESSTAT
        • V$SQL_AUDIT
        • V$SQL_WORKAREA
        • V$SQL_WORKAREA_ACTIVE
        • V$SQL_WORKAREA_HISTOGRAM
        • V$SYSSTAT
        • V$SYSTEM_EVENT
        • V$VERSION
        • V$SQL_MONITOR_STATNAME
        • V$RESTORE_POINT
        • V$GLOBAL_TRANSACTION
        • V$TIMEZONE_NAMES
        • V$LOCK
        • V$ENCRYPTED_TABLES
        • V$ENCRYPTED_TABLESPACES
    • System variables
      • System variable overview
      • auto_increment_increment
      • auto_increment_offset
      • autocommit
      • character_set_client
      • character_set_connection
      • character_set_results
      • character_set_system
      • collation_connection
      • interactive_timeout
      • last_insert_id
      • max_allowed_packet
      • sql_mode
      • time_zone
      • tx_isolation
      • version_comment
      • wait_timeout
      • binlog_row_image
      • character_set_filesystem
      • connect_timeout
      • datadir
      • debug_sync
      • div_precision_increment
      • group_concat_max_len
      • identity
      • lower_case_table_names
      • net_read_timeout
      • net_write_timeout
      • read_only
      • sql_auto_is_null
      • sql_select_limit
      • timestamp
      • tx_read_only
      • version
      • sql_warnings
      • max_user_connections
      • init_connect
      • license
      • net_buffer_length
      • system_time_zone
      • query_cache_size
      • query_cache_type
      • sql_quote_show_create
      • max_sp_recursion_depth
      • ob_default_replica_num
      • ob_proxy_partition_hit
      • ob_log_level
      • ob_max_parallel_degree
      • ob_query_timeout
      • ob_read_consistency
      • ob_enable_transformation
      • ob_trx_timeout
      • ob_enable_plan_cache
      • ob_enable_index_direct_select
      • ob_proxy_set_trx_executed
      • ob_enable_aggregation_pushdown
      • ob_last_schema_version
      • ob_global_debug_sync
      • ob_proxy_global_variables_version
      • ob_enable_trace_log
      • ob_enable_hash_group_by
      • ob_enable_blk_nestedloop_join
      • ob_bnl_join_cache_size
      • ob_org_cluster_id
      • ob_plan_cache_percentage
      • ob_plan_cache_evict_high_percentage
      • ob_plan_cache_evict_low_percentage
      • recyclebin
      • ob_capability_flag
      • ob_stmt_parallel_degree
      • is_result_accurate
      • error_on_overlap_time
      • ob_compatibility_mode
      • ob_create_table_strict_mode
      • ob_sql_work_area_percentage
      • ob_route_policy
      • ob_enable_transmission_checksum
      • foreign_key_checks
      • ob_enable_truncate_flashback
      • ob_tcp_invited_nodes
      • sql_throttle_current_priority
      • sql_throttle_priority
      • sql_throttle_rt
      • sql_throttle_network
      • auto_increment_cache_size
      • ob_enable_jit
      • ob_temp_tablespace_size_percentage
      • ob_timestamp_service
      • plugin_dir
      • undo_retention
      • ob_sql_audit_percentage
      • ob_enable_sql_audit
      • optimizer_use_sql_plan_baselines
      • optimizer_capture_sql_plan_baselines
      • parallel_max_servers
      • parallel_servers_target
      • ob_early_lock_release
      • ob_trx_idle_timeout
      • ob_reserved_meta_memory_percentage
      • nls_date_format
      • nls_timestamp_format
      • nls_timestamp_tz_format
      • nls_language
      • nls_territory
      • nls_sort
      • nls_comp
      • nls_characterset
      • nls_nchar_characterset
      • nls_date_language
      • nls_length_semantics
      • nls_calendar
      • nls_nchar_conv_excp
      • nls_numeric_characters
      • tracefile_identifier
      • transaction_isolation
      • ob_trx_lock_timeout
      • ob_trace_info
      • secure_file_priv
      • ob_pl_block_timeout
      • performance_schema
      • transaction_read_only
    • System configuration items
      • Overview of system configuration items
      • all_cluster_list
      • enable_unit_balance_resource_weight
      • plan_cache_high_watermark
      • plan_cache_low_watermark
      • sql_audit_queue_size
      • tenant_cpu_variation_per_server
      • max_stale_time_for_weak_consistency
      • sql_work_area
      • auto_leader_switch_interval
      • auto_delete_expired_backup
      • autoinc_cache_refresh_interval
      • audit_sys_operations
      • audit_trail
      • balancer_idle_time
      • balancer_log_interval
      • balancer_timeout_check_interval
      • balancer_task_timeout
      • balancer_tolerance_percentage
      • balancer_emergency_percentage
      • balance_blacklist_failure_threshold
      • balance_blacklist_retry_interval
      • backup_concurrency
      • backup_dest
      • backup_net_limit
      • backup_recovery_window
      • backup_region
      • builtin_db_data_verify_cycle
      • bf_cache_miss_count_threshold
      • bf_cache_priority
      • cache_wash_threshold
      • clog_cache_priority
      • clog_sync_time_warn_threshold
      • clog_disk_usage_limit_percentage
      • clog_transport_compress_all
      • clog_transport_compress_func
      • clog_persistence_compress_func
      • clog_max_unconfirmed_log_count
      • cluster
      • cluster_id
      • cpu_count
      • cpu_quota_concurrency
      • cpu_reserved
      • config_additional_dir
      • data_copy_concurrency
      • data_dir
      • datafile_disk_percentage
      • dtl_buffer_size
      • datafile_size
      • default_compress_func
      • default_compress
      • default_progressive_merge_num
      • default_row_format
      • devname
      • data_disk_usage_limit_percentage
      • disk_io_thread_count
      • dead_socket_detection_timeout
      • enable_clog_persistence_compress
      • election_cpu_quota
      • enable_one_phase_commit
      • enable_sys_unit_standalone
      • enable_pg
      • enable_smooth_leader_switch
      • election_blacklist_interval
      • enable_election_group
      • enable_auto_leader_switch
      • enable_global_freeze_trigger
      • enable_manual_merge
      • enable_merge_by_turn
      • enable_perf_event
      • enable_rebalance
      • enable_record_trace_log
      • enable_record_trace_id
      • enable_early_lock_release
      • enable_rereplication
      • enable_rich_error_msg
      • enable_rootservice_standalone
      • enable_sql_audit
      • enable_sql_operator_dump
      • enable_async_syslog
      • enable_syslog_recycle
      • enable_syslog_wf
      • enable_upgrade_mode
      • enable_separate_sys_clog
      • enable_ddl
      • enable_major_freeze
      • enable_rebuild_on_purpose
      • enable_log_archive
      • enable_monotonic_weak_read
      • external_kms_info
      • freeze_trigger_percentage
      • flush_log_at_trx_commit
      • fuse_row_cache_priority
      • force_refresh_location_cache_interval
      • force_refresh_location_cache_threshold
      • get_leader_candidate_rpc_timeout
      • global_major_freeze_residual_memory
      • global_write_halt_residual_memory
      • ignore_replay_checksum_error
      • global_index_build_single_replica_timeout
      • high_priority_net_thread_count
      • ignore_replica_checksum_error
      • ignore_replay_checksum_error
      • index_cache_priority
      • index_clog_cache_priority
      • index_info_block_cache_priority
      • internal_sql_execute_timeout
      • large_query_worker_percentage
      • large_query_threshold
      • leak_mod_to_check
      • lease_time
      • location_cache_cpu_quota
      • location_cache_expire_time
      • location_cache_priority
      • location_cache_refresh_min_interval
      • location_fetch_concurrency
      • location_refresh_thread_count
      • log_archive_checkpoint_interval
      • log_archive_concurrency
      • log_restore_concurrency
      • major_freeze_duty_time
      • max_kept_major_version_number
      • max_string_print_length
      • max_syslog_file_count
      • merge_stat_sampling_ratio
      • major_compact_trigger
      • memory_chunk_cache_size
      • memory_limit
      • memory_limit_percentage
      • memory_reserved
      • merge_thread_count
      • merger_check_interval
      • merger_completion_percentage
      • merger_switch_leader_duration_time
      • merger_warm_up_duration_time
      • max_px_worker_count
      • migration_disable_time
      • min_observer_version
      • minor_deferred_gc_time
      • minor_freeze_times
      • minor_warm_up_duration_time
      • mysql_port
      • minor_merge_concurrency
      • multiblock_read_gap_size
      • multiblock_read_size
      • micro_block_merge_verify_level
      • migrate_concurrency
      • minor_compact_trigger
      • memstore_limit_percentage
      • net_thread_count
      • obconfig_url
      • ob_enable_batched_multi_statement
      • partition_table_check_interval
      • partition_table_scan_batch_count
      • plan_cache_evict_interval
      • px_task_size
      • px_workers_per_cpu_quota
      • replica_safe_remove_time
      • resource_hard_limit
      • resource_soft_limit
      • rootservice_async_task_queue_size
      • rootservice_async_task_thread_count
      • rootservice_list
      • rootservice_ready_check_interval
      • row_compaction_update_limit
      • row_purge_thread_count
      • rpc_port
      • rpc_timeout
      • restore_concurrency
      • rootservice_memory_limit
      • rebuild_replica_data_lag_threshold
      • schema_history_expire_time
      • ssl_client_authentication
      • server_check_interval
      • server_data_copy_in_concurrency
      • server_data_copy_out_concurrency
      • server_permanent_offline_time
      • server_temporary_offline_time
      • stack_size
      • server_balance_critical_disk_waterlevel
      • server_balance_disk_tolerance_percent
      • system_memory
      • server_balance_cpu_mem_tolerance_percent
      • server_cpu_quota_max
      • server_cpu_quota_min
      • sql_audit_memory_limit
      • sys_bkgd_io_high_percentage
      • sys_bkgd_io_low_percentage
      • sys_bkgd_io_timeout
      • sys_bkgd_net_percentage
      • sys_bkgd_migration_change_member_list_timeout
      • sys_bkgd_migration_retry_num
      • syslog_level
      • switchover_process_thread_count
      • system_cpu_quota
      • sys_cpu_limit_trigger
      • system_trace_level
      • syslog_io_bandwidth_limit
      • tablet_size
      • tableapi_transport_compress_func
      • tenant_task_queue_size
      • tenant_groups
      • trace_log_slow_query_watermark
      • trace_log_sampling_interval
      • trx_2pc_retry_interval
      • trx_try_wait_lock_timeout
      • trx_force_kill_threshold
      • tde_method
      • token_reserved_percentage
      • unit_balance_resource_weight
      • user_block_cache_priority
      • user_row_cache_priority
      • user_tab_col_stat_cache_priority
      • user_iort_up_percentage
      • use_large_pages
      • virtual_table_location_cache_expire_time
      • workers_per_cpu_quota
      • wait_leader_batch_count
      • writing_throttling_maximum_duration
      • writing_throttling_trigger_percentage
      • weak_read_version_refresh_interval
      • workarea_size_policy
      • zone
      • zone_merge_concurrency
      • zone_merge_order
      • zone_merge_timeout
      • ob_ssl_invited_common_names
      • ssl_external_kms_info
      • ob_event_history_recycle_interval
      • backup_backup_dest
      • plsql_ccflags
      • plsql_code_type
      • plsql_debug
      • plsql_optimize_level
      • plsql_v2_compatibility
      • plsql_warnings
      • recyclebin_object_expire_time
      • log_archive_batch_buffer_limit
      • clog_disk_utilization_threshold
      • backup_backup_archive_log_batch_count
      • backup_backup_archivelog_retry_interval
      • backup_backupset_batch_count
      • backup_backupset_retry_interval
      • open_cursors
      • location_cache_refresh_rpc_timeout
      • location_cache_refresh_sql_timeout
      • backup_dest_option
      • backup_backup_dest_option
      • backup_zone
      • backup_log_archive_option
      • enable_tcp_keepalive
      • tcp_keepidle
      • tcp_keepintvl
      • tcp_keepcnt
    • Reserved keywords
  • FAQ
    • Product FAQ
    • Deployment FAQ
    • SQL FAQ
    • Storage FAQ
    • FAQ about primary and secondary databases
  • Version release records
    • V2.2
      • OceanBase Database V2.2.77

Download PDF

What is OceanBase Database? Benefits System architecture Features Compatibility with Oracle Database SQL data types Built-in functions System views Compatibility with MySQL Scenarios Technical standards Related services Overview Overall architecture Basic conceptsCluster management Tenant and resource managementData distributionReplicas and services Data balancingMulti-tenant architecture Compatibility modes System tenantGeneral tenantTable and table group Secondary index Tables without a primary keyViews High availability solutionDeployment modes REDO log management Isolation level Concurrency control GTS Local transactionDistributed transaction Distributed queryOverviewLSM-tree architecture MemTable Block storage (SSTable) Minor compaction and major compaction Caching Read and write process DDL Execution process of SQL queries Data linkODP Database driver OverviewBackup architecture Restoration architecture Backup setArchive log roundOverviewTypical scenariosProtection modeRole switchover Log transfer servicePrimary/standby database configuration Deployment introduction Deployment process Prepare servers Server configuration requirements Prepare the installation packages Deployment description Check after deployment Configure DNS (optional) Add an OBServer to the OCP resource pool Create an OceanBase cluster Deployment description Deploy OBProxyView available resources of a business tenant Create a tenant Verification after deployment Deployment description Check after deployment Deployment description Check after deployment Overview Connect to a MySQL tenant from a MySQL client Use OBClient to connect to an OceanBase Database tenant Database operations Table operations Index operations Insert data Query data Update data Delete data Commit a transaction Roll back a transaction Table-level operations Index operations Insert data Query data Update data Delete data Commit a transaction Roll back a transaction Basic database components
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. V2.2.77
iconOceanBase Database
SQL - V 2.2.77Enterprise Edition
SQL
KV
  • 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

ALTER SYSTEM

Last Updated:2023-08-18 09:26:34  Updated
share
What is on this page
BOOTSTRAP
JOB
MERGE
PARAMETER
REFRESH
REPLICA
ROOTSERVICE
SERVER
THROTTLE
UNIT
ZONE
CLUSTER
SWITCHOVER
BALANCE TASK
CANCEL MIGRATE UNIT
RESTORE
CHANGE TENANT
BACKUP
MAXIMIZE
DELETE BACKUPSET
DELETE OBSOLETE BACKUP

folded

share

ALTER SYSTEM

You can use the ALTER SYSTEM statement to send commands to OceanBase Database to perform a specified operation.

BOOTSTRAP

Description

You can use this statement to bootstrap OceanBase clusters.

Syntax

alter_system_bootstrap_stmt:
    ALTER SYSTEM BOOTSTRAP opt_cluster_type region_zone_server_list;
    
opt_cluster_type:
    [CLUSTER cluster_role]
 
cluster_role:
    PRIMARY | STANDBY
 
region_zone_server_list:
    region_zone_server [, region_zone_server ...]

region_zone_server:
    [region] zone server

region:
    REGION [=] region_name

zone:
    ZONE [=] zone_name

server:
    SERVER [=] ip_port

ip_port:
    'STR_VALUE:INT_VALUE'

Parameters

The information of RootServers that run the RootService must be specified during system bootstrap. Separate multiple RootServers with a comma (,).

Parameter Description
region_name The region where the RootServer is located. The region is specified in multi-region multi-center deployment.
zone_name The Zone to which the specified RootServer belongs.
ip_port The IP address and port of the specified RootServer.
PRIMARY | STANDBY The primary and standby clusters. The primary and standby clusters must be specified at system startup. Otherwise, the system boots from the primary cluster by default.

Example

  • Specify a RootServer:
ALTER SYSTEM BOOTSTRAP ZONE 'zone1' SERVER '10.218.248.178:55410';
  • Separate multiple RootsServers with commas (,):
ALTER SYSTEM BOOTSTRAP ZONE 'zone1' SERVER '172.24.65.24:55410', ZONE 'zone2' 
SERVER '172.24.65.114:55410';
  • Boot the standby cluster:
ALTER SYSTEM BOOTSTRAP CLUSTER STANDBY ZONE 'zone1' SERVER '10.218.248.178:55410';

JOB

Description

You can use this statement to trigger background jobs specified for parameters.

Syntax

alter_system_job_stmt:
ALTER SYSTEM RUN JOB job_name
[zone | server];

Parameters

Parameter Description
JOB job_name Specifies the job name. Single quotation marks (') are required for special characters, and optional in other cases. Supported jobs include: * check_partition_table: The OBServer runs the job to check and delete a partition table. * root_inspection: triggers a RootService inspection.
zone | server Specifies the zone or server to execute the job.

Example

  • Trigger a RootService inspection job.
ALTER SYSTEM RUN JOB "root_inspection";

MERGE

Description

You can use this statement to start a major compaction in the storage layer.

Syntax

alter_system_merge_stmt:
    ALTER SYSTEM merge_action;

merge_action:
      MAJOR FREEZE
    | MINOR FREEZE
      [tenant_list | replica] [server_list] [zone]
    | START MERGE
      zone
    | {SUSPEND | RESUME} MERGE
      [zone]
    | CLEAN MERGE ERROR

tenant_list:
    TENANT [=] (tenant_name_list)

tenant_name_list:
    tenant_name [, tenant_name ...]

replica:
    PARTITION_ID [=] 'partition_id%partition_count@table_id'

server_list:
    SERVER [=] ip_port_list

Parameters

Parameter Description
MAJOR FREEZE Initiates daily compaction.
MINOR FREEZE Initiates minor compaction.
START MERGE Starts daily compaction.
{SUSPEND | RESUME} MERGE Suspends or resumes daily compaction.
CLEAN MERGE ERROR Removes compaction error tags.
tenant_name Specifies a tenant for minor compaction.
PARTITION_ID Specifies a replica for minor compaction.
SERVER Specifies a server for minor compaction.
zone Specifies a zone for compaction.

Example

  • Initiate daily compaction.
OceanBase(root@oceanbase)>alter system major freeze;
Query OK, 0 rows affected (0.06 sec)

PARAMETER

Description

You can use this statement to modify configuration item information.

Syntax

alter_system_parameter_stmt:
    ALTER SYSTEM [SET]
    parameter_name = expression [SCOPE = {MEMORY | SPFILE | BOTH}] [COMMENT [=} 'text']
                                                            {SERVER [=] 'ip:port' | ZONE [=] 'zone'};

Parameters

Parameter Description
parameter_name Specifies the name of the configuration item to be modified.
expression Specifies the value of the configuration item after modification.
COMMENT 'text' Adds a comment on the modification. This parameter is optional. We recommend that this parameter is specified.
SCOPE Specifies the effective scope of the configuration item modification. Valid values: * MEMORY: indicates that only the configuration item in the MEMORY is modified, and the modification takes effect immediately. The modification becomes invalid after the server is restarted. However, no configuration item supports this modification. * SPFILE: indicates that only the configuration item value in the configuration table is modified. The modification takes effect after the server is restarted. * BOTH: indicates that the configuration item is modified in both the configuration table and the memory. The modification takes effect immediately and remains effective after the server is restarted. The default value is BOTH. If SCOPE is set to BOTH or MEMORY for configuration items of which the modifications do not take effect immediately, an error is returned.
SERVER Indicates modifying a configuration item of the specified server instance.
ZONE Indicates that the configuration item is modified for the specific server type of the specified cluster. If this parameter is not set, the configuration item is modified for the specific server type of all clusters.

Note

Separate multiple system configuration items to be modified with a comma (,).

Format of system configuration items: SHOW PARAMETERS [LIKE 'pattern' | WHERE expr];

Example

  • Modify the configuration item enable_sql_audit.
OceanBase(root@oceanbase)>show parameters like 'enable_sql_audit';
+------+----------+---------------+----------+------------------+-----------+-------+---------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+
| zone | svr_type | svr_ip        | svr_port | name             | data_type | value | info                                                                                                          | section  | scope   | source  | edit_level        |
+------+----------+---------------+----------+------------------+-----------+-------+---------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+
| z1   | observer | 11.11.111.111 |    19510 | enable_sql_audit | NULL      | True  | specifies whether SQL audit is turned on. The default value is TRUE. Value: TRUE: turned on FALSE: turned off | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
+------+----------+---------------+----------+------------------+-----------+-------+---------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+
1 rows in set (0.02 sec)

OceanBase(root@oceanbase)>alter system set enable_sql_audit = false scope = BOTH;
Query OK, 0 rows affected (0.05 sec)

OceanBase(root@oceanbase)>show parameters like 'enable_sql_audit';
+------+----------+---------------+----------+------------------+-----------+-------+---------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+
| zone | svr_type | svr_ip        | svr_port | name             | data_type | value | info                                                                                                          | section  | scope   | source  | edit_level        |
+------+----------+---------------+----------+------------------+-----------+-------+---------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+
| z1   | observer | 11.11.111.111 |    19510 | enable_sql_audit | NULL      | False | specifies whether SQL audit is turned on. The default value is TRUE. Value: TRUE: turned on FALSE: turned off | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
+------+----------+---------------+----------+------------------+-----------+-------+---------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+
1 rows in set (0.02 sec)

REFRESH

Description

You can use this statement series to trigger a refresh operation, including refreshing the schema, time zone information, and various caches.

Syntax

alter_system_refresh_stmt:
    ALTER SYSTEM refresh_action;

refresh_action:
      REFRESH SCHEMA
      [zone | server]
    | REFRESH TIME_ZONE_INFO
    | FLUSH cache_type CACHE
      [tenant_list] [GLOBAL]
    | FLUSH KVCACHE
      [tenant] [CACHE [=] cache_name]

cache_type:
      ALL
    | LOCATION
    | CLOG
    | ILOG
    | COLUMN_STAT
    | BLOCK_INDEX
    | BLOCK
    | ROW
    | BLOOM_FILTER
    | SCHEMA
    | PLAN

tenant:
    TENANT [=] tenant_name

cache_name:

Parameters

Parameter Description
REFRESH SCHEMA Refreshes the schema. When the system performs DDL operations, RootService notifies all OBServers to refresh the schema. If some OBServers are abnormal and disconnected from the RootService network, the schema needs to be manually refreshed on these servers. Schema refreshing can be performed for both a server and a cluster.
REFRESH TIME_ZONE_INFO Notifies all servers in the cluster to update the local time zone information.
FLUSH cache_type CACHE Clears the specified cache.
FLUSH KVCACHE Clears the KV cache. * If the tenant and cache_name parameters are specified, the specified KV cache of the specified tenant is cleared. * If only the tenant parameter is specified, all KV caches of the specified tenant are cleared. * If the tenant and cache_name parameters are specified, all KV caches of all tenants are cleared.

Example

  • Refreshing the schema of a single OBServer:
ALTER SYSTEM REFRESH SCHEMA SERVER='172.24.65.24:55410';
  • Refresh the schemas of the entire zone:
ALTER SYSTEM REFRESH SCHEMA ZONE='zone1';

REPLICA

Description

You can use this statement to perform various operations, such as moving, copying, and deleting replicas, converting replica types, and switching the roles of replicas.

Syntax

alter_system_replica_stmt:
    ALTER SYSTEM replica_action;

replica_action:
      SWITCH REPLICA
      {LEADER | FOLLOWER}
      {replica server | server [tenant_name] | zone [tenant_name]}
    | DROP REPLICA partition_id_desc
      replica server [create_timestamp] [zone] [FORCE]
    | {MOVE | COPY} REPLICA
      replica source destination
    | REPORT REPLICA partition_id_desc 
      {zone | server}
    | RECYCLE REPLICA partition_id_desc 
      {zone | server}
    | {ALTER | CHANGE | MODIFY} REPLICA  
      replica server [set] REPLICA_TYPE = replica_type

source:
    SOURCE [=] 'ip:port'

destination:
    DESTINATION [=] 'ip:port'
    
partition_id_desc
    PARTITION_ID partition_id%partition_count@table_id

partition_idx | partition_count | table_id | task_id:
    INT_VALUE

create_timestamp:
    CREATE_TIMESTAMP [=] INT_VALUE

tenant_name_list:
    tenant_name [, tenant_name ...]

replica_type:
      {FULL | F}
    | {READONLY | R}
    | {LOGONLY | L}

Parameters

Parameter Description
SWITCH REPLICA Reelects a leader.
DROP REPLICA Drops a replica. To drop a replica on a specified OBServer, you must specify the partition_id, create_timestamp, and the OBServer address.
{MOVE | COPY} REPLICA Moves or copies a replica. You must specify the source OBServer, destination OBServer, and partition_id.
REPORT REPLICA Forcibly makes an OBServer or all OBServers in a zone perform replica reporting.
RECYCLE REPLICA Reclaims unused replicas.
{ALTER | CHANGE | MODIFY} REPLICA Modifies replica attributes. You can modify the type of a specified replica. Supported replica types are FULL, READONLY, and LOGONLY.The value of replica_type can be the full name of the three replica types or their initial letter F, R, or L, which are case-insensitive.

Example

  • Moving a replica
ALTER SYSTEM MOVE REPLICA PARTITION_ID '0%4@1100611139403777'
SOURCE '172.24.65.24:55410'
DESTINATION '172.24.65.26:55410';
  • Drop a replica
ALTER SYSTEM DROP REPLICA PARTITION_ID '0%4@1100611139403777'
SERVER '172.24.65.26:55410';
  • Modify the type of a replica
ALTER SYSTEM CHANGE REPLICA PARTITION_ID '0%4@1100611139403777'
SERVER '172.24.65.26:55410';
CHANGE REPLICA_TYPE = 'L';
  • Reelect a leader
ALTER SYSTEM SWITCH REPLICA LEADER PARTITION_ID '0%4@1100611139403777'
SERVER '172.24.65.26:55410';

ROOTSERVICE

Description

Switch the RootServer (RS) role.

Syntax

alter_system_rootservice_stmt:
ALTER SYSTEM SWITCH ROOTSERVICE {LEADER | FOLLOWER} {zone | server};

Parameters

Parameter Description
LEADER | FOLLOWER Sets the RS role to Leader or Follower.
zone | server Modifies the RS role of a specified zone or server.

Example

  • Changing the RS of z1 to the leader
ALTER SYSTEM SWITCH ROOTSERVICE LEADER ZONE 'z1';

SERVER

Description

You can use this statement to maintain the status of OBServers in the system and control the add, delete, start, and stop operations of the OBServers.

Syntax

alter_system_server_stmt:
    ALTER SYSTEM server_action SERVER ip_port_list [zone];

server_action:
      ADD
    | DELETE
    | CANCEL DELETE
    | START
    | STOP
    | FORCE STOP

ip_port_list:
    ip_port [, ip_port ...]

Parameters

The following figure shows the server status.

image.png

Parameter Description
ip_port Specifies the IP address and port of an OBServer.
zone If a zone is specified, zone verification is performed for the server to be maintained.
ADD Adds a server.
DELETE Deletes a server.
CANCEL DELETE Cancels the deletion of a server.
START Starts a server.
STOP Stops a server.
FORCE STOP Forcibly stops a server.

Example

  • Adding a server
ALTER SYSTEM ADD SERVER '172.24.65.113:55410' ZONE 'zone1';

Notice

  • Run the Add and Delete commands to add servers to the service list. Only servers in the list can provide services.

  • The Delete operation reelects a leader and copies replicas.

  • The Delete operation takes a long time and can be canceled by using the Cancel command.

THROTTLE

Description

You can use this statement to configure feature throttling.

Syntax

alter_system_throttle_stmt:
    ALTER SYSTEM throttle_action;

throttle_action:
      ENABLE SQL THROTTLE [priority_option] [using_metric_option_list]
    | DISABLE SQL 

priority_option:
    FOR PRIORITY <= INT_VALUE

using_metric_option_list:
    USING metric_option_list

metric_option_list:
    metric_option [metric_option ...]

metric_option:
      RT = {INT_VALUE | DECIMAL_VALUE}
    | CPU = {INT_VALUE | DECIMAL_VALUE}
    | IO = INT_VALUE
    | NETWORK = {INT_VALUE | DECIMAL_VALUE}
    | QUEUE_TIME = {INT_VALUE | DECIMAL_VALUE}
    | LOGICAL_READS = {INT_VALUE | DECIMAL_VALUE}

Parameters

Parameter Description
ENABLE SQL Enables throttling. This parameter is followed by throttling features and eigenvalues.
FOR PRIORITY Specifies the priority for a throttling request to take effect only in specific sessions.
RT Performs throttling based on the request execution time.
CPU Performs throttling based on the CPU utilization, which is not supported.
IO Performs throttling based on the I/O times, which is not supported.
NETWORK Performs throttling based on the transmitted network traffic volume, which is not supported.
QUEUE_TIME Performs throttling based on the queue waiting time.
LOGICAL_READS Performs throttling based on the number of logical read times, which is not supported.
DISABLE SQL Disables throttling.

Example

  • Perform throttling for requests of which the waiting time exceeds 0.1s in sessions with a priority <= 100.
alter system enable sql throttle for priority <= 100 using queue_time=0.1

UNIT

Description

You can use this statement to migrate UNIT resources.

Syntax

alter_system_unit_stmt:
    ALTER SYSTEM MIGRATE
    UNIT [=] unit_id DESTINATION [=] ip_port

unit_id:
    INT_VALUE

Parameters

Parameter Description
unit_id The UNIT ID.
ip_port The destination server address to which the UNIT is to be migrated.

Example

  • Migrating UNIT 1001 to 11.11.111.111:19510
OceanBase(root@oceanbase)>alter system migrate unit = 1001 destination = '11.11.111.111:19510';
Query OK, 0 rows affected (0.05 sec)

ZONE

Description

You can use this statement to maintain the status of zones in the system and control the add, delete, start, and stop operations of the zones.

Syntax

alter_system_zone_stmt:
      ADD ZONE zone_name
      [zone_option_list]
    | {ALTER | CHANGE | MODIFY} ZONE zone_name
      [SET] zone_option_list
    | {DELETE | START | STOP | FORCE STOP} ZONE zone_name

zone_option_list:
    zone_option [, zone_option ...]

zone_option:
      region
    | idc
    | ZONE_TYPE {READONLY | READWRITE}

idc:
    STR_VALUE

Parameters

Parameter Description
ADD ZONE Adds a zone.
{ALTER | CHANGE | MODIFY} ZONE Modifies the Region attribute of a zone. Note The functions of the ALTER, CHANGE, and MODIFY commands are the same. They all can be used to modify the Region attribute of a zone.
DELETE ZONE Deletes a zone. Ensure that the zone to be deleted does not contain any server.
START | STOP Starts or stops a zone.

Example

  • Deleting a zone
OceanBase(root@oceanbase)>alter system delete zone 'z1';
ERROR 4668 (HY000): The zone is not empty and cannot be deleted. You should delete the servers of the zone. There are 1 servers alive and 0 not alive.

CLUSTER

Description

You can use this statement for cluster management, including adding, deleting, or modifying cluster attributes.

Syntax

ALTER SYSTEM  cluster_action cluster_name CLUSTER_ID INTNUM;
cluster_action:
    ADD CLUSTER
    | REMOVE CLUSTER
    | ENABLE CLUSTER SYNCHRONIZATION
    | DISABLE CLUSTER SYNCHRONIZATION
    | MODIFY CLUSTER REDO_TRANSPORT_OPTIONS = 'SYNC|ASYNC'

Parameters

Parameter Description
ADD CLUSTER Adds a standby cluster.
REMOVE CLUSTER Deletes an existing standby cluster.
ENABLE CLUSTER SYNCHRONIZATION Allows the synchronization of a standby cluster.
DISABLE CLUSTER SYNCHRONIZATION Disables the synchronization of a standby cluster.
MODIFY CLUSTER REDO_TRANSPORT_OPTIONS Modifies the log synchronization mode of a standby cluster in the primary cluster. * SYNC: strong synchronization * ASYNC: asynchronous synchronization The default synchronization mode is ASYCN.

Example

  • Adding a standby cluster
ALTER SYSTEM ADD CLUSTER 'ob1.test' cluster_id = 1;

SWITCHOVER

Description

You can use this statement for lossless and lossy switchover of clusters to switch over the roles between the primary cluster and a standby cluster.

Syntax

ALTER SYSTEM commit_switchover_clause;

commit_switchover_clause:
    COMMIT TO SWITCHOVER TO PRIMARY
    | COMMIT TO SWITCHOVER TO PHYSICAL STANDBY
    | ACTIVATE PHYSICAL STANDBY CLUSTER
    | CONVERT TO PHYSICAL STANDBY   

Parameters

Parameter Description
COMMIT TO SWITCHOVER TO PRIMARY Changes the role of a secondary cluster to the primary cluster. Execute this clause on a standby cluster after the original primary cluster becomes the primary cluster. Do not execute this command when another standby cluster is set as the primary cluster.
COMMIT TO SWITCHOVER TO PHYSICAL STANDBY Changes the role of the primary cluster to a standby cluster without data loss. Execute this clause on the primary cluster after all data is synchronized to the standby cluster.
ACTIVATE PHYSICAL STANDBY CLUSTER Changes a standby cluster to the primary cluster when the original primary cluster is down.
CONVERT TO PHYSICAL STANDBY Changes the primary cluster to a standby cluster.

Example

  • Changing the primary cluster to a standby cluster
ALTER SYSTEM COMMIT TO SWITCHOVER TO PHYSICAL STANDBY;
  • Change a standby cluster to the primary cluster
ALTER SYSTEM COMMIT TO SWITCHOVER TO PRIMARY;
  • Change a standby cluster to the primary cluster when the original primary cluster is down
ALTER SYSTEM ACTIVATE PHYSICAL STANDBY CLUSTER;
  • Restarte the original primary cluster and change it to a standby cluster
ALTER SYSTEM CONVERT TO PHYSICAL STANDBY;

BALANCE TASK

Description

You can use this statement to clear load balancing tasks that are not being scheduled.

Syntax

ALTER SYSTEM REMOVE BALANCE TASK opt_tenant_list opt_zone_list opt_balance_task_type;

opt_tenant_list
    TENANT [=] name,name_list
    
opt_zone_list
    ZONE [=] zone_name, zone_list
    
opt_balance_task_type
    ALL
    | MANUAL
    | AUTO

Parameters

Parameter Description
opt_tenant_list The tenant list. If it is not specified, the tasks of all tenants are cleared.
opt_zone_list Optional. The zone list.
opt_balance_task_type The type of tasks to be cleared. * ALL: all tasks * AUTO: tasks automatically generated * MANUAL: tasks manually initiated by users

Example

  • Clearing all tasks of all tenants that are not being scheduled
ALTER SYSTEM REMOVE BALANCE TASK;

CANCEL MIGRATE UNIT

Description

You can use this statement to cancel UNIT migration.

Syntax

ALTER SYSTEM CANCEL MIGRATE UNIT unit_id;

Parameters

Parameter Description
unit_id The ID of the migrated UNIT.

Example

  • Cancel the migration of UNIT 1001.
ALTER SYSTEM CANCEL MIGRATE UNIT 1001;

RESTORE

Description

You can use this statement to restore the data of tenants.

Syntax

ALTER SYSTEM RESTORE [table_name_list FOR] dest_tenant FROM source_tenant AT 'url' UNTIL 'timestamp' WITH 'restore_option';

Parameters

Parameter Description
table_name_list Specifies the tables to be restored in a tenant. The table names in the list must contain the database (MySQL tenant) or user (Oracle tenant) to which the table belongs.
dest_tenant The name of the destination tenant to which the data is to be restored.
source_tenant The name of the source tenant of which the data is backed up.
url The value of backup_dest specified during backup.
timestamp The restoration timestamp, which must be later than or equal to START_TIME in the CDB_OB_BACKUP_SET_DETAILS view of the earliest data backup, and earlier than or equal to MAX_NEXT_TIME in the CDB_OB_BACKUP_ARCHIVELOG_SUMMARY view of the log backup.
restore_option The restoration options. Valid values: * backup_cluster_name: Required. The name of the source cluster. * backup_cluster_id: Required. The ID of the source cluster. * pool_list: Required. The resource pool of users. * locality: Optional. The locality of the tenant. * kms_encrypt: Optional. The value true indicates specifying kms_encrypt_info during restoration.

Example

  • Restore the data of a tenant.
ALTER SYSTEM RESTORE restored_trade FROM trade 
    AT 'oss://antsys-oceanbasebackup/backup_rd/20200323?host=cn-hangzhou-alipay-b.oss-cdn.aliyun-inc.com&access_id=xxx&access_key=xxx'
  UNTIL ' 2020-03-23 08:59:45'
  WITH 'backup_cluster_name=ob20daily.backup&backup_cluster_id=1&pool_list=restore_pool';
 
ALTER SYSTEM RESTORE restored_trade FROM trade 
  AT 'file:///data/nfs/physical_backup_test/20200520'
  UNTIL '2020-05-21 09:39:54.071670' 
  WITH 'backup_cluster_name=ob20daily.backup&backup_cluster_id=1&pool_list=restore_pool';
  • Restore the data of specified tables in a tenant.
ALTER SYSTEM RESTORE `crm`.`sales`, `crm`.`products`, `hr`.`employees` FOR new_tenant1 FROM tenant1 
AT 'oss://antsys-oceanbasebackup/backup_rd/?host=cn-hangzhou-alipay-b.oss-cdn.aliyun-inc.com&access_id=xxx&access_key=xxx' 
UNTIL '2021-02-28 08:59:45' 
WITH 'backup_cluster_name=ob20daily.backup&backup_cluster_id=1&pool_list=restore_pool';

CHANGE TENANT

Description

You can use this statement to switch tenants.

Syntax

ALTER SYSTEM CHANGE TENANT tenant_name;

ALTER SYSTEM CHANGE TENANT TENANT_ID [=] INTNUM;

Parameters

Parameter Description
tenant_name The name of the target tenant.
TENANT_ID The ID of the target tenant.

Example

  • Changing to the tenant with the ID of 1001
ALTER SYSTEM CHANGE TENANT TENANT_ID = 1001;

Note

  1. The preceding command must be executed in a system tenant.

  2. This command must be executed during direct connection with the OBServer and be executed again after disconnection.

  3. This command cannot be executed during transaction execution.

  4. DDL operations cannot be performed after you switch to a non-system tenant.

BACKUP

Description

You can use this statement to trigger a backup.

Syntax

//Set the backup media path
ALTER SYSTEM SET backup_dest = <backup_uri>;
//Enable log archiving
ALTER SYSTEM ARCHIVELOG;
//Disable log archiving
ALTER SYSTEM NOARCHIVELOG;
//Trigger a baseline backup (only cluster-level backup is supported)
ALTER SYSTEM BACKUP DATABASE;
//Cancel the current backup
ALTER SYSTEM CANCEL BACKUP;
//Set the backup media path for the secondary backup
ALTER SYSTEM SET backup_backup_dest = <backup_backup_uri>;
//Perform secondary backup on log backups
ALTER SYSTEM BACKUP BACKUPPIECE ALL NOT BACKED UP N TIMES [tenant_id = N] [tenant_name = name] [backup_backup_dest=uri];
ALTER SYSTEM BACKUP BACKUPPIECE [= N] [tenant_id = N] [tenant_name = name]  [backup_backup_dest=uri] [WITH ACTIVE BACKUPPIECE];
//Cancel the ongoing secondary backup on log backups
ALTER SYSTEM CANCEL BACKUP BACKUPPIECE;
//Perform secondary backup on data backups
ALTER SYSTEM BACKUP BACKUPSET ALL NOT BACKED UP N TIMES [tenant_id = N] [tenant_name = name] [backup_backup_dest=uri];
ALTER SYSTEM BACKUP BACKUPSET = N [tenant_id = N] [tenant_name = name]  [backup_backup_dest=uri];
//Cancel the ongoing secondary backup on data backups
ALTER SYSTEM CANCEL BACKUP BACKUPSET;
//Enable automatic secondary backup of log backups
ALTER SYSTEM START BACKUP ARCHIVELOG;
//Disable automatic secondary backup of log backups
ALTER SYSTEM STOP BACKUP ARCHIVELOG;

Parameters

Parameter Description
backup_dest Specifies the path to store the backup data. You can set it to an Object Storage Service (OSS) bucket or a file. For more information about the syntax, see the following example.
backup_backup_dest Specifies the path to store the secondary backup. You can set it to an OSS bucket or a file.
tenant_id Specifies the ID of the tenant.
tenant_name Specifies the name of the tenant.
BACKUPPIECE ALL NOT BACKED UP N TIMES Performs secondary backup on log backups whose number of copies is less than N.
BACKUPPIECE [= N] Performs secondary backup on log backups with the specified BACKUPPIECE ID. If you specify WITH ACTIVE BACKUPPIECE, the active log backup will also be backed up.
BACKUPSET ALL NOT BACKED UP N TIMES Performs secondary backup on data backups whose number of copies is less than N.
BACKUPSET = N Performs secondary backup on data backups with the specified BACKUPSET ID.

Example

  • Setting the path to store the backup data
alter system set backup_dest='oss://antsys-oceanbasebackup/backup_dir?host=xxx&access_id=xxx&access_key=xxx';
alter system set backup_dest='file:///data/nfs/physical_backup_dir';
  • Performing secondary backup on log backups.
alter system backup backuppiece all not backed up 2 times backup_backup_dest= 'file:///ob_backup_backup/ob_cluster_1_backup_piece_20200125';
alter system backup backuppiece 1 tenant_name tenant_1 backup_backup_dest= 'file:///ob_backup_backup/ob_cluster_1_backup_piece_20200225';

Note

The preceding command must be executed in a system tenant.

MAXIMIZE

Description

You can use this statement to set the protection mode of the primary and standby clusters. You can execute this statement only in the primary cluster.

Syntax

ALTER SYSTEM SET STANDBY CLUSTER TO MAXIMIZE {AVAILABILITY | PERFORMANCE | PROTECTION};

Parameters

Parameter Description
AVAILABILITY The mode that provides the maximum availability.
PERFORMANCE The mode that provides the maximum performance. This is the default mode.
PROTECTION The mode that provides the maximum protection.

Example

  • Setting the protection mode of the primary and standby clusters to AVAILABILITY.
ALTER SYSTEM SET STANDBY CLUSTER TO MAXIMIZE AVAILABILITY;

DELETE BACKUPSET

Description

You can use this statement to clear a backup.

Syntax

ALTER SYSTEM DELETE BACKUPSET backup_set_id

Parameters

Parameter Description
backup_set_id The ID of the backup_set corresponding to the backup to be cleared. An ID is generated when a backup is initiated. The ID can be queried in the CDB_OB_BACKUP_SET_DETAILS view.

Example

  • Clear the backup data of which the backup_set_id is 1.
ALTER SYSTEM DELETE BACKUPSET 1;

DELETE OBSOLETE BACKUP

Description

You can use this statement to clear expired backup data. Note

Set the expiration time before you use this statement to clear expired backup data.

Syntax

ALTER SYSTEM SET backup_recovery_window = <expiration time>;
ALTER SYSTEM DELETE OBSOLETE BACKUP;

Parameters

Parameter Description
backup_recovery_window The recovery time window for backup data. The default value is 0, indicating that the backup data is retained permanently. We recommend that you set this parameter to 7d, which indicates that the backup data is retained for one week and will be cleared afterward.

Example

  • Setting the expiration time of backup data to one week, after which the backup data will be cleared
ALTER SYSTEM SET backup_recovery_window = '7d';
ALTER SYSTEM DELETE OBSOLETE BACKUP;

Previous topic

ALTER RESOURCE UNIT
Last

Next topic

ALTER TABLE
Next
What is on this page
BOOTSTRAP
JOB
MERGE
PARAMETER
REFRESH
REPLICA
ROOTSERVICE
SERVER
THROTTLE
UNIT
ZONE
CLUSTER
SWITCHOVER
BALANCE TASK
CANCEL MIGRATE UNIT
RESTORE
CHANGE TENANT
BACKUP
MAXIMIZE
DELETE BACKUPSET
DELETE OBSOLETE BACKUP