Categories:

# DATABASE_REFRESH_PROGRESS , DATABASE_REFRESH_PROGRESS_BY_JOB¶

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.

DATABASE_REFRESH_HISTORY

## Syntax¶

DATABASE_REFRESH_PROGRESS( '<secondary_db_name>' )

DATABASE_REFRESH_PROGRESS_BY_JOB( '<query_id>' )


## Arguments¶

secondary_db_name

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.

query_id

ID of the database refresh query. The query ID can be obtained from the History page in the web interface.

## Usage Notes¶

• Only returns results for account administrators (users with the ACCOUNTADMIN role).

• 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:

6. COMPLETED / FAILED / CANCELED

## 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

## 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'));