Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Question on CDC enabled DB Expand / Collapse
Author
Message
Posted Monday, October 29, 2012 9:03 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Sunday, September 14, 2014 1:28 AM
Points: 219, Visits: 693
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..
Post #1378548
Posted Monday, October 29, 2012 9:14 PM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Thursday, October 9, 2014 4:06 PM
Points: 450, Visits: 1,342
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
Post #1378549
Posted Monday, October 29, 2012 11:42 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Sunday, September 14, 2014 1:28 AM
Points: 219, Visits: 693
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?
Post #1378571
Posted Tuesday, October 30, 2012 1:08 PM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Thursday, October 9, 2014 4:06 PM
Points: 450, Visits: 1,342
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
Post #1378979
Posted Tuesday, October 30, 2012 1:13 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 5:50 AM
Points: 40,209, Visits: 36,618
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

Post #1378985
Posted Tuesday, October 30, 2012 2:01 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Sunday, September 14, 2014 1:28 AM
Points: 219, Visits: 693
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.
Post #1379008
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse