SYS_DATASHARE_CHANGE_LOG - Amazon Redshift

SYS_DATASHARE_CHANGE_LOG

Records the consolidated view for tracking changes to datashares on both producer and consumer clusters.

SYS_DATASHARE_CHANGE_LOG is visible to all users. Superusers can see all rows; regular users can see only their own data. For more information, see Visibility of data in system tables and views.

Table columns

Column name Data type Description
user_id integer The ID of the user taking the action.
user_name varchar(128) The name of the user taking the action.

session_id

integer The ID of the session.
transaction_id bigint The ID of the transaction.
share_id integer The ID of the datashare affected.
share_name varchar(128) The name of the datashare.
source_database_id integer The ID of the database to which the datashare belongs.
source_database_name varchar(128) The name of the database to which the datashare belongs.
consumer_database_id integer The ID of the database imported from the datashare.
consumer_database_name varchar(128) The name of the database imported from the datashare.
arn varchar(192) The ARN of the resource backing the imported database.
record_time timestamp The timestamp of the action.
action varchar(128) The action being run. Possible values are CREATE DATASHARE, DROP DATASHARE, GRANT ALTER, REVOKE ALTER, GRANT SHARE, REVOKE SHARE, ALTER ADD, ALTER REMOVE, ALTER SET, GRANT USAGE, REVOKE USAGE, CREATE DATABASE, GRANT, or REVOAKE USAGE on a shared database, DROP SHARED DATABASE, ALTER SHARED DATABASE.
status integer The status of the action. Possible values are SUCCESS and ERROR-ERROR CODE.
share_object_type varchar(64) The type of database object that was added to or removed from the datashare. Possible values are schemas, tables, columns, functions, and views. This is a field for the producer cluster.
share_object_id integer The ID of database object that was added to or removed from the datashare. This is a field for the producer cluster.
share_object_name varchar(128) The name of database object that was added to or removed from the datashare. This is a field for the producer cluster.
target_user_type varchar(16) The type of users or groups that a privilege was granted to. This is a field for both the producer and consumer cluster.
target_user_id integer The ID of users or groups that a privilege was granted to. This is a field for both the producer and consumer cluster.
target_user_name varchar(128) The name of users or groups that a privilege was granted to. This is a field for both the producer and consumer cluster.
consumer_account varchar(16) The account ID of the data consumer. This is a field for the producer cluster.
consumer_namespace varchar(64) The namespace of the data consumer account. This is a field for the producer cluster.
producer_account varchar(16) The account ID of the producer account that the datashare belongs to. This is a field for the consumer cluster.
producer_namespace varchar(64) The namespace of the product account that the datashare belongs to. This is a field for the consumer cluster.
attribute_name varchar(64) The name of an attribute of the datashare or shared database.
attribute_value varchar(128) The value of an attribute of the datashare or shared database.
message varchar(512) The error message when an action fails.

Sample queries

The following example shows a SYS_DATASHARE_CHANGE_LOG view.

SELECT DISTINCT action FROM sys_datashare_change_log WHERE share_object_name LIKE 'tickit%'; action ----------------------- "ALTER DATASHARE ADD"