Home > Database > Oracle > How to modify the directory directory in Oracle

How to modify the directory directory in Oracle

WBOY
Release: 2022-05-27 16:49:43
Original
6321 people have browsed it

In Oracle, you can use the "create or replace directory dumpdir as 'directory directory path';" statement to modify the directory directory. This statement can not only be used to modify the directory directory, but also to create the directory.

How to modify the directory directory in Oracle

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

How to modify the directory in Oracle

1. Query the directory

select * from dba_directories;
Copy after login

2. Create or modify the directory

create or replace directory dumpdir as '/home/dumpfiles';
Copy after login

3 , empower directory directory

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

4, delete directory directory

drop directory DIRENAME;
Copy after login

Expand knowledge:

Oracle Directory (directory) allows users to log in to the Oracle database Flexibly read and write files, greatly improving Oracle's ease of use and scalability. 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 modify the directory directory in Oracle

Recommended tutorial: "Oracle Video Tutorial"

The above is the detailed content of How to modify the directory 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