How to copy ASM files between remote ASM instances using asmcmd command

Source: Internet
Author: User

 

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: [asmcmd1__error_msg_05] [8201]
[2, 8201] means unable to connect remote ASM instance.
It cocould 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: '000000' ora-1031: 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
ASMCMD-08202: Internal error: [asmcmd1__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

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/failed' 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 shocould 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

Bytes -------------------------------------------------------------------------------------------------------

Blog: http://blog.csdn.net/tianlesoftware

Email: dvd.dba@gmail.com

Dba1 group: 62697716 (full); dba2 group: 62697977 (full) dba3 group: 62697850 (full)

Super DBA group: 63306533 (full); dba4 group: 83829929 dba5 group: 142216823

Chat group: 40132017 chat 2 group: 69087192

-- Add the group to describe the relationship between Oracle tablespace and data files in the remarks section. Otherwise, the application is rejected.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.