Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Hard copy of database file to repository

Author  Topic 

tuka
Starting Member

26 Posts

Posted - 2007-02-06 : 17:53:54
Hi,

I recently made a mistake and erroneously deleted a table in a database that is part of an application.

To avoid this happening again, I am thinking of Subversion backing up the database i.e. MDF and LOG copy to the repository.

Is it possible to just hard copy a database like that. Of course I know that the conections need to be closed for the copy but would there be any problem with opying and old database and running it without actually attaching it ? Would the sql server engine accept that ?

This would all run on a development laptop and not a server so we are not dealing with any remote connections here.

I would also like to avoid the sql server backups for now just becasue I would like to keep everything in one type of repository..

TIA,
Tuka

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-02-06 : 18:03:52
Why wouldn't you just run normal SQL Server backups?

Tara Kizer
Go to Top of Page

tuka
Starting Member

26 Posts

Posted - 2007-02-07 : 04:28:16
I already save many aspects of the projects (an asp.net app) in SVN including, test scripts, part of the documentation etc. I would like to keep the database in the same type of backup/versioning system.

If I were to do backups and then attach the backupfiles to the SVN, I would have to manage things in 2 steps when it could potentially just be one step..

Tuka

Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-02-07 : 04:37:00
If you are assuming this to be like copying Access database file to some location and later on use it the way you open it in Access, let me tell you it is not Access and you should refrain from such practices.

Backup is the only correct and reliable way PERIOD !

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-02-07 : 05:18:00
I can't foresee all sorts of grief trying to do this in SVN (which I'm familiar with as that's what we use for our source code), not least of which will be the vast amount of disk space SVN will use. One Reindex, Shrink or probably even Update Stats and SVNs ability to DIFF will be shot.

Use SQL Backups

Make sure your database(s) are set to FULL recovery model

Make sure that your Transaction Backups are frequent - I would recommend every 10 minutes

Consider the retention period you need. We store TLog backups online for around 5 days, daily (full) backups for two weeks and Full Backups from Sundays (same as daily backups, but made on a different schedule) for 4 weeks.

(The backups need to go to tape too, of course. Our on-line retention policy is based on an 80:20 rule of being able to recover without having to use tapes; if your folk are more comfortable with tape restore then you can have less on-line)

Kristen
Go to Top of Page
   

- Advertisement -