1.16 DBMS_WM Subprogram Categories

The Workspace Manager application programming interface (API) consists of PL/SQL subprograms (procedures and functions) in a single PL/SQL package named DBMS_WM.

The subprograms can be logically grouped into the categories described in this section.

Note:

Most Workspace Manager subprograms are procedures, but a few are functions. (A function returns a value; a procedure does not return a value.)

Most functions have names starting with Get (such as GetConflictWorkspace and CreateSavepoint ).

Reference information for all subprograms is in DBMS_WM Package: Reference .

1.16.1 Table Management Subprograms

Table management subprograms enable and disable workspace management on a table, and perform other table-related operations.

Table 1-8 shows the subprograms available for table management.

Table 1-8 Table Management Subprograms

Procedure Description

EnableVersioning

Version-enables a table, creating the necessary structures to enable the table to support multiple versions of rows.

DisableVersioning

Deletes all support structures that were created to enable the table to support versioned rows.

SetWoOverwriteOFF

Disables the VIEW_WO_OVERWRITE history option that was enabled by the EnableVersioning or SetWoOverwriteON procedure, changing the option to VIEW_W_OVERWRITE (with overwrite).

SetWoOverwriteON

Enables the VIEW_WO_OVERWRITE history option that was disabled by the SetWoOverwriteOFF procedure.

BeginDDL

Starts a DDL (data definition language) session for a specified table.

CommitDDL

Commits DDL changes made during a DDL session for a specified table, and ends the DDL session.

RollbackDDL

Rolls back (cancels) DDL changes made during a DDL session for a specified table, and ends the DDL session.

RecoverAllMigratingTables

Attempts to complete the migration process on a table that was left in an inconsistent state after the Workspace Manager migration procedure failed.

RecoverAllMigratingTables

Attempts to complete the migration process on all tables that were left in an inconsistent state after the Workspace Manager migration procedure failed.

CopyForUpdate

Allows LOB columns (BLOB, CLOB, or NCLOB) in version-enabled tables to be modified.

Export

Exports data from a version-enabled table (all rows, or as limited by any combination of several parameters) to a staging table.

Import

Imports data from a staging table (all rows, or as limited by any combination of several parameters) into a version-enabled table in a specified workspace.

1.16.2 Workspace Management Subprograms

Workspace management subprograms perform operations on workspaces.

Table 1-9 shows the subprograms available for workspace management.

Table 1-9 Workspace Management Subprograms

Procedure Description

CreateWorkspace

Creates a new workspace in the database.

GotoWorkspace

Moves the current session to the specified workspace.

SetDiffVersions

Finds differences in values in version-enabled tables for two savepoints and their common ancestor (base). It creates rows in the differences views describing these differences.

GetDiffVersions

Returns the names of the (workspace, savepoint) pairs on which the session has performed the SetDiffVersions operation.

MergeTable

Applies changes to a table (all rows or as specified in the WHERE clause) in a workspace to its parent workspace.

MergeWorkspace

Applies all changes in a workspace to its parent workspace, and optionally removes the workspace.

RollbackWorkspace

Discards all data changes made in the workspace to version-enabled tables.

RollbackTable

Discards all changes made in the workspace to a specified table (all rows or as specified in the WHERE clause).

RollbackToSP

Discards all data changes made in the workspace to version-enabled tables since the specified savepoint.

RefreshTable

Applies to a workspace all changes made to a table (all rows or as specified in the WHERE clause) in its parent workspace.

RefreshWorkspace

Applies to a workspace all changes made in its parent workspace.

AlterWorkspace

Modifies the description of a workspace.

ChangeWorkspaceType

Changes a workspace that is not continually refreshed to be continually refreshed.

RemoveWorkspace

Discards all row versions associated with a workspace and deletes the workspace.

RemoveWorkspaceTree

Discards all row versions associated with a workspace and its descendant workspaces, and deletes the affected workspaces.

FreezeWorkspace

Restricts access to a workspace and the ability of users to make changes in the workspace.

UnfreezeWorkspace

Enables access and changes to a workspace, reversing the effect of the FreezeWorkspace procedure.

CompressWorkspace

Deletes removable savepoints in a workspace, and minimizes the Workspace Manager metadata structures for the workspace.

CompressWorkspaceTree

Deletes removable savepoints in a workspace and all its descendant workspaces. It also minimizes the Workspace Manager metadata structures for the affected workspaces, and eliminates any redundant data that might arise from the deletion of the savepoints.

IsWorkspaceOccupied

Checks whether or not a workspace has any active sessions.

CreateSavepoint

Returns the current workspace for the session.

SetMultiWorkspaces

Makes the specified workspace or workspaces visible in the multiworkspace views for version-enabled tables.

GetMultiWorkspaces

Returns the names of workspaces visible in the multiworkspace views for version-enabled tables.

GetOpContext

Returns the context of the current operation for the current session.

AddAsParentWorkspace

Adds a workspace as a parent workspace to a child workspace in a multiparent workspace environment.

RemoveAsParentWorkspace

Removes a workspace as a parent workspace in a multiparent workspace environment.

1.16.3 Savepoint Management Subprograms

Savepoint management subprograms perform operations related to savepoints.

Table 1-10 shows the subprograms available for savepoint management.

Table 1-10 Savepoint Management Subprograms

Procedure Description

CreateSavepoint

Creates a savepoint for the current version.

GotoSavepoint

Goes to the specified savepoint in the current workspace.

GotoDate

Goes to a point at or near the specified date and time in the current workspace.

GetSessionInfo

Retrieves information about the current workspace and session context; useful for finding the session's current savepoint or instant in time.

AlterSavepoint

Modifies the description of a savepoint.

DeleteSavepoint

Deletes a savepoint and associated rows in version-enabled tables.

1.16.4 Privilege Management Subprograms

Privilege management subprograms grant and revoke Workspace Manager privileges.

Table 1-11 shows the subprograms available for privilege management.

Table 1-11 Privilege Management Subprograms

Procedure Description

GrantWorkspacePriv

Grants workspace-level privileges to users, roles, or PUBLIC.

RevokeWorkspacePriv

Revokes workspace-level privileges from users and roles.

GrantSystemPriv

Grants privileges on all workspaces to users, roles, or PUBLIC.

RevokeSystemPriv

Revokes system-level privileges from users and roles.

GetPrivs

Returns a comma-delimited list of all privileges that the current user has for the specified workspace.

1.16.5 Lock Management Subprograms

Lock management subprograms control Workspace Manager locking.

Table 1-12 shows the subprograms available for lock management.

Table 1-12 Lock Management Subprograms

Procedure Description

SetLockingON

Enables Workspace Manager locking for the current session.

SetLockingOFF

Disables Workspace Manager locking for the current session.

SetWorkspaceLockModeON

Enables Workspace Manager locking for the specified workspace.

SetWorkspaceLockModeOFF

Disables Workspace Manager locking for the specified workspace.

GetLockMode

Returns the locking mode for the current session, which determines whether or not access is enabled to versioned rows and corresponding rows in the previous version.

LockRows

Controls access to versioned rows in a specified table and to corresponding rows in the parent workspace.

UnlockRows

Enables access to versioned rows in a specified table and to corresponding rows in the parent workspace.

1.16.6 Conflict Management Subprograms

Conflict management subprograms detect and resolve conflicts between workspaces.

Table 1-13 shows the subprograms available for conflict management.

Table 1-13 Conflict Management Subprograms

Procedure Description

SetConflictWorkspace

Determines whether or not conflicts exist between a workspace and its parent workspace.

GetConflictWorkspace

Returns the name of the workspace on which the session has performed the SetConflictWorkspace procedure.

BeginResolve

Starts a conflict resolution session.

ResolveConflicts

Resolves conflicts between workspaces.

CommitResolve

Ends a conflict resolution session and saves (makes permanent) any changes in the workspace since the BeginResolve procedure was executed.

RollbackResolve

Quits a conflict resolution session and discards all changes in the workspace since the BeginResolve procedure was executed.

1.16.7 Bulk Load Support Subprograms

Bulk load support subprograms enable SQL*Loader to be used for bulk loading data into version-enabled tables, as explained in Bulk Loading into Version-Enabled Tables.

Table 1-14 shows the subprograms available for bulk loading support.

Table 1-14 Bulk Loading Support Subprograms

Procedure Description

GetBulkLoadVersion

Returns a version number to be specified when you call the BeginBulkLoading procedure.

BeginBulkLoading

Starts the bulk loading process for a version-enabled table.

CommitBulkLoading

Ends the bulk loading process for a version-enabled table by committing the bulk load changes.

RollbackBulkLoading

Rolls back changes made to a version-enabled table during a bulk load operation.