SQL Server – Offline Database Management

sql server

I do not really understand when it is necessary to set database offline .

I have googled and I did find any information or examples where and why should I set database offline.

I will be perfect if you will give me some example and cases when I need to make my database offline.

Best Answer

When you want to remove access but not DROP the database

Example 1: migrate one database to a new installation

  • Prepare new server
  • Backup/restore to new server
  • Update application connection srings
  • Take DB off-line on old server
  • Test thoroughly
  • Drop DB on old server

Without taking the DB off line, you limit rollback options

Example 2: Cleaning up a messy SQL Server (e.g. developers created DBs)

  • Take offline, see who calls...