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

推荐订阅源

S
Secure Thoughts
罗磊的独立博客
T
The Blog of Author Tim Ferriss
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
Last Week in AI
Last Week in AI
美团技术团队
Google Online Security Blog
Google Online Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
D
Docker
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件
月光博客
月光博客
L
LINUX DO - 最新话题
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
W
WeLiveSecurity
H
Heimdal Security Blog
Vercel News
Vercel News
SecWiki News
SecWiki News
Forbes - Security
Forbes - Security
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
TaoSecurity Blog
TaoSecurity Blog
T
Troy Hunt's Blog
A
About on SuperTechFans
C
Check Point Blog
S
Security Affairs
Hacker News - Newest:
Hacker News - Newest: "LLM"
AI
AI
WordPress大学
WordPress大学
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Help Net Security
Help Net Security
博客园_首页
The Last Watchdog
The Last Watchdog
S
SegmentFault 最新的问题
Hugging Face - Blog
Hugging Face - Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Engineering at Meta
Engineering at Meta
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
I
Intezer
K
Kaspersky official blog
M
MIT News - Artificial intelligence
J
Java Code Geeks
G
GRAHAM CLULEY
P
Palo Alto Networks Blog

博客园 - 清虚真人

关于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