Home > Database > Oracle > body text

How to delete directory in oracle

WBOY
Release: 2022-06-10 17:39:56
Original
6451 people have browsed it

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;
Copy after login

How to delete directory in oracle

Directory Purpose Data import and export

1. Query directory directory

select * from dba_directories;
Copy after login

2. Create or modify directory directory

create or replace directory dum_date_dir as  '/home/oracle/datatmp'
Copy after login

3. Empower directory directory

grant read,write on directory dumpdir to username;
Copy after login

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';
Copy after login

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;
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template