Thursday, March 22, 2012

Backing up a database?

I've got two developers that are working on a asp.net app that use SQL
Server 2000. They've both got the developer edition on each of their PCs.
I'd like to know what is the best way to "backup" the database so that 1) we
can put this backup on the server so our tape backup picks it up each night
and 2) so a developer can "synch" his version of the database with the other
developer (i.e. developer A does a backup and stores it on a network share
then developer B uses that backup to recreate developer a's database on his
PC).
I've used the backup command, and it seems that it does backup the data and
the schema to a location on the local disk. Then I copied that to the other
developer's PC and did a restore into a new database. That worked well, but
when I tried to restore the same backup file into a second new database on
the other developer's PC, SQL Server complained that the first database
(that I restored to) was using this file. So, something just seemed odd
about that. I also see there is an export wizard, but it seemed like that
was geared towards exporting the raw data to some other format.
Any help would be much appreciated. Thanks!Yikes. What happens when you have 5 developers? 20? 50? Maintaining that
many development databases will be a nightmare!
Here are my suggestions:
Buy a development database server that everyone can use.
Obtain a source control product such as Visual Source Safe.
When a developer creates a stored procedure or view have them create the
text for the object using Query Analyzer. Save the script to a file (with
the same name as the object) and have him check the file into VSS. When you
need to modify an object grab the script from source control, make the
change, create/recreate the object within the database, save the script
file, and check it back in to source control (with comments of course).
That will give you the ability to know what changed, who changed it, and
why.
Start backing up your database and your source control repository. Make
sure that they get to tape.
Keith
"epigram" <nospam@.spammy.com> wrote in message
news:1111753952.477f69973b1b43c598d9c65d29aec71a@.bubbanews...
> I've got two developers that are working on a asp.net app that use SQL
> Server 2000. They've both got the developer edition on each of their PCs.
> I'd like to know what is the best way to "backup" the database so that 1)
we
> can put this backup on the server so our tape backup picks it up each
night
> and 2) so a developer can "synch" his version of the database with the
other
> developer (i.e. developer A does a backup and stores it on a network share
> then developer B uses that backup to recreate developer a's database on
his
> PC).
> I've used the backup command, and it seems that it does backup the data
and
> the schema to a location on the local disk. Then I copied that to the
other
> developer's PC and did a restore into a new database. That worked well,
but
> when I tried to restore the same backup file into a second new database on
> the other developer's PC, SQL Server complained that the first database
> (that I restored to) was using this file. So, something just seemed odd
> about that. I also see there is an export wizard, but it seemed like that
> was geared towards exporting the raw data to some other format.
> Any help would be much appreciated. Thanks!
>

No comments:

Post a Comment