REPLICATION_GROUP_REFRESH_HISTORY

functionsupportedReplication, failover & backupBusiness Critical+

docs.snowflake.com ↗

Information SchemaTable functions

You can use the REPLICATION_GROUP_REFRESH_HISTORY family of table functions to query the replication history for one secondary replication or failover group, or all such groups. By default (when no date-range arguments are provided), these functions return data for the last 12 hours. You can 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_HISTORY(
      '<secondary_group_name>'
      [ , DATE_RANGE_START => <constant_expr> ]
      [ , DATE_RANGE_END => <constant_expr> ] )

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

Parameters

NameRequiredDescription
'secondary_group_name'requiredName of the secondary group. The entire name must be enclosed in single quotes. Required for REPLICATION_GROUP_REFRESH_HISTORY. Not used with REPLICATION_GROUP_REFRESH_HISTORY_ALL.
DATE_RANGE_START => constant_expr , DATE_RANGE_END => constant_exprrequiredThe date/time range for which to return replication refresh history. 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_HISTORY_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_HISTORY_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_HISTORY_ALL. PHASE_NAME | TEXT | Current phase in the replication operation. For the list of phases, see the Usage Notes. START_TIME | TIMESTAMP_LTZ | Time when the replication operation began. END_TIME | TIMESTAMP_LTZ | Time when the replication operation finished, if applicable. NULL if it is in progress. JOB_UUID | TEXT | Query ID for the refresh job. TOTAL_BYTES | VARIANT | A JSON object that provides detailed information about refreshed databases: totalBytesToReplicate: Total number of bytes expected to be replicated. bytesUploaded: Actual number of bytes uploaded. bytesDownloaded: Actual number of bytes downloaded. databases: List of JSON objects containing the following fields for each member database: name: Name of the database. totalBytesToReplicate: Total bytes expected to be replicated for the database. OBJECT_COUNT | VARIANT | A JSON object that provides detailed information about refreshed objects: totalObjects: Total number of objects in the replication or failover group. completedObjects: Total number of objects completed. objectTypes: List of JSON objects containing the following fields for each type: objectType: Type of object (for example users, roles, grants, warehouses, schemas, tables, columns, etc). totalObjects: Total number of objects of this type in the replication or failover group. completedObjects: Total number of objects of this type that were completed. COMMITTED_OBJECT_COUNT | VARIANT | A JSON object that represents the number of tables that have been processed during the SECONDARY_COMMITTING phase. The subfields have the same names as the subfields in the OBJECT_COUNT column: totalObjects: Total number of tables to process. completedObjects: Total number of tables processed. objectTypes: List of JSON objects containing the following fields for each type: objectType: Type of object. totalObjects: Total number of objects of this type. completedObjects: Total number of completed objects of this type. PRIMARY_SNAPSHOT_TIMESTAMP | TIMESTAMP_LTZ | Timestamp when the primary snapshot was created. ERROR | VARIANT | NULL if the refresh operation is successful. If the refresh operation fails, returns a JSON object that provides detailed information about the error: errorCode: Error code of the failure. errorMessage: Error message of the failure.

See also

Referenced by