INFORMATION_SCHEMA.TABLE_SNAPSHOTS 뷰는 테이블 스냅샷에 대한 메타데이터를 포함합니다. 자세한 내용은 테이블 스냅샷 소개를 참조하세요.
필수 권한
INFORMATION_SCHEMA.TABLE_SNAPSHOTS 뷰를 쿼리하려면 데이터 세트에 대한 bigquery.tables.list Identity and Access Management(IAM) 권한이 필요합니다.
사전 정의된 roles/bigquery.metadataViewer 역할에 필수 권한이 포함되어 있습니다.
INFORMATION_SCHEMA.TABLE_SNAPSHOTS 테이블을 쿼리하면 지정된 데이터 세트 또는 리전의 각 테이블 스냅샷에 대한 하나의 행이 결과에 포함됩니다.
INFORMATION_SCHEMA.TABLE_SNAPSHOTS 테이블에는 다음과 같은 스키마가 있습니다.
테이블 스냅샷을 가져온 표준 테이블을 기본 테이블이라고 부릅니다.
열 이름
데이터 유형
값
table_catalog
STRING
테이블 스냅샷이 포함된 프로젝트의 이름
table_schema
STRING
테이블 스냅샷이 포함된 데이터 세트의 이름
table_name
STRING
테이블 스냅샷의 이름
base_table_catalog
STRING
기본 테이블이 포함된 프로젝트의 이름
base_table_schema
STRING
기본 테이블이 포함된 데이터 세트의 이름
base_table_name
STRING
기본 테이블의 이름
snapshot_time
TIMESTAMP
테이블 스냅샷이 생성된 시간
범위 및 구문
이 뷰에 대한 쿼리에는 데이터 세트나 리전 한정자가 포함되어야 합니다. 데이터 세트 한정자가 있는 쿼리에는 데이터 세트에 대한 권한이 있어야 합니다.
리전 한정자가 있는 쿼리에는 프로젝트에 대한 권한이 있어야 합니다.
자세한 내용은 구문을 참조하세요.
다음 표에서는 이 뷰의 리전 범위와 리소스 범위를 설명합니다.
DATASET_ID: 데이터 세트의 ID입니다. 자세한 내용은 데이터 세트 한정자를 참조하세요.
예시
-- Returns metadata for the table snapshots in the specified dataset.SELECT*FROMmyDataset.INFORMATION_SCHEMA.TABLE_SNAPSHOTS;-- Returns metadata for the table snapshots in the specified region.SELECT*FROM`region-us`.INFORMATION_SCHEMA.TABLE_SNAPSHOTS;
예
다음 쿼리는 mydataset 데이터 세트에서 테이블 스냅샷에 대한 메타데이터를 검색합니다. 이 예시에서는 UTC 기준 2021년 5월 14일 오후 12시에 기본 테이블 myproject.mydataset.mytable에서 가져온 myproject.mydataset.mytablesnapshot 테이블 스냅샷을 보여줍니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-03-24(UTC)"],[[["\u003cp\u003eThe \u003ccode\u003eINFORMATION_SCHEMA.TABLE_SNAPSHOTS\u003c/code\u003e view provides metadata about table snapshots, with each row representing a single snapshot within a dataset or region.\u003c/p\u003e\n"],["\u003cp\u003eAccessing this view requires the \u003ccode\u003ebigquery.tables.list\u003c/code\u003e IAM permission, which is included in the \u003ccode\u003eroles/bigquery.metadataViewer\u003c/code\u003e predefined role, for the dataset being queried.\u003c/p\u003e\n"],["\u003cp\u003eQueries must use a dataset or region qualifier, and permissions are required for the specified dataset or project.\u003c/p\u003e\n"],["\u003cp\u003eThe schema includes columns like \u003ccode\u003etable_catalog\u003c/code\u003e, \u003ccode\u003etable_schema\u003c/code\u003e, \u003ccode\u003etable_name\u003c/code\u003e, \u003ccode\u003ebase_table_catalog\u003c/code\u003e, \u003ccode\u003ebase_table_schema\u003c/code\u003e, \u003ccode\u003ebase_table_name\u003c/code\u003e, and \u003ccode\u003esnapshot_time\u003c/code\u003e which describe the table snapshot and its base table.\u003c/p\u003e\n"],["\u003cp\u003eWhen querying this view the location of query execution must match the region of the \u003ccode\u003eINFORMATION_SCHEMA\u003c/code\u003e view.\u003c/p\u003e\n"]]],[],null,["# TABLE_SNAPSHOTS view\n====================\n\nThe `INFORMATION_SCHEMA.TABLE_SNAPSHOTS` view contains metadata about your\ntable snapshots. For more information, see [Introduction to table\nsnapshots](/bigquery/docs/table-snapshots-intro).\n\nRequired permissions\n--------------------\n\nTo query the `INFORMATION_SCHEMA.TABLE_SNAPSHOTS` view, you need the\n`bigquery.tables.list` Identity and Access Management (IAM) permission for the dataset.\nThe `roles/bigquery.metadataViewer` predefined role includes the required\npermission.\n\nFor more information about BigQuery permissions, see\n[Access control with IAM](/bigquery/docs/access-control).\n\nSchema\n------\n\nWhen you query the `INFORMATION_SCHEMA.TABLE_SNAPSHOTS` table, the results\ncontain one row for each table snapshot in the specified dataset or region.\n\nThe `INFORMATION_SCHEMA.TABLE_SNAPSHOTS` table has the following schema.\nThe standard table that the\ntable snapshot was taken from is called the *base table*.\n\nScope and syntax\n----------------\n\nQueries against this view must include a dataset or a region qualifier. For\nqueries with a dataset qualifier, you must have permissions for the dataset.\nFor queries with a region qualifier, you must have permissions for the project.\nFor more\ninformation see [Syntax](/bigquery/docs/information-schema-intro#syntax).\nThe following table explains the region and resource scopes for this view:\n\nReplace the following:\n\n- Optional: \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of your Google Cloud project. If not specified, the default project is used.\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: any [dataset region name](/bigquery/docs/locations). For example, ```region-us```.\n- \u003cvar translate=\"no\"\u003eDATASET_ID\u003c/var\u003e: the ID of your dataset. For more information, see [Dataset qualifier](/bigquery/docs/information-schema-intro#dataset_qualifier).\n\n \u003cbr /\u003e\n\n \u003cbr /\u003e\n\n | **Note:** You must use [a region qualifier](/bigquery/docs/information-schema-intro#region_qualifier) to query `INFORMATION_SCHEMA` views. The location of the query execution must match the region of the `INFORMATION_SCHEMA` view.\n\n\u003cbr /\u003e\n\n**Example** \n\n -- Returns metadata for the table snapshots in the specified dataset.\n SELECT * FROM myDataset.INFORMATION_SCHEMA.TABLE_SNAPSHOTS;\n\n -- Returns metadata for the table snapshots in the specified region.\n SELECT * FROM `region-us`.INFORMATION_SCHEMA.TABLE_SNAPSHOTS;\n\nExample\n-------\n\nThe following query retrieves metadata for the table snapshots in the `mydataset`\ndataset. In this example, it displays the table snapshot\n`myproject.mydataset.mytablesnapshot`,\nwhich was taken from the base table `myproject.mydataset.mytable` on May 14,\n2021, at 12 PM UTC. \n\n```googlesql\nSELECT *\nFROM\n `myproject`.mydataset.INFORMATION_SCHEMA.TABLE_SNAPSHOTS;\n```\n\nThe result is similar to the following: \n\n```\n+----------------+---------------+-----------------+--------------------+-------------------+-----------------+-----------------------------+\n| table_catalog | table_schema | table_name | base_table_catalog | base_table_schema | base_table_name | snapshot_time |\n+----------------+---------------+-----------------+----------------------------------------------------------------------------------------+\n| myproject | mydataset | mytablesnapshot | myProject | mydataset | mytable | 2021-05-14 12:00:00.000 UTC |\n+----------------+---------------+-----------------+--------------------+-------------------+-----------------+-----------------------------+\n```"]]