Schema:

ORGANIZATION_USAGE

For guidance on query performance when using organization-wide usage views, see Performance (Organization Usage).

BACKUP_OPERATION_HISTORY view

Organization Usage performance

When you query a specific view in the SNOWFLAKE.ORGANIZATION_USAGE schema, follow the organization-wide guidance in Performance (Organization Usage): bound every scan on history views, list columns explicitly, and use the time filter column table plus worked SQL and anti-patterns there.

This Organization Usage view provides information on operations performed on backups.

Columns

Organization-level columns

Column NameData TypeDescription
ORGANIZATION_NAMEVARCHARName of the organization.
ACCOUNT_LOCATORVARCHARSystem-generated identifier for the account.
ACCOUNT_NAMEVARCHARUser-defined identifier for the account.

Additional columns

Column nameData typeDescription
START_TIMETIMESTAMP_LTZThe timestamp at which the backup operation started.
END_TIMETIMESTAMP_LTZThe timestamp at which the backup operation ended.
BACKUP_SET_IDNUMBERThe local backup set ID.
BACKUP_IDVARCHARThe unique identifier of backup being worked on.
OPERATION_TYPEVARCHAR

Could be either of the below operations:

  • CREATE
  • EXPIRE
  • RESTORE
  • ADD_LEGAL_HOLD
  • REMOVE_LEGAL_HOLD
QUERY_IDVARCHARInternal system-generated identifier for the SQL statement.

Usage notes

  • Latency for the view may be up to 360 minutes (6 hours).

Examples

Use the QUERY_ID column to join with SNOWFLAKE.ORGANIZATION_USAGE.QUERY_HISTORY and retrieve the execution status for backup operations across accounts. For example, to find failed backup creation operations:

SELECT
  boh.account_locator,
  boh.account_name,
  boh.start_time,
  boh.end_time,
  boh.backup_set_id,
  boh.backup_id,
  boh.operation_type,
  boh.query_id,
  qh.execution_status,
  qh.error_code,
  qh.error_message
FROM SNOWFLAKE.ORGANIZATION_USAGE.BACKUP_OPERATION_HISTORY AS boh
JOIN SNOWFLAKE.ORGANIZATION_USAGE.QUERY_HISTORY AS qh
  ON boh.account_locator = qh.account_locator
 AND boh.query_id = qh.query_id
WHERE boh.operation_type = 'CREATE'
  AND qh.execution_status = 'FAIL'
ORDER BY boh.start_time DESC;