Chinaunix首页 | 论坛 | 博客
  • 博客访问: 364154
  • 博文数量: 79
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 42
  • 用 户 组: 普通用户
  • 注册时间: 2014-03-30 12:25
文章分类

全部博文(79)

文章存档

2019年(1)

2017年(19)

2016年(25)

2015年(30)

2014年(4)

分类: Oracle

2016-03-20 20:38:58

 

 
您已根据 ID 匹配定向到此文档。 或者, 单击此处搜索此短语。 隐藏
单击此项可添加到收藏夹 Rename Diskgroup having OCR , Vote File , ASM SPILE (文档 ID 1335975.1) 转到底部转到底部

In this Document

Goal
Solution


This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process and therefore has not been subject to an independent technical review.

APPLIES TO:

Oracle Database - Enterprise Edition - Version 11.2.0.1 to 11.2.0.4 [Release 11.2]
Information in this document applies to any platform.
***Checked for relevance on 16-Jan-2013*** 
***Checked for relevance on 18-Jun-2014*** 

GOAL

Consider a 11.2 Grid Infrastructure with CLUSTER setup having OCR ,Vote File and ASM SPFILE on a diskgroup. Under certain circumstances you may wish to rename that diskgroup.

"renamedg" utility can be used to rename of the diskgroup when the diskgroup is dismounted.

 But since the diskgroup contains OCR and Vote File we need to use an intermediate diskgroup for storing OCR and Vote File temporarily while renaming the actual diskgroup.

SOLUTION

Basic Steps to rename the diskgroup :


1) Create a temporary diskgroup (TEMP) with suitable redundancy for OCR and Vote files.

2) Move OCR and Vote file from to .

3) Change ASM SPFILE location from to diskgroup.

4) Restart CRS in all Nodes to Startup CRS using New SPFILE from diskgroup.

5) Dismount the OLD diskgroup in all cluster nodes that is not used by CRS.

6) Rename OLD diskgroup to NEW diskgroup 

7) Mount the renamed diskgroup .

8) Move OCR and Vote file from TEMP diskgroup to renamed diskgroup.

9) Change ASM SPFILE location from to renamed diskgroup.

10) Restart CRS in all nodes to startup CRS using new SPFILE from renamed diskgroup.

11) Drop the intermediate diskgroup TEMP.

12) Need to remove the diskgroup resources TEMP and from Oracle Clusterware .

13) Ensure ALL cluster resources are started successfully .

 

 Below assumptions are made :

-> Name of Temporary diskgroup is TEMP.
-> OCR,Voting Disks and ASM SPFILE are originally stored in a diskgroup DATA.
-> Diskgroup DATA should be renamed to CRS.
-> $ORACLE_HOME points to GRID Home.
-> Cluster is up and running in all nodes of RAC.




Detailed steps with commands to rename the diskgroup :

1) Create a temporary diskgroup :

Login as SYSASM using SQLPLUS into ASM instance on one node and run below commands:

create diskgroup TEMP normal redundancy disk , , 
attribute 'compatible.rdbms'='11.2.0.0', 'compatible.asm'='11.2.0.0', 'au_size'=;

Sample Command Output:

SQL> create diskgroup TEMP normal redundancy disk 'ORCL:DISK4' ,'ORCL:DISK5' ,'ORCL:DATA4' 
attribute 'compatible.rdbms'='11.2.0.0', 'compatible.asm'='11.2.0.0', 'au_size'='4M';

Diskgroup created.



2) Move OCR and Vote file from to :

$ORACLE_HOME/bin/bin/ocrconfig -add +TEMP
$ORACLE_HOME/bin/bin/ocrconfig -delete +DATA
$ORACLE_HOME/bin/crsctl replace votedisk +TEMP



Sample Command Output:

[root@test ~]# $ORACLE_HOME/bin/ocrconfig -add +TEMP
[root@test ~]# date
Mon Jul 4 21:10:16 IST 2011

[root@test ~]# $ORACLE_HOME/bin/ocrconfig -delete +DATA
[root@test ~]# date
Mon Jul 4 21:10:40 IST 2011


[root@test ~]# $ORACLE_HOME/bin/crsctl replace votedisk +TEMP
Successful addition of voting disk 9d351cfdbef64facbfe2d1519880ef33.
Successful addition of voting disk 302c23b19e864f92bfa68eda9045e5cc.
Successful addition of voting disk 6eeca4920acb4f8fbf6ec5a4e2b8ea7b.
Successful deletion of voting disk 32f7d65cf17d4fa3bf2932998251635f.
Successful deletion of voting disk 10c31fb0891d4f5abfb38ef34cd49f4d.
Successful deletion of voting disk 7d6f7d6480554f01bfc2621a3adb8f5f.
Successfully replaced voting disk group with +TEMP.
CRS-4266: Voting file(s) successfully replaced

