Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Tabellen-Snapshots löschen.
In diesem Dokument wird beschrieben, wie Sie einen Tabellen-Snapshot mithilfe der Google Cloud Console, einer DROP SNAPSHOT TABLE-GoogleSQL-Anweisung, einem bq rm-Befehl oder einem BigQuery API-tables.delete-Aufruf löschen.
Außerdem finden Sie Informationen zum Wiederherstellen eines Tabellen-Snapshots, der gelöscht wurde oder in den letzten sieben Tagen abgelaufen ist.
Das Dokument richtet sich an Nutzer, die mit Tabellen-Snapshots vertraut sind.
PROJECT_ID: die ID des Projekts, das den Snapshot enthält.
DATASET_NAME: der Name des Datasets, das den Snapshot enthält.
SNAPSHOT_NAME: der Name des Snapshots.
API
Rufen Sie die Methode tables.delete mit den folgenden Parametern auf:
Parameter
Wert
projectId
Die Projekt-ID des Projekts, das den Snapshot enthält.
datasetId
Der Name des Datasets, das den Snapshot enthält.
tableId
Der Name des Snapshots.
Gelöschten oder abgelaufenen Tabellen-Snapshot wiederherstellen
Sie können einen Tabellen-Snapshot, der gelöscht wurde oder in den letzten sieben Tagen abgelaufen ist, genauso wie eine Standardtabelle wiederherstellen. Weitere Informationen finden Sie unter Gelöschte Tabellen wiederherstellen.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-03-04 (UTC)."],[[["\u003cp\u003eTable snapshots can be deleted using the Google Cloud console, a \u003ccode\u003eDROP SNAPSHOT TABLE\u003c/code\u003e SQL statement, the \u003ccode\u003ebq rm\u003c/code\u003e command, or a BigQuery API \u003ccode\u003etables.delete\u003c/code\u003e call.\u003c/p\u003e\n"],["\u003cp\u003eTo delete a table snapshot, users need the \u003ccode\u003ebigquery.tables.deleteSnapshot\u003c/code\u003e permission, which is granted by the \u003ccode\u003ebigquery.dataOwner\u003c/code\u003e or \u003ccode\u003ebigquery.admin\u003c/code\u003e roles.\u003c/p\u003e\n"],["\u003cp\u003eDeleting a table snapshot is similar to deleting a standard table, and expired snapshots do not need to be manually deleted.\u003c/p\u003e\n"],["\u003cp\u003eA table snapshot deleted or expired in the past seven days can be recovered in the same way a standard table is recovered.\u003c/p\u003e\n"]]],[],null,["# Delete table snapshots\n======================\n\nThis document describes how to delete a table snapshot by using the\nGoogle Cloud console, a\n[`DROP SNAPSHOT TABLE`](/bigquery/docs/reference/standard-sql/data-definition-language#drop_snapshot_table_statement)\nGoogleSQL statement, a\n[`bq rm`](/bigquery/docs/reference/bq-cli-reference#bq_rm) command,\nor a BigQuery API\n[`tables.delete`](/bigquery/docs/reference/rest/v2/tables/delete) call.\nIt also provides information about how to recover a table snapshot that was\ndeleted or that expired in the past seven days.\nIt is intended for users who are familiar with\n[table snapshots](/bigquery/docs/table-snapshots-intro).\n\nPermissions and roles\n---------------------\n\nThis section describes the\n[Identity and Access Management (IAM) permission](/bigquery/docs/access-control#bq-permissions)\nthat you need to delete a table snapshot, and the\n[predefined IAM roles](/bigquery/docs/access-control#bigquery)\nthat grant those permissions.\n\n### Permissions\n\nTo delete a table snapshot, you need the following permission:\n\n### Roles\n\nThe predefined BigQuery roles that provide the required\npermissions are as follows:\n\nDelete a table snapshot\n-----------------------\n\nDelete a table snapshot as you would delete a standard table. You don't need to\ndelete a table snapshot that has expired.\n\nYou can delete a table snapshot by using one of the following options: \n\n### Console\n\n1. In the Google Cloud console, go to the **BigQuery** page.\n\n[Go to BigQuery](https://console.cloud.google.com/bigquery)\n\n1. In the **Explorer** pane, expand the project and dataset nodes of the\n table snapshot you want to look at.\n\n2. Click the name of the table snapshot.\n\n3. In the snapshot pane that appears, click **Delete**.\n\n4. Confirm, and then click **Delete** again.\n\n### SQL\n\nUse the\n[`DROP SNAPSHOT TABLE` DDL statement](/bigquery/docs/reference/standard-sql/data-definition-language#drop_snapshot_table_statement):\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n1. In the Google Cloud console, go to the **BigQuery** page.\n\n [Go to BigQuery](https://console.cloud.google.com/bigquery)\n2. In the query editor, enter the following statement:\n\n ```googlesql\n DROP SNAPSHOT TABLE PROJECT_ID.DATASET_NAME.SNAPSHOT_NAME;\n ```\n\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project ID of the project that contains the snapshot.\n - \u003cvar translate=\"no\"\u003eDATASET_NAME\u003c/var\u003e: the name of the dataset that contains the snapshot.\n - \u003cvar translate=\"no\"\u003eSNAPSHOT_NAME\u003c/var\u003e: the name of the snapshot.\n\n \u003cbr /\u003e\n\n3. Click play_circle **Run**.\n\n \u003cbr /\u003e\n\nFor more information about how to run queries, see [Run an interactive query](/bigquery/docs/running-queries#queries).\n\n### bq\n\nEnter the following command in the Cloud Shell:\n\n[Go to Cloud Shell](https://console.cloud.google.com/bigquery?cloudshell=true) \n\n```bash\nbq rm \\\nPROJECT_ID:DATASET_NAME.SNAPSHOT_NAME\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project ID of the project that contains the snapshot.\n- \u003cvar translate=\"no\"\u003eDATASET_NAME\u003c/var\u003e: the name of the dataset that contains the snapshot.\n- \u003cvar translate=\"no\"\u003eSNAPSHOT_NAME\u003c/var\u003e: the name of the snapshot.\n\n\u003cbr /\u003e\n\n### API\n\nCall the\n[`tables.delete`](/bigquery/docs/reference/rest/v2/tables/delete)\nmethod with the following parameters:\n\nRestore a deleted or expired table snapshot\n-------------------------------------------\n\nYou can recover a table snapshot that was deleted or that expired in\nthe past seven days in the same way that you recover a standard table. For more\ninformation, see\n[Restore table snapshots](/bigquery/docs/table-snapshots-restore).\n\nWhat's next\n-----------\n\n- [Create monthly snapshots of a table by using a service account that runs a scheduled query](/bigquery/docs/table-snapshots-scheduled)."]]