The following table describes the online DDL operations supported by the Oracle mode of OceanBase Database V4.x.
| Type | Operation | Time spent | Remarks | DDL support after creating mlog |
|---|---|---|---|---|
| Index operation | Add an index | Related to the data volume, because data is reorganized (or rewritten) | This operation mainly involves global indexes, local indexes, global indexes with specified partitions, and spatial indexes (supported in OceanBase Database V4.1.0 and later). | Supported |
| Index operation | Drop an index | Related to whether active transactions exist | N/A | Supported |
| Index operation | Rename an index | Only for metadata modification | N/A | Supported |
| Index operation | Hybrid index operations | Related to the operation with the longest execution time | For example, ALTER TABLE t1 ADD INDEX i4(c1), DROP INDEX i2, RENAME INDEX i1 TO i1x involves hybrid index operations. It is not supported in Oracle mode. |
Not supported |
| Column operation | Add, change, or delete the skip index type | Only for table schema modification | N/A | Not supported |
| Column operation | Add a column to the end of a table | Only for metadata modification | For example, add a LOB (TEXT) column by executing a statement similar to ALTER TABLE tbl1 ADD c3 LOB. |
Not supported |
| Column operation | Add a VIRTUAL column |
Only for metadata modification | N/A | Not supported |
| Column operation | Drop a VIRTUAL column |
Only for metadata modification | N/A | Not supported |
| Column operation | Set a NOT NULL constraint on a column |
Related to the data volume, because data is queried | N/A | Not supported |
| Column operation | Set a NULL constraint on a column |
Only for metadata modification | N/A | Not supported |
| Column operation | Set a default value for a column | Only for metadata modification | N/A | Not supported |
| Column operation | Drop the default value of a column | Only for metadata modification | N/A | Not supported |
| Column operation | Change the value of an auto-increment column | Only for metadata modification | N/A | Not supported |
| Column operation | Rename a column | Only for metadata modification | N/A | Not supported |
| Column operation | Increase the length or precision of the data type for a column | Only for metadata modification | For example, increase the length of the INT type, increase the length of the VARCHAR type, or convert the NUMBER type. |
Not supported |
| Column operation | Hybrid column operations | Related to the operation with the longest execution time | If an offline column operation is involved, the operation is upgraded to an offline DDL operation. | Not supported |
| Foreign key operation | Add a foreign key or a CHECK/NOT NULL constraint |
Related to the data volume, because data is queried | N/A | You can add a foreign key or a CHECK constraint but not a NOT NULL constraint. |
| Foreign key operation | Drop a foreign key or a CHECK/NOT NULL constraint |
Related to the data volume, because data is queried | N/A | You can drop a foreign key constraint but not a CHECK or NOT NULL constraint. |
| Table operation | Rename a table | Only for metadata modification | N/A | Not supported |
| Table operation | Change the row format | Only for metadata modification | N/A | Not supported |
| Table operation | Change the block size | Only for metadata modification | N/A | Not supported |
| Table operation | Switch the compression algorithm | Only for metadata modification | N/A | Not supported |
| Table operation | Optimize a tablespace | Only for metadata modification | N/A | Not supported |
| Partition operation | Add a partition | Only for metadata modification | N/A | Not supported |
The following table describes the offline DDL operations supported by the Oracle mode of OceanBase Database V4.x.
| Type | Operation | Time spent | Remarks | DDL support after creating mlog |
|---|---|---|---|---|
| Column operation | Add an auto-increment column | Related to the data volume, because data is reorganized (or rewritten) | N/A | Not supported |
| Column operation | Set a column as a primary key | Related to the data volume, because data is reorganized (or rewritten) | N/A | Not supported |
| Column operation | Add or drop a STORED column |
Related to the data volume, because data is reorganized (or rewritten) | N/A | Not supported |
| Column operation | Drop a column | Related to the data volume, because data is reorganized (or rewritten) | N/A | Not supported |
| Column operation | Hybrid column operations | Related to the data volume, because data is reorganized (or rewritten) | N/A | Not supported |
| Primary key operation | Add or drop a primary key | Related to the data volume, because data is reorganized (or rewritten) | N/A | Not supported |
| Table operation | Truncate a table | Related to whether active transactions exist | N/A | Not supported |
| Table operation | Drop a table | Related to whether active transactions exist | N/A | Not supported |
| Partition operation | Modify partitioning rules | Related to the data volume, because data is reorganized (or rewritten) | N/A | Not supported |
| Partition operation | Drop a partition | Related to whether active transactions exist | A partition-level table lock is added to the partition. | Not supported |
| Partition operation | Truncate a partition | Related to whether active transactions exist | A partition-level table lock is added to the partition. | Not supported |