[root@test ~]# date
Mon Jul 4 21:11:28 IST 2011


[root@test ~]# $ORACLE_HOME/bin/crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 9d351cfdbef64facbfe2d1519880ef33 (ORCL:DISK4) [TEMP]
2. ONLINE 302c23b19e864f92bfa68eda9045e5cc (ORCL:DISK5) [TEMP]
3. ONLINE 6eeca4920acb4f8fbf6ec5a4e2b8ea7b (ORCL:DATA4) [TEMP]
Located 3 voting disk(s).
[root@test ~]#


[root@test ~]# $ORACLE_HOME/bin/ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 2804
Available space (kbytes) : 259316
ID : 1778064925
Device/File Name : +TEMP
Device/File integrity check succeeded

Device/File not configured
Device/File not configured
Device/File not configured
Device/File not configured
Cluster registry integrity check succeeded
Logical corruption check succeeded



3) Change ASM SPFILE location from to diskgroup.

Login as SYSASM using SQLPLUS into ASM instance on one node and run below commands:

create pfile='/tmp/init/init' from spfile;
create spfile='+TEMP' from pfile='/tmp/init/init';

Now GPNPTOOL will get updated with new ASM SPFILE location.

That can be verified by below command :
$ORACLE_HOME/bin/gpnptool get



4) Restart CRS on all nodes to startup CRS using new SPFILE from TEMP diskgroup :

crsctl stop crs
crsctl start crs



5) Dismount the OLD Diskgroup on all cluster nodes:

Login as SYSASM using SQLPLUS into ASM instance on one node and run below commands:

SQL>alter diskgroup data dismount;

Sample Command Output:
SQL> alter diskgroup data dismount;
Diskgroup altered.

SQL> !date
Mon Jul 4 21:38:28 IST 2011


6) Rename OLD diskgroup to NEW diskgroup name :

renamedg phase=both dgname=DATA newdgname=CRS verbose=true 

Sample Command Output:
[grid@test ~]$ renamedg phase=both dgname=DATA newdgname=CRS asm_diskstring='' verbose=true

Parsing parameters..
Parameters in effect:
Old DG name : DATA
New DG name : CRS
Phases :
Phase 1
Phase 2
Discovery str : (null)
Clean : TRUE
Raw only : TRUE
renamedg operation: phase=both dgname=DATA newdgname=CRS verbose=true
Executing phase 1
Discovering the group
Performing discovery with string:
Identified disk ASM:/opt/oracle/extapi/32/asm/orcl/1/libasm.so:ORCL:DISK1 with disk number:0 and timestamp (32955539 -2120261632)
Identified disk ASM:/opt/oracle/extapi/32/asm/orcl/1/libasm.so:ORCL:DISK2 with disk number:1 and timestamp (32955539 -2120261632)
Identified disk ASM:/opt/oracle/extapi/32/asm/orcl/1/libasm.so:ORCL:DISK3 with disk number:2 and timestamp (32955539 -2120261632)
Checking for hearbeat...
Re-discovering the group
Performing discovery with string:
Identified disk ASM:/opt/oracle/extapi/32/asm/orcl/1/libasm.so:ORCL:DISK1 with disk number:0 and timestamp (32955539 -2120261632)
Identified disk ASM:/opt/oracle/extapi/32/asm/orcl/1/libasm.so:ORCL:DISK2 with disk number:1 and timestamp (32955539 -2120261632)
Identified disk ASM:/opt/oracle/extapi/32/asm/orcl/1/libasm.so:ORCL:DISK3 with disk number:2 and timestamp (32955539 -2120261632)
Checking if the diskgroup is mounted or used by CSS
Checking disk number:0
Checking disk number:1
Checking disk number:2
Generating configuration file..
Completed phase 1
Executing phase 2
Looking for ORCL:DISK1
Modifying the header
Looking for ORCL:DISK2
Modifying the header
Looking for ORCL:DISK3
Modifying the header
Completed phase 2
Terminating kgfd context 0xb7ee8050
[grid@test ~]$



SQL> set line 1000
set pages 599
col path format a30
select name,path,group_number,header_status,total_mb,free_mb from v$asm_disk;
select name,state,usable_file_mb,total_mb,free_mb,required_mirror_free_mb from v$asm_diskgroup;

NAME PATH GROUP_NUMBER HEADER_STATU TOTAL_MB FREE_MB
------------------------------ ------------------------------ ------------ ------------ ---------- ----------
ORCL:DISK1 0 MEMBER 0 0
ORCL:DISK2 0 MEMBER 0 0
ORCL:DISK3 0 MEMBER 0 0
ORCL:DISK6 0 MEMBER 0 0
DATA1 ORCL:DATA1 2 MEMBER 977 642
DATA2 ORCL:DATA2 2 MEMBER 977 642
DATA3 ORCL:DATA3 1 MEMBER 15109 9982
DATA4 ORCL:DATA4 3 MEMBER 252 76
DATA6 ORCL:DATA6 3 MEMBER 860 576
DISK4 ORCL:DISK4 3 MEMBER 668 376
DISK5 ORCL:DISK5 3 MEMBER 668 372

