Uninstalling the clean rooms environment¶
Uninstall the clean rooms application¶
To completely uninstall the clean room app from your account, you must use the ACCOUNTADMIN role in the Snowflake account where the clean room application is installed. This will delete the clean rooms environment for all users in your account, both as clean room providers and clean room consumers.
Important
This procedure completely uninstalls the entire environment, not just individual clean rooms.
To uninstall the clean rooms application for your account:
Uninstall all the clean rooms that you installed (joined) as a consumer.
Contact Snowflake Support to retrieve your account metadata.
When instructed by Snowflake support, run the following cleanup script:
-- Drop created and installed (joined) clean rooms, if you have not done so. USE ROLE ACCOUNTADMIN -- Drop listings SHOW LISTINGS; SELECT CONCAT('alter listing ', "name", ' unpublish; drop listing ', "name", ';') FROM TABLE(RESULT_SCAN(last_query_id())) WHERE "name" LIKE 'SAMOOHA_CLEANROOM_%'; -- Drop shares SHOW SHARES; SELECT CONCAT('drop share ', "name", ';') FROM TABLE(RESULT_SCAN(last_query_id())) WHERE "kind" = 'OUTBOUND' AND "name" LIKE 'SAMOOHA_CLEANROOM_%'; -- These 3 shares have to be dropped manually: DROP SHARE SAMOOHA_INTERNAL_GOVERNANCE_SUMMARY_SHARE_NAV2; DROP SHARE SAMOOHA_INTERNAL_LOGS_SHARE_NAV2; DROP SHARE SAMOOHA_INTERNAL_PROVIDER_METADATA_NAV2; -- Drop applications SHOW APPLICATIONS; SELECT CONCAT('drop application ', "name", ' cascade;') FROM TABLE(RESULT_SCAN(last_query_id())) WHERE "name" LIKE 'SAMOOHA_CLEANROOM_APP_%'; -- Drop application packages SHOW APPLICATION PACKAGES; SELECT CONCAT('drop application package ', "name", ' cascade;') FROM TABLE(RESULT_SCAN(last_query_id())) WHERE "name" LIKE 'SAMOOHA_CLEANROOM_%'; -- Drop databases SHOW DATABASES; SELECT CONCAT('drop database ', "name", ';') FROM TABLE(RESULT_SCAN(last_query_id())) WHERE "name" = 'SAMOOHA_SAMPLE_DATABASE' OR "name" LIKE 'SAMOOHA_CLEANROOM_%' OR "name" = 'SAMOOHA_BY_SNOWFLAKE_LOCAL_DB' OR "name" LIKE 'SAMOOHA_INTERNAL_GOVERNANCE_%' AND NOT startswith("name", 'SAMOOHA_CLEANROOM_CONSUMER_'); -- Finally drop the Snowflake native app DROP APPLICATION SAMOOHA_BY_SNOWFLAKE CASCADE;
Delete a clean room that you created¶
The clean room will no longer be visible to shared users the next time they open the clean room web app. If an analysis is in progress when a clean room is deleted, it might not complete before the clean room is deleted.
To delete a clean room in the web app, select the more button next to the clean room name in the
clean room web app, then select Delete.
To delete a single clean room using the API, call provider.drop_cleanroom.
To list your created clean rooms, call provider.view_cleanrooms:
USE ROLE samooha_app_role; USE WAREHOUSE app_wh; -- List created and published clean rooms CALL samooha_by_snowflake_local_db.provider.view_cleanrooms(); SELECT CLEANROOM_ID AS "cleanroom_name" FROM TABLE(RESULT_SCAN(last_query_id())) WHERE STATE = 'CREATED' AND IS_PUBLISHED = TRUE; -- Specify a clean room name from the list and drop it CALL samooha_by_snowflake_local_db.provider.drop_cleanroom($cleanroom_name);
Uninstall a clean room¶
You can uninstall a clean room that you installed (joined) as a consumer. This will uninstall the clean room for all users in the account.
To uninstall (unjoin) a single clean room using the API, call consumer.uninstall_cleanroom.
To list your installed (joined) clean rooms, call samooha_by_snowflake_local_db.consumer.view_cleanrooms and filter rows to IS_ALREADY_INSTALLED = TRUE. This shows clean rooms that are installed rather than simply invitations to join.
USE ROLE samooha_app_role; USE WAREHOUSE app_wh; CALL samooha_by_snowflake_local_db.consumer.view_cleanrooms(); SELECT CLEANROOM_ID AS "cleanroom_name" FROM TABLE(RESULT_SCAN(last_query_id())) WHERE IS_ALREADY_INSTALLED = TRUE; CALL samooha_by_snowflake_local_db.consumer.uninstall_cleanroom($cleanroom_name);