|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: 2 days ago @ 6:28 PM
Points: 180,
Visits: 513
|
|
Hi All, I had an issue of log space running out of space. So as master Gail as suggested, I have added a new log file on a different mount point. Now how do I delete the log file.
Do I have to did back up and restore with old database configuration? If I do that I guess I will loose the CT Table lsn chain? or will I not?
Please suggest..
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: 2 days ago @ 2:32 PM
Points: 442,
Visits: 1,302
|
|
Provided the log file is empty you can delete it. Ensure you have regulare log backups, do a shrink file and empty it.
DBCC SHRINKFILE (N'Scratch_log' , EMPTYFILE) Then you should be able to delete the file.
Cheers
Leo
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: 2 days ago @ 6:28 PM
Points: 180,
Visits: 513
|
|
Strange I did not do any shrinkfile I just went to DB properties and removed the log file from there and the log file just vanished as if nothing was there at all...
The log file has 20mb consumed data in it.. Do you know what might be the reason for this?
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: 2 days ago @ 2:32 PM
Points: 442,
Visits: 1,302
|
|
If a log file back up had marked all the records in the file as no longer needed then a delete will also work. I tend to do the shrink and empty as a precaution.
Leo
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 4:30 AM
Points: 37,742,
Visits: 30,021
|
|
As Books Online clearly says, shrinkfile with the emptyfile option is for data files. It is used to migrate data pages to other data files in the same filegroup.
Log records cannot be moved by anything. You need to wait until the entire active portion of the log is in the file you want to keep (use DBCC LOGINFO) and then you can simply drop the other file (via alter database or the SSMS GUI), no other commands necessary.
Gail Shaw Microsoft Certified Master: SQL Server 2008, MVP SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter We stand on the bridge and no one may pass
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: 2 days ago @ 6:28 PM
Points: 180,
Visits: 513
|
|
Thanks Master Gail.. As you said the transactions might have already been committed and VLFs have been marked as reusable thats why I was able to delete the newly added log file.
|
|
|
|