[Translated from mos] use the asmcmd command to copy the

Source: Internet
Author: User
To use the asmcmd command to copy asmfile between the local and remote asm instances, see the original article HowtoCopyasmfilesbetweenremoteASMinstancesusingASMCMDcommand (DocID785580.1) for: OracleDatabase

To use the asmcmd command to Copy the asm file between the local and remote asm instances, refer to the original article: How to Copy asm files between remote ASM instances using ASMCMD command (Doc ID 785580.1) applicable: oracle Database-Enterprise Edition-Version 11.1.0.6 to 11.2.0.2 [R

Use the asmcmd command to copy the asm file between the local and remote asm instances.

Reference Original:
How to Copy asm files between remote ASM instances using ASMCMD command (docid 785580.1)

Applicable:
Oracle Database-Enterprise Edition-Version 11.1.0.6 to 11.2.0.2 [Release 11.1 to 11.2]
Information in this document applies to any platform.
* ** Checked for relevance on 14-Jan-2011 ***
* ** Checked for relevance on 09-Jul-2014 ***


Objectives:
The purpose of this document is to use the asmcmd command to copy the asm file between a local instance and a remote instance.

Solution:
11g has new features-you can copy the asm file between the local and remote instances.
It can also be used to copy files from the asm disk group to the OS

Cp-ifr @ . . : /

User_name @ host_name. .

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

---> Note: The sid here is the sid of the asm instance, not the sid of the database instance.

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


Some explanations of ASMCMD remote copy:
To run asmcmd remote copy, you need to establish a connection through the listener.
Asmcmd remote connection may fail due to some errors.

ASMCMD-08202: internal error: [asmcmd1__error_msg_05] [8201]

[2, 8201] means unable to connect remote ASM Instance.

The possible causes of this error are as follows:
* Not able to reach remote host. The remote host cannot be connected.
* Remote host listener is down. Remote listener is down
* Remote ASM Instance is not registered with listener and running non-default port. The Remote asm Instance is not registered in the listener and the listener runs on a non-default port.
* Sysasm remote connection does not work. sysasm remote connection does not work
* Incorrect password given for sys user. sys Incorrect password
* Remote ASM Instance password file missing. The password file of the Remote asm Instance is lost.

We need to enable additional tracing to obtain the exact information about asmcmd connection failure.

++ Set the DBI_TRACE environment variable for asmcmd perl tracing

Export DBI_TRACE = 1

++ Now use asmcmd to connect and reproduce the problem:

Example 1:
---> Start with the example
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]

---> The example ends.

We can see that asmcmd failed to copy the file due to a ORA-01031 error.
If the-a option is not used, asmcmd uses the sysasm permission by default.
In the remote asm instance, sysasm permissions are not granted to sys user.
Grant sysasm permissions to sys users. When you authorize the system, the password file will be updated.

SQL> grant sysasm to sys;
Grant succeeded.

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


Now, the remote asm copy function works properly.

For more details, refer to the following article:
Note.730067.1-Troubleshooting Co., ORA-1031. Insufficient Privilege
Note.578796.1-ORA-01031 While Connecting as SYSASM


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>

The cp command fails because:
The target asm file name is not specified, or the file name should not include file number/incarnation.
---> Note: I have some questions about the translation of this sentence,
Original article: The cp command failed because the target ASM file name was not specified or File name shocould not contain the file number/incarnation

If no file name is specified, you cannot copy an omf file.

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 automatically created during The copy process.

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.