In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article will explain in detail how to clear the log in SQL server, the content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
Method 1:
Step one:
No_log and truncate_only are synonymous here, and you can execute either sentence.
Step 2:
1. Shrink all specific data and log files and execute:
-- database_name is the name of the database to be shrunk; target_percent is the percentage of free space left in the database file after the database is shrunk.
two。 Shrink the data or log files in a specific database at a time, and execute
-- file_id is the ID number of the file to be shrunk. To get the file ID, use the FILE_ID function or search the current database for the desired file size (in integers) where sysfiles;target_size is expressed in megabytes. If not specified, dbcc shrinkfile reduces the file size to the default file size. Both dbcc can take the parameter notruncate or truncateonly to see the online help.
Method 2:
Step one:
Back up the entire database in case of an accident.
Step 2:
When the backup is complete, execute the following statement in Query Analyzer:
-- remove the registration information of this DB in MSSQL
Step 3:
Delete the log file or move it out of the directory where the physical file of the log is located
Step 4:
Execute the following statement in Query Analyzer:
Register the DB as a single file, and if successful, MSSQL will automatically generate a 500K log file for the DB.
Method 3:
1. Go to Enterprise Manager and select the database, such as demo
two。 All tasks-> detach database
3. Go to the directory where the database file is stored and delete the MuOnline_log.LDF file. Just in case, you can copy it out.
4. Enterprise Manager-> add database, select muonline, at this time you will see that the log file is a cross, never mind, go on, the database will prompt you whether the database has no log to create a new one, just make sure.
On how to clear the log in SQL server to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
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.