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 12»»

Question regarding Log issues with Mirroring database. Expand / Collapse
Author
Message
Posted Friday, March 15, 2013 2:17 PM
SSC-Addicted

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

Group: General Forum Members
Last Login: Friday, November 14, 2014 10:40 PM
Points: 422, Visits: 2,661
Hi All,

I have a database which is mirrored and the log grew to about 50GB due to log backup being failed, so the steps I am doing now is taking a full and log backup manually just to be safe.

My question is this:

Would I be able to shrink the log file after taking log backup? or it won't let you shrink since mirroring in place?

In order to fix this issue, do I need to break the mirroring and reconfigure from scratch? Please advise.

Thanks,
SueTons.



Regards,
SQLisAwe5oMe.
Post #1431745
Posted Friday, March 15, 2013 2:27 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 4:56 AM
Points: 20,815, Visits: 32,748
I personally never tried shrinking the log of a mirrored database. If you can, perhaps you could set this up on a test server and see what happens.
I'd be interested in knowing.



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1431751
Posted Friday, March 15, 2013 2:53 PM
SSC-Addicted

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

Group: General Forum Members
Last Login: Friday, November 14, 2014 10:40 PM
Points: 422, Visits: 2,661
Lynn Pettis (3/15/2013)
I personally never tried shrinking the log of a mirrored database. If you can, perhaps you could set this up on a test server and see what happens.
I'd be interested in knowing.


After taking full and log backup, I see 99% free space on log file, but when I try to shink it, it's not working. I thought it should truncate the inactive logs after logbackup\shrink are done. I am not sure since mirroring is in place, it might not allowing this? Your thought.

SueTons.


Regards,
SQLisAwe5oMe.
Post #1431766
Posted Friday, March 15, 2013 2:55 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 @ 8:31 AM
Points: 40,456, Visits: 36,912
SQLCrazyCertified (3/15/2013)
I thought it should truncate the inactive logs after logbackup\shrink are done.


Just like any other database in full recovery, the logs are truncated (marked as reusable) when a log backup is run. Truncating doesn't mean shrinking. If you want to do a once-off shrink of the principal's log, you can use DBCC ShrinkFile, as normal.



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 #1431767
Posted Friday, March 15, 2013 2:56 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 4:56 AM
Points: 20,815, Visits: 32,748
When you say not working, not really sure what you mean. Is it just not doing it or are you getting an error message?



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1431768
Posted Friday, March 15, 2013 2:58 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 4:56 AM
Points: 20,815, Visits: 32,748
Also, you may have to take one or two more t-log backups. If it isn't shrinking, it could be that the active log is at the end of the log file.




Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1431770
Posted Friday, March 15, 2013 3:18 PM
SSC-Addicted

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

Group: General Forum Members
Last Login: Friday, November 14, 2014 10:40 PM
Points: 422, Visits: 2,661
GilaMonster (3/15/2013)
SQLCrazyCertified (3/15/2013)
I thought it should truncate the inactive logs after logbackup\shrink are done.


Just like any other database in full recovery, the logs are truncated (marked as reusable) when a log backup is run. Truncating doesn't mean shrinking. If you want to do a once-off shrink of the principal's log, you can use DBCC ShrinkFile, as normal.


Yes, I was doing DBCC Shrinkfile, and I did couple of log backups before I saw the free space....however, when I run DBCC Shrinkfile, it was running without any errors, but nothing is happening.

So, is there is any known factor with SQL server 2005 with mirroring, the shrink won't work?

SueTons.


Regards,
SQLisAwe5oMe.
Post #1431790
Posted Friday, March 15, 2013 3:21 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 4:56 AM
Points: 20,815, Visits: 32,748
If the (or an) active VLF is at the end of the log file, the file will not shrink. All I can suggest is keep trying after each log backup.



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1431792
Posted Friday, March 15, 2013 3:58 PM
SSC-Addicted

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

Group: General Forum Members
Last Login: Friday, November 14, 2014 10:40 PM
Points: 422, Visits: 2,661
Lynn Pettis (3/15/2013)
If the (or an) active VLF is at the end of the log file, the file will not shrink. All I can suggest is keep trying after each log backup.


Cannot shrink log file 2 (DatabaseName_Log) because all logical log files are in use.

(1 row(s) affected)
DBCC execution completed. If DBCC printed error messages, contact your system administrator.

What exactly this means?

SueTons.


Regards,
SQLisAwe5oMe.
Post #1431818
Posted Friday, March 15, 2013 4:01 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 @ 8:31 AM
Points: 40,456, Visits: 36,912
Exactly what it says, all logical log files are in use, so there are no empty ones. No empty VLFs = no shrink.

Check log_reuse_wait_desc in sys.databases for why the log is not being reused.



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 #1431820
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse