暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Oracle 符号链接上的目录对象

ASKTOM 2019-05-21
476

问题描述

团队,

正在阅读此博客文章-博客上的演示来自19c-它仍然声称即使在18c中,我们也无法通过目录对象指向符号链接的datapump活动。

http://christian-gohmann.de/2019/05/19/symbolic-links-in-directory-objects-not-permitted-with-oracle-18c-19c/

但是我反过来看。请帮助我们了解我在下面的演示中是否缺少某些内容。

/u02/app/oracle/product/18.0.0.0/dbhome_2
[oracle@local-host dbhome_2]$ echo $ORACLE_HOME
/u02/app/oracle/product/18.0.0.0/dbhome_2
[oracle@local-host dbhome_2]$ mkdir $ORACLE_HOME/hello2
[oracle@local-host dbhome_2]$ ln -s $ORACLE_HOME/hello2 /home/oracle/hello2
[oracle@local-host dbhome_2]$

[oracle@local-host dbhome_2]$ ls -ltr /home/oracle
total 248
-rw-r--r-- 1 oracle asmadmin   1288 May 21 11:17 export.log
lrwxrwxrwx 1 oracle oinstall     48 May 21 11:23 hello2 -> /u02/app/oracle/product/18.0.0.0/dbhome_2/hello2
[oracle@local-host dbhome_2]$



sys@PDB1> create directory DP as '/home/oracle/hello2';

Directory created.

sys@PDB1> grant read,write on directory dp to c##rajesh ;

Grant succeeded.

sys@PDB1> ! expdp c##rajesh/Password-1@localhost/pdb1 directory=DP tables=EMP dumpfile=EXP_EMP_02.dmp nologfile=YES

Export: Release 18.0.0.0.0 - Production on Tue May 21 11:28:35 2019
Version 18.1.0.0.0

Copyright (c) 1982, 2018, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 18c EE Extreme Perf Release 18.0.0.0.0 - Production
Starting "C##RAJESH"."SYS_EXPORT_TABLE_01":  c##rajesh/********@localhost/pdb1 directory=DP tables=EMP dumpfile=EXP_EMP_02.dmp nologfile=YES
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
. . exported "C##RAJESH"."EMP"                           8.781 KB      14 rows
Master table "C##RAJESH"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for C##RAJESH.SYS_EXPORT_TABLE_01 is:
  /home/oracle/hello2/EXP_EMP_02.dmp
Job "C##RAJESH"."SYS_EXPORT_TABLE_01" successfully completed at Tue May 21 11:28:49 2019 elapsed 0 00:00:13





专家解答

我认为这是博客文章中的一个小错误。我的理解是:

18c-我们处理了UTL_FILE、BFILE、外部表
19c-我们添加了数据泵

例如 (使用与您的演示相同的设置) 从18c

[oracle@host18 ~]$ expdp scott/tiger@pdb1 directory=DP dumpfile=EXP_EMP_03.dmp nologfile=yes

Export: Release 18.0.0.0.0 - Production on Wed May 22 09:21:44 2019
Version 18.3.0.0.0

Copyright (c) 1982, 2018, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Starting "SCOTT"."SYS_EXPORT_SCHEMA_01":  scott/********@pdb1 directory=DP dumpfile=EXP_EMP_03.dmp nologfile=yes 
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type SCHEMA_EXPORT/STATISTICS/MARKER
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/COMMENT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
. . exported "SCOTT"."EMP"                               8.773 KB      14 rows
. . exported "SCOTT"."DEPT"                              6.023 KB       4 rows
. . exported "SCOTT"."SALGRADE"                          5.953 KB       5 rows
. . exported "SCOTT"."BONUS"                                 0 KB       0 rows
Master table "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SCOTT.SYS_EXPORT_SCHEMA_01 is:
  /home/oracle/hello2/EXP_EMP_03.dmp
Job "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully completed at Wed May 22 09:22:16 2019 elapsed 0 00:00:32

SQL> declare
  2    f utl_file.file_type;
  3  begin
  4    f := utl_file.fopen('DP','demo.dat','W');
  5  end;
  6  /
declare
*
ERROR at line 1:
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 536
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 41
ORA-06512: at "SYS.UTL_FILE", line 478
ORA-06512: at line 4



文章转载自ASKTOM,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论