[ID 566941.1]
修改时间 11-SEP-2008 类型 HOWTO 状态 PUBLISHED |
In this Document
Goal
Solution
Applies to:
Oracle Server - Enterprise Edition - Version: 11.1.0.6.0 to 11.2.0.1Information in this document applies to any platform.
Goal
On release 11.1.0.6.0 and onwards ASMCMD utility includes the ‘CP’ command analogous to the cp command at OS level. Therefore you can copy all kind of files contained in the ASM diskgroups thru the “cp” ASMCMD command.Solution
Example:
1) Create a new directory in the desired diskgroup (FRA) thru the ASM instance:
SQL> show parameter instance_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
instance_name string +ASM
SQL> alter diskgroup FRA add directory '+FRA/dumpsets';
Diskgroup altered.
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
instance_name string +ASM
SQL> alter diskgroup FRA add directory '+FRA/dumpsets';
Diskgroup altered.
2) Create a directory thru the database instance:
SQL> show parameter instance_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
instance_name string DB11G
SQL> create directory dumpsets as '+FRA/dumpsets';
Directory created.
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
instance_name string DB11G
SQL> create directory dumpsets as '+FRA/dumpsets';
Directory created.
3) Create a directory at OS level:
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.
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) Perform. the expdp backup:
$> 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
Job "SYSTEM"."FULL_EXPORT" successfully completed at 10:24:07
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
Job "SYSTEM"."FULL_EXPORT" successfully completed at 10:24:07
5) The dmp file was created at: +FRA/dumpsets/expdp_5_5.dat:
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
Type Redund Striped Time Sys Name
N expdp_5_5.dat => +FRA/DB11G/DUMPSET/SYSTEMFULL_EXPORT_71029_1.303.654085391
6) Then copy it from FRA diskgroup to the /home/oracle/dumpsets 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
+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
相关的 产品
|
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/38267/viewspace-707803/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/38267/viewspace-707803/