Updating SAS OLAP Cubes |
When a new generation of a cube is created, it can be designated as the production version of the original cube. The new generation must be given a different name from the original cube or reside in a different OLAP schema. In order to update a cube in production, you must disable the existing production cube, rename the cubes, and then enable the new production cube.
Disable the Production Cube |
To disable a cube, you can use either the SAS OLAP Monitor plug-in to SAS Management Console or the PROC OLAPOPERATE statement (see DISABLE CUBE). When a cube is disabled, it is taken offline and is not available for new queries. All existing query results are closed, but the sessions are left open and can be closed by the SAS OLAP Server Monitor. If a query is being processed, however, the disable action will fail.
Rename the Cubes |
Rename the original cube to another name (for example, Sales_OLD). Then rename the cube generation to the original cube name (Sales). To rename a cube, you can use either SAS OLAP Cube Studio or the PROC OLAP RENAME option. The RENAME option enables you to reassign cube generations. It is used with the OUTCUBE or the OUTSCHEMA options. Renaming a cube updates the metadata for the cube but does not change the file structure or physical location of the cube. To rename a cube, you must have ReadMetadata and WriteMetadata permissions on all parts of the cube and the cube must be disabled.
Enable the New Production Cube |
To enable a cube, you can use either the SAS OLAP Monitor plug-in to SAS Management Console or the PROC OLAPOPERATE statement (see ENABLE CUBE). Enabling the cube enables queries to resume on the server for the new production cube. Existing reports will continue to work as they reference the cube by name.
Example 1 |
Here is an example where an existing production cube is replaced with an updated version in the same schema. The old cube is then deleted.
Perform an incremental update on production cube A.
proc olap cube=A outcube=A_New add_data data=lib1.data1; metasvr .... ; run;
Disable the production cube.
proc olapoperate <server-connection-options>; disable cube A; run;
Rename the production cube to a temporary name.
proc olap rename cube=A outcube=A_Old; metasvr ...; run;
Rename the new cube to the original production cube name.
proc olap rename cube=A_New outcube=A; metasvr ...; run;
Enable the new production cube (make available for queries).
proc olapoperate <server-connection-options>; enable cube A; run;
Delete the old cube.
proc olap cube=A_Old delete; metasvr ...; run;
Example 2 |
In this second example, an existing production cube is replaced with an updated version from another schema and the old cube is archived.
Perform an incremental update on production cube A. This creates a cube A located in OLAP Schema TestSchema.
proc olap cube=A outschema=TestSchema add_data data=lib1.data1; metasvr .... olap_schema=ProductionSchema ; run;
Disable the production cube.
proc olapoperate <server-connection-options>; disable cube A; run;
Move the old cube to an archive schema.
proc olap rename cube=A outcube=A_September2005 outschema=ArchiveSchema; metasvr ... olap_schema=ProductionSchema; run;
Move the new cube to the original production schema.
proc olap rename cube=A outschema=ProductionSchema; metasvr ...olap_schema=TestSchema; run;
Enable the new production cube (make available for queries).
proc olapoperate <server-connection-options>; enable cube A; run;
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.