저장소 수명 주기 정책

참고

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

A storage lifecycle policy is a schema-level object that automatically manages the data lifecycle for standard Snowflake tables. Use these policies to archive or expire specific table rows that are based on conditions that you define, such as data age or other criteria. Snowflake automatically executes these policies daily by using shared compute resources.

저장소 수명 주기 정책의 작동 방식

저장소 수명 주기 정책 워크플로 개요

To get started with storage lifecycle policies, complete the following steps:

  1. 보관하거나 만료할 행을 식별하는 식을 사용하여 :ref:`정책을 생성<label-slp_create>`합니다.

  2. :ref:`하나 이상의 테이블에 정책을 연결<label-slp_attach_to_table>`합니다.

After you attach a storage lifecycle policy to a table, Snowflake waits approximately 24 hours before running the policy for the first time. Following this initial delay, Snowflake automatically runs the policy daily by using shared compute resources to identify and process rows that meet your defined conditions.

When the policy runs, it checks each row against your expression, and then either archives the data to COOL or COLD storage or expires the data, which deletes it permanently. You can retrieve archived data by using the CREATE TABLE … FROM ARCHIVE OF command before expiration occurs. Snowflake waits until the specified archive period elapses before expiring the data from archive storage.

저장소 수명 주기 정책 보관에서 만료까지의 흐름에 대한 개요입니다.

주요 기능

저장소 수명 주기 정책은 Snowflake 데이터 관리에 다음과 같은 이점을 제공합니다.

저장소 비용 절감

Storage lifecycle policies help optimize costs by automatically moving older data to more cost-effective archival tiers. For data that must be retained long-term but accessed infrequently, archival storage can significantly reduce storage costs compared to standard storage tiers.

규정 준수

규정 표준에 따라 데이터를 보관하거나 만료하는 정책을 구성하여 규정 준수 요구 사항을 자동으로 충족합니다. 만료 전 특정 시간 동안 데이터를 보관하거나 보관하지 않고 직접 만료할 수 있습니다. 이를 통해 데이터 관리가 조직의 거버넌스 표준을 준수할 수 있습니다.

간단한 데이터 관리

저장소 수명 주기 정책을 사용하면 보관 및 만료 규칙을 자동으로 실행하여 수동 데이터 관리 작업을 수행할 필요가 없습니다. 자세한 내용은 Monitor storage lifecycle policies 섹션을 참조하십시오.

유연한 데이터 검색

필요한 행만 포함하는 새 테이블을 생성하여 :doc:`보관된 데이터 검색 </user-guide/storage-management/storage-lifecycle-policies-retrieving-archived-data>`을 정확하게 수행합니다. WHERE 절이 있는 간단한 명령을 사용하여 복원할 보관된 데이터를 정확하게 지정합니다.

아카이브 저장소 계층

Snowflake는 다음 저장소 계층에서 데이터 보관을 지원합니다.

아카이브 계층

설명

COOL

빠른 검색 시간을 제공하므로 데이터를 쉽게 사용할 수 있습니다. 최소 보관 기간은 90일입니다.

COLD

Offers greater cost savings than the COOL tier; it is four times less expensive. The minimum archival period is 180 days. Compared to the COOL tier, COLD has a longer data retrieval time, which is up to 48 hours. Data retrieval operations from the COLD storage tier support a maximum of 1 million files per restore operation.

아카이브 계층 선택하기

When you select an archive tier, consider the following factors:

  • 보관 비용: 데이터를 보관하는 일회성 비용은 두 계층에서 동일합니다.

  • 저장소 비용: COLD 계층 저장소가 COOL 계층 저장소보다 더 저렴합니다.

  • 검색 비용: COLD 계층 데이터 검색이 COOL 계층 검색보다 더 저렴합니다.

  • 검색 시간: COOL 저장소 계층은 즉각적인 데이터 검색을 제공하는 반면, COLD 계층 검색에는 최대 48시간이 걸릴 수 있습니다.

자세한 가격 정보는 `Snowflake Service Consumption Table`_의 테이블 3(e) 및 4(f)를 참조하세요.

For more information about archiving data, see Create a storage lifecycle policy and Archive storage considerations.

고려 사항

Consider the following information when you work with storage lifecycle policies.

클라우드 공급자 지원

  • Expiration policies: Supported for accounts hosted on all cloud providers (Amazon Web Services (AWS), Microsoft Azure, and Google Cloud).

  • 아카이브 정책: 현재 AWS에서 호스팅되는 계정에만 사용 가능합니다.

