How to restore an specific database within an managed SQL Server Instance

Cloud SQL : SQL Server Instance holding 4 databases.

If i need to recover an single database from the Cloud SQL instance, how can i do it ? Is there any documentation to refer. Please advise. Thank you!

It entirely depends on the conditions the database was deleted, a couple of examples of those conditions:

  • Was a backup setup?
  • How many days since it was deleted?

I think this is what you are looking for Troubleshooting Cloud SQL - Backups.

Thanks Hector for the response!

Documents doesn’t talk about taking individual databases from an managed Cloud SQL Instance. So hence, this post is more around that specific scenario.

Here database is not deleted.

Example : I have 3 databases within an Cloud SQL instance

If an application corrupts one of the database, how can i recover only that database ? instead of recovering the whole Cloud SQL Instance.

Please let me know if this explains.

From your example, it sounds like you need a point-in-time recovery, but be aware this procedure involves the whole instance, not a single database.

Without a doubt, my recommendation would be to create a GCP Support Case to avoid any further corruption of any of those 4 databases or the entire instance.

Thanks Hector! So, it is not possible to do it ourselves to perform point-in-time recovery for an database in my scenario with managed Cloud SQL instance.

Looks like - Only option is to open an GCP support case to handle such scenarios.

Thanks for clarifying the questions!

It’s not impossible to do it yourself, that’s exactly the purpose of the guide.

Naturally, like in any IT environment the risk is higher if you do something wrong. My recommendation remains to create a GCP Support Case to lower the risk.

Thank you Hector! My question was around having an internal DBA to do that point in recovery in such scenario. Currently in on-premise environment, we have an dedicated DBA performing such activity for us.

If that’s part of managed Cloud SQL instance advantage is to reduce the dependency around having an DBA - then it explains.