11204 ASM 在线存储迁移。
2.1停止数据库
shutdown immediate
2.2 扫描磁盘
echo 1 > /sys/class/fc_host/host3/issue_lip
echo 1 > /sys/class/fc_host/host4/issue_lip
3,更改磁盘属性
chown oracle:oinstall /dev/mapper/3PART*
4,备份ocr
./ocrconfig -manualbackup
./ocrconfig -showbackup
5,新建asm磁盘组
create diskgroup SYSDG normal redundancy disk '/dev/mapper/3PAR01VOTE01','/dev/mapper/3PAR01VOTE02','/dev/mapper/3PAR01VOTE03' attribute 'compatible.rdbms'='11.2.0.0', 'compatible.asm'='11.2.0.0';
create diskgroup SYSDG external redundancy disk '/dev/mapper/3PARVOT01','/dev/mapper/3PARVOT02','/dev/mapper/3PARVOT03';
6,迁移votedisk
crsctl query css votedisk
crsctl replace votedisk +SYSDG
crsctl query css votedisk
7,迁移ocr
ocrcheck
ocrconfig -add +SYSDG
ocrconfig -delete +DATA
ocrcheck
8,迁移asmspfile
sqlplus / as sysasm
show parameter spfile
create pfile='/home/oracle/asmpfilebak.ora' from spfile;
create spfile='+SYSDG' from pfile='/home/oracle/asmpfilebak.ora'
9,更换asm磁盘到新存储
alter diskgroup DATA
add disk
'/dev/mapper/3PAR01DATA01',
'/dev/mapper/3PAR01DATA02',
'/dev/mapper/3PAR01DATA03',
'/dev/mapper/3PAR01DATA04',
'/dev/mapper/3PAR01DATA05'
drop disk
DATA_0000,DATA_0001,DATA_0002,DATA_003,DATA_0004 rebalance power 11;
alter diskgroup DATA02
add disk
'/dev/mapper/3PAR01DATA06',
'/dev/mapper/3PAR01DATA07',
'/dev/mapper/3PAR01DATA08',
'/dev/mapper/3PAR01DATA09',
'/dev/mapper/3PAR01DATA10',
'/dev/mapper/3PAR01DATA11',
'/dev/mapper/3PAR01DATA12'
drop disk
DATA_0005,DATA_0006,DATA_007,DATA_0008,DATA_0009,DATA_0010,DATA02_0006 rebalance power 11;
10,检查集群和数据库状态
crsctl stat res -t
===============
SQL> create diskgroup SYSDG normal redundancy disk '/dev/mapper/3PAR01VOTE01','/dev/mapper/3PAR01VOTE02','/dev/mapper/3PAR01VOTE03' attribute 'compatible.rdbms'='11.2.0.0', 'compatible.asm'='11.2.0.0';
Diskgroup created.
SQL> create pfile='/home/oracle/asmpfilebak.ora' from spfile;
File created.
SQL> create spfile='+SYSDG' from pfile='/home/oracle/asmpfilebak.ora'
2 ;
File created.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
[oracle@PSIYKTDB03 snow]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 2928
Available space (kbytes) : 259192
ID : 677303095
Device/File Name : +DATA
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 bypassed due to non-privileged user
[oracle@PSIYKTDB03 snow]$ ocrconfig -add +SYSDG
PROT-20: Insufficient permission to proceed. Require privileged user
[oracle@PSIYKTDB03 snow]$ which ocrconfig
/oracle/grid/bin/ocrconfig
[oracle@PSIYKTDB03 snow]$ su -
Password:
[root@PSIYKTDB03 ~]# /oracle/grid/bin/ocrconfig -add +SYSDG
[root@PSIYKTDB03 ~]# /oracle/grid/bin/ocrconfig -add +SYSDG
[root@PSIYKTDB03 ~]# /oracle/grid/bin/ocrconfig -delete +DATA
[root@PSIYKTDB03 ~]# cat /etc/ora
oracle/ oraInst.loc oratab
[root@PSIYKTDB03 ~]# cat /etc/oracle/o
ocr.loc ocr.loc.orig olr.loc olr.loc.orig oprocd/
[root@PSIYKTDB03 ~]# cat /etc/oracle/ocr.loc
#Device/file +DATA getting replaced by device +SYSDG
ocrconfig_loc=+SYSDG
[root@PSIYKTDB03 ~]# /oracle/grid/bin/crsctl query css
Parse error:
Missing additional arguments
Usage:
crsctl query css ipmiconfig
Checks whether Oracle Clusterware has been configured for IPMI
crsctl query css ipmidevice
Checks whether the IPMI device/driver is present
crsctl query css votedisk
Lists the voting files used by Cluster Synchronization Services
[root@PSIYKTDB03 ~]# /oracle/grid/bin/crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 7f6b3c9b6f6b4fb7bff0d6e03f993474 (/dev/mapper/DATA1) [DATA]
Located 1 voting disk(s).
[root@PSIYKTDB03 ~]# /oracle/grid/bin/crsctl replace votedisk +SYSDG
Successful addition of voting disk 4e76af5f1ce24fa9bf5df9efb6f660e8.
Successful addition of voting disk 7129487e16954fb0bf796e3d8b005d0c.
Successful addition of voting disk 1133f01ca9ec4f23bf056fb90fa883fc.
Successful deletion of voting disk 7f6b3c9b6f6b4fb7bff0d6e03f993474.
Successfully replaced voting disk group with +SYSDG.
CRS-4266: Voting file(s) successfully replaced
[root@PSIYKTDB03 ~]# /oracle/grid/bin/crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 4e76af5f1ce24fa9bf5df9efb6f660e8 (/dev/mapper/3PAR01VOTE01) [SYSDG]
2. ONLINE 7129487e16954fb0bf796e3d8b005d0c (/dev/mapper/3PAR01VOTE02) [SYSDG]
3. ONLINE 1133f01ca9ec4f23bf056fb90fa883fc (/dev/mapper/3PAR01VOTE03) [SYSDG]
Located 3 voting disk(s).
[root@PSIYKTDB03 ~]#
[root@PSIYKTDB03 ~]# exit
logout
[
SQL> alter diskgroup DATA
add disk
'/dev/mapper/3PAR01DATA01',
'/dev/mapper/3PAR01DATA02',
'/dev/mapper/3PAR01DATA03',
'/dev/mapper/3PAR01DATA04',
'/dev/mapper/3PAR01DATA05'
drop disk
DATA_0000,
DATA_0001,
DATA_0002,
DATA_0003,
DATA_0004 rebalance power 11;
2 3 4 5 6 7 8 9 10 11 12 13
Diskgroup altered.
SQL> SQL> ^Hexit
SP2-0042: unknown command exit" - rest of line ignored.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
[oracle@PSIYKTDB03 snow]$ ssh PSIYKTDB0
[oracle@PSIYKTDB03 snow]$ asmcmd
ASMCMD> lsop
Group_Name Dsk_Num State Power
DATA02 REBAL WAIT 11
DATA REBAL RUN 11
ASMCMD> lsop
Group_Name Dsk_Num State Power
DATA02 REBAL WAIT 11
DATA REBAL RUN 11
ASMCMD> lsop
Group_Name Dsk_Num State Power
DATA02 REBAL WAIT 11
DATA REBAL RUN 11
ASMCMD> lsop
Group_Name Dsk_Num State Power
DATA02 REBAL WAIT 11
DATA REBAL RUN 11
ASMCMD> exit
[oracle@PSIYKTDB03 snow]$
[oracle@PSIYKTDB03 snow]$ asmcmd
ASMCMD> lsop -help
Group_Name Dsk_Num State Power
DATA02 REBAL WAIT 11
DATA REBAL RUN 11
ASMCMD> lsop
Group_Name Dsk_Num State Power
DATA02 REBAL WAIT 11
DATA REBAL RUN 11
ASMCMD> lsop
Group_Name Dsk_Num State Power
DATA02 REBAL WAIT 11
DATA REBAL RUN 11
ASMCMD> exit