Friday, February 24, 2012

Backup/Restore Versus Detach/Attach

Hi All,
when I've to deploy my applications (c# and MSDE), generally I make a backup
on th edevelopment machine of the SQL Database the on the deployment machine
I make a restore and restoring from the backup I get my database up and
running (so boiring that I've to change the data/log file path at any
restore...).
Are there any real differences if instead of backup/restore I detach the
database file from the development machine (running sql developer edition)
then copy the file on the deployment machine and then make an attach to that
file?
which one is the best way?
Thanks, Davide.
Davide Piras
Naxo Software
hi Davide,
Davide Piras wrote:
> Hi All,
> when I've to deploy my applications (c# and MSDE), generally I make a
> backup on th edevelopment machine of the SQL Database the on the
> deployment machine I make a restore and restoring from the backup I
> get my database up and running (so boiring that I've to change the
> data/log file path at any restore...).
> Are there any real differences if instead of backup/restore I detach
> the database file from the development machine (running sql developer
> edition) then copy the file on the deployment machine and then make
> an attach to that file?
> which one is the best way?
please remember to add the log file to your distribution too, as it's part
of the dabase files set... and reattaching without the log file can end in
attaching problems...
the restore scenario only requires a little more physical space as you have
to consider the backup size in addition to the database files size...
both scenarios are simple to run but you have to consider some potential
issues..
MSDE usually set the "autoclose" database property, where the full blown SQL
Server editions do not, so you'll end up with a database that does not
reflect this standard MSDE setting, but it could be a choice...
you do not inherit database settings/options/objects from the end user model
database but from yours...
this can bring up some problems regarding orphaned users you will have to
fix by use of the sp_change_users_login system stored procedure
(http://msdn.microsoft.com/library/de...ca-cz_8qzy.asp
, http://www.sqlservercentral.com/colu...okenlogins.asp )
personally I go this way, http://tinyurl.com/dyjjg , that will even help in
structure upgrade to, and can grant a database deployment based on version
control check ... and the best article I found for this kind of situation is
http://msdn.microsoft.com/msdnmag/is...baseinstaller/
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.12.0 - DbaMgr ver 0.58.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||Ciao Andrea,
thanks for you help, I will read those articles BEFORE the next deployment
loop...
you know I use your DbaManager 0.12.0 as a Client User Interface?! :-)
Nice and useful Tool, thanks!
Davide.

No comments:

Post a Comment