Refreshing Cube Metadata

Overview

When a cube is accessed by a SAS OLAP Server, the cube data is read by the OLAP Server and then reported when queries against the cube are made. It is possible that changes and updates to a cube can occur after the OLAP Server accesses the cube. To make certain the data that is being queried is the most recent, the Refresh Cube function can be used. The Refresh Cube function enables the SAS OLAP Server to access cube data that was created or updated since the cube was last accessed by the SAS OLAP Server. You might also want to refresh a cube that has had changes or functions performed since you opened the cube in SAS OLAP Cube Studio. For example, if a cube has had calculated members or named sets defined by other users, the Refresh Cube function would make the changes visible with the Cube Viewer function.
To refresh a cube, select the cube in the tree view. Select Refresh Cube from the Actions menu or from the cube's context menu. The Refresh Cubes function then updates the OLAP server metadata for the cube. If the refresh process is successful, you receive a message in the lower left corner of the SAS OLAP Cube Studio window stating: “Cube Refresh of “cubename” is successful”.
You must be connected to a server and have administrative permissions in order to select the Refresh Cubes function.

MDX DDL REFRESH Statement

The REFRESH statement can be sent manually. You can send the REFRESH statement for each additional server that the schema is associated with.
refresh cube (cubename | "_ALL_" )
Cubename specifies a single cube to refresh for the current server connection. _ALL_ specifies that all cubes are refreshed for the current server connection. Here are some examples.
This example uses the REFRESH statement to refresh the metadata associated with a cube named OrionStar.
refresh cube [OrionStar]
This example uses the REFRESH statement to refresh the metadata for all cubes managed by the connected server.
refresh cube _ALL_
You can use the OLAP MDX SQL pass-through facility to send the DLL REFRESH statement to a server. Here is an example.
proc sql noerrorstop;
  connect to olap (&olapcon);
  execute
  (
    refresh cube [OrionStar]
  ) by olap;

proc sql noerrorstop;
  connect to olap (&olapcon);
  execute
  (
    refresh cube _ALL_
  ) by olap;