Dimension Snapshots
Dimension snapshots are point-in-time copies of a built dimension. Use them to preserve the current state before a metadata change, roll back a change, or inspect how individual members differed from a saved state.
SNAPSHOT_DIMENSION
Section titled “SNAPSHOT_DIMENSION”Minimum role: CUBE_ADMIN
SNAPSHOT_DIMENSION( CUBE_NAME_PARAM, DIM_NAME_PARAM, NOTES_PARAM) -> VARCHARCreates a snapshot of a dimension’s current built state.
Parameters
Section titled “Parameters”| Parameter | Type | Req/Opt | Description |
|---|---|---|---|
CUBE_NAME_PARAM |
VARCHAR |
req | Cube name. |
DIM_NAME_PARAM |
VARCHAR |
req | Dimension to snapshot. |
NOTES_PARAM |
VARCHAR |
opt | Note describing the reason for the snapshot. |
Example
Section titled “Example”CALL CUBE.SNAPSHOT_DIMENSION( 'FINANCE', 'ENTITY', 'Before Q3 restructure');LIST_DIMENSION_SNAPSHOTS
Section titled “LIST_DIMENSION_SNAPSHOTS”Minimum role: CUBE_ADMIN
LIST_DIMENSION_SNAPSHOTS( CUBE_NAME_PARAM, DIM_NAME_PARAM) -> VARCHARLists available dimension snapshots as JSON.
Parameters
Section titled “Parameters”| Parameter | Type | Req/Opt | Description |
|---|---|---|---|
CUBE_NAME_PARAM |
VARCHAR |
req | Cube name. |
DIM_NAME_PARAM |
VARCHAR |
opt | Dimension name. Pass NULL to list snapshots for all dimensions. |
Returns
Section titled “Returns”Returns snapshot information as JSON in a VARCHAR.
Example
Section titled “Example”CALL CUBE.LIST_DIMENSION_SNAPSHOTS('FINANCE', 'ENTITY');RESTORE_DIMENSION_SNAPSHOT
Section titled “RESTORE_DIMENSION_SNAPSHOT”Minimum role: CUBE_ADMIN
RESTORE_DIMENSION_SNAPSHOT( CUBE_NAME_PARAM, DIM_NAME_PARAM, SNAPSHOT_NAME_PARAM, AUTO_BACKUP) -> VARCHARRestores a dimension to a previously saved snapshot.
Parameters
Section titled “Parameters”| Parameter | Type | Req/Opt | Description |
|---|---|---|---|
CUBE_NAME_PARAM |
VARCHAR |
req | Cube name. |
DIM_NAME_PARAM |
VARCHAR |
req | Dimension name. |
SNAPSHOT_NAME_PARAM |
VARCHAR |
req | Snapshot to restore. |
AUTO_BACKUP |
BOOLEAN |
opt | When TRUE, snapshots the current state before restoring, making the restore itself reversible. |
Example
Section titled “Example”CALL CUBE.RESTORE_DIMENSION_SNAPSHOT( 'FINANCE', 'ENTITY', '<snapshot>', TRUE);DROP_DIMENSION_SNAPSHOT
Section titled “DROP_DIMENSION_SNAPSHOT”Minimum role: CUBE_ADMIN
DROP_DIMENSION_SNAPSHOT( CUBE_NAME_PARAM, DIM_NAME_PARAM, SNAPSHOT_NAME_PARAM) -> VARCHARDeletes a single dimension snapshot.
Parameters
Section titled “Parameters”| Parameter | Type | Req/Opt | Description |
|---|---|---|---|
CUBE_NAME_PARAM |
VARCHAR |
req | Cube name. |
DIM_NAME_PARAM |
VARCHAR |
req | Dimension name. |
SNAPSHOT_NAME_PARAM |
VARCHAR |
req | Snapshot to delete. |
Example
Section titled “Example”CALL CUBE.DROP_DIMENSION_SNAPSHOT( 'FINANCE', 'ENTITY', '<snapshot>');PRUNE_DIMENSION_SNAPSHOTS
Section titled “PRUNE_DIMENSION_SNAPSHOTS”Minimum role: CUBE_ADMIN
PRUNE_DIMENSION_SNAPSHOTS( CUBE_NAME_PARAM, DIM_NAME_PARAM, KEEP_COUNT) -> VARCHARDeletes older dimension snapshots while retaining the most recent number specified by KEEP_COUNT.
Parameters
Section titled “Parameters”| Parameter | Type | Req/Opt | Description |
|---|---|---|---|
CUBE_NAME_PARAM |
VARCHAR |
req | Cube name. |
DIM_NAME_PARAM |
VARCHAR |
opt | Dimension name. Pass NULL to prune snapshots across all dimensions. |
KEEP_COUNT |
FLOAT |
opt | Number of most recent snapshots to retain. |
Example
Section titled “Example”Keep the 10 most recent snapshots for ENTITY:
CALL CUBE.PRUNE_DIMENSION_SNAPSHOTS( 'FINANCE', 'ENTITY', 10);SNAPSHOT_MEMBERS
Section titled “SNAPSHOT_MEMBERS”Minimum role: CUBE_ADMIN
SNAPSHOT_MEMBERS( CUBE_NAME_PARAM, DIM_NAME_PARAM, SNAPSHOT_NAME_PARAM, MEMBER_PARAM, OPERATION_PARAM) -> VARCHARInspects or compares individual members within a snapshot. Use this procedure to investigate what changed about a member without restoring the snapshot.
Parameters
Section titled “Parameters”| Parameter | Type | Req/Opt | Description |
|---|---|---|---|
CUBE_NAME_PARAM |
VARCHAR |
req | Cube name. |
DIM_NAME_PARAM |
VARCHAR |
req | Dimension name. |
SNAPSHOT_NAME_PARAM |
VARCHAR |
req | Snapshot name. |
MEMBER_PARAM |
VARCHAR |
opt | Member name or pattern. |
OPERATION_PARAM |
VARCHAR |
opt | Operation to perform. |
Example
Section titled “Example”CALL CUBE.SNAPSHOT_MEMBERS( 'FINANCE', 'ENTITY', '<snapshot>', 'US_West', NULL);