Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

How to archive a database Expand / Collapse
Author
Message
Posted Wednesday, December 19, 2012 4:52 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, July 14, 2014 7:39 AM
Points: 111, Visits: 307
Hey,

Each of my customers has his own database. Sometimes a customer quits. When that happens, I want to archive that database. My idea is:

1) Make a full backup to "\\backupserver\final_backups\FINAL_BACKUP_CUSTOMERNAME.BAK"
2) Detach the database "DBCUSTOMER"
3) Delete the files DBCUSTOMER.MDF and DBCUSTOMER_LOG.LDF

Is this the way to go? And if so, how do I do step 3 with T-SQL?

Thanks,
Raymond
Post #1398315
Posted Wednesday, December 19, 2012 5:02 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 8:54 AM
Points: 5,149, Visits: 4,961
Why not just drop the database after you have backed it up?



Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1398321
Posted Wednesday, December 19, 2012 5:28 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, July 14, 2014 7:39 AM
Points: 111, Visits: 307
That simple eh...

Thanks!

Raymond
Post #1398330
Posted Thursday, December 20, 2012 8:20 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, July 15, 2014 3:49 PM
Points: 191, Visits: 891
Just a thought, I would also keep and stash away a copy of the associated logins scripted out using the sp_help_revlogin procedure. That way, you can reinstall the database on another server if needed, and it will keep the same security ID's for the logins, and any SQL Authentication passwords.
Post #1398999
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse