SHOW BACKUP POLICIES¶
Lists all the backup policies in your account for which you have access privileges.
语法
参数
LIKE 'pattern'Optionally filters the command output by object name. The filter uses case-insensitive pattern matching, with support for SQL wildcard characters (
%and_).For example, the following patterns return the same results:
... LIKE '%testing%' ...... LIKE '%TESTING%' ...
Default: No value (no filtering is applied to the output).
[ IN ... ](可选)指定命令的作用域。指定以下任一项:
If you specify the keyword
ACCOUNT, then the command retrieves records for all schemas in all databases of the current account.If you specify the keyword
DATABASE, then:- If you specify a
db_name, then the command retrieves records for all schemas of the specified database. - If you don’t specify a
db_name, then:- If there is a current database, then the command retrieves records for all schemas in the current database.
- If there is no current database, then the command retrieves records for all databases and schemas in the account.
If you specify the keyword
SCHEMA, then:-
If you specify a qualified schema name (for example,
my_database.my_schema), then the command retrieves records for the specified database and schema. -
If you specify an unqualified
schema_name, then:- If there is a current database, then the command retrieves records for the specified schema in the current database.
- If there is no current database, then the command displays the error
SQL compilation error: Object does not exist, or operation cannot be performed.
-
If you don’t specify a
schema_name, then:-
If there is a current database, then:
- If there is a current schema, then the command retrieves records for the current schema in the current database.
- If there is no current schema, then the command retrieves records for all schemas in the current database.
-
If there is no current database, then the command retrieves records for all databases and all schemas in the account.
-
STARTS WITH 'name_string'Optionally filters the command output based on the characters that appear at the beginning of the object name. The string must be enclosed in single quotes and is case sensitive.
For example, the following strings return different results:
... STARTS WITH 'B' ...... STARTS WITH 'b' ...
Default: No value (no filtering is applied to the output)
- If you specify a
LIMIT rows(可选)限制返回的最大行数,同时还对结果启用“分页”功能。返回的实际行数可能小于指定的限制。例如,现有对象的数量小于指定的限制。
默认:无值(不对输出应用限制)
使用说明
-
The command returns a maximum of ten thousand records for the specified object type, as dictated by the access privileges for the role used to execute the command. Any records above the ten thousand records limit aren’t returned, even with a filter applied.
To view results for which more than ten thousand records exist, query the corresponding view (if one exists) in the Snowflake Information Schema.
要判断某个备份策略是否关联了任何备份集,请使用 SHOW BACKUP SETS 命令。
Note
备份策略是位于特定架构和数据库中的对象。因此,当对包含该策略的架构和数据库执行这些操作时,策略会被复制、删除或取消删除等。如果备份策略因关联了备份集而无法删除,则包含该策略的架构或数据库也无法删除。
输出
| Column | Description |
|---|---|
created_on | Timestamp backup policy was created. |
name | Name of backup policy. |
database_name | Name of database that contains the backup policy. |
schema_name | Name of schema that contains the backup policy. |
owner | Name of the role with the OWNERSHIP privilege on the backup policy. |
comment | Comment for backup policy. |
schedule | Schedule for backup creation. |
expire_after_days | Number of days after backup creation when backup expires. |
has_retention_lock | 指明策略是否包含保留锁定。
For more information, see Retention lock. |
owner | Name of the role with the OWNERSHIP privilege on the backup set. |
owner_role_type | Type of role with the OWNERSHIP privilege on the backup policy. |
示例
列出当前账户中您有权限访问的所有备份策略: