SQL 2000 Transaction Log and "DBCC SHRINKFILE"

Hi,

I've got a problem with an SQL Server in that the transaction log has grown too large and filled the disk.

As such, I performed a backup of the transaction logs, and then tried to use the DBCC SHRINKFILE T-SQL command to shrink the file.

However, when I run the command it immidiately returns "The command(s) completed successfully" and nothing happens to the file.

I tried to run it using SQL Server Management Studio 2005 from another machine in the domain, and the graphical interface here confirms that the log file is 97% free space, but again when I run it it says "Executing" for a few seconds, and completes without error, again without changing the size of the log file.

There is nothing in the EventLog that suggests an error either.

This is the T-SQL command I ran (though I have tried several other permutations): -
DBCC SHRINKFILE (N'MyDB_LOG.LDF', 0, TRUNCATEONLY)

What am I doing wrong???

Thanks in advance.
SafeserveAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Cedric_DCommented:
run CHECKPOINT stetement before shrinking.
then run DBCC SHRINKFILE (N'pacs_oltp_log1' , 1).

but these measures will not effect when you initially created too large logfile. In that case you should move log to new file and delete old file.

also, I can advice to change recovery model from full to simple to decrease Logfile growth.

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SafeserveAuthor Commented:
Hi, thanks for the help.

No luck with CHECKPOINT either, but once I changed it to simple it shrank correctly.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.