DATABASE_REFRESH_PROGRESS , DATABASE_REFRESH_PROGRESS_BY_JOB | Snowflake Documentation (original) (raw)

The DATABASE_REFRESH_PROGRESS family of functions can be used to query the status of a database refresh along various dimensions:

Each function is optimized for querying along the specified dimension.

Note

See also:

DATABASE_REFRESH_HISTORY

Syntax

DATABASE_REFRESH_PROGRESS( '' )

DATABASE_REFRESH_PROGRESS_BY_JOB( '' )

Arguments

_secondarydbname_

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.

_queryid_

ID of the database refresh query. The query ID can be obtained from the History History tab 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.

Examples

Retrieve the current progress of the database refresh for the mydb1 database:

select * from table(information_schema.database_refresh_progress(mydb1));

Retrieve the current progress of a database refresh by query ID:

select * from table(information_schema.database_refresh_progress_by_job('012a3b45-1234-a12b-0000-1aa200012345'));