Home  >  Article  >  Database  >  How to delete directory in oracle

How to delete directory in oracle

WBOY
WBOYOriginal
2022-06-10 17:26:176454browse

In Oracle, you can use the "drop directory" statement to delete the directory. This statement is used to delete the specified directory alias. The syntax is "drop directory DIRENAME;"; the directory is used for importing and exporting the database.

How to delete directory in oracle

The operating environment of this tutorial: Windows 10 system, Oracle version 12c, Dell G3 computer.

How to delete directory in oracle

Delete directory directory

The syntax is as follows:

drop directory DIRENAME;

How to delete directory in oracle

Directory Purpose Data import and export

1. Query directory directory

select * from dba_directories;

2. Create or modify directory directory

create or replace directory dum_date_dir as  '/home/oracle/datatmp'

3. Empower directory directory

grant read,write on directory dumpdir to username;

Extended knowledge:

Oracle Directory (directory) allows users to flexibly read and write files in the Oracle database, greatly improving the ease of use and scalability of Oracle . The syntax is as follows:

CREATE [OR REPLACE] DIRECTORY DIRECTORY AS 'PATHNAME';

The permissions to create and delete Directory are: CREATE ANY DIRECTORY, DROP ANY DIRECTORY. The permissions given to ordinary users to use Directory include READ, WRITE, and EXECUTE. They can also directly write ALL, as shown below:

GRANT READ,WRITE,EXECUTE ON DIRECTORY EXP_DIR_LHR TO LHR;
GRANT ALL ON DIRECTORY EXP_DIR_LHR TO LHR;

It should be noted that when creating a Directory database object, the corresponding path does not exist and will not When reporting an error, the Oracle database will not verify the existence of the path on the operating system. It will only verify the existence of the path when it is used. Therefore, when creating the Directory, remember the true existence of the corresponding path, otherwise ORA-29913 or ORA may be reported. -29400 error.

The following is an example of creating Oracle Directory:

How to delete directory in oracle

Recommended tutorial: "Oracle Video Tutorial"

The above is the detailed content of How to delete directory in oracle. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn