Oracle创建directory

Oracle创建directory

一般创建directory都是为了用数据泵导入/导出数据用,其实directory还有很多别的用处,本文不做阐述

1、新建directory的语法

CREATE [OR REPLACE] DIRECTORY directory AS 'pathname';

例如:

create or replace directory dump_dir as 'D:\dump\dir'

这样把目录d:\dump\dir设置成dump_dir代表的directory

2、查询有哪些directory

select * from dba_directories

3、赋权

grant read,write on directory dump_dir to user01

4、删除

drop directory dump_dir

例:

1	SYS	FILEDIR	C:\temp\PMS\template\XLSX	5
2	SYS	FILE_DIR_DOCX	C:\temp\PMS\template\DOCX	5
3	SYS	FILE_DIR_XLSX	C:\temp\PMS\template\XLSX	5
4	SYS	ORACLECLRDIR	F:\app\oracleDB\product\12.2.0\dbhome_1\bin\clr	1
5	SYS	XMLDIR	F:\app\oracleDB\product\12.2.0\dbhome_1\rdbms\xml	1
6	SYS	XSDDIR	F:\app\oracleDB\product\12.2.0\dbhome_1\rdbms\xml\schema	1
7	SYS	ORA_DBMS_FCP_LOGDIR	F:\app\oracleDB\product\12.2.0\dbhome_1\cfgtoollogs	1
8	SYS	ORA_DBMS_FCP_ADMINDIR	F:\app\oracleDB\product\12.2.0\dbhome_1\rdbms\admin	1
9	SYS	OPATCH_INST_DIR	F:\app\oracleDB\product\12.2.0\dbhome_1\OPatch	1
10	SYS	ORACLE_OCM_CONFIG_DIR	F:\app\oracleDB\product\12.2.0\dbhome_1\ccr\state	1
11	SYS	DATA_PUMP_DIR	F:\app\oracleDB\admin\orcl\dpdump\/7F32D70BF49F4E2096ED8DBE4197D682	1
12	SYS	ORACLE_OCM_CONFIG_DIR2	F:\app\oracleDB\product\12.2.0\dbhome_1\ccr\state	1
13	SYS	OPATCH_SCRIPT_DIR	F:\app\oracleDB\product\12.2.0\dbhome_1\QOpatch	1
14	SYS	OPATCH_LOG_DIR	F:\app\oracleDB\product\12.2.0\dbhome_1\rdbms\log	1
15	SYS	ORACLE_BASE	F:\app\oracleDB	1
16	SYS	ORACLE_HOME	F:\app\oracleDB\product\12.2.0\dbhome_1	1

  

posted @ 2021-05-11 10:27  奥兰王子  阅读(1535)  评论(0编辑  收藏  举报