DATABASE_REFRESH_PROGRESS_BY_JOB

functionsupportedReplication, failover & backup

docs.snowflake.com ↗

Information SchemaTable functions

The DATABASE_REFRESH_PROGRESS family of functions can be used to query the status of a database refresh along various dimensions: - DATABASE_REFRESH_PROGRESS returns a JSON object indicating the current refresh status for a secondary database by name. - DATABASE_REFRESH_PROGRESS_BY_JOB returns a JSON object indicating the current refresh status for a secondary database by refresh query. Each function is optimized for querying along the specified dimension. Note - DATABASE_REFRESH_PROGRESS only returns the database refresh activity for the most recent database refresh if it occurred within the last 14 days. - DATABASE_REFRESH_PROGRESS_BY_JOB returns database refresh activity within the last 14 days.

Syntax

DATABASE_REFRESH_PROGRESS( '<secondary_db_name>' )

DATABASE_REFRESH_PROGRESS_BY_JOB( '<query_id>' )

Parameters

NameRequiredDescription
secondary_db_namerequiredName 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.
query_idrequiredID of the database refresh query. The query ID can be obtained from the History page in the web interface.

Usage notes

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. RESULT | TEXT | Status of the replication phase. Valid statuses are EXECUTING, SUCCEEDED, CANCELLED, FAILED. START_TIME | NUMBER | Time when the replication phase began. Format is epoch time. END_TIME | NUMBER | Time when the phase finished, if applicable. Format is epoch time. DETAILS | VARIANT | Returned by the DATABASE_REFRESH_PROGRESS function only. A JSON object that provides detailed information for the following phases: - Primary uploading data: The timestamp of the current snapshot of the primary database. - Primary uploading data and Secondary downloading data: Total number of bytes in the database refresh as well as the number of bytes copied so far in the phase. - Secondary downloading metadata: The number of tables, table columns, and all database objects (including tables and table columns) in the latest snapshot of the primary database.

See also