1.创建asm导出数据目录
sql>select name,total_mb,free_mb from v$asm_diskgroup;
确认集群asm磁盘组环境
asmcmd>cd +DGDSDB
asmcmd>mkdir dpbak
asmcmd>ls -l
sql>conn / as sysdba
create directory expdp_asm_dir as ‘+DGDSDB/dpbak’;
create directory expdp_log_dir as ‘/home/oracle’;
2.导出数据
cd /home/oracle
vim expdp.sh
expdp \’/ as sysdba\’ directory=expdp_asm_dir dumpfile=用户_%U.dmp parallel=8 logfile=expdp_log_dir:用户.log schemas=用户 compression=all cluster=n
expdp \’/ as sysdba\’ directory=expdp_asm_dir dumpfile=用户_%U.dmp parallel=8 logfile=expdp_log_dir:用户.log schemas=用户 compression=all cluster=n
nohup ./expdp.sh &>/dev/null &
tail -f 用户.log
ps -ef|grep expdp.sh
取消导出
select job_name,state from dba_datapump_jobs;
expdp \’/ as sysdba\’ attach=SYS_EXPORT_SCHENA_02
stop_job
kill_job
3.asm到asm
asmcmd>cd +data/orcl/dpbak
asmcmd>ls -l
分别在源端与目标端授予sys用户sysasm权限
sql>grant sysasm to sys;
拷贝前检查目标端监听,是否监听了ASM实例
检查目标端磁盘组空间
sql>select name,total_mb,free_mb from v$asm_diskgroup;
asmcmd>cp +data/oracl/dpbak/dmpfile sys@目标端ip.+ASM:+data/orcl/dpbak/dmpfile