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 CopiedThe target cube is independent of the source cube after the clone completes.
Clone a Cube Using the UI
Section titled “Clone a Cube Using the UI”From Cube Config:
- Select the cube you want to clone.
- Select Clone Cube.
- Enter a name for the new cube.
- Choose whether to select Rebuild dimensions after clone.
- 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.
Rebuild Dimensions After Clone Enabled
Section titled “Rebuild Dimensions After Clone Enabled”When selected, Casabase Cube:
Copies Configuration │ ▼Rebuilds Dimensions │ ▼Copies Fact Table │ ▼Populated Target CubeRebuild Dimensions After Clone Disabled
Section titled “Rebuild Dimensions After Clone Disabled”When not selected, Casabase Cube:
Copies Configuration │ ▼Dimensions Remain Inactive │ ▼Fact Table Is Not Copied │ ▼Empty Target CubeThe empty replica can then be modified, rebuilt, and populated independently.
Clone a Cube Using SQL
Section titled “Clone a Cube Using SQL”Use:
CUBE.CLONE_CUBEto 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.
Parameters
Section titled “Parameters”| 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 |
What Is Cloned
Section titled “What Is Cloned”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 CUBEThe 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.
Complete Replica
Section titled “Complete Replica”Set:
P_REBUILD = TRUEto create a populated replica of the source cube.
For example:
CALL CASABASE_CUBE.CUBE.CLONE_CUBE( 'FINANCE', 'FINANCE_TEST', TRUE);Casabase Cube:
- Copies the source cube configuration.
- Rebuilds the target cube’s dimensions.
- Copies the source cube’s fact table to the target cube.
Conceptually:
FINANCE │ ▼Copy Configuration │ ▼FINANCE_TEST │ ▼Rebuild Dimensions │ ▼Copy Fact Table │ ▼Populated FINANCE_TESTThis is useful when the target should begin as a complete replica of the source cube.
Empty Replica
Section titled “Empty Replica”Set:
P_REBUILD = FALSEto 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 DataThis is useful when you want to modify the cloned configuration before constructing and populating the target cube.
Dimensions and Hierarchies
Section titled “Dimensions and Hierarchies”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└── VERSIONproduces a target configuration containing corresponding dimension definitions:
FINANCE_TEST│├── ACCOUNT├── ENTITY├── PERIOD├── YEARS├── SCENARIO└── VERSIONThe target dimensions belong to the new cube and can subsequently be configured independently.
Rebuilding an Empty Replica
Section titled “Rebuilding an Empty Replica”When:
P_REBUILD = FALSEthe target dimensions remain inactive until they are rebuilt.
After making any desired configuration changes, use:
CUBE.REBUILD_DIMENSIONSFor example:
CALL CASABASE_CUBE.CUBE.REBUILD_DIMENSIONS( 'FINANCE_TEST', TRUE, FALSE, TRUE);Conceptually:
Empty Replica │ ▼Modify Configuration │ ▼REBUILD_DIMENSIONS │ ▼Active DimensionsRebuilding 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.
Fact Data Behavior
Section titled “Fact Data Behavior”Fact-data handling is directly tied to P_REBUILD.
P_REBUILD = TRUE
Section titled “P_REBUILD = TRUE”The source cube’s fact table is copied to the target.
Source Fact Table │ ▼ CLONE_CUBE P_REBUILD = TRUE │ ▼Target Fact TableThe resulting cube therefore begins with both the source configuration and source fact data.
P_REBUILD = FALSE
Section titled “P_REBUILD = FALSE”The source fact table is not copied.
Source Fact Table │ X │ CLONE_CUBE P_REBUILD = FALSE │ ▼No Target Fact DataThis produces an empty replica of the multidimensional model.
Fact data can subsequently be loaded into the target cube using the appropriate data-loading workflow.
Source and Target Independence
Section titled “Source and Target Independence”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 CubeYou 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.
Example: Creating a Populated Test Cube
Section titled “Example: Creating a Populated Test 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_TESTFINANCE_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 DataYou can then:
- Modify the cloned configuration.
- Rebuild the dimensions.
- Load development or test data.
- Validate the resulting cube.
This is particularly useful when production fact data should not be copied into a development or testing cube.
Clone Results
Section titled “Clone Results”CLONE_CUBE returns a summary of the clone operation.
When:
P_REBUILD = TRUEthe 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.
Security
Section titled “Security”CLONE_CUBE requires the:
CUBE_ADMINapplication 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:
Governance Considerations
Section titled “Governance Considerations”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 = FALSEcan provide the model configuration without copying the fact table.
See Data Classification.
Clone vs. Export / Import
Section titled “Clone vs. Export / Import”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.
Recommended Workflow
Section titled “Recommended Workflow”For a populated clone:
Select Source Cube │ ▼CLONE_CUBEP_REBUILD = TRUE │ ▼Configuration CopiedDimensions RebuiltFact Table Copied │ ▼Review Security │ ▼HEALTH_CHECK │ ▼Verification QueriesFor an empty replica:
Select Source Cube │ ▼CLONE_CUBEP_REBUILD = FALSE │ ▼Configuration Only │ ▼Review / ModifyConfiguration │ ▼REBUILD_DIMENSIONS │ ▼Load Target Data │ ▼HEALTH_CHECK │ ▼Verification QueriesAfter Cloning
Section titled “After Cloning”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 ResultUse:
CALL CUBE.HEALTH_CHECK('FINANCE_TEST');for broader cube validation.
Recommended Practices
Section titled “Recommended Practices”When cloning cubes:
- Choose
P_REBUILDbased on whether the target should include source fact data. - Use
P_REBUILD = FALSEwhen you need an empty replica. - Use
P_REBUILD = TRUEonly 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_CHECKafter 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.
Key Takeaways
Section titled “Key Takeaways”CLONE_CUBEcreates a new cube from an existing cube.- The target cube must not already exist.
- Cube configuration is copied regardless of
P_REBUILD. P_REBUILD = TRUErebuilds the target dimensions and copies the source fact table.P_REBUILD = FALSEcreates 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_CUBErequires theCUBE_ADMINapplication role.- Cloning is an administrative cube lifecycle operation.
- Export/import is the better choice when portable configuration rather than direct cube replication is required.
