Manually trucate and shrink the transaction log for SQL 2005

In some situation, the transaction log grow too big until the harddisk space become unavailable and backup cannot be performed to truncate the log immediately.
 
How to truncate and shrink the transaction log manually?
Run the below 2 SQL query:
===============================
use databasename
DBCC LOGINFO('databasename')
go
==============================
Note down the fileID
==========================
Use databasename
DBCC shrinkdatabase (N'databasename', fileid, truncateonly)
Backup LOG databasename WITH TRUNCATE_ONLY
DBCC shrinkdatabase (N'databasename', fileid, truncateonly)
GO
========================================
 
Please perform full database backup immediately after the above SQL statement.
 

十月二十六 雨月夜 小女追问 做完一件事后做什么事 接连几天下来 小女发现生活一直重复 原来是无趣和不好

女儿,生活的表征看起来固然不断重复。谨记这只是表面的,并不是人生的全部。好或不好,有趣或无趣,二分法是无意义的。
必须让每一刻的"我"死去,那才有每一刻的重生和新生。背负上一刻脏污的"我"来影响这一刻的我,明智吗?


Sent from my BlackBerry® Smartphone

颜面短语录

Ong Keng Hin wrote:

人间疾苦知多少。花开花落不觉晓。烦恼。不如说说笑笑。

Jeff Tan wrote:

朱门酒肉冻死骨,花裳玉雕不觉苦。狂喜。不如宁宁静静。
Sent from my BlackBerry® Smartphone

颜面短语录

Ong Keng Hin wrote:

人间疾苦知多少。花开花落不觉晓。烦恼。不如说说笑笑。

Jeff Tan wrote:

朱门酒肉冻死骨,花裳玉雕不觉苦。狂喜。不如宁宁静静。
Sent from my BlackBerry® Smartphone
Related Posts with Thumbnails

Saving The Seahorse Means Saving The Sea