监控动态表
This topic describes how to view and monitor the dynamic tables in your pipelines. For guidance on what to look for when diagnosing performance issues, see Monitor dynamic table performance.
| Section | Description |
|---|---|
| 列出动态表或查看有关特定列的信息 | List the dynamic tables in a schema and view information about them. |
| 查看连接到动态表的表图形 | See the graph of tables connected to your dynamic tables. |
| 使用 SQL 表函数监控动态表 | Monitor your dynamic tables using SQL table functions. |
| 监控动态表的刷新状态 | View the refresh status for your dynamic tables. |
列出动态表或查看有关特定列的信息
To list the dynamic tables in a schema and view information about those dynamic tables, you can use either the following SQL commands or Snowsight, as long as you use a role that has the MONITOR privilege on the dynamic tables.
For more information, see Privileges to view a dynamic table’s metadata.
To list the dynamic tables in the current database (or in the account, if no database is currently in use), use the SHOW DYNAMIC TABLES command.
For example, to list the dynamic tables with names that start with product_ in the database mydb and schema myschema, execute
the following SQL statement:
To output information about the columns in a dynamic table, use the DESCRIBE DYNAMIC TABLE command.
For example, to list the columns in my_dynamic_table, execute the following SQL statement:
Dynamic tables are also included in the results of the TABLES view.
要列出架构中的动态表并查看有关特定动态表的信息,请执行以下操作:
- Sign in to Snowsight.
- In the navigation menu, select Catalog » Database Explorer.
- 选择数据库和架构。
- Select the Dynamic Tables tab or expand Dynamic Tables in the database object explorer.
- To view information about a specific dynamic table, select the dynamic table from the list of dynamic tables in the Dynamic Tables tab or from the database object explorer.
- 此页面中的选项卡可提供有关所选动态表的以下详细信息:
-
Table Details: Displays basic information about the dynamic table, including:
-
动态表的计划状态。
-
The last refresh status of your dynamic table. For failed refreshes, you can see more information about the error if you hover over the status.
-
动态表的当前滞后和目标滞后。
-
Whether incremental refreshes or full refreshes are used to update the table.
-
动态表的定义。
-
动态表的标签。
-
为使用动态表而授予的权限。
-
- Columns: Information about the columns in the dynamic table.
- Data Preview: A preview of up to 100 rows of the data in the dynamic table.
- Graph: Displays the directed acyclic graph (DAG) that includes this dynamic table.
- Refresh History: Displays the history of refreshes and the lag metrics.
查看连接到动态表的表图形
Viewing dependencies is particularly useful for troubleshooting dynamic table chains. In Snowsight, you can visualize which dynamic tables a given dynamic table depends on using the lineage graph. For example, you can identify the following:
- 动态表从中提取数据的上游依赖项。
- 可能受到动态表更改影响的下游依赖项。

依赖项可能会影响刷新性能。例如,假设动态表的上游表在计划刷新之前添加了大量数据负载。动态表将等待它完成刷新,从而导致其无法满足目标滞后要求。在沿袭图中,您会看到标记为“正在执行”的输入表,这表示存在延迟。
要查看特定动态表的图表,请执行以下操作:
- Sign in to Snowsight.
- In the navigation menu, select Transformation » Dynamic tables.
- Select your dynamic table. The Graph view is displayed by default. This displays the graph with the node for the dynamic table selected. The Details pane on the right displays information about its lag metrics and configuration.
- 要在图表中显示不同表的详细信息,请选择相应表。
要更新图表,请选择图表上方栏中的刷新按钮。

如果由于 UPSTREAM_FAILED 错误代码导致刷新失败,则可以使用图表来可视化哪个上游表导致了失败。

To view the full details of a table in the graph, see 列出动态表或查看有关特定列的信息.
使用 SQL 表函数监控动态表¶
使用以下 INFORMATION_SCHEMA 表函数监控动态表:
-
DYNAMIC_TABLES: Returns metadata about your dynamic tables, including aggregate lag metrics and the status of the most recent refreshes, within seven days of the current time.
-
DYNAMIC_TABLE_REFRESH_HISTORY: Returns information about each completed and running refresh of your dynamic tables, including refresh status and trigger, and the target lag.
- DYNAMIC_TABLE_REFRESH_HISTORY view: This Account Usage view also displays information for dynamic table refresh history. It is useful for debugging issues that are for longer than the DYNAMIC_TABLE_REFRESH_HISTORY table function’s data retention time (seven days).
-
DYNAMIC_TABLE_GRAPH_HISTORY: Returns information that provides the history of each dynamic table, its properties, and its dependencies on other tables and dynamic tables.
您可以使用此表函数获取给定时间点动态表的依赖关系树的快照。
输出还反映了随时间推移动态表属性所做的更改。每行表示一个动态表和一组特定的属性。如果更改动态表的某个属性(例如,目标滞后),则该函数将返回最新的属性。
监控动态表的刷新状态
本节介绍如何查看所有动态表或特定动态表的刷新状态。
- For guidance on what to look for when diagnosing slow refreshes, see Monitor dynamic table performance.
- For troubleshooting skipped or failed refreshes, see Troubleshooting skipped or failed dynamic table refreshes.
监控所有动态表的刷新
You can use Snowsight or the DYNAMIC_TABLES table function to view the refresh status for all your dynamic tables.
Sign in to Snowsight. In the navigation menu, select Transformation » Dynamic tables.
您可以在此页面上查看所有动态表的状态和上次刷新状态。您还可以按数据库或架构进行筛选以缩小结果范围。

DYNAMIC_TABLES provides information about all of the dynamic tables in your account.
以下示例检索有关账户中所有动态表及其关联数据库和架构的状态和目标滞后的信息。
以下示例检索账户中所有动态表的状态及每个状态的相关信息,以便进行刷新。
监控特定动态表的所有刷新
You can use Snowsight or the DYNAMIC_TABLE_REFRESH_HISTORY table function to view the refresh history for a given dynamic table.
- Sign in to Snowsight.
- In the navigation menu, select Transformation » Dynamic tables.
- Select your dynamic table and then go to the Refresh History tab.
此页面显示动态表的刷新历史记录,其中包括有关每次刷新的状态、持续时间和实际滞后时间以及每次刷新时更改的行数的信息。
它还显示动态表的滞后指标,其中包括目标滞后内的时间百分比以及给定间隔内最长的实际滞后时间。

To view the refresh history for a specific dynamic table, use the DYNAMIC_TABLE_REFRESH_HISTORY table function.
For example, if you want to view the refresh history for all the dynamic tables in the my_db database and my_schema schema, execute
the following statement:
To filter for refreshes that had errors, pass in the argument ERROR_ONLY => TRUE. For example: