2016-10-06

Database: How database dies: DROP DATABASE

Every dba troubles about his databases and cares about their health. But finally each database needs to die. To remove a database ALFA use  following statement:

USE master
GO

DROP DATABASE ALFA
GO


For DROP DATABASE to succeed following conditions need to be met:

  • User executing the statement must be a SA (system admin) or DBO (database owner)
  • No one can use the database when it is dropped. If still some sessions exist, they can be terminated using KILL command
  • Database cannot be refereced by other databases
  • DROP DATABASE must be started from master database

No comments:

Post a Comment

SAP Adaprive Server Enterprise

SAP Adaprive Server Enterprise
SAP Adaprive Server Enterprise