惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
Know Your Adversary
Know Your Adversary
P
Palo Alto Networks Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
K
Kaspersky official blog
L
LINUX DO - 热门话题
P
Proofpoint News Feed
P
Privacy & Cybersecurity Law Blog
Google DeepMind News
Google DeepMind News
Attack and Defense Labs
Attack and Defense Labs
Cisco Talos Blog
Cisco Talos Blog
AI
AI
L
LINUX DO - 最新话题
H
Heimdal Security Blog
Hacker News: Ask HN
Hacker News: Ask HN
Webroot Blog
Webroot Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The GitHub Blog
The GitHub Blog
I
Intezer
Blog — PlanetScale
Blog — PlanetScale
有赞技术团队
有赞技术团队
S
Securelist
博客园_首页
IT之家
IT之家
Schneier on Security
Schneier on Security
博客园 - 叶小钗
罗磊的独立博客
WordPress大学
WordPress大学
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
MongoDB | Blog
MongoDB | Blog
P
Proofpoint News Feed
阮一峰的网络日志
阮一峰的网络日志
A
Arctic Wolf
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
W
WeLiveSecurity
The Register - Security
The Register - Security
D
DataBreaches.Net
S
Security @ Cisco Blogs
Security Archives - TechRepublic
Security Archives - TechRepublic
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
腾讯CDC
Recorded Future
Recorded Future
NISL@THU
NISL@THU
N
News and Events Feed by Topic
T
Tailwind CSS Blog
N
News and Events Feed by Topic
Cyberwarzone
Cyberwarzone
T
Tor Project blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com

博客园 - 清虚真人

关于flask-sqlalchemy的用法研究 [原]跟我学silverlight系列教程[1]—wpf/silverlight体系架构和运行机制 [原]跟我学silverlight系列教程 IIS中网站出错 javascript获取滚动条位置 - 清虚真人 - 博客园 .Net framework [转载]My97DatePicker在Frame中无法打开站点 输出datagrid的内容到excel - 清虚真人 - 博客园 sql select的时候按特定的顺序排序 vs2008 安装Silverlight tools遇到的崩溃问题。。。 关于.NET中的Server push技术 .net 几种序列化类的比较 asp.net ajax实现(—):Jquery+Json WPF中BitMapEffect的性能问题 我写的PageDataSurce分页的 asp.net页面执行机制 关于服务器端控件的attributes属性的奇怪问题 关于使用javascript+asp.net实现多文件上传的若干问题 正则表达式相关教程
sql2005 数据库没有完全关闭,无法重新生成日志
清虚真人 · 2010-01-05 · via 博客园 - 清虚真人

问题:

MDF文件10G,日志文件20G,我嫌日志文件大,就停掉数据库后把日志文件删除,然后再附加就无法附加。

 报错:数据库没有完全关闭,无法重新生成日志

在网上找的解决方案

创建一样的数据库MyDB(文件名.mdf 和要恢复的mdf要一样)

数据库服务停止,把要恢复的数据库文件MyDB.mdf覆盖上去,启动数据库服务

数据库这个时候是可疑状态。

USE MASTER

GO

SP_CONFIGURE 'ALLOW UPDATES',1 RECONFIGURE WITH OVERRIDE

GO

ALTER DATABASE MyDB SET EMERGENCY

GO

sp_dboption 'MyDB', 'single user', 'true'

GO

DBCC CHECKDB('MyDB','REPAIR_ALLOW_DATA_LOSS')

GO

ALTER DATABASE MyDB SET ONLINE

GO

sp_configure 'allow updates', 0 reconfigure with override

GO

sp_dboption 'MyDB', 'single user', 'false'

GO