How to decommission a database
Before decommissioning a database, try to find out which application the database is related to. Either talk to the application owner or run Profiler for some time and check if anyone is using the database.
Here are some steps to take:
- Check if the database is in use.
- Check if the database is participating in a replication, mirroring or log shipping. If it does, then you will have to make a plan to dismantle the activities.
- Take a note of the properties of the database and document them
- Check if there are any SQLAgent jobs related to the database and disable them; back up the jobs and save them as .sql scripts. Also, check if the database is included in any Mainetnance plan jobs (for example Database backup, index rebuild etc) and remove it from the Maintenance plan.
- Script all SQL Server logins related to users in the database; keep in mind that scripting the logins does NOT script the real password, but a password placeholder only.
- Backup security certificates etc.
- Set the datbase in a SINGLE_USER mode and take a full backup of it.
- Place the database backup together with the scripted agent jobs, the documentation and the logins in a folder and zip it (and encrypt it).
- Find a good secure location for the zipped folder and place it there. Take a note of where you have saved the zipped file. And then take a note of where you have written the note.
- Either detach the database or delete it. Keep in mind that detaching the database leaves the files on the disk system and deleting the database deletes the files.
run Profiler, sp_who2, cached plans, index usage statistics etc to check if there are currently any connections to the database. (Not getting data from the above mentioned methods does not mean that the database is not used once a month or once a year even, so beware.)
– number of filegroups and number of files in each filegroup; document the locations of the filegroups
– note down the sizes of each file
– note if there are Full text catalogs and filestream involved and document the names and sizes
– note the SQL Server instance version, edition and service pack level
How to decommission an instance
- Perform the steps in How to decommission a database for each database on the instance.
- Take notes about the instance settings and zip them together with the databases.
- Script linked servers, credentials, endpoints, trigers, replications, database mail, SQL Server logs, SQLAgent logs, default trace files
- Check if there are other services running (SSIS, SSRS, SSAS) and backup all objects.
- After all user databases have been detached or deleted, take a note of the location of the system databases for the instance
- Go to Run –> services.msc and document the settings of the services related to the SQL Server instance and the account names which run the services
- Stop the SSIS, SSRS and SSAS
- Go to the folder containing the system databases and copy the files of msdb, master, model and mssqlsystemresource databases to the backup folder, together with all other information from previous points above.
- Stop the SQL Server service.
– pretty much all settings from the instance properties window (right-click on the instance name in SSMS and click Properties)
– note the current size of tempdb
– script all sysadmins and securityadmins
How to uninstall SQL Server instance
- Go to Control Panel –> Programs and features, find the ‘MS SQL Server’ program.
- Click ‘Uninstall’ and follow the wizard.
- Make sure to uninstall the right insance, if there are a few on the server.
Ref :
http://sqlconcept.com/2011/05/13/how-to-decommission-database-or-sql-server-instance/
No comments:
Post a Comment