In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article shows you how to restore the master database in SQL, the content is concise and easy to understand, it will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
Step 1: copy model.mdf, mastlog.ldf, model.mdf, modellog.ldf, msdbdata.mdf, msdblog.ldf files. From X:\ Program Files\ Microsoft SQL Server\ MSSQL10.MSSQLSERVER\ MSSQL\ Binn\ Templates to X:\ Program Files\ Microsoft SQL Server\ MSSQL10.MSSQLSERVER\ MSSQL\ DATA Note: the above "X:\ Program Files\ Microsoft SQL Server" is the SQL Server installation directory. The following "C:\ Program Files\ Microsoft SQL Server" is the directory under the system disk.
Step 2: locate and execute the installation command 1. First find the installation command: C:\ Program Files\ Microsoft SQL Server\ 100\ Setup Bootstrap\ Release\ setup.exe2. Execute a command
If you are only in Windows authentication mode, you only need the following syntax: copy the code as follows: setup / ACTION=REBUILDDATABASE / QUIET / INSTANCENAME= / SQLSYSADMINACCOUNTS=
If it is a compound authentication mode, you need to use the / SAPWD parameter to provide the sa password: the copy code is as follows: setup / ACTION=REBUILDDATABASE / QUIET / INSTANCENAME= / SQLSYSADMINACCOUNTS= / SAPWD=
When I installed, I set up the compound authentication mode, the SQL Server system administrator account is administrators group, and the sa password is 123456. And just one default example: MSSQLSERVER. So execute the following command on the command line: copy the code as follows: setup / ACTION=REBUILDDATABASE / QUIET / INSTANCENAME=MSSQLSERVER / SQLSYSADMINACCOUNTS=administrators / SAPWD=123456
Step 3: there is no prompt (successful or not) after execution, but you can immediately view the installation log in C:\ Program Files\ Microsoft SQL Server\ 100\ Setup Bootstrap\ Log\ Summary.txt.
Finally, the SQL Server service was started successfully in Sql Server Configuration Manager.
What if the SQL recovers the database when this happens during processing? How to restore when there is only mdf file, that is, how to restore the database with log file
Specific implementation steps for SQL recovery database:
1. Create a database with the same name.
2. Stop the database service and overwrite the newly created database master file (tip: it is best to put it on the same disk, delete or remove the newly created database master file, and then cut the database master file to be restored. This will save time. )
3. Start the database service, and the database becomes suspicious or suspicious. Then run it in the query analyzer: the database name of the alter database no log file set emergency is set to a state of emergency.
4. Run again: alter database database name without log files set single_user or: Sp_dboption 'database name without log files', and 'single user',' true' is set to single-user mode.
5, check and rebuild the log file, run: dbcc checkdb ('database name without log file', REPAIR_ALLOW_DATA_LOSS) this time is relatively long. Wait patiently! If there is an error, run: dbcc checkdb ('database name without log files', REPAIR_REBUILD) to fix it. If there are no mistakes, you can skip it.
6, restore to the multi-user mode alter database no-log file database name set multi_user or: Sp_dboption'no-log file database name', 'single user',' false' refresh the database, you can see the repaired database.
The above content is how to restore the master database in SQL. Have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to 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: 278
*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.