'asm copy'에 해당되는 글 1건

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



Applies to:

Oracle Server - 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.
Oracle Server Enterprise Edition - Version: 11.1 to 11.1
***Checked for relevance on 14-Jan-2011***

Goal

The purpose of this document is to provide information about the Copy the asm files between remote instances and local instances using ASMCMD.

Solution

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

For more detals,please go through the below notes

Note.730067.1 - Troubleshooting 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/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.

Posted by pat98
이전버튼 1 이전버튼

05-09 18:52
Flag Counter
Yesterday
Today
Total

글 보관함

최근에 올라온 글

달력

 « |  » 2024.5
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

최근에 달린 댓글