Dropping an account¶
The organization administrator (i.e. a user with the ORGADMIN role) can drop an account to delete it from the system. A dropped account is not deleted immediately, but rather enters a grace period during which the administrator can restore (“undrop”) the account. When the grace period expires, Snowflake purges the dropped account from the system.
The organization administrator cannot drop an account while they are logged in to it; they must log in to a different ORGADMIN account before executing the DROP ACCOUNT command. This means that the organization administrator cannot drop the last account in the organization. If your organization consists of a single account that needs to be deleted, contact Snowflake Support.
Tip
Because Snowflake does not permanently delete an account when it is initially dropped, you cannot immediately create a new account with the same name as the one you just dropped. As a workaround, rename the account before dropping it.
About the grace period¶
When dropping the account, the organization administrator defines a grace period during which the account can be restored, keeping in mind that the organization continues to pay for the cost of account storage during the grace period. Once an account is dropped, it is locked to prevent activity during the grace period.
The minimum grace period is 3 days and the maximum grace period is 90 days, not including the current date. For example, if the organization administrator defines the grace period as 3 days when they drop the account on Monday at 11 a.m., then the grace period expires on Thursday at 11 a.m.
If you want to change the grace period of a dropped account, restore the account, then drop it again with the new grace period.
The grace period is not the same as the data retention period of Time Travel.
Dropping an account¶
An organization administrator can drop an account using Snowsight, or SQL.
- Snowsight:
Select Admin » Accounts.
Find the active account, and select … » Drop Account.
Enter a grace period during which the account can be restored.
Select Drop Account.
- SQL:
Execute the DROP ACCOUNT command.
For example, to drop an account
my_account
and allow a 14-day grace period for recovering the account, enter:DROP ACCOUNT my_account GRACE_PERIOD_IN_DAYS = 14;
Note
If you want to drop a reader account, execute the DROP MANAGED ACCOUNT command.
Viewing dropped accounts¶
Organization administrators have multiple options for viewing dropped accounts that are still within their grace period. Some of these options also show dropped accounts that have been permanently deleted from the system.
- Snowsight:
You can use Snowsight to view all dropped accounts, including those that have been permanently deleted.
Select Admin » Accounts.
Select the Dropped Accounts tab.
Dropped accounts that are still within the grace period appear with a yellow indicator and have a Drop Date that is in the future.
Permanently deleted accounts have a Drop Date that is on or before the current date.
- SQL:
Executing the SHOW ACCOUNTS command with the optional HISTORY keyword shows dropped accounts that are still within their grace period. Permanently deleted accounts are not included in the output.
When the organization administrator executes the following command:
SHOW ACCOUNTS HISTORY;
The output includes dropped accounts and the additional
dropped_on
,scheduled_deletion_time
, andrestored_on
columns.- ACCOUNTS View:
Users with access to the ORGANIZATION_USAGE schema can query the ACCOUNTS view to see all dropped accounts, including those that have been permanently deleted.
Restoring an account¶
An organization administrator can restore, or undrop, a dropped account within the grace period, which prevents it from being purged. Undropping an account unlocks it, allowing users to access the account as if it had never been dropped.
An organization administrator can undrop an account using Snowsight or SQL.
- Snowsight:
Select Admin » Accounts.
Select the Dropped Accounts tab.
Find the account, and select … » Undrop Account.
Select Undrop Account.
- SQL:
Execute the UNDROP ACCOUNT command to restore an account. For example, the following command restores the dropped account
myaccount123
, which was still within the grace period:UNDROP ACCOUNT myaccount123;