SQLServe数据库日志文件被删问题处理方法

注意!该方案仅做备忘,切勿直接用于生产环境!

1.确认需要的信息

select dbid,DB_NAME(dbid) as DBID,name,filename

from sys.sysaltfiles

where DB_NAME(dbid) = N'{Database_Name}'

and filename like '%LDF'

 

2.将库切为紧急模式

Alter database Database_Name SET EMERGENCY

GO

3. 重建ldf(您执行中的数据可能会遗失)

Alter database {Database Name} rebuild log on (NAME= {Transaction Log Logic Name} ,FILENAME='{Transaction Log Path wit File Name}')

4.将库切回一般模式

 

Alter Database {Database_Name} set multi_user

Alter Database {Database_Name} set online

 

posted on 2024-10-08 10:35  王.小辉  阅读(331)  评论(0)    收藏  举报

导航