This topic describes the compatibility between OceanBase Database's Oracle mode and native Oracle Database.
OceanBase Database is compatible with Oracle Database in terms of basic features, including the data types, SQL features, and database objects. OceanBase Database is compatible with most Procedural Language (PL)-related R&D features of Oracle Database. In terms of advanced features such as database security, backup and restore, high availability, and optimizer, OceanBase Database provides sound compatibility with and even outperforms Oracle Database. Therefore, you can smoothly migrate data and services from Oracle Database to OceanBase Database without spending much time learning everything about OceanBase Database.
However, due to the differences in the underlying architecture and product form between the two, OceanBase Database does not support some features of Oracle Database and differs from Oracle Database in some aspects. This topic describes the compatibility between OceanBase Database's Oracle mode and Oracle Database in the following aspects:
SQL data types
Built-in functions
SQL syntaxes
Procedural Language (PL) features
System views
Character sets
Collations
Database object management
Security features
Backup and restore
SQL engine
SQL data types
OceanBase Database is compatible with most of the data types supported by Oracle Database. For more information, see SQL data types.
However, for optimization reasons, the LONG and LONG RAW data types are considered too outdated, and OceanBase Database currently has no plans to support these two data types.
Built-in functions
OceanBase Database is compatible with most of the built-in functions supported by Oracle Database. For more information, see Built-in functions.
SQL syntaxes
OceanBase Database supports most of the SQL syntaxes in Oracle Database. For some unsupported SQL syntaxes, OceanBase Database will return an "unsupported syntax" error to indicate that the corresponding features are unavailable.
SELECT
Supports most query features, including single- and multi-table queries, subqueries, lateral derived tables, inner joins, semi joins, outer joins, grouping, aggregation, hierarchical queries, and regular data mining functions such as probability and linear regression functions.
Supports the following collection operations:
UNION,UNION ALL,INTERSECT, andMINUS.Supports the
EXPLAINstatement for viewing execution plans.
INSERT
Supports single- and multi-row inserts. OceanBase Database also supports inserting data into a specified partition.
Supports the
INSERT INTO ... SELECT ...statement.Supports single- and multi-table inserts.
UPDATE
Supports single- and multi-column updates.
Supports updates by using subqueries.
Supports collection updates.
DELETE
- Supports single- and multi-table deletion.
TRUNCATE
- Supports the truncation of a specified table.
Parallel queries
Supports parallel queries similar to those in Oracle Database.
OceanBase Database supports the auto degree of parallelism (DOP) feature. You can also manually specify the DOP by using hints or session variables.
Supports parallel DML statements.
Hint
OceanBase Database supports hints. For more information about hints, see Hints.
PL features
OceanBase Database is compatible with most PL features of Oracle Database. For more information about PL features, see PL reference.
OceanBase Database supports the following PL features of Oracle Database:
Data types
Process control
Collections and records
Static SQL statements
Dynamic SQL statements
Subprograms
Triggers
Exception handling
Packages
Performance optimization
Custom data types
PL packages, including
DBMS_CRYPTO,DBMS_DEBUG,DBMS_LOB,DBMS_LOCK,DBMS_METADATA,DBMS_OUTPUT,DBMS_RANDOM,DBMS_SQL,DBMS_XA,UTL_I18N, andUTL_RAWPL label security packages, including
SA_SYSDBA,SA_COMPONENTS,SA_LABEL_ADMIN,SA_POLICY_ADMIN,SA_USER_ADMIN, andSA_SESSION
System views
OceanBase Database is compatible with some system views of Oracle Database, including:
195 dictionary views
20 performance views whose names are prefixed with V$
For a detailed list of compatible views, see System views.
For more information about columns in system views, see Outline of system views.
Character sets
OceanBase Database supports the following character sets:
- binary
- utf8mb4
- gbk
- utf16
- gb18030
- latin1
- gb18030_2022
- ascii
- tis620
- utf16le
- sjis
- hkscs
- hkscs31
- dec8
Collations
The following table describes the collations supported by OceanBase Database.
| Collation | Character set | Description |
|---|---|---|
| utf8mb4_general_ci | utf8mb4 | A general collation. |
| utf8mb4_bin | utf8mb4 | A binary collation. |
| utf8mb4_unicode_ci | utf8mb4 | A collation that is based on Unicode Collation Algorithm (UCA). |
| binary | binary | A binary collation. |
| gbk_chinese_ci | gbk | A collation for Chinese. |
| gbk_bin | gbk | A binary collation. |
| utf16_general_ci | utf16 | A general collation. |
| utf16_bin | utf16 | A binary collation. |
| utf16_unicode_ci | utf16 | A collation that is based on UCA. |
| gb18030_chinese_ci | gb18030 | A collation for Chinese. |
| gb18030_bin | gb18030 | A binary collation. |
| latin1_bin | latin1 | latin1 A binary collation. |
| gb18030_2022_bin | gb18030_2022 | A binary collation. This is the default collation for this character set in Oracle mode. |
| gb18030_2022_chinese_ci | gb18030_2022 | A collation that sorts data by Pinyin. The collation is case-insensitive. |
| gb18030_2022_chinese_cs | gb18030_2022 | A collation that sorts data by Pinyin. The collation is case-sensitive. |
| gb18030_2022_radical_ci | gb18030_2022 | A collation that sorts data by radicals. The collation is case-insensitive. |
| gb18030_2022_radical_cs | gb18030_2022 | A collation that sorts data by radicals. The collation is case-sensitive. |
| gb18030_2022_stroke_ci | gb18030_2022 | A collation that sorts data by strokes. The collation is case-insensitive. |
| gb18030_2022_stroke_cs | gb18030_2022 | A collation that sorts data by strokes. The collation is case-sensitive. |
| ascii_bin | ascii | A binary collation. |
| ascii_general_ci | ascii | A collation that sorts data in alphabetical order. The collation is case-insensitive. |
| tis620_bin | tis620 | A binary collation. |
| tis620_thai_ci | tis620 | A collation for Thai. The collation is case-insensitive. |
Database object management
Table management
Create tables: OceanBase Database allows you to create tables and specify partitions and constraints when you create a table. For more information about the syntax for creating tables, see CREATE TABLE.
Modify base tables: OceanBase Database allows you to use the
ALTER TABLEstatement to add, drop, or modify columns, add or drop constraints, and add, drop, or modify partitions. For more information about the syntax for modifying tables, see ALTER TABLE.Drop base tables: OceanBase Database allows to you drop tables and the constraints on the tables. For more information about the syntax for dropping tables, see DROP TABLE.
Constraints
Supports the
CHECK,UNIQUE, andNOT NULLconstraints.Supports the
PRIMARY KEYconstraint.Supports the
FOREIGN KEYconstraint.Allows you to add
CHECK,PRIMARY KEY,FOREIGN KEY, andNOT NULLconstraints by executing theALTER TABLEstatement.Supports the
SET NULLconstraint for cascaded tables.
Partition support
Supports partitioning, template-based subpartitioning, and non-template-based subpartitioning.
Supports HASH, RANGE, LIST, and composite partitioning.
Supports local and global indexes.
For partition maintenance, take note of the following points:
You can add, drop, and truncate partitions for partitioned tables.
You can add and drop partitions for template-based subpartitioned tables, and add, drop, and truncate partitions and subpartitions for non-template-based subpartitioned tables.
For more information about partitioning, see Overview.
Index management
Supports only B-tree indexes.
Allows you to create and drop indexes.
View management
Allows you to create simple and complex views.
Allows you to drop views.
Allows you to use the
SELECTstatement to query views.Supports DML statements.
Sequence management
Allows you to create sequences.
Allows you to modify sequences. For example, you can reset sequences.
Allows you to drop sequences.
Synonym
Allows you to create synonyms for objects such as tables, views, synonyms, and sequences.
Allows you to create public synonyms.
Trigger management
Allows you to create triggers.
Allows you to modify triggers.
Allows you to drop triggers.
DBLinks
Supports read and write operations on an OceanBase database by using a DBLink.
Supports read and write operations on an Oracle database by using a DBLink.
Constraints
- Does not support
DISABLEoperations for theUNIQUEconstraint.
Partition support
- Does not allow you to add or drop subpartitions for template-based subpartitioned tables.
Index management
- Does not support index types such as bitmap indexes or reverse indexes.
Updatable views
Does not support the WITH CHECK OPTION clause.
Security features
OceanBase Database implements a wide range of security features.
Privilege management
Compatible with most system privileges in Oracle Database. For more information about the privileges supported by the Oracle mode of OceanBase Database, see Privilege types in Oracle mode.
Supports regular object privilege management operations such as privilege granting and revocation.
Supports allowlist configuration for secure network access control.
Supports predefined system roles and custom roles.
Identity authentication
Compatible with the password strategies of Oracle Database.
Supports user locking and unlocking.
TDE
OceanBase Database is compatible with the transparent data encryption (TDE) feature of Oracle Database. Data is automatically encrypted before it is written to storage devices and automatically decrypted when it is read.
Auditing
Supports the standard auditing feature of Oracle Database.
Supports statement auditing and object auditing.
Supports only tables, sequences, functions, and packages for object auditing.
Allows you to store audit data in files or internal tables.
Provides various audit-related system views.
Label security
Compatible with the Oracle Label Security feature of Oracle Database.
Supports the level component of Oracle Label Security.
SSL-based transmission link encryption
Offers the ability to encrypt data transmission both between clients and OBServer nodes and between OBServer nodes themselves.
Supports one-way Secure Sockets Layer (SSL) authentication, two-way X509 authentication, as well as additional special two-way authentication mechanisms, such as specifying the encryption algorithm, issuer, and SSL subject for authentication.
Auditing
Does not support unified auditing or fine-grained auditing (FGA).
Does not support privilege auditing or network auditing.
Does not allow you to delete audit data.
Label security
- Does not support the compartment component or group component of Oracle Label Security.
Backup and restore
OceanBase Database also supports backup and restore features. For more information about the physical backup and restore features of OceanBase Database, see Overview.
Allows you to use Network File System (NFS), Alibaba Cloud Object Storage Service (OSS), Tencent Cloud Object Storage (COS), Amazon Simple Storage Service (S3), and object storage services compatible with the S3 protocol as the backup media.
Supports automatic cleanup of expired backups.
Supports backup and restore at the tenant level.
Supports restore at the database and table levels.
Supports restore to a specified path.
Does not support backup and restore at the cluster level.
Does not support backup to a specified path.
Does not support database- or table-level backup within a tenant.
Does not support compression for log archives.
Does not support manual cleanup of backups.
Does not support second backup.
Does not support the verification of backup data.
SQL engine
The SQL engine of OceanBase Database is compatible with most features of Oracle Database. For more information about the SQL engine of OceanBase Database, see SQL tuning.
Supports query rewriting.
Supports precompiled statements.
Supports the cost-based optimizer.
Supports the generation and display of execution plans by using the
EXPLAINstatement.Supports the plan cache.
Supports fast parameterization of execution plans.
Supports execution plan binding.
Supports optimizer hints.
Supports adaptive cursor sharing (ACS).
Supports SQL plan management (SPM).
Does not support the estimator.
Does not support execution plan isolation.
Does not support expression statistics store (ESS).
Does not support approximate query processing (AQP).