LightDB24.1支持create/drop directory命令

背景介绍

为了方便用户从Oracle数据库迁移到LightDB上,从LightDB24.1版本开始,支持create/drop directory命令。

使用约束:

  • 该命令只在Oracle兼容模式下生效
  • 不能为LTHOME、LTDATA目录或者它们的子目录建立directory对象

使用示例

  1. 创建directory对象
lightdb@oracle_test=# create directory adir as '/home/lightdb';
 create_directory 
------------------
 t
(1 row)

lightdb@oracle_test=# select * from utl_file.utl_file_dir;
      dir      | dirname 
---------------+---------
 /home/lightdb | ADIR
(1 row)

lightdb@oracle_test=# 
  1. create or replace创建对象
lightdb@oracle_test=# create directory adir as '/home/lightdb';
ERROR:  directory ADIR is exist
lightdb@oracle_test=# create or replace directory adir as '/home/lightdb';
 create_directory 
------------------
 t
(1 row)

lightdb@oracle_test=# select * from utl_file.utl_file_dir;
      dir      | dirname 
---------------+---------
 /home/lightdb | ADIR
(1 row)

lightdb@oracle_test=# 
  1. drop对象
lightdb@oracle_test=# drop directory adir;
 drop_directory 
----------------
 t
(1 row)

lightdb@oracle_test=# select * from utl_file.utl_file_dir;
 dir | dirname 
-----+---------
(0 rows)

lightdb@oracle_test=# 

你可能感兴趣的:(数据库)