Skip to content

Cloning a Cube

Cloning creates a new Casabase Cube based on an existing cube.

A clone can be created either as:

  • A complete replica, including rebuilt dimensions and the source cube’s fact table.
  • An empty replica, containing the cube configuration without its fact data.

This makes cloning useful for:

  • Creating development or testing copies of a cube
  • Creating a sandbox for testing changes without affecting the source cube
  • Creating variations of a cube with different formulas or security rules
  • Creating an empty model based on an existing multidimensional structure
  • Creating a populated replica of an existing cube

The behavior is controlled by the Rebuild option.

Conceptually:

SOURCE CUBE
CLONE_CUBE
┌─────────┴─────────┐
│ │
P_REBUILD = TRUE P_REBUILD = FALSE
│ │
▼ ▼
Complete Replica Empty Replica
│ │
Configuration Copied Configuration Copied
Dimensions Rebuilt Dimensions Inactive
Fact Table Copied No Fact Data Copied

The target cube is independent of the source cube after the clone completes.

From Cube Config:

  1. Select the cube you want to clone.
  2. Select Clone Cube.
  3. Enter a name for the new cube.
  4. Choose whether to select Rebuild dimensions after clone.
  5. Select Clone.

The target cube name must not already exist.

The Rebuild dimensions after clone option determines whether the clone is created as a complete populated replica or an empty replica.

When selected, Casabase Cube:

Copies Configuration
Rebuilds Dimensions
Copies Fact Table
Populated Target Cube

When not selected, Casabase Cube:

Copies Configuration
Dimensions Remain Inactive
Fact Table Is Not Copied
Empty Target Cube

The empty replica can then be modified, rebuilt, and populated independently.

Use:

CUBE.CLONE_CUBE

to clone a cube programmatically.

For example:

CALL CASABASE_CUBE.CUBE.CLONE_CUBE(
'SOURCE_CUBE',
'NEW_CUBE',
TRUE
);

The procedure requires the CUBE_ADMIN application role.

Parameter Type Default Description
P_SOURCE_CUBE VARCHAR Name of the existing cube to clone.
P_TARGET_CUBE VARCHAR Name for the new cube. The target cube must not already exist.
P_REBUILD BOOLEAN FALSE Controls whether the target dimensions are rebuilt and the source fact table is copied.

The behavior of P_REBUILD is:

P_REBUILD Configuration Dimensions Fact Data Result
TRUE Copied Rebuilt Copied Populated replica
FALSE Copied Remain inactive until rebuilt Not copied Empty replica

The clone operation copies the multidimensional configuration associated with the source cube.

This includes:

  • Dimension definitions
  • Dimension column mappings and settings
  • Formulas
  • Cube variables
  • Saved queries
  • Security rules
  • Cube-level settings

For example:

SOURCE CUBE
├── Dimensions
├── Hierarchies
├── Formulas
├── Cube Variables
├── Saved Queries
├── Security Rules
└── Cube Settings
CLONE_CUBE
TARGET CUBE

The resulting target cube begins with the same logical multidimensional configuration as the source cube.

Whether it also begins with the source cube’s fact data depends on P_REBUILD.

Set:

P_REBUILD = TRUE

to create a populated replica of the source cube.

For example:

CALL CASABASE_CUBE.CUBE.CLONE_CUBE(
'FINANCE',
'FINANCE_TEST',
TRUE
);

Casabase Cube:

  1. Copies the source cube configuration.
  2. Rebuilds the target cube’s dimensions.
  3. Copies the source cube’s fact table to the target cube.

Conceptually:

FINANCE
Copy Configuration
FINANCE_TEST
Rebuild Dimensions
Copy Fact Table
Populated FINANCE_TEST

This is useful when the target should begin as a complete replica of the source cube.

Set:

P_REBUILD = FALSE

to create an empty replica.

For example:

CALL CASABASE_CUBE.CUBE.CLONE_CUBE(
'FINANCE',
'FINANCE_TEST',
FALSE
);

