Categories:

Information Schema , Table functions

DATABASE_REFRESH_HISTORY

Returns the refresh history for a secondary database.

Note

This function returns database refresh activity within the last 14 days.

See also:

DATABASE_REFRESH_PROGRESS , DATABASE_REFRESH_PROGRESS_BY_JOB

Syntax

DATABASE_REFRESH_HISTORY( '<secondary_db_name>' )
Copy

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.

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:

    1. SECONDARY_UPLOADING_INVENTORY

    2. PRIMARY_UPLOADING_METADATA

    3. PRIMARY_UPLOADING_DATA

    4. SECONDARY_DOWNLOADING_METADATA

    5. SECONDARY_DOWNLOADING_DATA

    6. COMPLETED / FAILED / CANCELED

Output

The function returns the following columns:

Column Name

Data Type

Description

CURRENT_PHASE

TEXT

Current replication phase. For the list of phases, see the usage notes.

START_TIME

NUMBER

Time when the replication operation began. Format is epoch time.

END_TIME

NUMBER

Time when the replication operation finished, if applicable. Format is epoch time.

JOB_UUID

TEXT

Query ID for the secondary database refresh job.

COPY_BYTES

NUMBER

Number of bytes copied during the replication operation.

OBJECT_COUNT

NUMBER

Number of database objects copied during the replication operation.

Examples

Retrieve the database refresh history for the database that is currently active in the user session:

select *
from table(information_schema.database_refresh_history());
Copy
Language: English