- Schema:
LISTING_ ACCESS_ HISTORY 视图¶
This view in the DATA_SHARING_USAGE schema can be used to explore the history of consumers’ usage of your listings. LISTING_ACCESS_HISTORY provides object-level information about queries run against the data shares or Native Apps attached to your listings. For more information about the data provided by the LISTING_ACCESS_HISTORY view, see the Columns section.
LISTING_ACCESS_HISTORY 返回的每一行都代表使用者对列表的一次访问。由于这些行代表的是查询而不是会话,因此同一列表很可能会出现多次,每次查询出现一行。
单个使用者查询可以访问多个列表中的对象。QUERY_TOKEN 识别在列表访问历史记录中生成一行的查询。要识别通过单个使用者查询访问的列表对象的集合,请使用 QUERY_TOKEN。
LISTING_ACCESS_HISTORY 视图不允许提供商获取任何私人使用者信息,例如查询的实际文本。该视图还排除不属于提供商账户的任何对象。例如,如果使用者将列表中的数据与他们自己的数据或其他提供商的数据相结合,则 LISTING_ACCESS_HISTORY 视图仅返回您拥有的列表对象。
列
| Column Name | Data Type | Description |
|---|---|---|
| QUERY_TOKEN | VARCHAR | Unique ID for each query run by a consumer. A QUERY_TOKEN does not correlate with any actual query identifier on the consumer side. |
| QUERY_DATE | DATE | Date when the query was executed. |
| EXCHANGE_NAME | VARCHAR | Snowflake Marketplace or the data exchange where the listing is available. |
| SNOWFLAKE_REGION | VARCHAR | Snowflake region where the consumption occurred. |
| LISTING_GLOBAL_NAME | VARCHAR | Global name of the listing in the Snowflake Marketplace or data exchange that provides the share. |
| PROVIDER_ACCOUNT_LOCATOR | VARCHAR | Account locator of the share owner. |
| PROVIDER_ACCOUNT_NAME | VARCHAR | Account name of the share owner. |
| SHARE_NAME | VARCHAR | Name of the data share that consumers accessed. When IS_SHARE is FALSE, the value is NULL. |
| CONSUMER_ACCOUNT_LOCATOR | VARCHAR | Account locator of the consumer. |
| CONSUMER_ACCOUNT_NAME | VARCHAR | Account name of the consumer. |
| CONSUMER_ACCOUNT_ORGANIZATION | VARCHAR | Name of the organization for the consumer account. |
| LISTING_OBJECTS_ACCESSED | ARRAY | Use SHARE_OBJECTS_ACCESSED as it contains the same data. When IS_SHARE is FALSE, the value is NULL. See LISTING_OBJECTS_ACCESSED 数组 for formatting. |
| REGION_GROUP | VARCHAR | Region group where the account of the consumer is located. |
| CONSUMER_NAME | VARCHAR | Contains the name of the consumer account that accessed, used, or requested a listing. If no name is available, such as for trial accounts, the value is NULL. |
| IS_SHARE | BOOLEAN | TRUE if the access was on a share. When TRUE, the SHARE_OBJECTS_ACCESSED column provides details about the share objects accessed by the consumer query. |
| IS_APPLICATION | BOOLEAN | TRUE if the access was on an application. When TRUE, APPLICATION_OBJECTS_ACCESSED column provides details about the application objects accessed by the consumer query. |
| SHARE_OBJECTS_ACCESSED | ARRAY | Details the share objects accessed by the consumer query. When IS_SHARE is FALSE, the value is NULL. See SHARE_OBJECTS_ACCESSED 数组 for formatting. |
| APPLICATION_OBJECTS_ACCESSED | ARRAY | Details the application objects accessed by the consumer query. When IS_APPLICATION is FALSE, the value is NULL. See APPLICATION_OBJECTS_ACCESSED 数组. |
| APPLICATION_PACKAGE_NAME | VARCHAR | The current name of the application package from which the application was installed. When IS_APPLICATION is FALSE, the value is NULL. |
| APPLICATION_VERSION | VARCHAR | The version of the application when the query occurred. When IS_APPLICATION is FALSE, the value is NULL |
| APPLICATION_PATCH_ID | NUMBER | The application patch number when the query occurred. When IS_APPLICATION is FALSE, the value is NULL. |
使用说明
- 视图的延迟时间最长可达 2 天。
- 数据会保留 365 天(1 年)。
SHARE_ OBJECTS_ ACCESSED 数组¶
SHARE_OBJECTS_ACCESSED 数组提供有关使用者查询访问的共享中的对象的详细信息。数组中项目的格式取决于所访问的对象的类型。
函数:
存储过程:
表、视图和列:
Cortex Search Service:
APPLICATION_ OBJECTS_ ACCESSED 数组¶
APPLICATION_OBJECTS_ACCESSED 数组提供有关使用者查询访问的原生应用程序中的对象的详细信息。数组中项目的格式取决于所访问的对象的类型。
与 LISTING_OBJECTS_ACCESSED 列数组结果不同,包含对象 IDs 的 APPLICATION_OBJECTS_ACCESSED 结果不可用,且数据库名称已掩码。
函数:
存储过程:
表、视图和列:
LISTING_ OBJECTS_ ACCESSED 数组¶
Use SHARE_OBJECTS_ACCESSED Array instead.
示例
本节包含 LISTING_ACCESS_HISTORY 视图的以下示例 SQL 查询。
不同时间段访问情况汇总视图
汇总视图,其中显示了(在特定时间段内)已访问的函数、存储过程、表、视图和列以及总次数。
使用者随时间推移的访问情况汇总视图
This example is similar to 不同时间段访问情况汇总视图, broken down by consumer.
访问次数(按列)
对于给定对象(表、视图),每列被访问的次数。
表格联接
该视图显示了要将哪些表组合联接在一起。
表格联接(按使用者)
该视图显示了按使用者细分的哪些表被联接在一起(成对)。