在SqlServer2012中恢复已删除的表数据? [英] Recover Deleted Table data in SqlServer2012?
本文介绍了在SqlServer2012中恢复已删除的表数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
hi
I accidentaly ran a DELETE Table data usin "select * from Company"
command. i need to recover table. iam using sql2012 server
提前感谢
thanks in advance
推荐答案
http:/ /stackoverflow.com/questions/3540729/how-to-recover-deleted-rows-from-sql-server-table [ ^ ]
http://www.sql-server-performance.com/forum/threads /accidently-deleted-records.33128/ [ ^ ]
http://www.red-gate.com/products/dba/sql-log-rescue/ [ ^ ]
http:// dba.stackexchange.com/questions/995/how-do-i-get-back-some-deleted-records [ ^ ]
< a href =http://raresql.com/2012/10/10/how-to-recover-the-deleted-records-from-sql-server/> http://raresql.com/2012/10/ 10 /如何从sql-server / 恢复已删除的记录[ ^ ] ..
查看此链接并尝试一次.. 。
http://stackoverflow.com/questions/3540729/how-to-recover-deleted-rows-from-sql-server-table[^]
http://www.sql-server-performance.com/forum/threads/accidently-deleted-records.33128/[^]
http://www.red-gate.com/products/dba/sql-log-rescue/[^]
http://dba.stackexchange.com/questions/995/how-do-i-get-back-some-deleted-records[^]
http://raresql.com/2012/10/10/how-to-recover-the-deleted-records-from-sql-server/[^]..
check this link and try out once...
SQL Server为每个已删除的记录保留日志。你可以通过fn_dblog sql server函数查询这些日志。
SQL Server keeps log for each deleted records. you can query these logs via fn_dblog sql server function.
Select [RowLog Contents 0]
FROM sys.fn_dblog(NULL, NULL)
WHERE AllocUnitName = 'dbo.TableName'
AND Context IN ( 'LCX_MARK_AS_GHOST', 'LCX_HEAP' )
AND Operation in ( 'LOP_DELETE_ROWS' )
但是这个日志是十六进制格式。并且你需要将这个十六进制格式转换为你的实际数据。
But this log is in Hex format. and you need to convert this Hex format to your actual data.
可能会有所帮助:
在良好的服务器上执行此代码,该服务器将为您提供PUBLIC角色的完整权限。复制输出并粘贴到出现问题的服务器。执行。尝试重新登录。
SELECT SDP.state_desc,
SDP.permission_name,
SSU。[name] ASSchema ,
SSO。[姓名],
SSO。[类型]
来自sys.sysobjects SSO
INNER JOIN sys.database_permissions SDP ON SSO.id = SDP.major_id
INNER JOIN sys.sysusers SSU ON SSO.uid = SSU.uid
订购SSU。[name] ,
SSO。[name]
May be this can help:
Execute this code on a good server which will provide you the complete rights for PUBLIC role. Copy the output and paste to the server with the issue. Execute. Try logging in again.
SELECT SDP.state_desc ,
SDP.permission_name ,
SSU.[name] AS "Schema" ,
SSO.[name] ,
SSO.[type]
FROM sys.sysobjects SSO
INNER JOIN sys.database_permissions SDP ON SSO.id = SDP.major_id
INNER JOIN sys.sysusers SSU ON SSO.uid = SSU.uid
ORDER BY SSU.[name] ,
SSO.[name]
这篇关于在SqlServer2012中恢复已删除的表数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文