지원되는 테이블 및 기능

  • Supported tables: Storage lifecycle policies are supported for standard Snowflake tables. To evaluate and apply storage lifecycle policy expressions, Snowflake internally and temporarily bypasses any governance policies on a table.

  • 복제

    • Snowflake는 저장소 수명 주기 정책 및 테이블과의 연결을 대상 계정에 복제하지만 정책을 실행하지는 않습니다.

    • 대상 계정으로 장애 조치한 후 Snowflake는 원래 기본 계정에서 저장소 수명 주기 정책 실행을 일시 중지합니다. 원래 기본 계정으로 장애 복구한 후 Snowflake는 정책 실행을 재개합니다.

    • Snowflake는 장애 조치 후에도 보조 테이블에서 보조 저장소 수명 주기 정책을 자동으로 실행하지 않습니다. 그러나 테이블에 보조 정책을 연결하여 대상 계정에서 보조 정책을 사용할 수 있습니다. 이러한 새 테이블에 대해 Snowflake는 정책을 실행합니다.

  • 복제: Snowflake는 복제된 테이블에 저장소 수명 주기 정책을 자동으로 적용하지 않습니다. 복제본 그룹의 테이블에 저장소 수명 주기 정책을 적용하는 경우 Snowflake는 해당 특정 테이블의 행만 보관합니다. 이 정책은 복제본에 영향을 주지 않습니다. 이를 통해 표준 및 아카이브 저장소 계층 모두에 데이터 복사본이 생성되며 각 계층의 저장소 비용을 지불합니다. 비용 정보는 저장소 수명 주기 정책에 대한 요금 청구 섹션을 참조하세요.

  • 지원되지 않는 기능

    Storage lifecycle policies aren’t supported for the following features:

    • 일반 Snowflake 테이블 및 동적 테이블을 제외한 모든 오브젝트 유형.

    • Write once read many (WORM) snapshots, which are immutable snapshots that can’t be modified after creation.

    • Both provider and consumer tables shared through Snowflake data sharing.

    • 기본 앱.

    • 사용자 정의 함수(UDFs) 및 외부 액세스와 외부 함수.

    • Python, Java 또는 Scala UDFs.

정책 동작 및 실행

저장소 수명 주기 정책은 :ref:`행 수준 액세스 정책에 대한 지침<label-security_row_performance>`과 유사한 성능 지침을 사용하며 다음과 같은 특성으로 자동 작동합니다.

  • 테이블에 저장소 수명 주기 정책을 연결하는 경우 Snowflake는 약 24시간을 기다린 후 처음으로 실행합니다.

  • Snowflake는 공유 컴퓨팅 리소스를 사용하여 저장소 수명 주기 정책을 매일 실행합니다. 저장소 수명 주기 정책 비용에 대한 자세한 내용은 저장소 수명 주기 정책에 대한 요금 청구 섹션을 참조하세요.

  • To prevent excessively long archive or expiration runs, Snowflake processes large data operations incrementally in smaller chunks. A large operation might not complete in one daily run and might instead complete across multiple daily runs.

  • 저장소 수명 주기 정책이 테이블에서 실행 중인 경우 Snowflake는 UPDATE, DELETE, MERGE 작업을 잠급니다. 이때 INSERT 및 COPY 작업은 계속 수행할 수 있습니다. 자세한 내용은 리소스 잠금 섹션을 참조하세요.

아카이브 저장소 정책

Consider the following information when you work with tables that have an archival storage lifecycle policy attached:

  • 보관된 데이터에 액세스하기: Snowflake가 행을 보관한 후에는 직접 쿼리할 수 없습니다. 액세스하려면 CREATE TABLE … FROM ARCHIVE OF 명령을 사용하여 보관된 데이터의 복사본으로 새 테이블을 생성합니다. 자세한 내용은 보관된 데이터 검색하기 섹션을 참조하세요.

  • 보안: |tri-secret-secure|(TSS)를 사용하여 정기적인 키 순환으로 보관된 데이터를 보호합니다.

  • Rekeying: Snowflake doesn’t rekey archived data. If you suspect a key compromise, perform the following steps:

    1. CREATE TABLE … FROM ARCHIVE OF 명령을 사용하여 보관된 데이터를 새 테이블로 검색합니다.

    2. Archive data in the new table when needed.

      Each table has its own encryption key, so the new table effectively uses a new key.

    3. 키가 손상된 원본 테이블의 아카이브를 삭제합니다.

  • 아카이브 계층 제한 사항:

    • You can’t change the archive tier for a policy from COOL to COLD or from COLD to COOL. Create a new policy instead. For instructions, see 저장소 수명 주기 정책 다시 만들기.

    • 테이블은 하나의 아카이브 계층만 사용할 수 있습니다. COOL 아카이브를 이미 사용하는 테이블에 COLD 정책을 연결할 수 없습니다.

  • 정책 제거: 테이블에서 정책을 제거하면 보관된 데이터는 아카이브 저장소에 남아 있으며 계속 검색할 수 있습니다.

  • 테이블 삭제 또는 자르기:

    • 테이블을 잘라도 해당 테이블의 보관된 데이터에는 영향을 주지 않습니다. 테이블을 자른 후에도 아카이브 저장소에서 데이터를 계속 검색할 수 있습니다.

    • :doc:`/sql-reference/sql/undrop-table`을 사용하여 해당 :ref:`Time Travel 데이터 보존 기간<label-time_travel_data_retention_period>`에 테이블을 복원하는 경우 Snowflake는 아카이브 저장소의 모든 데이터도 복원합니다.

    • 테이블이 Fail-safe 기간 내에 있는 경우 Snowflake 지원을 통해 Fail-safe 데이터 복구 단계를 사용하여 아카이브 저장소의 데이터를 복구할 수 있습니다.

    • ARCHIVE_FOR_DAYS 기간이 경과하기 전에 삭제한 아카이브 저장소의 테이블 데이터에는 저장 비용이 부과됩니다. 자세한 내용은 최소 저장 기간 요금 섹션을 참조하십시오.