Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to TRUNCATE transaction log of a SQL Server database?

Hello All,

I hav installed BW 3.5 on Windows / MS SQL database.

Now my transaction log is growing very high in my Quality & Production server. Please guide me how can i truncate its size.

In PRD currently log size has reached 140 GB.

Wat shd i do system is becoming too slow.

Regards & Thanks,

Ankita.

Former Member
Former Member replied

Hi,

Run the following Transact-SQL statements in Query analyzer:

1. Clear log file :

BACKUP LOG DatabaseName WITH NO_LOG

2. Shrink the transaction log file.

DBCC SHRINKFILE (<FileName>, <TargetSize>) WITH NO_INFOMSGS

3. If the DBCC SHRINKFILE statement does not shrink the transaction log file to the target size, run the BACKUP LOG statement that is mentioned in step 1 to make more of the virtual log files inactive

4. Run the DBCC SHRINKFILE statement that is mentioned in step 2. After this operation, the transaction log file should be similar to the target size.

Regards,

wojtek

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question