Casabase Cube copies the configuration but does not rebuild the target dimensions or copy the source fact table.

Conceptually:

FINANCE
Copy Configuration
FINANCE_TEST
├── Configuration Copied
├── Dimensions Inactive
└── No Fact Data

This is useful when you want to modify the cloned configuration before constructing and populating the target cube.

Cloning copies the dimension definitions from the source cube.

Each dimension retains the configuration required to construct its members and hierarchy structures, including applicable column mappings and dimension settings.

For example:

FINANCE
├── ACCOUNT
├── ENTITY
├── PERIOD
├── YEARS
├── SCENARIO
└── VERSION

produces a target configuration containing corresponding dimension definitions:

FINANCE_TEST
├── ACCOUNT
├── ENTITY
├── PERIOD
├── YEARS
├── SCENARIO
└── VERSION

The target dimensions belong to the new cube and can subsequently be configured independently.

When:

P_REBUILD = FALSE

the target dimensions remain inactive until they are rebuilt.

After making any desired configuration changes, use:

CUBE.REBUILD_DIMENSIONS

For example:

CALL CASABASE_CUBE.CUBE.REBUILD_DIMENSIONS(
'FINANCE_TEST',
TRUE,
FALSE,
TRUE
);

Conceptually:

Empty Replica
Modify Configuration
REBUILD_DIMENSIONS
Active Dimensions

Rebuilding the dimensions constructs the multidimensional structures. Because the original fact table was not copied when the empty replica was created, fact data must be loaded separately as required for the target cube.

See Rebuilding Dimensions.

Fact-data handling is directly tied to P_REBUILD.

The source cube’s fact table is copied to the target.

Source Fact Table
CLONE_CUBE
P_REBUILD = TRUE
Target Fact Table

The resulting cube therefore begins with both the source configuration and source fact data.

The source fact table is not copied.

Source Fact Table
X
CLONE_CUBE
P_REBUILD = FALSE
No Target Fact Data

This produces an empty replica of the multidimensional model.

Fact data can subsequently be loaded into the target cube using the appropriate data-loading workflow.

After cloning, the target cube is a separate Casabase Cube.

Changes made to the target do not modify the source cube.

For example:

FINANCE
└── Source Cube
FINANCE_TEST
└── Independent Target Cube

You can modify the target independently by:

  • Changing dimension definitions
  • Changing dimension settings
  • Adding dimensions
  • Modifying formulas
  • Changing cube variables
  • Changing security rules
  • Changing cube-level settings
  • Rebuilding dimensions
  • Loading different fact data

This makes cloning useful for experimentation and controlled model evolution without changing the source cube.

Assume FINANCE is a production cube and you want a populated replica for testing.

Use:

CALL CASABASE_CUBE.CUBE.CLONE_CUBE(
'FINANCE',
'FINANCE_TEST',
TRUE
);

The result is:

FINANCE
CLONE_CUBE
├── Configuration
├── Rebuilt Dimensions
└── Fact Data
FINANCE_TEST

FINANCE_TEST can then be modified independently.

Before making the clone available to users, review its configuration and security and run validation queries.

Example: Creating an Empty Development Cube

Section titled “Example: Creating an Empty Development Cube”

Suppose instead that you want the multidimensional structure of FINANCE but do not want to copy its business data.

Use:

CALL CASABASE_CUBE.CUBE.CLONE_CUBE(
'FINANCE',
'FINANCE_DEV',
FALSE
);

The result is:

FINANCE
CLONE_CUBE
└── Configuration Only
FINANCE_DEV
├── Dimensions Inactive
└── No Fact Data

You can then:

  1. Modify the cloned configuration.
  2. Rebuild the dimensions.
  3. Load development or test data.
  4. Validate the resulting cube.

This is particularly useful when production fact data should not be copied into a development or testing cube.

CLONE_CUBE returns a summary of the clone operation.

When:

P_REBUILD = TRUE

the results also include information associated with rebuilding the target dimensions.

Review the returned status to confirm that the clone and any requested rebuild completed successfully.

For important clones, follow the operation with a health check and representative queries.

CLONE_CUBE requires the:

CUBE_ADMIN

application role.

Security rules associated with the source cube are included in the cloned configuration.

This means a target cube can initially inherit the same Casabase Cube row-level security configuration as the source.

However, the target is an independent cube.

Review its security rules before making it available to users, particularly when:

  • The target serves a different audience.
  • The target is used for development or testing.
  • Different fact data will be loaded.
  • The target’s dimensions or hierarchy structures will be modified.

Remember that Casabase Cube row-level security is opt-in per user. A user with application access but no active security rules for the target cube remains unrestricted by Casabase Cube row-level security.

See:

Cloning can duplicate configuration and, when P_REBUILD = TRUE, business data.

Before creating a populated clone, consider whether the target environment and intended users are appropriate for the source cube’s data.

Review:

  • Data Classification
  • Target-user access
  • Row-level security rules
  • Purpose of the clone
  • Whether source fact data should be duplicated

For development and testing environments where production business data is not required, an empty replica created with:

P_REBUILD = FALSE

can provide the model configuration without copying the fact table.

See Data Classification.

Cloning and configuration export/import solve different administrative lifecycle problems.

Clone Cube Export / Import
Primary purpose Create another cube from an existing cube Preserve or move configuration
Operation Direct cube-to-cube operation Portable JSON configuration
Cross-environment use Primarily within the current Casabase Cube installation Designed for configuration portability
Configuration copied Yes Yes
Fact data included When P_REBUILD = TRUE No
Typical use Development, testing, sandbox, replica creation Environment promotion, backup, configuration management

See Exporting & Importing Configuration.

For a populated clone:

Select Source Cube
CLONE_CUBE
P_REBUILD = TRUE
Configuration Copied
Dimensions Rebuilt
Fact Table Copied
Review Security
HEALTH_CHECK
Verification Queries

For an empty replica:

Select Source Cube
CLONE_CUBE
P_REBUILD = FALSE
Configuration Only
Review / Modify
Configuration
REBUILD_DIMENSIONS
Load Target Data
HEALTH_CHECK
Verification Queries

After an important clone operation, validate the target before relying on it.

A practical sequence is:

Clone Cube
Review Configuration
Review Security
HEALTH_CHECK
Representative Query
Validate Business Result

Use:

CALL CUBE.HEALTH_CHECK('FINANCE_TEST');

for broader cube validation.

See Health and Diagnostics.

When cloning cubes:

  • Choose P_REBUILD based on whether the target should include source fact data.
  • Use P_REBUILD = FALSE when you need an empty replica.
  • Use P_REBUILD = TRUE only when copying the source fact table is appropriate.
  • Review Data Classification before creating populated clones.
  • Review target security rules before granting users access.
  • Remember that the target cube becomes independent of the source after cloning.
  • Rebuild dimensions before using an empty replica.
  • Load appropriate fact data into empty replicas after rebuilding.
  • Run HEALTH_CHECK after important clone operations.
  • Run representative queries before relying on a cloned cube for production or testing.
  • Use configuration export/import instead when portable configuration is the primary requirement.
  • CLONE_CUBE creates a new cube from an existing cube.
  • The target cube must not already exist.
  • Cube configuration is copied regardless of P_REBUILD.
  • P_REBUILD = TRUE rebuilds the target dimensions and copies the source fact table.
  • P_REBUILD = FALSE creates an empty replica with inactive dimensions and no copied fact data.
  • An empty replica can be modified before its dimensions are rebuilt.
  • Fact data can be loaded separately into an empty replica.
  • The target cube is independent of the source after cloning.
  • Security rules are included in the cloned configuration and should be reviewed before granting access.
  • CLONE_CUBE requires the CUBE_ADMIN application role.
  • Cloning is an administrative cube lifecycle operation.
  • Export/import is the better choice when portable configuration rather than direct cube replication is required.