数据库还原时的一个存储过程
create proc killspid (@dbname varchar(20))
as begin declare @sql nvarchar(500)
declare @spid int set @sql='declare getspid cursor for select spid from sysprocesses where dbid=db_id('''+@dbname+''')' exec (@sql)
open getspid fetch next from getspid into @spid while @@fetch_status<>-1 begin exec('kill '+@spid)
fetch next from getspid into @spid end close getspid deallocate getspid end GO
我只是知道:因为数据库还原时不能还有其它用户仍在对数据库保持操作所以需要用到这个存储过程,但不知道它的真实意义,希望有人解答下,并且跟我说下数据库备份还原的原理。
as begin declare @sql nvarchar(500)
declare @spid int set @sql='declare getspid cursor for select spid from sysprocesses where dbid=db_id('''+@dbname+''')' exec (@sql)
open getspid fetch next from getspid into @spid while @@fetch_status<>-1 begin exec('kill '+@spid)
fetch next from getspid into @spid end close getspid deallocate getspid end GO
我只是知道:因为数据库还原时不能还有其它用户仍在对数据库保持操作所以需要用到这个存储过程,但不知道它的真实意义,希望有人解答下,并且跟我说下数据库备份还原的原理。
...全文
相关推荐
mysql存储过程——用于数据库的备份与还原
数据库备份的存储过程,创建一个备份库,表自动搜索和复制,可以自定义要备份的表
asp.net备份和还原数据库(C#)
ASP.NET备份还原数据库,以及sqlDMO的注册
sql server 还原数据库时提示数据库正在使用,无法进行操作的解决方法
sql server 还原数据库时提示:数据库正在使用,无法进行操作的解决方法
对数据库自动备份,分离,附加,还原,删除
在没有SSMS下对数据库自动备份,分离,附加,删除,还原 可自己定时备份,自动压缩成rar,到一定数量自己会删除
mysql数据库太大了如何备份与还原
今天小编就为大家分享一篇关于mysql数据库太大了如何备份与还原,小编觉得内容挺不错的,现在分享给大家,具有很好的参考价值,需要的朋友一起跟随小编来看看吧


