Shrink sgvault db

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

Post Reply
kha
Posts: 221
Joined: Fri Sep 12, 2008 8:25 am

Shrink sgvault db

Post by kha » Tue Feb 15, 2011 4:59 pm

I just deleted bunch of repositories in the database, but the db size remains unchanged. Is there a good way for me to shrink the db size? Is it recommended?

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Shrink sgvault db

Post by Beth » Wed Feb 16, 2011 8:44 am

The SQL command shrinkdatabase should do what you need. You can find the details of how to use it here: http://msdn.microsoft.com/en-us/library/ms190488.aspx.

As a precautionary measure, make sure you have current backups of your sgvault and sgmaster databases before you shrink the database.
Beth Kieler
SourceGear Technical Support

Brody
Posts: 19
Joined: Sun Feb 22, 2004 6:14 pm
Location: Auckland, New Zealand

Re: Shrink sgvault db

Post by Brody » Wed Mar 02, 2011 6:05 pm

Unless you are short on space you probably shouldn't worry about shrinking your database or log files.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Shrink sgvault db

Post by Beth » Thu Mar 03, 2011 1:42 pm

Brody, I agree with you to a point. Most users don't need to be concerned about their database size, and it's just a matter of having enough disk space.

Where I disagree is on the SQL transaction logs. Having large .ldf files can affect SQL's performance. That didn't relate to the user's original post though.

We have a KB article on recommended Vault database maintenance posted here: http://support.sourcegear.com/viewtopic.php?t=2924. Regular database maintenance can also help performance.

Admittedly, I missed addressing the user's question about whether it's recommended to shrink the database. I can't say in general that we have a recommendation to shrink databases.
Beth Kieler
SourceGear Technical Support

Post Reply