- Categories:
DATABASE_REFRESH_HISTORY¶
Returns the refresh history for a secondary database.
Note
This function returns database refresh activity within the last 14 days.
Syntax¶
DATABASE_REFRESH_HISTORY( '<secondary_db_name>' )
Arguments¶
secondary_db_name
Name of the secondary database. This argument is optional if the secondary database is the active database in the current session.
Note that the entire name must be enclosed in single quotes.
Usage notes¶
Only returns results for account administrators (users with the ACCOUNTADMIN role).
When calling an Information Schema table function, the session must have an INFORMATION_SCHEMA schema in use or the function name must be fully-qualified. For more details, see Snowflake Information Schema.
Following is the list of phases in the order processed:
SECONDARY_UPLOADING_INVENTORY
PRIMARY_UPLOADING_METADATA
PRIMARY_UPLOADING_DATA
SECONDARY_DOWNLOADING_METADATA
SECONDARY_DOWNLOADING_DATA
COMPLETED / FAILED / CANCELED
Output¶
The function returns the following columns:
Column Name |
Data Type |
Description |
---|---|---|
CURRENT_PHASE |
TEXT |
Current replication phase. For the list of phases, see the usage notes. |
START_TIME |
NUMBER |
Time when the replication operation began. Format is epoch time. |
END_TIME |
NUMBER |
Time when the replication operation finished, if applicable. Format is epoch time. |
JOB_UUID |
TEXT |
Query ID for the secondary database refresh job. |
COPY_BYTES |
NUMBER |
Number of bytes copied during the replication operation. |
OBJECT_COUNT |
NUMBER |
Number of database objects copied during the replication operation. |
Examples¶
Retrieve the database refresh history for the database that is currently active in the user session:
select * from table(information_schema.database_refresh_history());