SQL Azure 数据恢复可能吗?

发布于 2024-11-09 03:11:03 字数 284 浏览 0 评论 0原文

我刚刚犯了一个愚蠢的错误。以为我已连接到本地开发数据库,​​我不小心对我的生产 SQL Azure 数据库运行了以下脚本:

DELETE myTable
GO

我的数据是否像我担心的那样永远消失了,或者 SQL Azure 是否有一些神奇的“回滚到 1 小时前”按钮?

我可以采取什么措施来恢复表的数据吗?

(顺便说一句,不,我没有数据库备份。SQL Azure 不支持备份。而且,是的,我意识到这可能回答了我自己的问题......我只是希望我错了。)

I just made a boneheaded mistake. Thinking I was connected to my local dev db, I accidentally ran the following script against my production SQL Azure database:

DELETE myTable
GO

Is my data gone for good as I fear, or does SQL Azure have some magic "Roll back to 1 hour ago" button?

Is there anything I can do to recover my table's data?

(BTW, no, I do not have a backup of the database. SQL Azure does not support backups. And, yes, I realize that probably answers my own question... I just hope I'm wrong.)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

甜妞爱困 2024-11-16 03:11:03

更新

Azure SQL 数据库自动为所有基本、标准和高级数据库创建备份。通过这些备份,您可以执行时间点还原并恢复已删除的数据库。这些备份也会异地复制到配对区域,因此在发生区域灾难时,您可以使用最新备份恢复数据库(V12 服务器为 1 小时 RPO)。

您可以在此处详细了解 Azure SQL 数据库的备份和还原功能:https: //msdn.microsoft.com/en-us/library/azure/jj650016.aspx

还有一个关于 时间点的博客还原 以及 上的博客异地恢复以及有关业务连续性 Azure SQL 数据库中的产品。

您可能不想听到这个,但常规数据库副本似乎是您唯一的选择,即http://social.technet.microsoft.com/wiki/contents/articles/sql-azure-backup-and-restore-strategy。 aspx - 并且必须积极完成。

用户错误数据库常见原因
恢复不是由于故障或
灾难;这是由用户造成的
错误。要么是一个错误的命令,比如
删除数据库,架构更改
没有正确执行(导致数据
丢失),或损坏数据的代码。
创建备份以防止
用户的错误是责任
客户并需要采取
编写时要考虑到
备份和恢复策略。

在 SQL Azure 服务更新 4 中
复制数据库的能力是
介绍了。此功能允许您
复制正在运行的数据库创建
另一个功能齐全的 SQL Azure
数据库位于同一数据中心。这
是你之前可以采取的策略
对数据库进行任何更改或
代码调用数据库创建一个
完整备份。不错的之一
关于这项技术的事情是
该副本功能齐全
数据库并可以恢复
迅速地。事实上,恢复可能是
就像更改应用程序一样简单
连接字符串指向副本
数据库。

Transact SQL 如下所示:

创建数据库
目的地数据库名称
作为 [source_server_name.]source_database_name 的副本
复制 Adventure Works 数据库
对于同一台服务器,我执行以下命令:

创建数据库 [AdvetureWorksBackup]
作为 [AdventureWorksLTAZ2008R2] 的副本
该命令必须在以下情况下执行
连接到主数据库
目标 SQL Azure 服务器。

Update

Azure SQL Database automatically creates backup for all Basic, Standard, and Premium databases. With these backups you can perform Point in Time Restore and recover deleted databases. These backups are also Geo-Replicated to the pair region, so in the event of a regional disaster you could recover your databases with your latest backups (1 hour RPO for V12 servers).

You can learn more about Azure SQL Database's backup and restore capabilities here: https://msdn.microsoft.com/en-us/library/azure/jj650016.aspx.

There is also a blog on Point in Time Restore and a blog on Geo-Restore and a document about the Business Continuity offerings in Azure SQL Database.

You probably don't want to hear this, but regular database copies seems to be your only option, i.e., http://social.technet.microsoft.com/wiki/contents/articles/sql-azure-backup-and-restore-strategy.aspx - and must be actively done.

User Error A common cause of database
restores is not from failure or
catastrophe; it is caused by user
error. Either a mistaken command like
DROP DATABASE, schema changes that
don’t get executed right (causing data
loss), or code that corrupts the data.
Creating backups to protect against
user error is the responsibility of
the customer and needs to be taken
into consideration when writing the
backup and restore strategy.

In service update 4 of SQL Azure the
ability to copy the database was
introduced. This feature allows you to
copy a running database creating
another fully functional SQL Azure
database in the same data center. This
is a strategy you can take before
making any changes to the database or
code calling the database to create a
complete backup. One of the nice
things about this technique is that
the copy is a fully functional
database and could be restored
quickly. In fact, restoration might be
as simple as changing the applications
connection string to point to the copy
of the database.

The Transact SQL looks like this:

CREATE DATABASE
destination_database_name
AS COPY OF [source_server_name.]source_database_name
To copy the Adventure Works database
to the same server, I execute this:

CREATE DATABASE [AdvetureWorksBackup]
AS COPY OF [AdventureWorksLTAZ2008R2]
This command must be executed when
connected to the master database of
the destination SQL Azure server.

°如果伤别离去 2024-11-16 03:11:03

不幸的是,到目前为止,由于这是一个用户级错误 - 它不属于当代 SQL Azure 功能集的范围。

我建议您在 http://www.mygreatwindowsazureidea 上投票支持此功能。 com/forums/34685-sql-azure-feature-voting - 这是投票最高的“最想要”功能 - 它由微软团队。

哈特哈,

Unfortunately, as of now since it's a user level error - it is not covered by the contemporary SQL Azure feature set.

I suggest you to vote for this feature on http://www.mygreatwindowsazureidea.com/forums/34685-sql-azure-feature-voting - it's a top voted 'most wanted' feature - it is officially monitored by the MS team.

HTH,

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文