Oracle9i Application Developer's Guide - Workspace Manager Release 1 (9.0.1) Part Number A88806-01 |
|
Workspace Manager creates and maintains metadata views to hold information about such things as version-enabled tables, workspaces, savepoints, users, privileges, locks, and conflicts. These views are read-only to users. You can use the information in these views to help administer the long transaction environment and diagnose problems.
USER_WM_VERSIONED_TABLES
(
Section 3.17
) and
ALL_WM_VERSIONED_TABLES
(
Section 3.6
) contain information about version-enabled tables.
USER_WM_MODIFIED_TABLES
(
Section 3.13
) and
ALL_WM_MODIFIED_TABLES
(
Section 3.3
) contain information about version-enabled tables that have been modified.
USER_WORKSPACES
(
Section 3.20
) and
ALL_WORKSPACES
(
Section 3.9
) contain information about workspaces.
USER_WORKSPACE_SAVEPOINTS
(
Section 3.19
) and
ALL_WORKSPACE_SAVEPOINTS
(
Section 3.8
) contain information about savepoints.
USER_WORKSPACE_PRIVS
(
Section 3.18
) and
ALL_WORKSPACE_PRIVS
(
Section 3.7
) contain information about privileges specific to Workspace Manager.
USER_WM_PRIVS
(
Section 3.14
) contains information about privileges that the current user has in each workspace.
ROLE_WM_PRIVS
(
Section 3.11
) contains information about privileges that all roles granted to the current user have in each workspace.
USER_WM_LOCKED_TABLES
(
Section 3.12
) and
ALL_WM_LOCKED_TABLES
(
Section 3.2
) contain information about locks placed in the current workspace on rows in version-enabled tables.
DBA_WORKSPACE_SESSIONS
(
Section 3.10
) contains information about all users in all workspaces other than LIVE
.
USER_WM_RIC_INFO
(
Section 3.15
) and
ALL_WM_RIC_INFO
(
Section 3.4
) contain information about referential integrity constraints.
USER_WM_TAB_TRIGGERS
(
Section 3.16
) and
ALL_WM_TAB_TRIGGERS
(
Section 3.5
) contain information about triggers defined on version-enabled tables.
ALL_VERSION_HVIEW
(
Section 3.1
) contains information about the version hierarchy.
There are also views created per version-enabled table, as follows:
ALL_VERSION_HVIEW
contains information about the version hierarchy. It is used by Workspace Manager to perform queries against the xxx_HIST views (described in Section 3.24).
ALL_WM_LOCKED_TABLES
contains information about Workspace Manager locks on rows in version-enabled tables that the current user can access.
Related View
USER_WM_LOCKED_TABLES
(Section 3.12) contains information about Workspace Manager locks on rows in version-enabled tables of which the current user is the owner.
ALL_WM_MODIFIED_TABLES
contains information about all version-enabled tables that have been modified and on which the current user has one or more of the following privileges: SELECT
, INSERT
, DELETE
, UPDATE
.
Related View
USER_WM_MODIFIED_TABLES
(Section 3.13) contains information about version-enabled tables that have been modified and of which the current user is the owner.
ALL_WM_RIC_INFO
contains information about referential integrity constraints in version-enabled tables that the current user can access. Workspace Manager uses this information to provide referential integrity support, which is described in Section 1.6.
Related View
USER_WM_RIC_INFO
(Section 3.15) contains information about referential integrity constraints in version-enabled tables of which the current user is the owner.
ALL_WM_TAB_TRIGGERS
contains information about triggers that the current user created and for version-enabled tables owned by the current user that have triggers defined on them. If the current user has the CREATE ANY TRIGGER
privilege, trigger information is displayed for all version-enabled tables.
Related View
USER_WM_TAB_TRIGGERS
(Section 3.16) contains information about triggers that are owned by the current user and that are on version-enabled tables.
TRIGGER_TYPE
is one of the following values:
BIR
: before insert for each row
AIR
: after insert for each row
BUR
: before update for each row
AUR
: after update for each row
BDR
: before delete for each row
ADR
: after delete for each row
BIS
: before insert for each statement
AIS
: after insert for each statement
BUS
: before update for each statement
AUS
: after update for each statement
BDS
: before delete for each statement
ADS
: after delete for each statement
ALL_WM_VERSIONED_TABLES
contains information about all version-enabled tables on which the current user has one or more of the following privileges: SELECT
, INSERT
, DELETE
, UPDATE
.
Related View
USER_WM_VERSIONED_TABLES
(Section 3.17) contains information about version-enabled tables of which the current user is the owner.
Column | Datatype | Null? | Description |
---|---|---|---|
|
|
|
Name of a version-enabled table. |
|
|
|
Owner (schema) of the table. |
|
|
|
|
|
|
|
Names of workspaces where a user needs to be notified if a conflict occurs on the table. |
|
|
|
|
|
|
|
|
ALL_WORKSPACE_PRIVS
contains information about Workspace Manager privileges in all workspaces that the current user can access.
Related View
USER_WORKSPACE_PRIVS
(Section 3.18) contains information about Workspace Manager privileges in workspaces created by the current user.
ALL_WORKSPACE_SAVEPOINTS
contains information about savepoints in all workspaces that the current user can access.
Related View
USER_WORKSPACE_SAVEPOINTS
(Section 3.19) contains information about savepoints in workspaces created by the current user.
Column | Datatype | Null? | Description |
---|---|---|---|
|
|
|
Name of the savepoint. Explicit savepoints are named by users; implicit savepoints are named by Workspace Manager. |
|
|
|
Workspace in which the savepoint was created. |
|
|
|
|
|
|
|
Position of the savepoint in the sequence in which savepoints were created. In a RollbackToSP operation, if any implicit savepoints have greater position values than the position of the savepoint to be rolled back to, you must first merge or remove the workspaces that caused these intervening implicit savepoints to be created. |
|
|
|
Name of the user that created the savepoint. |
|
|
|
Date and time that the savepoint was created. |
|
|
|
Description of the savepoint. |
ALL_WORKSPACES
contains information about all workspaces that the current user can access.
Related View
USER_WORKSPACES
(Section 3.20) contains information about workspaces created by the current user.
Column | Datatype | Null? | Description |
---|---|---|---|
|
|
|
Name of the workspace. |
|
|
|
Parent workspace of this workspace. |
|
|
|
Implicit savepoint that was created in the parent workspace when this workspace was created. |
|
|
|
User that created the workspace. |
|
|
|
Date and time that the workspace was created. |
|
|
|
Description of the workspace. |
|
|
|
|
|
|
|
|
|
|
|
The user allowed to make changes in the workspace; or null if the workspace is not frozen or if it is frozen in |
|
|
|
|
|
|
|
Name of the user that started the conflict resolution session if |
|
|
|
|
|
|
|
|
|
|
|
|
DBA_WORKSPACE_SESSIONS
contains information about all users and workspaces (except for the LIVE
workspace). This view is only available to users with the WM_ADMIN_ROLE
role. It is useful for monitoring users in the different workspaces.
ROLE_WM_PRIVS
contains information about privileges that all roles granted to the current user have in each workspace.
Related View
USER_WM_PRIVS
(Section 3.14) contains information about privileges that the current user has in each workspace.
USER_WM_LOCKED_TABLES
contains information about Workspace Manager locks on rows in version-enabled tables of which the current user is the owner. Its columns are the same as those in ALL_WM_LOCKED_TABLES
in Section 3.2.
USER_WM_MODIFIED_TABLES
contains information about version-enabled tables that have been modified and of which the current user is the owner. Its columns are the same as those in ALL_WM_MODIFIED_TABLES
in Section 3.3.
USER_WM_PRIVS
contains information about privileges that the current user has in each workspace.
Related View
ROLE_WM_PRIVS
(Section 3.11) contains information about privileges that all roles granted to the current user have in each workspace.
USER_WM_RIC_INFO
contains information about referential integrity constraints in version-enabled tables of which the current user is the owner. Its columns are the same as those in ALL_WM_RIC_INFO
in Section 3.4.
Workspace Manager uses this information to provide referential integrity support, which is described in Section 1.6.
USER_WM_TAB_TRIGGERS
contains information about triggers that are owned by the current user and that are on version-enabled tables. Its columns are the same as those in ALL_WM_TAB_TRIGGERS
in Section 3.5, except that it does not contain the
TRIGGER_OWNER
column.
USER_WM_VERSIONED_TABLES
contains information about version-enabled tables of which the current user is the owner. Its columns are the same as those in ALL_WM_VERSIONED_TABLES
in Section 3.6.
USER_WORKSPACE_PRIVS
contains information about Workspace Manager privileges in workspaces created by the current user. Its columns are the same as those in ALL_WORKSPACE_PRIVS
in Section 3.7.
USER_WORKSPACE_SAVEPOINTS
contains information about savepoints in workspaces created by the current user. Its columns are the same as those in ALL_WORKSPACE_SAVEPOINTS
in Section 3.8.
USER_WORKSPACES
contains information about workspaces created by the current user. Its columns are the same as those in ALL_WORKSPACES
in Section 3.9.
There is one conflict view per version-enabled table. Each conflict view has a name in the form <table_name>_CONF. For example, if the EMPLOYEE
table is version-enabled, the EMPLOYEE_CONF
metadata view exists.
Each conflict view contains the columns shown in Table 3-1.
The following example lists the key value and all column values of conflicting rows in the EMPLOYEE
table in the current workspace and the parent workspace. This view is available after the SetConflictWorkspace procedure has been called specifying the child workspace (the current workspace in this case).
SELECT * FROM EMPLOYEE_CONF;
If ID
, NAME
, and CITY
are the columns in the EMPLOYEE
table, then assume the following values:
WM_WORKSPACE ID NAME CITY WM_DEL NEWWORKSPACE 12 SMITH NASHUA NO DiffBase 12 SMITH NY NO LIVE 12 SMITH BOSTON NO
The database row identified by ID = 12
was changed in NEWWORKSPACE
and LIVE
workspaces. In NEWWORKSPACE
the city was changed to NASHUA
, and in the LIVE
workspace the city was changed to BOSTON
. When NEWWORKSPACE
is merged into LIVE
, this row will show up as a conflict. The application must pick between the choices and resolve conflicts in favor of the workspace with the desired value.
The following example begins a conflict resolution session, calls the ResolveConflicts procedure to delete the conflicting row from the NEWWORKSPACE
workspace and to insert the value in the parent workspace (LIVE
) into both workspaces, commits the transaction, and ends the conflict resolution session.
DBMS_WM.BeginResolve ('NEWWORKSPACE'); DBMS_WM.ResolveConflicts ('NEWWORKSPACE', 'EMPLOYEE', 'ID = 12', 'PARENT'); COMMIT; DBMS_WM.CommitResolve ('NEWWORKSPACE');
For additional information about conflict resolution, see Section 1.2.5.
There is one difference view for each version-enabled table. Each difference view has a name in the form <table_name>_DIFF. For example, if the EMPLOYEE
table is version-enabled, the EMPLOYEE_DIFF
metadata view exists. Rows are added to one or more xxx_DIFF views each time the SetDiffVersions procedure is executed.
Each difference view contains the columns shown in Table 3-2.
The WM_DIFFVER
value is in one of the following formats:
If the two-parameter version of the SetDiffVersions procedure was used, the value of savepoint1
or savepoint2
is LATEST
.
Note the following about the possible values for WM_CODE
:
NC
will appear for rows in workspaces that did not change the value when another workspace did change the value. For example, if '<workspace2>, <savepoint2>'
updated the row, the code for that row is U
, but the code for the '<workspace1>, <savepoint1>'
and 'DiffBase'
rows is NC
if they did not modify the row.
NE
will appear for 'DiffBase'
if a row is inserted in one or more branches, and NE
will appear for 'DiffBase'
and a branch if only one branch has had any insert operations.
For more information, including an example showing rows being added to a differences view, see the section on the SetDiffVersions procedure in Chapter 2.
There is one lock view per version-enabled table. Each lock view has a name in the form <table_name>_LOCK. For example, if the EMPLOYEE
table is version-enabled, the EMPLOYEE_LOCK
metadata view exists.
Each lock view contains the columns shown in Table 3-3.
There is one history view per version-enabled table if the table was version-enabled with the hist
parameter set to VIEW_W_OVERWRITE
or VIEW_WO_OVERWRITE
in the call to the EnableVersioning procedure. Each history view has a name in the form <table_name>_HIST. For example, if the EMPLOYEE
table is version-enabled with the hist
parameter set to VIEW_W_OVERWRITE
or VIEW_WO_OVERWRITE
, the EMPLOYEE_HIST
metadata view exists.
You can use the history views to log and audit modifications to version-enabled tables.
Each history view contains the columns shown in Table 3-4.
There is one multiworkspace view per version-enabled table. Each multiworkspace view has a name in the form <table_name>_MW. For example, if the EMPLOYEE
table is version-enabled, the EMPLOYEE_MW
metadata view exists. Rows are added to one or more xxx_MW views each time the SetMultiWorkspaces procedure (described in Chapter 2) is executed.
Each multiworkspace view contains the columns shown in Table 3-5.
You can use the <table_name>_MW view to see changes in another workspace without leaving the current workspace (for example, to check if there is a conflict with the other workspace). Each row in the view shows the data as it would be in that workspace if the workspace had been merged when the row was inserted in the view.
You can also use the <table_name>_DIFF view (see Section 3.22) to see changes in another workspace without leaving the current workspace; however, the <table_name>_DIFF view can be used for only two workspaces, whereas the <table_name>_MW view can be used for any number of workspaces.
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|