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--
Today, I will talk to you about how to clear log files in SQL Server 2008. Many people may not know much about it. In order to let everyone know more, Xiaobian summarizes the following contents for everyone. I hope everyone can gain something according to this article.
SQL2008 Empty Delete Log:
Method 1:
USE [master]GOALTER DATABASE AFMS SET RECOVERY SIMPLE WITH NO_WAITGOALTER DATABASE AFMS SET RECOVERY SIMPLEGOUSE AFMSGODBCC SHRINKFILE (N'AFMS_Log' , 11, TRUNCATEONLY) GOUSE [master]GOALTER DATABASE AFMS SET RECOVERY FULL WITH NO_WAITGOALTER DATABASE AFMS SET RECOVERY FULLGO
In SQL2008, log cleanup must be performed in simple mode, and then reverted to full mode after the cleanup action is completed.
USE [master]GOALTER DATABASE DNName SET RECOVERY SIMPLE WITH NO_WAITGOALTER DATABASE DNName SET RECOVERY SIMPLE --SIMPLE SINGLE MODULAR GOUSE DNNameGODBCC SHRINKFILE (N'DNName_Log', 11, TRUNCATONLY) GO ' DNName_Log here If you don't know what the name is in sys.database_files, you can query it with the following commented statement 'USE DNName 'GO 'SELECT file_id, nameFROM sys.database_files;'GOUSE [master]GOALTER DATABASE DNName SET RECOVERY FULL WITH NO_WAITGOALTER DATABASE DNName SET RECOVERY FULL --revert to full mode GO
SQL2005 Clears Delete Log:
Backup Log DNName with no_log 'DNName here is the name of the database you want to shrink, pay attention to modify the database name below, I will not comment anymore. godump transaction DNName with no_log goUSE DNNameDBCC SHRINKFILE (2)Go
sqlserver2000 compressed logs
You can make the jb51.ldf file very small to facilitate backup of databases, etc., and execute it in sqlserver query analyzer.
DUMP TRANSACTION [jb51] WITH NO_LOG BACKUP LOG [jb51] WITH NO_LOG DBCC SHRINKDATABASE([jb51]) Having read the above, do you know more about how to empty log files in SQL Server 2008? If you still want to know more knowledge or related content, please pay attention to the industry information channel, thank you for your support.
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.