How to Copy asm files between remote ASM instances using ASMCMD command

 

Oracle Server - Enterprise Edition - Version: 11.1.0.6 to 11.2.0.2 - Release: 11.1 to 11.2

 

 

11g new feature,you can use asmcmd to copy files between remote instances, Enables you to copy files between ASM disk groups on local instances and remote instances. You can also use this command to copy files from ASM disk groups to the operating system.

cp -ifr <source file name> <user_name>@<host_name>.<Port Number>.<SID>:<targer path>/<target file name>

user_name@host_name.<Port Number>.<SID>

The user_name, host_name, and SID are required. The default port number is 1521.

Example :-

asmcmd>cp -ifr +DATA/RAC/PARAMETERFILE/spfile.257.678975489 sys@stgrac1.1521.+ASM2:+FRA/RAC/ARCHIVELOG/spfile



Troubleshooting-ASMCMD remote copy

asmcmd remote copy works through listener connection.
ASMCMD remote connection can fail with below generic error.
ASMCMD-08202: internal error: [asmcmdshare_error_msg_05] [8201]
[8201] means unable to connect remote ASM Instance.
It could be due to following reason.

 

* not able to reach remote host.
* Remote host listener is down.
* Remote ASM Instance is not registered with listener and running non-default port.
* sysasm remote connection does not work.
* Incorrect password given for sys user.
* Remote ASM Instance password file missing.


We need to enable additional tracing for asmcmd connection to get a exact failure message.

++ set DBI_TRACE environment variable for asmcmd perl tracing.

export DBI_TRACE=1

++ Now connect using asmcmd and re-produce the issue.

 

Example 1:-

asmcmd>cp +data/spfileorcl.ora.289.686235413 sys@stgrac1.1521.+ASM1:+test

-> DBI->connect(dbi:Oracle:host=stgrac1;port=1521;sid=+ASM1, sys, ****, HASH (0x8b2b044))
connect using '(DESCRIPTION=(ADDRESS=(HOST=stgrac1)(PROTOCOL=tcp)(PORT=1521))(CONNECT_DATA=(SID=+ASM1)))'
ERROR: '1031' 'ORA-01031: insufficient privileges

(DBD ERROR: OCISessionBegin)'
<- DESTROY= undef at DBI.pm line 591
DBI connect('host=stgrac1;port=1521;sid=+ASM1','sys',...) failed: ORA-01031: insufficient privileges (DBD ERROR: OCISessionBegin)
KK FROM HERE A
ASMCMD-08202: internal error: [asmcmdshare_error_msg_05] [8201]


Here we can see that asmcmd copy failed due to ORA-01031.

ASMCMD uses SYSASM by default if -a option is not used.

Here the problem is sysasm privelege was not given to sys user on remote ASM Instance. Given the SYSASM privilege to SYS ( or the user trying to connect ). When you grant a system privilege, the password file is updated.


SQL> grant sysasm to sys;
Grant succeeded.

SQL> select * from v$pwfile_users;
USERNAME SYSDB SYSOP SYSAS
------------------------------ ----- ----- -----
SYS TRUE TRUE TRUE

Now the remote asmcmd copy works fine


Example 2:-

ASMCMD> cp -ifr thread_2_seq_5.264.678983423 sys@bderac2-vip.1521.+ASM2:+FRA/RAC/ARCHIVELOG/
Enter password: ***
ASMCMD-08016: copy source->'+FRA/RAC/ARCHIVELOG/2009_02_16/thread_2_seq_5.264.678983423' and target->'+FRA/RAC/ARCHIVELOG/thread_2_seq_5.264.678983423' failed
ORA-17628: Oracle error 19505 returned by remote Oracle server
ORA-06512: at "SYS.X$DBMS_DISKGROUP", line 258
ORA-06512: at line 3 (DBD ERROR: OCIStmtExecute)
ASMCMD>



Solution:-
       The cp command failed because the target ASM file name was not specified  or File name should not contain the file number/incarnation.We can not copy OMF form files without specifying file name

 

cp -ifr thread_2_seq_5.264.678983423 sys@bderac2-vip.1521.+ASM2:+FRA/RAC/ARCHIVELOG/thread_2_seq_5

The file number/incarnation will be created automatically during the copy.

 

 

 

 

 

From Oracle

-------------------------------------------------------------------------------------------------------

QQ: 492913789
Email: ahdba@qq.com
Blog: http://www.cndba.cn/dave

DBA1 群:62697716();   DBA2 群:62697977()   DBA3 群:62697850()  

DBA 超级群:63306533();  DBA4 群: 83829929  DBA5群: 142216823   

聊天 群:40132017   聊天2群:69087192

--加群需要在备注说明Oracle表空间和数据文件的关系,否则拒绝申请

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值