question

chauhan_5041 avatar image
chauhan_5041 asked

DBCC SRINKFILE not working in Mirroring

Hi My log space used 100 in mirroring on principal Server. no effect space used percentage when I use dbcc shrinkfile (logship_log, 0). What advice on this situation.
space
2 comments
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Now my log space used 56% is showing after increasing log file size through DB property --> Files --> Initial size MB This is right way or wrong ??? my had disk have 30 GB space left.
0 Likes 0 ·
If any answer proves helpful, mark it by clicking on the thumbs up. If any answer provides a valid solution, mark that by clicking on the checkbox next to it. You can mark multiple answers as helpful and one as a solution.
0 Likes 0 ·
Grant Fritchey avatar image
Grant Fritchey answered
If the log space used is 100%, you can't shrink that file because there's nothing to shrink. Are you running log backups regularly (at least once an hour depending on your load)? If not, start doing that. That will free up space within the log for committed transactions that have been transmitted to the mirror. The first couple of times you run log backups, you may not still be able to shrink because all the most recent transactions will be at the end of the log, which is where the shrink needs to come from. But after a couple of backups you should then be able to shrink. But, let's talk about the shrink. You're only doing this because the log has grown right? You're not trying to shrink it all the time are you?
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Tim avatar image
Tim answered
What is the status of the secondary? Is your database on the primary showing synchronizing, synchronized, or suspended? I have many times seen a database that is being mirrored shift to a suspended state if something happened to the mirror for a period of time. If that happens you have to go back into mirroring and chose resume. Unless the principle and see the secondary and synch the log, the primary will keep those transactions in the log so it can play catchup. This will cause the log on the principle to keep growing and growing and growing.
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.