eygle.com   eygle.com
eygle.com eygle
eygle.com  
 

« 2011邮政有奖明信片 - 凤翔木板年画 | Blog首页 | 五一见闻 - 2011 ·东北 »

使用 ASM 存储 expdp 导出文件(ORA-39070)

在客户系统中,由于空间问题,想要将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



历史上的今天...
    >> 2010-05-06文章:
    >> 2008-05-06文章:
           推荐电影《Juno》-朱诺
    >> 2007-05-06文章:
    >> 2005-05-06文章:
           五一的生活

无觅

By eygle on 2011-05-06 12:00 | Comments (5) | Backup&Recovery | 2797 |

5 Comments

有的时候觉得为什么需要日志呢?

expdp01.log
这个文件需要自己建,还是会自动生成的呢?

expdp01.log
这个文件需要自己建,还是会自动生成的呢?

找了半天,可算找到了。试试去。


CopyRight © 2004~2020 云和恩墨,成就未来!, All rights reserved.
数据恢复·紧急救援·性能优化 云和恩墨 24x7 热线电话:400-600-8755 业务咨询:010-59007017-7040 or 7037 业务合作: marketing@enmotech.com