![]() Previous |
![]() Next |
The MAINTAIN command enters and maintains the values of dimensions, composites, and partition template objects.
Note: You can also issue a MAINTAIN statement for a surrogate dimension that has a Maintain trigger. In this case, Oracle OLAP only executes the Maintain trigger program; no other action occurs. See "Trigger Programs" for more information for more information. Issuing a MAINTAIN statement for a surrogate dimension that does not have a Maintain trigger, returns an error. |
Syntax
MAINTAIN object {ADD|DELETE|RENAME|MOVE|MERGE} args
The keywords that you can use with the MAINTAIN command varies by object:
MAINTAIN dimension {ADD|DELETE|RENAME|MOVE|MERGE} args
The keyword that you can use varies by the type of dimension that you want to maintain:
With a non-concat dimension, you can use the ADD, DELETE, RENAME, MOVE, or MERGE keywords to add, delete, rename, move, or merge non-concat dimension values. You can also use the ADD keyword to add temporary calculated members to a dimension.
With a concat dimension, you can only use the MOVE keyword to move concat dimension values.
MAINTAIN composite {ADD|DELETE|MERGE} args
MAINTAIN partition-template {ADD|DELETE|MOVE} args
The specific syntax varies by keyword. Consequently, there are separate topics for each keyword of the MAINTAIN command:
For information that applies to the MAINTAIN command in general, see the Usage Notes in this topic.
Usage Notes
Triggering Program Execution When MAINTAIN Executes
Using the TRIGGER command, you can make the execution of a MAINTAIN statement an event that automatically executes an OLAP DML program. See "Trigger Programs" for more information.
Automatic Status Reset
When you use the ADD, DELETE, MERGE, or MOVE keyword to maintain a dimension or composite whose status is not currently ALL, the MAINTAIN command automatically resets status to ALL before performing the maintenance function. However, when you use the RENAME keyword to maintain a dimension whose status is not currently ALL, the MAINTAIN command does not change the status of the dimension.
Maintain Permission
You cannot perform maintenance on a dimension when a PERMIT MAINTAIN statement denies maintain permission for the dimension. Maintain permission is implicitly denied whenever read permission is restricted for a dimension, even when you specify maintain permission for the dimension. (See the PERMIT command.)
Maintaining Dimensions in Multiwriter Analytic Workspaces
Keep the following points in mind when maintaining dimensions in an analytic workspace that is attached in multiwriter mode:
You cannot update a variable when any of its dimensions have been acquired and modified.
Reverting a dimension after adding dimension values is not recommended since it can result in suboptimal space allocation for variables dimensioned by the dimension.
When an acquired variable is dimensioned by an acquired dimension that has been maintained, you cannot update the variable until the dimension is updated or released.
You do not have to acquire composites in order for them to be maintained, Oracle OLAP automatically performs concurrent dimension maintenance for the composite dimensions.
Also, before you can maintain dimensions in an analytic workspace that is attached in multiwriter mode, you must first acquire the dimension using an ACQUIRE statement.
For example, assume that user A and user B both have to perform what-if computations on both actuals
and budget
. After performing the what-if computations, user A needs to modify actuals
and B needs to modify budget
. Finally, both user A and user B have to add a new time
dimension value and add data corresponding to that new dimension value to actuals
or budget
.
User A issues the following OLAP DML statements.
AW ATTACH myworkspace MULTI ...make modifications ACQUIRE actuals ...make more modifications ACQUIRE time MAINTAIN time ADD 'Y2002' actuals (time 'Y2002', ...) = ... UPDATE MULTI actuals, time COMMIT RELEASE actuals, time AW DETACH myworkspace
User B issues the following OLAP DML statements.
AW ATTACH myworkspace MULTI ...make modifications ACQUIRE budget ...make more modifications ACQUIRE time--> failed ACQUIRE RESYNC time WAIT MAINTAIN time ADD 'Y2003' budget (time 'Y2003', ...) = ... UPDATE MULTI budget, time COMMIT RELEASE budget, time AW DETACH myworkspace
MAINTAIN and Dimension Surrogates
You cannot use a MAINTAIN statement on a dimension surrogate. You can only use MAINTAIN to add values to or delete them from a dimension. However, when you add or delete a dimension value, then Oracle OLAP adds or removes a position from surrogates of that dimension. When you add a position to a dimension, the corresponding position in a surrogate for that dimension receives an NA
value.
Maintaining a Concat Dimension
A concat dimension contains the values of its component dimensions. You do not directly add, merge, or delete the values of a concat dimension using MAINTAIN statements. Instead, when you add, merge, or delete values from a component dimension of the concat, Oracle OLAP automatically adds or deletes the values from the concat dimension. You can use the MOVE keyword of the MAINTAIN command to change the order of the values of a concat dimension.