Delete a Database¶
You can delete a database from Okera using the UI or a SQL command on the Workspace page.
Note: When you delete a database using the UI, all of the datasets and internal views included in the database are also removed from Okera. To add the datasets back to Okera for policy management, you must recrawl the connection and reregister the datasets. To add views back to Okera, you must recreate them.When you delete a database, the permissions set for that database in an Okera policy are not deleted.
To delete a database using the UI:
-
Select the database you want to delete on the Databases tab of the Data page. The tabs for the selected database appear.
-
Select
. A confirmation dialog appears.
-
Select
to delete the database.
To delete a database using the DDL:
-
Access the Workspace page. SQL commands can be issued in the Workspace or in another SQL editor. For more information, see Drop a Database and its Datasets or Views.
-
Issue one of the following SQL commands.
-
Issue
DROP DATABASE <database-name>
, where<database-name>
is the name of the database you want to delete. This SQL command deletes the database from Okera. IFor example:
DROP DATABASE mydb
Note: This SQL command will fail if the database contains any datasets or views. You must first delete its datasets and views from Okera, or you can issue the SQL command using the
CASCADE
option, as described next. -
Issue
DROP DATABASE IF EXISTS <database-name> CASCADE
, where<database-name>
is the name of the database you want to delete. This SQL command deletes the database from Okera as well as all of its datasets and views. To add the datasets back to Okera for policy management, you must recrawl the connection and reregister the datasets. To add the views back to Okera, you must recreate them.
-