REPLICATION_GROUP_REFRESH_PROGRESS_ALL

functionsupportedReplication, failover & backupBusiness Critical+

docs.snowflake.com ↗

Information SchemaTable functions

You can use the REPLICATION_GROUP_REFRESH_PROGRESS family of table functions to query the status of refresh operations for replication or failover groups: - 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. - REPLICATION_GROUP_REFRESH_PROGRESS_ALL returns a JSON object indicating the refresh status for all the secondary replication and failover groups. 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 and REPLICATION_GROUP_REFRESH_PROGRESS_ALL return replication or failover group refresh activity within the last 14 days. By default (when no date-range arguments are provided), REPLICATION_GROUP_REFRESH_PROGRESS_ALL returns data for the last 12 hours. Use the optional DATE_RANGE_START and DATE_RANGE_END arguments to query a custom range within the 14-day retention window. Database and share replication are available to all accounts. Replication of other account objects & failover/failback require Business Critical Edition (or higher). To inquire about upgrading, please contact Snowflake Support.

Syntax

supportedpartialnot supportednot scored

REPLICATION_GROUP_REFRESH_PROGRESS( '<secondary_group_name>' )

REPLICATION_GROUP_REFRESH_PROGRESS_BY_JOB( '<query_id>' )

REPLICATION_GROUP_REFRESH_PROGRESS_ALL(
      [ DATE_RANGE_START => <constant_expr> ]
      [ , DATE_RANGE_END => <constant_expr> ] )

Parameters

NameRequiredDescription
'secondary_group_name'requiredName of the secondary replication or failover group. Note that the entire name must be enclosed in single quotes.
'query_id'requiredID of the replication group refresh query. The query ID can be obtained from the History page in the web interface.
DATE_RANGE_START => constant_expr , DATE_RANGE_END => constant_exprrequiredThe date/time range for which to return replication refresh progress. If neither a start date nor an end date is specified, the default is the last 12 hours. If a start date is specified but no end date, CURRENT_DATE at midnight is used as the end of the range. If an end date is specified but no start date, the range starts 12 hours prior to the start of DATE_RANGE_END. Data is retained for 14 days. If the requested range extends beyond the 14-day retention window, the function returns an error.

Usage notes

Output

The function returns the following columns. REPLICATION_GROUP_REFRESH_PROGRESS_ALL has additional columns that are the first two columns in the result set. Column Name | Data Type | Description GROUP_NAME | TEXT | Specifies which secondary replication or failover group corresponds to this row in the result set. Only applies to REPLICATION_GROUP_REFRESH_PROGRESS_ALL. GROUP_TYPE | TEXT | Specifies whether the group corresponding to this row in the result set is a failover group or a replication group. The value is either FAILOVER or REPLICATION. Only applies to REPLICATION_GROUP_REFRESH_PROGRESS_ALL. 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. NULL if the phase is in progress or is the terminating phase (COMPLETED/FAILED/CANCELED). PROGRESS | TEXT | PRIMARY_UPLOADING_DATA: Percentage of total bytes replicated. SECONDARY_DOWNLOADING_METADATA: Percentage of the total number of objects replicated. SECONDARY_DOWNLOADING_DATA: Percentage of total bytes replicated. SECONDARY_COMMITTING: Percentage of tables that finished replicating. Empty for remaining phases DETAILS | VARIANT | For phase PRIMARY_UPLOADING_METADATA: primarySnapshotTimestamp: Time when the primary snapshot was created. Format is epoch time. For phase PRIMARY_UPLOADING_DATA: totalBytesToReplicate: Total number of bytes expected to be uploaded. totalBytesToUpload: Total number of bytes to required to be uploaded. bytesUploaded: Total number of bytes uploaded so far. databases: List of JSON objects containing the following fields for each member database: name: Database name. totalBytesToReplicate: Total bytes expected to be uploaded for the database. For phase SECONDARY_DOWNLOADING_DATA: totalBytesToReplicate: Total number of bytes expected to be downloaded. totalBytesToDownload: Actual number of bytes required to be downloaded. bytesDownloaded: Actual number of bytes downloaded so far. databases: List of JSON objects containing the following fields for each member database: name: Database name. totalBytesToReplicate: Total bytes expected to be downloaded for the database. For phase SECONDARY_DOWNLOADING_METADATA: totalObjects: Total number of objects to download. completedObjects: Total number of objects downloaded so far. objectTypes: List of JSON objects containing the following fields for each object type: objectType: Type of object (for example, users, roles, grants, warehouses, schemas, tables, columns, etc). totalObjects: Total number of objects of this type. completedObjects: Number of completed objects of this type. For phase SECONDARY_COMMITTING: totalObjects: Total number of tables to process. completedObjects: Total number of tables processed so far. objectTypes: List of JSON objects containing the following fields for each object type: objectType: Type of object. totalObjects: Total number of objects of this type. completedObjects: Number of completed objects of this type. For phase FAILED: errorCode: Error code of the failure. errorMessage: Error message of the failure.