【翻譯自mos文章】將expdp的dmp檔案從asm磁碟組裡邊放到本地檔案系統裡邊,expdpasm

來源:互聯網
上載者:User

【翻譯自mos文章】將expdp的dmp檔案從asm磁碟組裡邊放到本地檔案系統裡邊,expdpasm
將expdp的dmp檔案從asm磁碟組裡邊放到本地檔案系統裡邊
參考原文:
How To Extract Datapump File From ASM Diskgroup To Local Filesystem? (Doc ID 566941.1)

適用於:
Oracle Database - Enterprise Edition - Version 11.1.0.6 to 11.1.0.7 [Release 11.1]
Information in this document applies to any platform.
Information in this document applies to any platform.

目標:
從11.1.0.6開始, asmcmd 提供了cp命令,該cp命令跟os上的cp命令類似。
你可以使用asmcmd cp命令 copy 出asm磁碟組中的所有檔案。

解決方案:
舉例:
1)在asm執行個體中建立一個directory
SQL> show parameter instance_name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
instance_name                        string      +ASM

SQL> alter diskgroup FRA add directory '+FRA/dumpsets';

Diskgroup altered.

2)在資料庫執行個體中建立一個directory--用於存放dmp檔案
SQL>  show parameter instance_name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------  
instance_name                        string      DB11G

SQL> create directory dumpsets as '+FRA/dumpsets';

Directory created.

3)在os上建立一個directory並在database 執行個體中,為此os directory 建立 db中的directory。該 os directory用於存放匯出產生的logfile

SQL> ! mkdir /home/oracle/dumpsets

SQL> !ls -ld /home/oracle/dumpsets
drwxr-xr-x  2 oracle oinstall 4096 May  7 10:20 /home/oracle/dumpsets

SQL> create directory logfile_dest as '/home/oracle/dumpsets';

Directory created.


4)執行expdp匯出資料
expdp  userid=system/storage01 directory='DUMPSETS' dumpfile=expdp_5_5.dat job_name=full_export logfile=logfile_dest:exp5_5.log  

Export: Release 11.1.0.6.0 - Production on Wednesday, 07 May, 2008 10:22:57

Copyright (c) 2003, 2007, Oracle.  All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SYSTEM"."FULL_EXPORT":  userid=system/******** directory=DUMPSETS dumpfile=expdp_5_5.dat job_name=full_export logfile=logfile_dest:exp5_5.log  
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 320 KB
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/SYNONYM/SYNONYM
Processing object type SCHEMA_EXPORT/TYPE/TYPE_SPEC
.
.
.
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/TRIGGER
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/POST_TABLE_ACTION
Processing object type SCHEMA_EXPORT/POST_SCHEMA/PROCACT_SCHEMA
. . exported "SYSTEM"."REPCAT$_AUDIT_ATTRIBUTE"          6.398 KB       2 rows
. . exported "SYSTEM"."REPCAT$_OBJECT_TYPES"             6.882 KB      28 rows
. . exported "SYSTEM"."REPCAT$_RESOLUTION_METHOD"        5.875 KB      19 rows
. . exported "SYSTEM"."REPCAT$_TEMPLATE_STATUS"          5.484 KB       3 rows
. . exported "SYSTEM"."REPCAT$_TEMPLATE_TYPES"           6.289 KB       2 rows
. . exported "SYSTEM"."DEF$_AQCALL"                          0 KB       0 rows
. . exported "SYSTEM"."DEF$_AQERROR"                         0 KB       0 rows
.
.
.
. . exported "SYSTEM"."REPCAT$_SITE_OBJECTS"                 0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_SNAPGROUP"                    0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_TEMPLATE_OBJECTS"             0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_TEMPLATE_PARMS"               0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_TEMPLATE_REFGROUPS"           0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_TEMPLATE_SITES"               0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_TEMPLATE_TARGETS"             0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_USER_AUTHORIZATIONS"          0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_USER_PARM_VALUES"             0 KB       0 rows
. . exported "SYSTEM"."SQLPLUS_PRODUCT_PROFILE"              0 KB       0 rows
Master table "SYSTEM"."FULL_EXPORT" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.FULL_EXPORT is:
  +FRA/dumpsets/expdp_5_5.dat


5)dmp檔案被建立在了+FRA/dumpsets/下。

ASMCMD> ls -l  +FRA/dumpsets/expdp_5_5.dat
Type     Redund  Striped  Time             Sys  Name
                                           N    expdp_5_5.dat => +FRA/DB11G/DUMPSET/SYSTEMFULL_EXPORT_71029_1.303.654085391
                                           
6)將此dmp檔案從asm 磁碟組中拷貝到os 的directory中。
ASMCMD> pwd  
+fra/dumpsets
ASMCMD> ls
expdp_5_5.dat
ASMCMD>  cp expdp_5_5.dat /home/oracle/dumpsets/expdp_5_5.dat
source +fra/dumpsets/expdp_5_5.dat
target /home/oracle/dumpsets/expdp_5_5.dat
copying file(s)...
file, /home/oracle/dumpsets/expdp_5_5.dat, copy committed.
ASMCMD> exit
$> ls -l /home/oracle/dumpsets/expdp_5_5.dat
-rw-r-----  1 oracle oinstall 2289664 May  7 11:05 /home/oracle/dumpsets/expdp_5_5.dat




相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.