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:

  1. Delete all the clean rooms that you created as a provider.

  2. Uninstall all the clean rooms that you installed (joined) as a consumer.

  3. Contact Snowflake Support to retrieve your account metadata.

  4. 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;
Copy

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 Three vertical dots indicating more options next to the clean room name in the clean room web app, then select Delete.

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.

  1. Sign in to the clean rooms app as an administrator:

    • Admin > Snowflake Admin > Log in to Snowflake.

  2. Uninstall all your clean rooms:

    1. Clean rooms > Created >, then for each tile choose More (Three vertical dots indicating more options) > Delete.

    2. Clean Rooms > Joined >, then for each tile choose More (Three vertical dots indicating more options) > Leave.