重庆思庄Oracle、Redhat认证学习论坛
标题:
记一次按用户导出数据到asm磁盘组,并复制到另一个集群的asm
[打印本页]
作者:
mahan
时间:
2022-10-16 15:27
标题:
记一次按用户导出数据到asm磁盘组,并复制到另一个集群的asm
本帖最后由 mahan 于 2022-10-16 15:29 编辑
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
欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/)
Powered by Discuz! X3.2