Hi,
A dataset has been deleted by mistake. It contains several views and tables. Is there any way to retrieve them all
Unfortunately, once a dataset is deleted in BigQuery, it cannot be directly recovered in its entirety. However, you still have options to potentially retrieve tables and views individually:
Time Travel: BigQuery's Time Travel feature is your first line of defense for table recovery. If the deletion occurred within the last 7 days, this feature allows you to access and query past versions of a table. For detailed steps, refer to the official documentation on restoring a table.
Snapshots: If you created snapshots of your tables before their deletion, these can be a lifesaver. You can restore your tables from these snapshots, even beyond the 7-day window of the Time Travel feature. For more on this, see how to restore table snapshots.
Backups: As a best practice, if you have backups of your dataset or individual tables, you can restore your data from these backups. Regular backups are crucial for mitigating data loss.
Query History: To recover views, use the BigQuery Logs Viewer to search for "CREATE VIEW" or "CREATE OR REPLACE VIEW" queries made before the deletion. This can help you find the necessary SQL queries to recreate your views in a new dataset.
Code Repositories: If your views were scripted or noted in notebooks, check your version control systems or code repositories. You can re-run these scripts to recreate the views.
If a dataset is deleted in BigQuery, check the following:
BigQuery Console:
Audit Logs:
Contact Support:
Snapshots or Backups:
Ask Administrators:
Act quickly, as recovery options may depend on retention policies and configurations. Implement regular backups to avoid future data loss.