dbcc shrinkfile on a replicated database

  • I'm having 2nd thought on executing shrinkfile command on a replicated database.

    will it cause trouble on the replication setup?

  • Shouldn't, but it will wreck your indexes and create fragmentation. Why run it?

  • i just wanted to shrink the file size of my log. 90Gb

  • In this case of course it will not cause fragmentation on your data file. The question is why do you want to shrink the log's size. If you had a one time operation that caused the log file to grow much larger then it's usual size, then shrinking it will be beneficial, but if the log usually needs 90GB and after few hours it will reach this size again, then there is no use of shrinking it.

    Adi

    --------------------------------------------------------------
    To know how to ask questions and increase the chances of getting asnwers:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • Hi,

    I guess this one should help you.

    BACKUP LOG [datebase name] WITH NO_LOG

    DBCC SHRINKFILE ( 'databasename_log', truncateonly )

    simply DBCC SHRINKFILE won't help you u need to backup log first and then shrink it.

    Thanks,

    SC

  • Definitely use SHRINKFILE, but be sure that you don't need that space. HAving the log shrink and grow is a waste of resources.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply