Note
This statement is available since V4.4.2 BP1.
Purpose
This statement is used to explicitly recompile an invalid view or modify view constraints.
Privilege requirements
To execute this statement, you must have the ALTER ANY TABLE system privilege. For more information about the privileges of OceanBase Database, see Privilege types in Oracle mode.
Syntax
ALTER VIEW [schema_name.]view_name COMPILE;
Parameters
| Parameter | Description |
|---|---|
| schema_name | The name of the schema to which the view belongs. This parameter is optional. |
| view_name | The name of the view to be recompiled. |
| COMPILE | A keyword indicating that the database should execute the recompile operation. |
Examples
Execute the following command to recompile the view named customer_ro.
obclient> ALTER VIEW customer_ro COMPILE;
