Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 disk space issue

Author  Topic 

laddu
Constraint Violating Yak Guru

332 Posts

Posted - 2008-03-02 : 16:53:25
one user database ldf file is growing like it reached 50GB and total D:\ drive space is 70GB. No SAN drives for D:\. I tried to shrink the file but it not shrinking. Even I tried take to Tlog backup but it is throwing the below error
'not enough disk space'

This is production server. Please let me know how to resolve this issue?

dineshasanka
Yak Posting Veteran

72 Posts

Posted - 2008-03-02 : 17:58:35
Take a full backup for safety reasons.

Detach the database.
Delete the log file
Attach the database again file again.

But you have to mak sure that this won't happen in future by addind more disk space or by chaning the recovery method.



---------------------
http://dineshasanka.spaces.live.com/
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-03-02 : 18:01:59
I prefer shrink file instead of detaching db, much less risk. What you can try is backup db, set the db to simple recovery mode, shrink log file, set recovery mode back and backup db again.


You have to backup log more often to prevent it happens again.
Go to Top of Page

laddu
Constraint Violating Yak Guru

332 Posts

Posted - 2008-03-02 : 18:28:06
Changing the recovery model is a big proccess in our banking organization. I have create Change Request and it will get approved in 5 days. So I tried the below command, it worked.




BACKUP LOG [AdventureWorks]

WITH TRUNCATE_ONLY



DBCC SHRINKFILE(AdventureWorks_Log)


Thank you rmiao and dineshasanka.


Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-03-02 : 19:57:21
Should backup db again, otherwise you can't backup log.
Go to Top of Page

laddu
Constraint Violating Yak Guru

332 Posts

Posted - 2008-03-03 : 00:44:34
Yep, soon after shrinking I have took full backup
Go to Top of Page
   

- Advertisement -