Jump to content

Database CleanUp


swerner

Recommended Posts

Hi all,

i just started to play with PlasticSCM and like it so far.

The only question i have is about Database cleanup.

I noticed that after i delete a repostitory the Database for that repostitory stays behind and will not be deleted.

How can i make sure that the SQL Server will not have a whole bunch of lingering objects after a while?

Thanks,

Sebastian

Link to comment
Share on other sites

@psantosl The only problem that I have with that, and this applies specifically to the "Community Edition", is that in really small organizations (like mine, 4 developers) there isn't a designated DBA. In our case we threw up a virtual machine and installed SQL Server Express, and installed Plastic on it.

No one will ever look at that SQL server database again, because it's not a part of our development database server(s); and because of the way Plastic creates databases (proliferates databases) we didn't want it on our normal development sql servers (the quote was: "It will make too much clutter"). So that means that these databases will continue to proliferate and pile up, until we run out of disk space and someone is forced to go figure out why and do some cleanup. And then when that happens, they will have to back-track and figure out which databases are still in use as repositories, and which ones are not.

I totally understand your position, I can see where it would be way to easy for someone to accidentally delete a repo and destroy months or years worth of work. That was why I suggested it as an option, you can protect that a little bit by say "Are you really sure you want to permanently destroy this repository and all it's data?"

Link to comment
Share on other sites

My 0.2 (your currency of choice) here is that I mostly agree with psantosl, which one caveat. When I was last in the repository, all of my databases were named repo_XXX (with XXX being some number). For me to figure which databases I wanted to get rid of seemed like kind of a complicated task and one I'd be nervous executing.

While making it simple for someone to make a mistake of this magnitude should definitely be a concern, reducing the possibility for someone to make an error when they make the informed decision to do so is just as important. If there was a secondary (even command line only) tool that allowed me to cleanup the databases I would love it.

I'd see it working thusly:

cm cleanupdb
Doing this could destroy existence on this planet as we know it are you sure you want to go through with it? Y
Have you backed up your database before going down this path? Y
Really? Are you sure? Y

Scanning for unused databases...

Removed unused_repo_021 (Y/N)? Y
unused_repo_021 removed!

Removed unused_repo_035 (Y/N)? Y
unused_repo_035 removed!

That would be ideal! I would settle for a tool that listed out what database names were linked to unused repositories.

Disclaimer: It's possible this tools exists and I just haven't seen it.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...