Deletes a database (namespace).
DROP DATABASE dbname [RETAIN_FILES]
||The name of the database (namespace) to be deleted.
||Optional If specified, the physical database files (CACHE.DAT files) will not be deleted. The default is to delete the .DAT files along with the namespace and the other database entities.
The DROP DATABASE
command deletes a namespace and its associated database.
The specified dbname
is the name of the namespace and the directory that contains the corresponding database files. Specify dbname
as an identifier
. Namespace names are not case-sensitive. If the specified dbname
namespace does not exist, Caché issues an SQLCODE -340 error.
The DROP DATABASE
command is a privileged operation. Prior to using DROP DATABASE
, it is necessary to be logged in as a user with the %Admin_Manage resource. The user must also have READ permission on the resource for the routines and global's database definitions. Failing to do so results in an SQLCODE -99 error (Privilege Violation).
cannot be used to drop a system namespace, regardless of privileges. Attempting to do so results in an SQLCODE -342 error.
cannot be used to drop the namespace that you are currently using or connected to. Attempting to do so results in an SQLCODE -344 error.
If you specify this option, the physical file structure is retained; the database and its associated namespace is removed. After performing this operation, a subsequent attempt to use dbname
results in the following:
The following example deletes a namespace and its associated database (in this case 'C:\InterSystems\Cache\mgr\DocTestDB'). It retains the physical database files:
CREATE DATABASE DocTestDB ON DIRECTORY 'C:\InterSystems\Cache142\mgr\DocTestDB'
DROP DATABASE DocTestDB RETAIN_FILES
© 1997-2019 InterSystems Corporation, Cambridge, MA