DROP ACCOUNT

删除一个账户,这将启动 :doc:` 删除该账户 </user-guide/organizations-manage-accounts-delete>` 的过程。

小技巧

除了 SQL,您还可以使用其他接口,如 Snowflake REST APIs、Snowflake Python APIs 和 Snowflake CLI。请参阅 备用接口

另请参阅:

CREATE ACCOUNTSHOW ACCOUNTSUNDROP ACCOUNT

语法

DROP ACCOUNT [ IF EXISTS ] <name> GRACE_PERIOD_IN_DAYS = <integer>
Copy

参数

name

指定要删除的账户的名称。例如,如果完整账户标识符为 myorg-account123,则指定 account123 为名称。如果您不知道账户名称,请执行 SHOW ACCOUNTS 命令,并在 account_name 列中找到该名称。

旧版账户定位器不能用于识别账户。

GRACE_PERIOD_IN_DAYS = integer

指定账户可以恢复(“取消删除”)的天数。最短为 3 天,最长为 90 天。

使用说明

  • 只有 组织管理员 才能执行命令。

  • 组织管理员无法删除他们当前登录的账户。

  • 如果指定了 IF EXISTS 子句,而目标对象不存在,该命令会成功完成,不会返回错误。

重要

If the account contains a snapshot set that has an associated snapshot policy with a retention lock, and there are any unexpired snapshots in the snapshot set, then you can't delete the account containing the snapshot set. In that case, you must wait for all the snapshots in the set to expire. This restriction applies even to privileged roles such as ACCOUNTADMIN, and to Snowflake support. For that reason, be careful when specifying retention lock and a long expiration period in a snapshot policy.

示例

要删除账户 my_account 并允许有 14 天的宽限期来恢复账户,请输入:

DROP ACCOUNT my_account GRACE_PERIOD_IN_DAYS = 14;
Copy

备用接口

语言: 中文