简体   繁体   English

如何在SQL Server 2005中修复master数据库

[英]how to repair master database in sql server 2005

For some unknown reasons, all of a sudden my sql servers master database has been corrupted and sql service won't run. 由于某些未知的原因,我的sql server master数据库突然间已经损坏,并且sql service无法运行。 I have spent hours and tried various things like trying to run the service under different accounts, also checked that no compression is set in the data folder etc but nothing seems to work. 我已经花了几个小时,尝试了各种尝试,例如尝试以不同的帐户运行该服务,还检查了数据文件夹中未设置任何压缩等,但似乎没有任何效果。 I copied master database from another instance and the service would start and I can connect to the database instance via management studio but I won't see my databases. 我从另一个实例复制了主数据库,该服务将启动,并且可以通过Management Studio连接到数据库实例,但是看不到我的数据库。 I have backup of the corrupted master database (mdf and log file) but just wondering how can we fix this database to see all my databases? 我已经备份了损坏的主数据库(mdf和日志文件),但是想知道如何修复该数据库以查看我的所有数据库? thanks 谢谢

Just restore from the backup (good to have one!), it's the recommended way: 只需从备份中还原(最好有一个!),这是推荐的方式:

http://blogs.technet.com/b/fort_sql/archive/2011/02/01/the-easiest-way-to-rebuild-the-sql-server-master-database.aspx http://blogs.technet.com/b/fort_sql/archive/2011/02/01/the-easiest-way-to-rebuild-the-sql-server-master-database.aspx

In case you don't have a good backup, you will have to rebuild master database: 如果没有良好的备份,则必须重建主数据库:

http://msdn.microsoft.com/en-us/library/ms144259%28v=sql.90%29.aspx http://msdn.microsoft.com/en-us/library/ms144259%28v=sql.90%29.aspx

Copying over from another existing instance is not recommended. 不建议从另一个现有实例进行复制。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM