Monitor storage lifecycle policies

참고

:doc:`저장소 수명 주기 정책</user-guide/storage-management/storage-lifecycle-policies>`은 현재 정부 리전에서 사용할 수 없습니다.

저장소 수명 주기 정책이 연결된 테이블을 식별하고 Snowflake의 기본 제공 함수를 사용하여 저장소 수명 주기 정책 실행을 모니터링합니다.

참고

저장소 수명 주기 정책 비용 모니터링에 대한 자세한 내용은 저장소 수명 주기 정책에 대한 요금 청구 섹션을 참조하세요.

Monitor policy assignments

저장소 수명 주기 정책 메타데이터를 보려면 다음 뷰를 사용하세요.

수명 주기 정책 연결 보기

To see which tables a particular lifecycle policy is attached to, call the POLICY_REFERENCES table function in the Snowflake Information Schema. The function displays only the tables that you have the OWNERSHIP privilege on.

이 함수는 지정된 정책이 연결된 데이터베이스의 각 테이블에 대한 행을 반환합니다.

예: 정책과 연결된 모든 테이블 나열

The following query retrieves a list of tables with a specified storage lifecycle policy attached:

SELECT *
  FROM TABLE(
    my_db.INFORMATION_SCHEMA.POLICY_REFERENCES(
    POLICY_NAME => 'my_storage_lifecycle_policy'
  )
);
Copy

예: 테이블에 할당된 정책 찾기

지정된 테이블에 할당된 정책을 검색합니다.

SELECT *
  FROM TABLE(
    my_db.INFORMATION_SCHEMA.POLICY_REFERENCES(
      REF_ENTITY_NAME => 'my_db.my_schema.my_table',
      REF_ENTITY_DOMAIN => 'table'))
  WHERE POLICY_KIND = 'STORAGE_LIFECYCLE_POLICY';
Copy

저장소 수명 주기 정책 실행 모니터링

To monitor storage lifecycle policy executions over the last 14 days, use the STORAGE_LIFECYCLE_POLICY_HISTORY table function. For information about the function output, see the STORAGE_LIFECYCLE_POLICY_HISTORY page.

다음 예에서는 마지막 날 이내에 예약된 지정된 테이블에 연결된 정책에 대해 가장 최근 실행 100개를 검색합니다.

SELECT * FROM
  TABLE(
    INFORMATION_SCHEMA.STORAGE_LIFECYCLE_POLICY_HISTORY(
      REF_ENTITY_NAME => 'my_db.my_schema.my_source_table',
      REF_ENTITY_DOMAIN => 'table',
      TIME_RANGE_START => DATEADD('DAY', -1, CURRENT_TIMESTAMP()),
      RESULT_LIMIT => 100
    )
  );
Copy

Alternatively, to retrieve historical data for storage lifecycle policy runs, use the following views: