CubeSaveData

CubeSaveData() serializes a cube.

This function is valid in processes only.

This function is not available in processes on Planning Analytics Engine.

To improve performance, transaction logging may be disabled while loading data. To safeguard newly loaded data in the unlikely event of a server crash, the changes can be serialized to disk. SaveDataAll has been used to serialize data to disk and to truncate the transaction log. When processing a SaveDataAll command, the server acquires a READ lock on every cube and an IX lock on every changed cube. This can cause significant contention with user activity if SaveDataAll is run during periods of user activity.

Typically not all the cubes affected by SaveDataAll need to be serialized since not all cubes are typically loaded with new data. CubeSaveData is used to serialize an individual cube to disk. CubeSaveData serializes the cube's data that has been committed to memory including the modifications that have been performed against it in the current TurboIntegrator process but not yet committed.

Syntax

CubeSaveData(Cube);

Argument

Description

Cube

The name of the cube you want to serialize.

Example

CubeSaveData ('SalesCube');

Consider the following TurboIntegrator process code:

CellPutN(500, 'y2ksales', 'Actual', 'Argentina', 'S Series 1.8 L Wagon', 'Sales', 'Jan');

CubeSaveData('y2ksales');

CellPutN(1000, 'y2ksales', 'Actual', 'Argentina', 'S Series 1.8 L Wagon', 'Sales', 'Jan');

When the CubeSaveData command is processed, the value of 500 for the January Sales cell will be included in the cube's serialization to disk, even though it has not yet been committed. The update of the January Sales cell to 1000 will not be part of the serialization.

Transaction Log

A new transaction entry appears in the Transaction log when CubeSaveData has been run. When processing a transaction log file during recovery, all updates to a cube that have been applied so far will be discarded when a CubeSaveData directive against the cube is encountered as all of the updates have already been serialized to the cube.

Server Crash Recovery

The SaveDataAll command takes advantage of the fact that all cubes are locked during its processing and truncates the transaction log knowing that all updates performed before serialization have been safely stored to disk. This is not the case for CubeSaveData so you must modify the way data recovery is performed when a cube has been serialized.

The transaction log file could contain records that represent changes that are older than the most recent data in the cube and should not be applied when data is being recovered.