--紧急情况下就数据库从 恢复模式 转换到可用模式 的6个步骤(数据肯能会有逻辑错误。比如没有COMMIT的数据就会 产生不一致)
alter database dbname set single_user with rollback immediate
go
alter database dbname set emergency with rollback immediate
go
select name ,physical_name from sys.master_files where database_id=DB_ID('db_test')
go
alter database dbname rebuild log on (name='log_name',filename='physical_name')
go
alter database dbname set online with rollback immediate
go
alter database dbname set multi_user with rollback immediate
go