Friday, February 24, 2012

Cannot shrink database log

I backup database and then truncate log with no_log option, then try to shr
ink the log file. It doesnot get shrunk.
Also, Checked the sysprocesses. there are writelog under lastwaittype.
Please help.
Thanks,
SanWhat about BACKUP LOG WITH NO_LOG? This should whack the t-log w/o having
to shrink. If this doesn't work, can you stop and restart the SQL service
and try the same thing again?
"san" <anonymous@.discussions.microsoft.com> wrote in message
news:57CF303C-1C95-4094-8D3A-E404E8C3E8D7@.microsoft.com...
> I backup database and then truncate log with no_log option, then try to
shrink the log file. It doesnot get shrunk.
> Also, Checked the sysprocesses. there are writelog under lastwaittype.
> Please help.
> Thanks,
> San|||San,
For SQL7
INF: How to Shrink the SQL Server 7.0 Transaction Log
http://support.microsoft.com/?ID=256650 and/or
www.sqlserverfaq.com and search for "sql7shrinklognowork.txt"
For SQL2000
INF: Shrinking the Transaction Log in SQL Server 2000 with DBCC SHRINKFILE
http://support.microsoft.com/?ID=272318
In case the log doesnt shrink even after DBCC SHRINKFILE, then do a
combination of...
Back up the Database (BACKUP DATABASE dbname...)
Back up the log (BACKUP LOG dbname...)
Truncate the log (BACKUP LOG dbname WITH TRUNCATE_ONLY)
Shrink the file (DBCC SHRINKFILE...)
Dinesh
SQL Server MVP
--
--
SQL Server FAQ at
http://www.tkdinesh.com
"san" <anonymous@.discussions.microsoft.com> wrote in message
news:57CF303C-1C95-4094-8D3A-E404E8C3E8D7@.microsoft.com...
> I backup database and then truncate log with no_log option, then try to
shrink the log file. It doesnot get shrunk.
> Also, Checked the sysprocesses. there are writelog under lastwaittype.
> Please help.
> Thanks,
> San|||Hi Dinesh,
I have tried:
1. backup database db to disk = 'c:\db.bak'
2. backup log db with truncate_only
3. dbcc shrinkfile(db_log,10)
4. dbcc shrinkdatabase(db,20)
Nothing works...!|||Thanks Dinesh...This indeed worked
The script presented to wrap aroun the tx log help solved it..!
Microsoft Knowledge Base Article - 256650
INF: How to Shrink the SQL Server 7.0 Transaction Log
Thanks once again for all your valuable help.
San|||Thanks a lot Jim... I will try in future when it happens again..for now I go
t my solution..
Thank you Jim.

No comments:

Post a Comment