- Categories:
REPLICATION_GROUP_REFRESH_PROGRESS, REPLICATION_GROUP_REFRESH_PROGRESS_BY_JOB¶
The REPLICATION_GROUP_REFRESH_PROGRESS family of functions can be used to query the status of a replication or failover group refresh:
REPLICATION_GROUP_REFRESH_PROGRESS returns a JSON object indicating the refresh status for a secondary replication or failover group by name.
REPLICATION_GROUP_REFRESH_PROGRESS_BY_JOB returns a JSON object indicating the refresh status for a secondary replication or failover group by query ID.
Note
REPLICATION_GROUP_REFRESH_PROGRESS only returns the replication or failover group refresh activity for the most recent refresh if it occurred within the last 14 days.
REPLICATION_GROUP_REFRESH_PROGRESS_BY_JOB returns replication or failover group refresh activity within the last 14 days.
Syntax¶
REPLICATION_GROUP_REFRESH_PROGRESS( '<secondary_group_name>' )
REPLICATION_GROUP_REFRESH_PROGRESS_BY_JOB( '<query_id>' )
Arguments¶
Output¶
The function returns the following columns:
Column Name |
Data Type |
Description |
---|---|---|
PHASE_NAME |
TEXT |
Name of the replication phases completed (or in progress) so far. For the list of phases, see the usage notes. |
START_TIME |
TIMESTAMP_LTZ |
Time when the replication phase began. |
END_TIME |
TIMESTAMP_LTZ |
Time when the phase finished, if applicable. |
PROGRESS |
TEXT |
Empty for remaining phases |
DETAILS |
VARIANT |
|
Usage Notes¶
Only returns rows for a role with any privilege on the replication or failover group.
Only returns rows for a secondary replication or failover group in the current account.
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_SYNCHRONIZING_MEMBERSHIP
SECONDARY_UPLOADING_INVENTORY
PRIMARY_UPLOADING_METADATA
PRIMARY_UPLOADING_DATA
SECONDARY_DOWNLOADING_METADATA
SECONDARY_DOWNLOADING_DATA
COMPLETED / FAILED / CANCELED
In the
PRIMARY_UPLOADING_DATA
andSECONDARY_DOWNLOADING_DATA
phases, thetotalBytesToReplicate
value is estimated prior to the replication operation. This value may differ from thetotalBytesToUpload
ortotalBytesToDownload
value in the respective phase.For example, if during the
PRIMARY_UPLOADING_DATA
phase, a previous replication operation uploaded some bytes but was canceled before the operation completed, those bytes would not be uploaded again. In that case,totalBytesToUpload
would be lower thantotalBytesToReplicate
.
Examples¶
Retrieve the current progress of the replication group refresh for the rg1
replication group:
select * from table(information_schema.replication_group_refresh_progress('rg1'));
Retrieve the current progress of a replication group refresh by query ID:
select * from table(information_schema.replication_group_refresh_progress_by_job('012a3b45-1234-a12b-0000-1aa200012345'));