本节将介绍使用audit日志来追踪datashare的变更记录。
使用svl_datashare_change_log
视图,从生产端和消费端都能追踪到相关的变更记录
在etl-redshift-cluster
上执行:
select username, share_name, recordtime, action,
share_object_type, share_object_name
from svl_datashare_change_log
order by recordtime desc;
切换到bi-redshift-cluster
,由于上一节使用了sam
用户,先把连接改回成awsuser
:
然后执行:
select username, share_name, recordtime, action,
share_object_type, share_object_name
from svl_datashare_change_log
order by recordtime desc;
在etl-redshift-cluster
执行:
Select * from svl_datashare_usage_producer;
字段说明见 https://docs.aws.amazon.com/redshift/latest/dg/r_SVL_DATASHARE_USAGE_PRODUCER.html
在bi-redshift-cluster
执行:
Select * from svl_datashare_usage_consumer;