Dropping a Cube
Dropping a cube permanently removes the cube and its associated Casabase Cube objects.
This is an administrative lifecycle operation intended for cubes that are no longer required.
Because the operation is destructive, Casabase Cube requires explicit confirmation before the cube is deleted.
Conceptually:
Existing Cube │ ▼ DROP_CUBE │ ▼Confirmation Required │ ┌───┴───┐ │ │FALSE TRUE │ │ ▼ ▼Preview PermanentlyOnly Drop CubeWhat Is Removed
Section titled “What Is Removed”Dropping a cube removes the cube and its associated Casabase Cube configuration.
This includes configuration such as:
- Dimension and hierarchy configuration
- Formulas
- Cube variables
- Saved queries
- Row-level security rules
- Cube-level settings
- Other objects associated with the cube
Conceptually:
Cube │ ├── Dimensions ├── Hierarchies ├── Formulas ├── Cube Variables ├── Saved Queries ├── Security Rules └── Cube Settings │ ▼ DROP_CUBE │ ▼ RemovedThe operation acts on the selected Casabase Cube. It does not represent a general-purpose deletion of customer-owned Snowflake source objects.
For example, a customer-owned dimension definition table such as:
FINANCE_DB.PLANNING.DIM_ACCOUNTis a Snowflake source object referenced by the cube configuration.
Casabase Cube access to customer-owned objects is governed separately through Snowflake privileges.
Before Dropping a Cube
Section titled “Before Dropping a Cube”Before permanently removing a cube, consider whether its configuration may be needed later.
A recommended pre-drop sequence is:
Identify Cube │ ▼Review Dependencies │ ▼Export Configuration │ ▼Preview DROP_CUBE │ ▼Confirm Correct Cube │ ▼Drop CubeUse:
EXPORT_CUBE_CONFIGto preserve the cube configuration as JSON before deletion.
See Exporting & Importing Configuration.
Remember that a configuration export does not contain the cube’s business data or the contents of referenced dimension definition tables. If those are required for recovery, they must be preserved separately.
Drop a Cube Using the UI
Section titled “Drop a Cube Using the UI”From Cube Config:
- Select the cube you want to remove.
- Select Drop Cube.
- Type the cube name to confirm the operation.
- Select Drop Cube.
Requiring the cube name to be entered provides an additional safeguard against accidental deletion.
Before confirming the operation, verify that you have selected the intended cube.
Drop a Cube Using SQL
Section titled “Drop a Cube Using SQL”Use:
CUBE.DROP_CUBEto drop a cube programmatically.
DROP_CUBE uses a two-step confirmation pattern.
Step 1: Preview the Operation
Section titled “Step 1: Preview the Operation”First call the procedure with:
P_CONFIRM = FALSEFor example:
CALL CASABASE_CUBE.CUBE.DROP_CUBE( 'MY_CUBE', FALSE);This performs a dry run.
No objects are deleted.
Instead, Casabase Cube returns a summary of what would be removed.
Step 2: Confirm the Operation
Section titled “Step 2: Confirm the Operation”After reviewing the preview, call the procedure with:
P_CONFIRM = TRUEFor example:
CALL CASABASE_CUBE.CUBE.DROP_CUBE( 'MY_CUBE', TRUE);This permanently removes the cube and its associated objects.
Parameters
Section titled “Parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
P_CUBE_NAME |
VARCHAR |
Name of the cube to drop. | |
P_CONFIRM |
BOOLEAN |
FALSE |
When FALSE, previews what will be deleted without making changes. When TRUE, permanently deletes the cube and its associated objects. |
The default:
P_CONFIRM = FALSEmakes the procedure non-destructive unless deletion is explicitly confirmed.
Dry-Run Behavior
Section titled “Dry-Run Behavior”The dry-run capability is an important safety feature.
When:
P_CONFIRM = FALSECasabase Cube returns information about the cube and the objects that would be removed without modifying the cube.
The preview includes counts such as:
- Hierarchies
- Formulas
- Cube variables
- Saved queries
- Security rules
Conceptually:
DROP_CUBEP_CONFIRM = FALSE │ ▼Inspect Cube │ ▼Return Deletion Summary │ ▼No Changes MadeUse the preview to confirm that:
- The correct cube was selected.
- The expected configuration is associated with the cube.
- Any configuration that must be retained has been exported.
- The cube is ready for permanent deletion.
Confirmed Drop Behavior
Section titled “Confirmed Drop Behavior”When:
P_CONFIRM = TRUEthe operation becomes destructive.
Conceptually:
DROP_CUBEP_CONFIRM = TRUE │ ▼Confirm Cube │ ▼Remove Cube andAssociated Objects │ ▼Cube No Longer AvailableThis action cannot be undone through DROP_CUBE.
If the cube configuration was exported beforehand, it may be possible to recreate the configuration later using:
IMPORT_CUBE_CONFIGbut configuration import should not be treated as restoration of the cube’s business data.
Example: Safely Dropping a Cube
Section titled “Example: Safely Dropping a Cube”Suppose the cube:
FINANCE_TESTis no longer required.
First export its configuration if you may need to recreate it later:
CALL CASABASE_CUBE.CUBE.EXPORT_CUBE_CONFIG( 'FINANCE_TEST');Then preview the drop:
CALL CASABASE_CUBE.CUBE.DROP_CUBE( 'FINANCE_TEST', FALSE);Review the returned summary.
If the correct cube has been identified and you are ready to delete it:
CALL CASABASE_CUBE.CUBE.DROP_CUBE( 'FINANCE_TEST', TRUE);The sequence is:
FINANCE_TEST │ ▼Export Configuration │ ▼DROP_CUBE(FALSE) │ ▼Review Preview │ ▼DROP_CUBE(TRUE) │ ▼Cube RemovedDropping a Cube vs. Clearing Cube Data
Section titled “Dropping a Cube vs. Clearing Cube Data”Dropping a cube should not be confused with removing only the data from an existing cube.
These are different lifecycle operations.
DROP_CUBE │ └── Removes the cube and associated objects
CLEAR_CUBE_DATA │ └── Removes data from the cube's fact table while preserving the cube structureUse:
DROP_CUBEwhen the cube itself is no longer required.
Use:
CLEAR_CUBE_DATAwhen the multidimensional model should remain but its fact data needs to be removed.
This distinction is particularly important when preparing a cube for a new data load or when retaining its configuration for continued use.
Dropping a Cube vs. Creating an Empty Clone
Section titled “Dropping a Cube vs. Creating an Empty Clone”If you need a configuration-only copy of an existing cube, do not drop and recreate the model manually.
Instead, CLONE_CUBE can create an empty replica using:
P_REBUILD = FALSEThis copies the cube configuration without copying the source fact table.
Conceptually:
Existing Cube │ ├───────────────┐ │ │ ▼ ▼ DROP_CUBE CLONE_CUBE P_REBUILD = FALSE │ │ ▼ ▼Cube Removed Empty Replica Configuration PreservedSee Cloning a Cube.
Configuration Recovery
Section titled “Configuration Recovery”If you exported the configuration before dropping the cube, the JSON can be used to recreate configuration through:
IMPORT_CUBE_CONFIGConceptually:
Before Drop
Cube │ ▼EXPORT_CUBE_CONFIG │ ▼Configuration JSON
Later
Configuration JSON │ ▼IMPORT_CUBE_CONFIG │ ▼Recreated ConfigurationHowever:
Configuration Recovery ≠Complete Data RecoveryThe exported JSON does not include business data or the contents of referenced dimension definition tables.
See Exporting & Importing Configuration.
Security and Permissions
Section titled “Security and Permissions”DROP_CUBE requires the:
CUBE_ADMINapplication role.
Because dropping a cube permanently removes application objects, access to CUBE_ADMIN should be limited to users who require administrative capabilities.
The Snowflake account role used by an administrator must have access to the Casabase Cube application role through the appropriate Snowflake grants.
See Roles and Privileges.
Audit Considerations
Section titled “Audit Considerations”Dropping a cube is a significant administrative lifecycle event.
Where applicable, review Casabase Cube audit information as part of operational or governance procedures involving cube deletion.
Organizations may also choose to retain:
- The exported cube configuration
- Change-management approval
- The reason for deletion
- The administrator responsible for the operation
- Relevant operational records
according to their own governance and retention requirements.
See Audit Log.
Recommended Workflow
Section titled “Recommended Workflow”For production or otherwise important cubes, use the following workflow:
Confirm Cube IsNo Longer Required │ ▼Review RecoveryRequirements │ ▼Export Configuration │ ▼Preserve RequiredData Separately │ ▼DROP_CUBEP_CONFIRM = FALSE │ ▼Review Preview │ ▼Confirm Cube Name │ ▼DROP_CUBEP_CONFIRM = TRUE │ ▼Verify RemovalThe dry run should be treated as a normal part of the SQL deletion workflow rather than an optional troubleshooting step.
Recommended Practices
Section titled “Recommended Practices”When dropping cubes:
- Use
P_CONFIRM = FALSEfirst to preview the operation. - Review the returned object counts before confirming deletion.
- Verify the cube name carefully.
- Export configuration before dropping an important cube.
- Remember that configuration export does not preserve business data.
- Preserve any required source data or other recovery artifacts separately.
- Use
P_CONFIRM = TRUEonly after confirming that permanent deletion is intended. - Restrict
CUBE_ADMINaccess appropriately. - Use
CLEAR_CUBE_DATAinstead when only fact data should be removed. - Retain appropriate audit or change-management records for important production deletions.
- Do not rely on configuration export as a complete data-recovery mechanism.
Key Takeaways
Section titled “Key Takeaways”DROP_CUBEpermanently removes a Casabase Cube and its associated objects.- The operation requires the
CUBE_ADMINapplication role. P_CONFIRMdefaults toFALSE.P_CONFIRM = FALSEperforms a dry run and does not modify the cube.- The dry run returns a summary of objects that would be removed.
P_CONFIRM = TRUEperforms the permanent deletion.- The UI requires the cube name to be entered as confirmation.
- Important configuration should be exported before dropping a cube when recovery may be required.
- Configuration export does not contain business data.
CLEAR_CUBE_DATAshould be used instead when the cube structure should remain and only fact data needs to be removed.- Dropping a cube is an administrative cube lifecycle operation.
