[ Web Proxy ]
URL:
Viewing: https://cloud.google.com/spanner/docs/pitr [Back]  [Original]

Point-in-time recovery (PITR) overview  |  Spanner  |  Google Cloud Documentation Skip to main content
Google Cloud Documentation [Google Cloud Documentation]
Send feedback

Point-in-time recovery (PITR) overview Stay organized with collections Save and categorize content based on your preferences.

Spanner point-in-time recovery (PITR) provides protection against accidental deletion or writes. For example, if an operator inadvertently writes data or an application rollout corrupts the database, with PITR you can recover the data from a point-in-time in the past (up to a maximum of seven days) seamlessly. If you need longer-term retention of data, you can use either Backup and Restore or Export and Import.

By default, your database retains all versions of its data and schema for one hour. You can increase this time limit to as long as seven days through the version_retention_period option. For instructions, see Set the retention period. Spanner stores earlier versions of data at microsecond granularity and the database maintains an earliest_version_time, which represents the earliest time in the past that you can recover earlier versions of the data.

Note: PITR provides additional insurance against logical data corruption, but does not protect you in case a user accidentally deletes the database. Make sure that you have other recovery options in place and that access to roles that include the spanner.databases.drop permission are set appropriately. For more information, see Using IAM securely. You can also enable database deletion protection to prevent the accidental deletions of databases.

Ways to recover data

There are three ways to recover data:

Performance considerations

Databases with longer retention periods and, in particular, those that frequently overwrite data, use more system resources. This can affect how your database performs, especially if your instance is not provisioned with enough compute capacity. If your database has a very high overwrite rate (for example, if your database is overwritten multiple times per day), you might consider increasing the retention period gradually and monitoring the system. Here are some things to be aware of:

Pricing

There is no additional charge for using PITR. However, if you increase the version retention period of your database from the default one hour, your database storage and compute capacity costs might increase. Your on-demand backup cost is unaffected because only a single version of your database is stored. For more information, see the Performance considerations section. Before increasing a database's version retention period, you can estimate the expected increase in database storage.

For general information about how Spanner is charged, see Spanner pricing.

What's next

Send feedback

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-08-11 UTC.

Need to tell us more? [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-08-11 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page