This optional section describes how to delete a schema from an Oracle database. If it is ever required to import an exported schema into the same database from which it was exported earlier, the old HPD schema must be dropped, that is, deleted, first. The database administrator might need to do this on a test database, before replacing it with a newer copy from production.
Note Before starting, it is necessary to find out: This information can be found by using Oracle’s Enterprise Manager program, for example, or from records kept when the new HPD schema was first created. This information must be known if this schema is to be restored again later. |
> sqlplus system/password@database SQL> DROP USER hpdowner CASCADE; User dropped. -- Use DROP ROLE to drop the HPD Admin (hpdownerADM_R) role used by this schema -- Use DROP USER to drop all other HPD users of this schema as necessary ... -- Optionally: If the tablespace is no longer needed, it can be deleted too: Tablespace altered. SQL> DROP TABLESPACE tablespace_name INCLUDING CONTENTS AND DATAFILES CASCADE CONSTRAINTS; Tablespace dropped. SQL> exit |
Connect to the Oracle database as the Oracle System database administrator user (or another DBA) account. Make sure that a good backup exists, and that no-one else is storing data in the tablespace besides the HPD database schema owner. If other HPD user accounts were created to connect to the schema to be dropped, these will need to be processed, that is, dropped, as well.