This procedure creates the necessary structures to enable the table to support multiple versions of rows.
table_name IN VARCHAR2
[, hist IN VARCHAR2 DEFAULT 'NONE']);
Table 70-13 EnableVersioning Procedure Parameters
Name of the table. The length of a table name must not exceed 25 characters. The name is not case sensitive.
History option, for tracking modifications to
table_name. Must be one of the following values:
NONE: No modifications to the table are tracked. (This is the default.)
VIEW_W_OVERWRITE: The with overwrite (W_OVERWRITE) option: A view named
<table_name>_HIST is created to contain history information, but it will show only the most recent modifications to the same version of the table. A history of modifications to the version is not maintained; that is, subsequent changes to a row in the same version overwrite earlier changes. (The
CREATETIME column of the
<table_name>_HIST view contains only the time of the most recent update.)
VIEW_WO_OVERWRITE: The without overwrite (WO_OVERWRITE) option: A view named
<table_name>_HIST is created to contain history information, and it will show all modifications to the same version of the table. A history of modifications to the version is maintained; that is, subsequent changes to a row in the same version do not overwrite earlier changes.
The table that is being version-enabled must have a primary key defined.
Only the owner of a table can enable versioning on the table.
Tables that are version-enabled and users that own version-enabled tables cannot be deleted. You must first disable versioning on the relevant table or tables.
Tables owned by
SYS cannot be version-enabled.
An exception is raised if the table is already version-enabled.
If the table is version-enabled with the
VIEW_WO_OVERWRITE hist option specified, this option can later be disabled and re-enabled by calling the SetWoOverwriteOFF Procedure and SetWoOverwriteON Procedure. However, the
VIEW_WO_OVERWRITE hist option can be overridden when a workspace is compressed by specifying the
compress_view_wo_overwrite parameter as
TRUE with the CompressWorkspace Procedure or CompressWorkspaceTree Procedure.
The history option affects the behavior of the GotoDate Procedure. See the Usage Notes for that procedure.
Current notes and restrictions include:
- If you have referential integrity constraints on version-enabled tables, note the considerations and restrictions in Oracle9i Application Developer's Guide - Workspace Manager.
- If you have triggers defined on version-enabled tables, note the considerations and restrictions in Oracle9i Application Developer's Guide - Workspace Manager.
- Constraints and privileges defined on the table are carried over to the version-enabled table.
- DDL operations are not allowed on version-enabled tables.
- Index-organized tables cannot be version-enabled.
- Object tables cannot be version-enabled.
- A table with one or more columns of LONG data type cannot be version-enabled.
The following example enables versioning on the