11 rows selected.

SQL>
NAME STATE USABLE_FILE_MB TOTAL_MB FREE_MB REQUIRED_MIRROR_FREE_MB
------------------------------ ----------- -------------- ---------- ---------- -----------------------
DATA1 MOUNTED 9982 15109 9982 0
FLASH MOUNTED 642 1954 1284 0
TEMP MOUNTED 552 2448 1400 296
CRS DISMOUNTED 0 0 0 0

 

7) Mount the renamed diskgroup on All the nodes:

Login as SYSASM using SQLPLUS into ASM instance on one node and run below commands:

SQL>alter diskgroup CRS mount;

Sample Command Output:

SQL> alter diskgroup CRS mount;
Diskgroup altered.


SQL> select name,state,usable_file_mb,total_mb,free_mb,required_mirror_free_mb from v$asm_diskgroup;

NAME STATE USABLE_FILE_MB TOTAL_MB FREE_MB REQUIRED_MIRROR_FREE_MB
------------------------------ ----------- -------------- ---------- ---------- -----------------------
DATA1 MOUNTED 9982 15109 9982 0
FLASH MOUNTED 642 1954 1284 0
TEMP MOUNTED 552 2448 1400 296
CRS MOUNTED 1196 3596 2644 252

SQL> !date
Mon Jul 4 21:52:05 IST 2011

 

8) Move OCR and Vote file from TEMP Diskgroup to Renamed Diskgroup :

$ORACLE_HOME/bin/ocrconfig -add +CRS
$ORACLE_HOME/bin/ocrconfig -delete +TEMP
$ORACLE_HOME/bin/crsctl replace votedisk +CRS

Sample Command Output:

[root@test ~]# $ORACLE_HOME/bin/ocrconfig -add +CRS
[root@test ~]# $ORACLE_HOME/bin/ocrconfig -delete +TEMP
[root@test ~]# $ORACLE_HOME/bin/crsctl replace votedisk +CRS
Successful addition of voting disk ae0f06430e724fb7bf3757a7cdf8a101.
Successful addition of voting disk 1b355413f5904f5abff181938191ed97.
Successful addition of voting disk a7f75c9872ac4f6fbf77bbcb10ea17a6.
Successful deletion of voting disk 9d351cfdbef64facbfe2d1519880ef33.
Successful deletion of voting disk 302c23b19e864f92bfa68eda9045e5cc.
Successful deletion of voting disk 6eeca4920acb4f8fbf6ec5a4e2b8ea7b.
Successfully replaced voting disk group with +CRS.
CRS-4266: Voting file(s) successfully replaced
[root@test ~]# date
Mon Jul 4 21:55:48 IST 2011

 

9) Change ASM SPFILE location from to Renamed Diskgroup:

Login as SYSASM using SQLPLUS into ASM instance on one node and run below commands:

create spfile='+CRS' from pfile='/tmp/init/init';

Sample Command Output:

SQL> create spfile='+CRS' from pfile='/tmp/init/init';
File created.

SQL> !date
Mon Jul 4 21:56:56 IST 2011

 

10) Restart CRS on all nodes to Startup CRS using new SPFILE from renamed diskgroup :

crsctl stop crs
crsctl start crs

 

11) Drop the Intermediate Diskgroup TEMP :

Login as SYSASM using SQLPLUS into ASM instance on one node and run below commands::

SQL>drop diskgroup temp including contents;
NOTE: Diskgroup TEMP must be mounted in order to be able to drop it.You need to mount it (if it is not already mounted at CRS startup) and then run "drop diskgroup.."

 


12) Need to Remove the Diskgroup Resources TEMP and from Oracle Clusterware :

srvctl remove diskgroup -g data
srvctl remove diskgroup -g TEMP

Sample Command Output:

[root@test ~]# $ORACLE_HOME/bin/srvctl remove diskgroup -g data
[root@test ~]# $ORACLE_HOME/bin/srvctl remove diskgroup -g TEMP
[root@test ~]# date
NOTE: Normally diskgroup TEMP as resource should be removed by "drop diskgroup.." command, hence you need to run above command only if the resource is not already dropped.
In case of DATA diskgroup resource you need to explicitly remove it using srvctl command as the diskgroup was just renamed not dropped.

 

13) Ensure ALL Cluster resources are started successfully using below sample commands :

$ORACLE_HOME/bin/crsctl stat res -init -t
$ORACLE_HOME/bin/crsctl check cluster -all
$ORACLE_HOME/bin/crsctl stat res -t
阅读(1978) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~