Delete table snapshots
This document describes how to delete a table snapshot by using the
Google Cloud console, a  DROP SNAPSHOT TABLE 
 
GoogleSQL statement, a  bq rm 
 
command,
or a BigQuery API  tables.delete 
 
call.
It also provides information about how to recover a table snapshot that was
deleted or that expired in the past seven days.
It is intended for users who are familiar with table snapshots 
.
Permissions and roles
This section describes the Identity and Access Management (IAM) permission that you need to delete a table snapshot, and the predefined IAM roles that grant those permissions.
Permissions
To delete a table snapshot, you need the following permission:
| Permission | Resource | 
|---|---|
| bigquery.tables.deleteSnapshot | The table snapshot that you want to delete | 
Roles
The predefined BigQuery roles that provide the required permissions are as follows:
| Role | Resource | 
|---|---|
| Any of the following: bigquery.dataOwnerbigquery.admin | The table snapshot that you want to delete. | 
Delete a table snapshot
Delete a table snapshot as you would delete a standard table. You don't need to delete a table snapshot that has expired.
You can delete a table snapshot by using one of the following options:
Console
- In the Google Cloud console, go to the BigQuerypage.
-  In the left pane, click Explorer:  If you don't see the left pane, click Expand left paneto open the pane. 
-  In the Explorerpane, expand your project, click Datasets, and then click the dataset that has the table snapshot. 
-  Click Overview > Tables, and then click the name of the table snapshot. 
-  In the details pane that appears, click Delete. 
-  In the dialog that appears, type delete, and then click Deleteagain.
SQL
Use the  DROP SNAPSHOT TABLE 
DDL statement 
:
-  In the Google Cloud console, go to the BigQuerypage. 
-  In the query editor, enter the following statement: DROP SNAPSHOT TABLE PROJECT_ID . DATASET_NAME . SNAPSHOT_NAME ; Replace the following: -  PROJECT_ID: the project ID of the project that contains the snapshot.
-  DATASET_NAME: the name of the dataset that contains the snapshot.
-  SNAPSHOT_NAME: the name of the snapshot.
 
-  
-  Click Run. 
For more information about how to run queries, see Run an interactive query .
bq
Enter the following command in the Cloud Shell:
bq rm \ PROJECT_ID : DATASET_NAME . SNAPSHOT_NAME
Replace the following:
-  PROJECT_ID: the project ID of the project that contains the snapshot.
-  DATASET_NAME: the name of the dataset that contains the snapshot.
-  SNAPSHOT_NAME: the name of the snapshot.
API
Call the  tables.delete 
 
method with the following parameters:
| Parameter | Value | 
|---|---|
| projectId | The project ID of the project that contains the snapshot. | 
| datasetId | The name of the dataset that contains the snapshot. | 
| tableId | The name of the snapshot. | 
Restore a deleted or expired table snapshot
You can recover a table snapshot that was deleted or that expired in the past seven days in the same way that you recover a standard table. For more information, see Restore table snapshots .

