Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Type HOWTO
Status PUBLISHED
In this Document
Goal
Solution
References
Applies to:
Oracle Server - Enterprise Edition - Version: 11.2.0.1.0 to 11.2.0.2 - Release: 11.2 to 11.2
Information in this document applies to any platform.
Goal
It is not possible to directly restore a manual or automatic OCR backup if the OCR is located in
an ASM disk group. This is caused by the fact that the command 'ocrconfig -restore' requires
ASM to be up & running in order to restore an OCR backup to an ASM disk group. However, for
ASM to be available, the CRS stack must have been successfully started. For the restore to
succeed, the OCR also must not be in use (r/w), i.e. no CRS daemon must be running while the
OCR is being restored.
A description of the general procedure to restore the OCR can be found in the documentation,
this document explains how to recover from a complete loss of the ASM disk group that held the
OCR and Voting files in a 11gR2 Grid environment.
Solution
When using an ASM disk group for CRS there are typically 3 different types of files located in
the disk group that potentially need to be restored/recreated:
the Oracle Cluster Registry file (OCR)
the Voting file(s)
the shared SPFILE for the ASM instances
The following example assumes that the OCR was located in a single disk group used
exclusively for CRS. The disk group has just one disk using external redundancy.
Since the CRS disk group has been lost the CRS stack will not be available on any node.
The following settings used in the example would need to be replaced according to the actual
configuration:
GRID user:
GRID home:
ASM disk group name for OCR:
ASM/ASMLIB disk name:
Linux device name for ASM disk:
Cluster name:
Nodes:
oragrid
/u01/app/11.2.0/grid ($CRS_HOME)
CRS
ASMD40
/dev/sdh1
rac_cluster1
racnode1, racnode2
When using a non-shared CRS home, automatic OCR backups can be located on any node of
the cluster, consequently all nodes need to be checked for the most recent backup:
$ ls -lrt $CRS_HOME/cdata/rac_cluster1/
-rw------- 1 root root 7331840 Mar 10 18:52
-rw------- 1 root root 7651328 Mar 26 01:33
-rw------- 1 root root 7651328 Mar 29 01:33
-rw------- 1 root root 7651328 Mar 30 01:33
-rw------- 1 root root 7651328 Mar 30 01:33
-rw------- 1 root root 7651328 Mar 30 05:33
-rw------- 1 root root 7651328 Mar 30 09:33
week.ocr
week_.ocr
day.ocr
day_.ocr
backup02.ocr
backup01.ocr
backup00.ocr
Please note:
This document assumes that the CRS diskgroup was completely lost, in which case the CRS
daemon (resource ora.crsd) will terminate again due to the inaccessibility of the OCR - even if
above message indicates that the start succeeded.
If this is not the case - i.e. if the CRS diskgroup is still present (but corrupt or incorrect) the CRS
daemon needs to be shutdown manually using:
# $CRS_HOME/bin/crsctl stop res ora.crsd -init
IMPORTANT:
A new option '-nocrs' has been introduced with 11.2.0.2, which prevents the start of the
ora.crsd resource. It is vital that this option is specified, otherwise the failure to start the ora.crsd
resource will tear down ora.cluster_interconnect.haip, which in turn will cause ASM to crash.
3. Label the CRS disk for ASMLIB use
If using ASMLIB the disk to be used for the CRS disk group needs to stamped first, as user root
do:
# /usr/sbin/oracleasm createdisk ASMD40 /dev/sdh1
Writing disk header: done
Instantiating disk: done
Please note:
If you are
- not using an SPFILE for ASM
- not using a shared SPFILE for ASM
- using a shared SPFILE not stored in ASM (e.g. on cluster file system)
this step possibly should be skipped.
Also use extra care in regards to the asm_diskstring parameter as it impacts the discovery of
the voting disks.
Please verify the previous settings using the ASM alert log.
Prepare a pfile (e.g. /tmp/asm_pfile.ora) with the ASM startup parameters - these may vary from
the example below. If in doubt consult the ASM alert log as the ASM instance startup should list
all non-default parameter values. Please note the last startup of ASM (in step 2 via CRS start)
will not have used an SPFILE, so a startup prior to the loss of the CRS disk group would need to
be located.
*.asm_power_limit=1
*.diagnostic_dest='/u01/app/oragrid'
*.instance_type='asm'
*.large_pool_size=12M
*.remote_login_passwordfile='EXCLUSIVE'
9. Shutdown CRS
Since CRS is running in exclusive mode, it needs to be shutdown to allow CRS to run on all
nodes again. Use of the force (-f) option may be required:
# $CRS_HOME/bin/crsctl stop crs -f
...
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on
'auw2k3' has completed
CRS-4133: Oracle High Availability Services has been stopped.
References
Related
Products
Oracle Database Products > Oracle Database > Oracle Database > Oracle Server Enterprise Edition
Keywords
11GR2; ASM; CRS; DISKGROUP; OCR; RESTORE
Errors
CRS-4537; CRS-2672; CRS-4266; CRS-4529; CRS-2676; CRS-4533; CRS-2793; CRS4133; CRS-4123
How to Copy asm files between remote ASM instances using ASMCMD command [ID
785580.1]
Modified 14-APR-2011
Type HOWTO
Status PUBLISHED
In this Document
Goal
Solution
References
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
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]
References
BUG:8274003 - ASMCMD REMOTE COPY BETWEEN ASM INSTANCES IS NOT WORKING
NOTE:451900.1 - ASMCMD - New commands in 11gR1
NOTE:578796.1 - ORA-01031, ORA-01017 While Connecting as SYSASM
NOTE:730067.1 - Troubleshooting ORA-1031 Insufficient Privilege While Connecting As
SYSDBA
http://download.oracle.com/docs/cd/B28359_01/server.111/b31107/asm_util.htm
Related
Products
Oracle Database Products > Oracle Database > Oracle Database > Oracle Server Enterprise Edition
Keywords
ASM; ASMCMD; FILES
Errors
ORA-12538; ORA-17628; ORA-6512; ORA-1031; ERROR 19505
How to move ASM database files from one diskgroup to another ? [ID 330103.1]
Modified 03-DEC-2010
Type HOWTO
Status PUBLISHED
In this Document
Goal
Solution
References
Applies to:
Oracle Server - Enterprise Edition - Version: 10.2.0.1 to 11.2.0.2 - Release: 10.2 to 11.2
Information in this document applies to any platform.
***Checked for relevance on 03-Dec-2010***
Goal
MOVING ASM DATABASE FILES FROM ONE DISKGROUP TO ANOTHER:
Solution
The preferred way of doing the file movement amoung ASM DISKGROUPS is using RMAN.
RMAN is critical to Automatic Storage Management and is responsible for tracking the ASM
filenames and for deleting obsolete ASM files. Since ASM files cannot be accessed through
normal operating system interfaces, RMAN is the preferred means of copying ASM file.
The steps involved in moving a datafile from a diskgroup to another is as given below.
1) Identify the data file to be moved.
2) Identify the diskgroup on to which the file has to be moved.
3) Take the file offline.
4)Now Copy the file from Source diskgroup ASMDSK1 to target Diskgroup ASMDSK2.
-------------------------------------------------------------------------------------------Either
4. a) DBMS_FILE_TRANSFER package or
4. b) RMAN
can be used for this step.
( The step 5 to step 8 is based on the filenames from method b).
4.a).Using DBMS_FILE_TRANSFER package
SQL:ORCL>create or replace directory orcl1 as '+asmdsk1/orcl/datafile';
SQL:ASM> Alter disgroup asmdsk2 add directory '+asmdsk2/test';
SQL:ORCL> create or replace directory orcl2 as '+asmdsk2/test';
SQL:ORCL>
BEGIN
DBMS_FILE_TRANSFER.COPY_FILE(
source_directory_object => 'ORCL1',
source_file_name => 'users.259.565359071',
destination_directory_object => 'ORCL2',
destination_file_name => 'USERS01.DBF');
END;
Database altered.
4 b).Using RMAN copy the file to new diskgroup.
$ rman target system@orcl10
target database Password:
connected to target database: ORCL (DBID=1089529226)
RMAN>
RMAN> COPY DATAFILE '+ASMDSK2/orcl/datafile/users.256.565313879' TO
'+ASMDSK1';
Starting backup at 03-AUG-05
using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=146 devtype=DISK
channel ORA_DISK_1: starting datafile copy
input datafile fno=00004 name=+ASMDSK2/orcl/datafile/users.256.565313879
output filename=+ASMDSK1/orcl/datafile/users.259.565359071
tag=TAG20050803T12110
9 recid=2 stamp=565359071
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 03-AUG-05
5) Rename the file to point to new location.
------------------------------------------If you have used DBMS_FILE_TRANSFER (method 4 a)) use the following command to
rename:
SQL:ORCL> ALTER DATABASE RENAME FILE
'+ASMDSK2/orcl/datafile/users.256.565313879' TO
'+ASMDSK1/orcl/datafile/users.259.565359071'
Database altered.
If you have used RMAN (method 4 b) use the following option of RMAN
RMAN run {
set newname for datafile
'+ASMDSK2/orcl/datafile/users.256.565313879'
to '+ASMDSK1/orcl/datafile/users.259.565359071'
;
switch datafile all;
}
6) Recover the file.
------------------SQL:ORCL> RECOVER DATAFILE '+ASMDSK1/orcl/datafile/users.259.565359071'
Media recovery complete.
7) Bring the file online.
-----------------------
References
Products
Oracle Database Products > Oracle Database > Oracle Database > Oracle Server Enterprise Edition
Keywords
TABLESPACE; FILES; ASM; DATA FILE; DISK GROUP; LOCATION MOVE
Errors
ORA-15177