问题描述
在客户系统中,由于空间问题,想要将expdp的逻辑导出文件存储到ASM磁盘组中。
经过测试,expdp导出文件完全可以放在ASM磁盘组中,但是日志文件需要放在文件系统上。
首先建立磁盘组中的Directory:
SQL> create or replace directory obak as '+ORADATA/obak'; Directory created.
手工创建目录:
[oracle@oracle ~]$ export ORACLE_SID=+ASM1 [oracle@oracle ~]$ asmcmd ASMCMD> ls ORADATA/ RECOVER/ ASMCMD> cd ORADATA ASMCMD> ls ORADB/ ASMCMD> mkdir obak ASMCMD> ls ORADB/ obak/ ASMCMD> exit
如果直接执行导出,会出现错误:
[oracle@oracledb3 ~]$ expdp eygle/eygle DUMPFILE=eygle.dmp DIRECTORY=OBAK CONTENT=METADATA_ONLY Export: Release 10.2.0.5.0 - 64bit Production on Friday, 06 May, 2011 10:49:48 Copyright (c) 2003, 2007, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production With the Partitioning, Real Application Clusters, Data Mining and Real Application Testing options ORA-39002: invalid operation ORA-39070: Unable to open the log file. ORA-29283: invalid file operation ORA-06512: at "SYS.UTL_FILE", line 536 ORA-29283: invalid file operation
专家解答
此时需要找到一个文件系统的路径:
SQL> select directory_name, directory_path from dba_directories; DIRECTORY_NAME ------------------------------ DIRECTORY_PATH --------------------------------------------------------------------------------------------------- DATA_PUMP_DIR /opt/app/oracle/product/10.2.0/db_1/rdbms/log/ OBAK +ORADATA/obak
现在为LOGFILE指定独立的路径,即可导出成功:
[oracle@oracle ~]$ expdp eygle/eygleDUMPFILE=eygle.dmp DIRECTORY=OBAK CONTENT=METADATA_ONLY logfile=DATA_PUMP_DIR:expdp01.log Export: Release 10.2.0.5.0 - 64bit Production on Friday, 06 May, 2011 10:53:11 Copyright (c) 2003, 2007, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production With the Partitioning, Real Application Clusters, Data Mining and Real Application Testing options FLASHBACK automatically enabled to preserve database integrity. Starting "EYGLE"."SYS_EXPORT_SCHEMA_01": eygle/******** DUMPFILE=eygle.dmp DIRECTORY=OBAK CONTENT=METADATA_ONLY logfile=DATA_PUMP_DIR:expdp01.log Processing object type SCHEMA_EXPORT/USER Processing object type SCHEMA_EXPORT/SYSTEM_GRANT Processing object type SCHEMA_EXPORT/ROLE_GRANT Processing object type SCHEMA_EXPORT/DEFAULT_ROLE Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA Processing object type SCHEMA_EXPORT/DB_LINK Processing object type SCHEMA_EXPORT/SEQUENCE/SEQUENCE Processing object type SCHEMA_EXPORT/TABLE/TABLE Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS Processing object type SCHEMA_EXPORT/TABLE/COMMENT Processing object type SCHEMA_EXPORT/FUNCTION/FUNCTION Processing object type SCHEMA_EXPORT/PROCEDURE/PROCEDURE Processing object type SCHEMA_EXPORT/FUNCTION/ALTER_FUNCTION Processing object type SCHEMA_EXPORT/PROCEDURE/ALTER_PROCEDURE Processing object type SCHEMA_EXPORT/VIEW/VIEW Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS Processing object type SCHEMA_EXPORT/JOB Master table "EYGLE"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded ****************************************************************************** Dump file set for EYGLE.SYS_EXPORT_SCHEMA_01 is: +ORADATA/obak/eygle.dmp Job "EYGLE"."SYS_EXPORT_SCHEMA_01" successfully completed at 10:53:40
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。