In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
Editor to share with you to restore the database tips on how to restore the database, I hope you will gain something after reading this article, let's discuss it together!
When you restore a database, you are prompted that the restore was successful, but the database in the database list shows that the database is in the process of being restored:
Execute this command to:
RESTORE DATABASE EnterPriseBuilding WITH RECOVERY
1. At least one full backup of the database before it was mistakenly deleted.
two。 The recovery model (Recovery mode) of the database is "Full".
First, restore the required condition settings
The command is restored through the transaction log of sqlserver and a full backup of the database before it was mistakenly deleted, so in the sqlserver2012 maintenance plan wizard, establish a full backup, differential backup and transaction log, as follows
And in the database properties and options settings, set it to full backup, as shown below
If you do a good job such as the above two settings, it will be very easy to retrieve the data after the database is deleted by mistake. Now let's talk about how to restore the sqlserver data to the point of failure.
Second, restore command
Reduction is mainly divided into four steps:
1. After a failure, first execute the command to back up the transaction log, with AdventureWorks as the database name. The command is as follows:
BACKUP LOG AdventureWorks TO DISK ='C:\ SQLServerBackups\ AdventureWorks_transcationlog.bak' WITH NORECOVERY
2. Restore data from a full backup
RESTORE DATABASE [QASupervision] FROM DISK='M:\ Database\ OA\ AdventureWorks_Fullbackup_2014_03_18_010002_0155764.bak' WITH NORECOVERY, REPLACE
3. Restore data from differential backup
RESTORE DATABASE [QASupervision] FROM DISK='M:\ Database\ OA\ AdventureWorks_diffbackup_2014_03_18_020002_0155764.bak' WITH NORECOVERY, REPLACE
4. Restore data from the transaction log before a certain point in time
DECLARE @ dt datetime SELECT @ dt=DATEADD (HOUR,-16,GETDATE ()) select @ dtRESTORE LOG [QASupervision] FROM DISK='C:\ SQLServerBackups\ AdventureWorks_transcationlog.bak' WITH STOPAT=@dt,RECOVERY
5. Restore the database, and execute this command if the database prompt is being restored.
RESTORE DATABASE AdventureWorks WITH RECOVERY finished reading this article, I believe you have a certain understanding of "restore database tips are being restored". If you want to know more about it, welcome to follow the industry information channel. Thank you for your reading!
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.