Skip to content

Delete a Database

You can delete a database from Okera using the UI or a DDL statement 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 deleted from Okera. 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.

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:

  1. Select the database you want to delete on the Databases page. The tabs for the selected database appear.

  2. Select . A confirmation dialog appears.

    Delete database confirmation dialog

  3. Select to delete the database.

To delete a database using the DDL:

  1. Access the Workspace page. DDL statements can be issued in the Workspace or in another SQL editor. For more information, see Drop a Database and its Datasets or Views.

  2. Issue one of the following DDL statements.

    • Issue DROP DATABASE <database-name>, where <database-name> is the name of the database you want to delete. This DDL statement deletes the database from Okera. I

      For example: DROP DATABASE mydb

      Note: This DDL statement 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 DDL statement 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 DDL statement 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.