Use the database
DROP DIRECTORY command to drop a directory
For example, the following command drops the
database directory object
DROP DIRECTORY staging;
DROP DIRECTORY command does not delete files in the
directory. If you want to delete the directory and the files in the directory, first use the
DBMS_CLOUD.DELETE_FILE to delete the
files. See DELETE_FILE Procedure for more information.
To drop a directory, you must have the
DIRECTORY system privilege. The ADMIN user is
DROP ANY DIRECTORY
system privilege. The ADMIN user can grant
DIRECTORY system privilege to other
See DROP DIRECTORY for more information.
You are not allowed to drop the predefined directories:
If you just want to drop the directory and you do not remove the files in the directory, after you drop the directory you can view all the files in the file system, including any files that were in the directory you dropped, as follows:
CREATE OR REPLACE DIRECTORY ROOT_DIR AS '';
Then list the contents of
ROOT_DIRwith the following command:
SELECT * FROM DBMS_CLOUD.list_files('ROOT_DIR');
DBMS_CLOUD.LIST_FILESwith a user other than ADMIN you need to grant read privileges on the directory to that user. See LIST_FILES Function for more information.
DROP DIRECTORYcommand does not remove the underlying file system directory. Autonomous Database manages the underlying file system directory; users do not remove the file system directory.