All Products
Search
Document Center

ApsaraDB for OceanBase:Out-of-line constraints

Last Updated:Jun 03, 2024

This topic describes the conversion scope of CREATE TABLE DDL operations for out-of-line constraints during data migration from an Oracle database to an Oracle tenant of OceanBase Database.

Syntax

The syntax of out_of_line_constraint is as follows:

[ CONSTRAINT constraint_name ]
{ UNIQUE (column [, column ]...)
| PRIMARY KEY (column [, column ]...)
| FOREIGN KEY (column [, column ]...) references_clause
| CHECK (condition)
} [ constraint_state ]

references_clause:
REFERENCES [ schema_name. ] object [ (column [, column ]...) ]
  [ON DELETE { CASCADE | SET NULL } ]

constraint_state:
[ [NOT] DEFERRABLE [INITIALLY {IMMEDIATE | DEFERRED}]
 |  INITIALLY { IMMEDIATE | DEFERRED } [ NOT ] [ DEFERRABLE ]
]
[  RELY | NORELY  ]
[ using_index_clause ]
[ ENABLE | DISABLE ]
[ VALIDATE | NOVALIDATE ]
[ exceptions_clause ]

Supported DDL

  • Defining constraint names by using the CONSTRAINT constraint_name clause is supported.

  • Defining the UNIQUE and PRIMARY KEY constraints by using the UNIQUE (column [, column ]...) and PRIMARY KEY (column [, column ]...) clauses is supported.

  • Defining the CHECK constraint is supported.

  • Defining the FOREIGN KEY constraint by using the FOREIGN KEY (column [, column ]...) references_clause clause is supported, and filters can be set.

  • Specifying the ENABLE/DISABLE, VALIDATE/NOVALIDATE, and RELY/NORELY options in the constraint_state clause for CHECK constraints is supported. Other options that are specified are ignored.

Unsupported DDL

Specifying the ENABLE, DISABLE, VALIDATE, NOVALIDATE, RELY, and NORELY options in the constraint_state clause for constraints other than CHECK constraints is not supported. These options are ignored when they are specified for other constraints.