Drop Directory in Autonomous AI Database

Use the database DROP DIRECTORY command to drop a directory object.

For example, the following command drops the database directory object staging:

DROP DIRECTORY staging;

The 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 procedure DBMS_CLOUD.DELETE_FILE to delete the files. See DELETE_FILE Procedure for more information.

To drop a directory, you must have the DROP ANY DIRECTORY system privilege. The ADMIN user is granted the DROP ANY DIRECTORY system privilege. The ADMIN user can grant DROP ANY DIRECTORY system privilege to other users.

See DROP DIRECTORY for more information.

Div:

Notes:

CREATE OR REPLACE DIRECTORY ROOT_DIR AS '';

Then list the contents of ROOT_DIR with the following command:

SELECT * FROM DBMS_CLOUD.list_files('ROOT_DIR');

To run DBMS_CLOUD.LIST_FILES with a user other than ADMIN you need to grant read privileges on the directory to that user. See LIST_FILES Function for more information.