INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

What maintenance actions can't be done when log shipping is set up?

What maintenance actions can't be done when log shipping is set up?

(OP)
Hi all,
I had another thread that I didn't want to overload with too many questions, so here is another log-shipping question:
Can I perform dbcc ShrinkFile on either database in a log shipping setup without having to backup/restore and restart the log shipping? If not, are there any other common maintenance tasks (aside from backup of course) that I am restricted from doing on the primary database when I have log shipping set up? We're undergoing this for the first time and would like to know the gotcha's and all the little things that we may not be able to do anymore when we have the remote site set up and are depending on them to be perfectly in sync.
Thanks very much,
--Jim

RE: What maintenance actions can't be done when log shipping is set up?

You can shrink the source but make sure you use the notruncate option as truncating will break log shipping. The shrink will be shipped over to the destination so only needs to be done on the source.

Not sure what would happen if you only shrunk the destination or did it first so I wouldn't try it.

Personally I would never class dbccc shrinkfile as a maint task and should only ever be used as a last resort or "get out of jail card". Look at why you are needing to shrink and resolve the space issues instead.

Biglebowskis Razor - with all things being equal if you still can't find the answer have a shave and go down the pub.

RE: What maintenance actions can't be done when log shipping is set up?

(OP)
thedude,
Thanks for the response, I'm interested in the point about dbcc shrinkfile. We have a situation where we have a massive usertable for tracing, and it gets used infrequently, but when it does it grows huge, and deleting (or truncating) its records doesn't release the space--the .mdf file stays in its bloated state.

This is more common on our dev onstances which have limited disk space (and aren't in a log-shipped situation)--but we have found ourselves having to do this in prod during off hours. So is it something in the way we're deleting the records that causes the .mdf not to go back to its original size? So in our case we don't always assume that when the file grows that huge it simply must stay that big, even assuming future growth may fill that space eventually.

I get that using a temp file like that in production is not a best practice, but from an academic standpoint, is the situation I described (a table that grows huge and then is truncated) something that would grow the .mdf and not automatically shrink it, and a valid case where one would need dbcc shrinkfile?
Thanks,
--Jim

RE: What maintenance actions can't be done when log shipping is set up?

JSteph,

Try DBCC SHRINKFILE with the TRUNCATEONLY option. If you do not use this option you must rebuild the indexes, which most likely will cause the DB to grow again.

MCP SQL Server 2000, MCTS SQL Server 2005, MCTS SQL Server 2008 (DBD, DBA)

RE: What maintenance actions can't be done when log shipping is set up?

Best thing to do in that scenario is preallocate the DB to the max you will utilise, if the table is used infrequently and truncated it still won't shrink the table back to its "empty" size again. Dbcc shrinkfile actually messes up the indexes more than not shrinking.

Biglebowskis Razor - with all things being equal if you still can't find the answer have a shave and go down the pub.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close