V4.2.1 GA
Version information
- Release date: September 28, 2023
- Version: V4.2.1 GA
- RPM version: oceanbase-4.2.1.0-100000182023092722
Overview
OceanBase Database V4.2.1 is the first long-term support (LTS) version in the V4.2.x series. This version introduced new features compatible with MySQL, such as the VALUES statement and JSON_TABLE expression. It also provides compatibility with Oracle through features like DBLink for package calling and sequence reading. Additionally, this version introduced the Workload Repository (WR)-based data collection framework and enhanced end-to-end diagnostic capabilities for commercialization. It optimized system resource utilization and supports table-level restore and Tencent Cloud Object Storage (COS). This version is recommended in production environments for routine business operations both in the cloud and offline.
Key features
Compatibility with MySQL
VALUESstatementThe
VALUESstatement was introduced in MySQL 8.0.19. It can be used to quickly construct a table of data or as a standalone DML statement with support forORDER BYandLimitclauses. It can also be used as a special table in regular DML statements. OceanBase Database V4.2.1 is compatible with MySQL Database and supports theVALUESstatement, making table value construction more convenient and easy to use. For more information, see VALUES.RENAME COLUMNThe
RENAME COLUMNsyntax was supported since MySQL 8.0. It allows users to rename columns without changing their definitions, which is more lightweight than theCHANGE COLUMNsyntax. OceanBase Database is compatible with theRENAME COLUMNsyntax of MySQL 8.0 since V4.2.1. For more information, see RENAME COLUMN.
Compatibility with Oracle
Extended DBLink capabilities
In OceanBase Database V4.1.0, the Oracle mode already supported the ability to read and write native Oracle tables through DBLink. Starting from V4.2.1, it also supports reading remote packages through DBLink. After you establish a connection with Oracle Database, you can call remote stored procedures by using a string in the format of
remote stored procedure name @DBLink namein the Oracle tenant of OceanBase Database. You can also call a stored procedure by using remote synonyms defined in the remote database or local synonyms defined in DBLink. For more information, see PL DBLink.In addition, OceanBase Database V4.2.1 supports access to remote
SEQUENCEobjects. Similar to data tables, you can access remoteSEQUENCEobjects, including calculating theNEXTVALandCURRVALvalues ofSEQUENCEobjects, by using a string in the format ofSEQUENCE object name @DBLink name.Partition or subpartition renaming
Oracle Database supports the
RENAME PARTITIONandRENAME SUBPARTITIONsyntax for renaming a partition or subpartition. OceanBase Database has supported partitioned and subpartitioned tables since its early versions but lacked a simple method to change partition names. Starting from V4.2.1, OceanBase Database is compatible with theRENAME PARTITIONandRENAME SUBPARTITIONsyntax of Oracle Database, making it easier to rename partitions or subpartitions. For more information, see Rename a partition or subpartition.
OBKV features
JSON_TABLEexpressionJSON is a semi-structured data format where users can extract specific values from JSON strings based on a path. The
JSON_TABLEexpression allows users to convert semi-structured data into structured data. The earlier versions of OceanBase Database already supported the JSON data type in both MySQL mode and Oracle mode, but theJSON_TABLEexpression was not implemented in MySQL mode. To meet the needs of users who want to convert JSON data into structured data for computations, OceanBase Database V4.2.1 also supports this expression in MySQL mode. For more information, see JSON_TABLE.OBKV TTL
Time-to-live (TTL) is a commonly used feature in NoSQL databases, designed to automatically expire data. For example, in businesses that deal with historical data, there is a need to periodically scan the data, determine its expiration time, and delete it accordingly. Many businesses currently rely on the TableAPI of OBKV. To simplify the management of periodic data, OceanBase Database provided the OBKV TTL capability since V4.2.1. Users can define TTL attributes at the table or row level using the
CREATE TABLEstatement so that expired data is not processed during read and write operations in OBKV. For more information, see TTL.
Performance improvements
Concurrent execution of
CREATE TABLEIn the earlier versions of OceanBase Database, DDL requests were executed serially in RootService queues. Starting from OceanBase Database V4.1.0, the concurrent DDL capability was introduced, with support for concurrent execution of
TRUNCATE TABLE. To address the performance issues related to schema migration for tables with millions of data rows, V4.2.1 now supports concurrent execution ofCREATE TABLE, providing a performance improvement of tenfold or even more compared with serial execution.Improved foreign key check performance
Prior to OceanBase Database V4.2.1, foreign key checks were implemented using nested SQL statements, incurring significant overhead. From V4.2.1, foreign key checks are performed using Database Autonomy Service (DAS) tasks, and batch checks in single-table DML operations is supported. Additionally, with the check result caching strategy, noticeable performance improvements have been achieved in
INSERTandUPDATEscenarios. In a single-node scenario (where the parent table and child table are on the same node), the performance degradation caused by foreign key checks duringINSERTandUPDATEoperations on foreign key tables is generally controlled to around 10% compared with tables without foreign keys. In a distributed scenario (where the parent table and child table are on different nodes), the performance degradation is generally controlled to around 30% compared with tables without foreign keys duringINSERTandUPDATEoperations.Dynamic sampling on MemTables
OceanBase Database V4.2.0 introduced the dynamic sampling feature, which samples data during the generation of an execution plan. When the number of rows in the SSTable exceeds that in the MemTable, dynamic sampling is performed on SSTable blocks. When the number of rows in the MemTable exceeds that in the SSTable, dynamic sampling is performed on the MemTable. In V4.2.0, this was achieved through full read of the MemTable, which was relatively inefficient. However, in V4.2.1, direct sampling for the MemTable is implemented, utilizing RANGE partitioning to perform interval reads. This enhancement significantly improves the efficiency of dynamic sampling on the MemTable.
Parallel read of archived logs
In OceanBase Database V4.1.0, OceanBase Change Data Capture (CDC) can read archived logs through the CDC service or directly read logs from the archive destination. In V4.2.0, a network-based standby database reuses the log pulling framework of OceanBase CDC to pull logs from the primary database by using the CDC service. After the CDC service receives a log pulling remote procedure call (RPC) request from OceanBase CDC or a network-based standby database, the service first attempts to read logs from the local disk. If the corresponding logs do not exist in the local disk due to reasons such as log stream garbage collection (GC) or log recycling, and if the tenant has enabled log archiving, the CDC service reads logs from the log archive destination, such as the network file system (NFS) or Alibaba Cloud Object Storage Service (OSS). The log reading performance of the CDC service determines the log consumption speed at the downstream. If the performance of the CDC service in reading archived logs from OSS is poor, the synchronization link or the network-based standby database may lag behind the primary database and may be unable to become synchronized with the primary database. To address this issue, V4.2.1 allows the CDC service to read OSS-archived log files based on the basic capability of parallel read of OSS files.
Resource optimization
This version optimized the utilization of system resources in public cloud environments, including user tenant memory, memory of the SYS500 tenant, and operating system memory. For example, for Elastic Compute Service (ECS) instances with specifications of 128 GB or higher, the memory utilization of system resources has been reduced from around 30% to approximately 15%.
High availability enhancement
Table-level restore
Prior to OceanBase Database V4.2.1, tenant-level data restore was supported. If data within a table was damaged due to a misoperation, users needed to rely on the physical restore feature to restore the tenant to a previous point in time or use the import/export feature for table-level restore. V4.2.1 added support for table-level restore, allowing users to specify which backup data to use, which databases or tables to restore, which tenant to operate on, and the desired recovery point in time on the target cluster. For more information, see Table-level restore.
Support for COS
OceanBase Database V4.1.0 supports OSS as the backup media. OceanBase Database V4.2.1 supplements this support by allowing users to back up logs and data to COS and read backup data from COS for data restore.
Security enhancement
Data integrity protection: The Security Assessment of Commercial Cryptography Application imposes requirements for confidentiality and integrity protection on stored data in information systems. In the versions earlier than V4.2.1, the transparent encryption feature of OceanBase Database has already supported AES_ECD and SM4_CBC (which are named in the format of encryption algorithm_encryption mode), providing confidentiality protection for stored data. V4.2.1 added support for the GCM mode. In addition to data encryption, the checksum of ciphertext is calculated based on the key, and the ciphertext is checked during decryption to determine whether the ciphertext has been changed, thereby protecting data integrity.
Diagnostic capabilities improvement
WR-based data collection framework
The ease of use of the database performance diagnostics feature is closely related to the efficiency of system tuning. Oracle Database 10g introduces proactive automatic diagnostic capabilities such as Active Session History (ASH), Automatic Workload Repository (AWR), and Automatic Database Diagnostic Monitor (ADDM), and provides an inside-out (with information collected by internal components) and top-down (based on the database time and other metrics) database optimization and analysis framework. After decades of development, these capabilities have become industry benchmarks. OceanBase Database V4.2.1 implements a data collection framework similar to AWR of Oracle Database. The framework collects existing data such as ASH reports, statistics, wait events, and SQL execution details, and periodically persists performance-related views of OceanBase Database. OceanBase Database V4.2.1 introduces WR views and supports configuration adjustment and snapshot management by using
DBMS_WORKLOAD_REPOSITORYpackages. The new version also unifies, streamlines, enriches, and enhances SYSSTAT, ASH, and other statistical metrics for higher comprehensiveness and accuracy. The performance diagnostic capabilities will be further enhanced in future OceanBase Database versions. For more information, see Overview of WR.Enhanced ASH feature
The ASH feature was introduced in OceanBase Database V4.0.0_CE. It samples the status of all active sessions in the system at an interval of 1 second and records the information in internal tables. In OceanBase Database V4.2.1, additional sampling points related to transactions, storage, and DAS were added. The ASH data is collected into the WR internal table at a default sampling rate of 10:1 and a collection interval of 1 hour. By analyzing ASH data, you can easily identify issues such as long wait events, slow SQL statements, and resource utilization of active sessions, which helps in performance optimization.
End-to-end diagnostics feature
OceanBase Database V4.2.0 supports visualized end-to-end tracing of SQL requests, and in V4.2.1, the configuration management capability for end-to-end diagnosis is further enhanced. A new view
GV$OB_FLT_TRACE_CONFIGis added to record the configuration policies for end-to-end diagnostics at different levels. TheGV$OB_PROCESSLISTview now includesLEVEL,SAMPLE_PERCENTAGE, andRECORD_POLICYcolumns to display the monitoring level, sampling frequency, and recording/printing policy that are effective for each session. Additionally, theGV$OB_SQL_AUDITview includes a new columnFLT_TRACE_IDto record the end-to-end trace information, enabling comprehensive SQL tracing. OceanBase Cloud Platform (OCP) will also provide corresponding page functionality to support this feature.
Product form
Public cloud primary address mode: In the public cloud architecture, the Client -> SLB -> ODP -> OceanBase Database link can be too long, resulting in significant performance loss in scenarios that require extremely high performance. For businesses whose data is stored on a single node and does not require read/write splitting, OceanBase Database V4.2.1 provides the primary address mode where a client can directly connect to a database through Alibaba Cloud Server Load Balancer (SLB), greatly reducing performance loss in the link.
Product behavioral changes
The following table describes the product behavioral changes made in this version.
| Feature | Change description |
|---|---|
Triggers disabled for the LOAD DATA statement |
The LOAD DATA statement is executed in parallel for fast data import. When parallel execution involves triggers, trigger correctness issues may occur. Therefore, triggers are disabled for the LOAD DATA statement in OceanBase Database V4.2.1. |
Semantic change for tenant=all |
|
| Load balancing control |
|
| Case sensitivity in OceanBase CDC | OceanBase CDC is case-insensitive in versions earlier than V4.2.1. The new version supports case sensitivity. The specific behaviors are as follows:
|
| Transport Layer Security (TLS) protocol version for SSL encryption | In the versions earlier than V4.2.1, there were no restrictions on the TLS protocol version for SSL encryption. Therefore, clients can use the TLS protocol of an early version for encrypted communication with databases. However, some scenarios require TLS1.2 and TLS1.3 for higher security. For compatibility with clients of earlier versions, OceanBase Database V4.2.1 introduces the sql_protocol_min_tls_version parameter, which allows you to specify the minimum version of the TLS protocol. The default value is compatible with previous versions. |
| Calling a stored procedure with an output parameter without returning a result set | MySQL allows you to call a stored procedure with an output parameter without returning the result set of the output parameter.
|
| zlib compression disabled | In OceanBase Database V4.2.1, you cannot use zlib compression for new tables or change the compression algorithm of an existing table to zlib. |
View changes
The following table describes the changes to views made in this version.
| View | Change type | Description |
|---|---|---|
| DBA/USER/ALL_CONSTRAINTS | Modified | In previous versions, the DBA/USER/ALL_CONSTRAINTS view contains the GENERATED column, which is defined as cast("NULL" as VARCHAR2(14)). In this version, the column is defined to output GENERATED NAME or USER NAME for compatibility with Oracle. However, if you upgrade an earlier version to this version, existing NULL values in this column will be retained. |
| CDB/DBA_WR_CONTROL | New | Stores WR-related configurations. |
| [G]V$OB_PROCESSLIST | Modified | The LEVEL, SAMPLE_PERCENTAGE, and RECORD_POLICY columns are added to display the monitoring level, sampling frequency, and recording/printing strategy that take effect on a session. The LB_VID, LB_VIP, LB_VPORT, IN_BYTES, and OUT_BYTES columns are added to meet statistics requirements in public cloud primary address mode. |
| [G]V$OB_TENANT_RUNTIME_INFO | New | Displays the running details of tenants. |
| DBA_SCHEDULER_JOB_RUN_DETAILS | New | Displays the running status of scheduled tasks under Oracle tenants. |
| [G]V$OB_SQL_AUDIT | Modified | The FLT_TRACE_ID column is added to record end-to-end trace information. |
Parameter changes
The following table describes the parameter changes made in this version.
| Parameter | Change type | Description |
|---|---|---|
| memory_limit_percentage | Modified | The upper limit of the percentage of available memory for OBServer nodes is changed from 90% to 95%. OBServer nodes are allowed to use a higher percentage of resources in servers with high specifications. |
| sql_protocol_min_tls_version | New | The minimum version of the SSL/TLS protocol used by SSL connections for SQL statements. This is a cluster-level parameter. The default value is none, which means there are no restrictions on the TLS version for connections.
NoteThis parameter controls only the version number of SSL. To enable SSL, you must set the |
| enable_transfer | New | Specifies whether to allow transfer within the tenant. This is a tenant-level parameter. This parameter is invalid when enable_rebalance is disabled. The default value is True, which indicates that transfer within the tenant is allowed. |
| compaction_dag_cnt_limit | New | The maximum number of directed acyclic graphs (DAGs) in a compaction DAG queue. This parameter is a tenant-level parameter. The default value is 15000. In scenarios with millions of partitions, you can increase the value of this parameter to speed up compaction, which however increases memory consumption. |
| compaction_schedule_tablet_batch_cnt | New | The maximum number of partitions that can be scheduled in each batch for batch compaction scheduling. This parameter is a tenant-level parameter. The default value is 50000. In scenarios with millions of partitions, you can increase the value of this parameter to speed up compaction, which however increases CPU consumption and results in longer thread scheduling time. |
| server_cpu_quota_min | Modified | The default value is changed from 1 to 0, and the value range is changed to [0, 16]. The value 0 indicates that the specifications of the sys tenant are adaptive. |
| server_cpu_quota_max | Modified | The default value is changed from 1 to 0, and the value range is changed to [0, 16]. The value 0 indicates that the specifications of the sys tenant are adaptive. |
Recommended versions of tools
The recommended platform tool versions for OceanBase Database V4.2.1 are described in the following table:
| Tool | Version | Remarks |
|---|---|---|
| OceanBase Database Proxy (ODP) | V4.2.1.0 | - |
| OCP | V4.2.0 | We recommend that you use the latest BP version. |
| OceanBase Developer Center (ODC) | V4.1.3 BP3 | ODC V4.2.2 will be released soon. |
| OceanBase CDC | V4.2.0 | - |
| OceanBase Migration Service (OMS) | V4.2.0 | - |
| OceanBase C++ Call Interface (OCCI) | V1.0.3 | - |
| OceanBase Call Interface (OBCI) | V2.0.7 | - |
| Embedded SQL in C for OceanBase (ECOB) | V1.1.8 | - |
| OceanBase Command-Line Client (OBClient) | V2.2.3 | - |
| OceanBase Connector/C | V2.2.3 | - |
| OceanBase Connector/J | V2.4.5.1 | V2.4.5 or later is required. |
| OceanBase Connector/ODBC | V2.0.8 | - |
Upgrade notes
- An online upgrade of OceanBase Database Community Edition from V4.2.0 to V4.2.1 is supported.
- An online upgrade of OceanBase Database Community Edition from V4.1.0 to V4.2.1 is supported.
- We recommend that you upgrade OceanBase Database before you upgrade ODP.
- During the upgrade, the system automatically disables major compactions and DDL operations. After the upgrade is complete, the system resumes normal operation.
- An online upgrade of OceanBase Database Community Edition from V3.x to V4.2.1 is not supported.
- You can upgrade OceanBase Database Community Edition from V3.x to V4.2.1 through logical data migration by using OMS.