Showing posts with label shrink. Show all posts
Showing posts with label shrink. Show all posts

Sunday, February 19, 2012

Can I shrink Trans log even if doing log-shipping?

I have a 2000 DB which is log-shipping to another server. The log has grown huge and needs to be made smaller. Can I use DBCC SHRINKFILE without damaging the log-shipping? I know that truncating the log destroys log-shipping, but shrinking should logically not cause any harm. Do you know? Is there a better way to reduce the size of the log file without damaging log-shipping?

Thanks!

Hi,

DBCC shrinkfile with default options should be ok to shrink the transaction log.

Jag

|||

I don't know if this is functionally the same, but I selected "AutoShrink" in EM / database/properties/Options and the trans log file shrank and log shipping appears to be functioning well.

Thanks.

|||

Hi

The database property autoshrink allows a database to shrink automatically at 30-minute intervals. The effect is the same as doing a DBCC SHRINKDATABASE (dbname, 25). This option leaves 25 percent free space in a database after the shrink, and any free space beyond that is returned to the operating system.

This can be a bit dangerous for transaction logs, as at any point you might have empty transaction log, so the autoshrink will make the transaction log really small. This will result in transaction log full errors or increased amount of shrinks and growths , if you have autogrowth on, which can result in poor perfromance.

The best option is to use DBCC Shrinkfile and specify the required file size.

Jag

|||

jag,

Thank you for a very nice reply. It is very helpful and gives me a lot to follow-up on.

Michael

Can I shrink a table in SQL Server 2000?

I have a table that has a ton of unused space in it (1.8 GB). Is there any
way to shrink just a table or do I have to shrink the whole DB to recover
that space?
Thanks,
Davehave you try to defrag your indexes?
specially the clustered index.
also, what is your index fill ratio?
I don't remember if SQL 2000 has this function, but in SQL 2005 you can
recover unused space of the varchar columns.
I don't remember the command, maybe you can search for this.
"Dave" <Dave@.discussions.microsoft.com> wrote in message
news:5D9FF2D4-307A-48F1-BBB6-3FE4D568464B@.microsoft.com...
>I have a table that has a ton of unused space in it (1.8 GB). Is there any
> way to shrink just a table or do I have to shrink the whole DB to recover
> that space?
> Thanks,
> Dave

Can I shrink a table in SQL Server 2000?

I have a table that has a ton of unused space in it (1.8 GB). Is there any
way to shrink just a table or do I have to shrink the whole DB to recover
that space?
Thanks,
Davehave you try to defrag your indexes?
specially the clustered index.
also, what is your index fill ratio?
I don't remember if SQL 2000 has this function, but in SQL 2005 you can
recover unused space of the varchar columns.
I don't remember the command, maybe you can search for this.
"Dave" <Dave@.discussions.microsoft.com> wrote in message
news:5D9FF2D4-307A-48F1-BBB6-3FE4D568464B@.microsoft.com...
>I have a table that has a ton of unused space in it (1.8 GB). Is there any
> way to shrink just a table or do I have to shrink the whole DB to recover
> that space?
> Thanks,
> Dave