In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article is to share with you about how to recover ldf file data in mssqlserver, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.
Our important data is stored in the MDF file, if the LDF file is lost, the MDF file is not lost, then the data can also be restored. If the LDF file is not lost, the MDF file is lost, and the LDF file is complete, it can also provide some means to restore the data. Phenomenon description the problem we have to face now is that for the wtlog_2008_m12 database, only the MDF file is missing and the LDF file is missing, and there is no such database in SQL Server Management Studio. The solution (1) is to delete the problem database with the state of Recovery Pending (that is, the missing LDF) in SQL Server Management Studio (if any, it should not be in database management) (2) rename the old MDF file. For example, change to wtlog_2008_m12_bak.mdf (3) to rebuild a new database, the name is exactly the same as the lost database, for example, if the name of the wtlog_2008_m12,LDF file is wtlog_2008_m12, the database prompts you to report an error, saying that the logical name already exists, but the file cannot be found, and the LDF file here is named wtlog_2008_m12_log. Notice that the location of the new MDF is the same as the location of our old MDF files. The location of the LDF file here is in the final location you want to store (this is the restored LDF file you want). (4) close the SQL Server service, rename the new MDF (wtlog_2008_m12.mdf) (for example, wtlog_2008_m12___.mdf), and rename the old MDF (wtlog_2008_m12_bak.mdf) back to its original name (wtlog_2008_m12.mdf). (5) start the SQL Server service. Connect to the database and execute the following statement. If you report an error, check to see if you are connected to the database, or if there are other processes connected to the database. The copy code is as follows: alter database wtlog_2008_m12 set emergencyalter database wtlog_2008_m12 set single_user with rollback immediatealter database wtlog_2008_m12 rebuild log on (name=wtlog_2008_m12, filename='D:/watcher/database/wtlog_2008_m12.ldf') alter database wtlog_2008_m12 SET MULTI_USER with rollback immediate
(6) at this point, the names of mdf and ldf are both wtlog_2008_m12, so delete the redundant mdf files.
The above is how to recover ldf file data in mssqlserver. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.