生产环境,更换存储,交换机流程。
- 关闭1节点数据库
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
- 关闭集群
Root 进入grid用户的bin目录
crsctl stop crs
3.刷新磁盘
echo "- - - " > /sys/class/scsi_host/host0/scan
echo "- - - " > /sys/class/scsi_host/host1/scan
echo "- - - " > /sys/class/scsi_host/host2/scan
echo "- - - " > /sys/class/scsi_host/host3/scan
echo "- - - " > /sys/class/scsi_host/host4/scan
echo "- - - " > /sys/class/scsi_host/host5/scan
echo "- - - " > /sys/class/scsi_host/host6/scan
echo "- - - " > /sys/class/scsi_host/host7/scan
echo "- - - " > /sys/class/scsi_host/host8/scan
echo "- - - " > /sys/class/scsi_host/host9/scan
echo "- - - " > /sys/class/scsi_host/host10/scan
4.刷新 multipath -rr
一节点、二节点磁盘信息一致。
vote3 (36005076300828c785000000000000000) dm-0 IBM,2145
size=10G features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=50 status=active
| |- 0:0:1:0 sdh 8:112 active ready running
| `- 2:0:1:0 sdv 65:80 active ready running
`-+- policy='round-robin 0' prio=10 status=enabled
|- 0:0:0:0 sda 8:0 active ready running
`- 2:0:0:0 sdo 8:224 active ready running
vote2 (36005076300828c785000000000000001) dm-2 IBM,2145
size=10G features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=50 status=active
| |- 0:0:0:1 sdb 8:16 active ready running
| `- 2:0:0:1 sdp 8:240 active ready running
`-+- policy='round-robin 0' prio=10 status=enabled
|- 0:0:1:1 sdi 8:128 active ready running
`- 2:0:1:1 sdw 65:96 active ready running
vote1 (36005076300828c785000000000000002) dm-1 IBM,2145
size=10G features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=50 status=active
| |- 0:0:1:2 sdj 8:144 active ready running
| `- 2:0:1:2 sdx 65:112 active ready running
`-+- policy='round-robin 0' prio=10 status=enabled
|- 0:0:0:2 sdc 8:32 active ready running
`- 2:0:0:2 sdq 65:0 active ready running
mpathh (36005076300828c78500000000000000a) dm-5 IBM,2145
size=243G features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=50 status=active
| |- 0:0:1:6 sdn 8:208 active ready running
| `- 2:0:1:6 sdab 65:176 active ready running
`-+- policy='round-robin 0' prio=10 status=enabled
|- 0:0:0:6 sdg 8:96 active ready running
`- 2:0:0:6 sdu 65:64 active ready running
data3 (36005076300828c785000000000000009) dm-6 IBM,2145
size=1.0T features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=50 status=active
| |- 0:0:0:5 sdf 8:80 active ready running
| `- 2:0:0:5 sdt 65:48 active ready running
`-+- policy='round-robin 0' prio=10 status=enabled
|- 0:0:1:5 sdm 8:192 active ready running
`- 2:0:1:5 sdaa 65:160 active ready running
data2 (36005076300828c785000000000000008) dm-3 IBM,2145
size=1.0T features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=50 status=active
| |- 0:0:1:4 sdl 8:176 active ready running
| `- 2:0:1:4 sdz 65:144 active ready running
`-+- policy='round-robin 0' prio=10 status=enabled
|- 0:0:0:4 sde 8:64 active ready running
`- 2:0:0:4 sds 65:32 active ready running
data1 (36005076300828c785000000000000007) dm-4 IBM,2145
size=1.0T features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=50 status=active
| |- 0:0:0:3 sdd 8:48 active ready running
| `- 2:0:0:3 sdr 65:16 active ready running
`-+- policy='round-robin 0' prio=10 status=enabled
|- 0:0:1:3 sdk 8:160 active ready running
`- 2:0:1:3 sdy 65:128 active ready running
5.对比信息
更换完磁盘信息一致:
第一次更换
vote3 (36005076300828c785000000000000000) dm-0 IBM,2145
size=10G features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=50 status=active
| |- 0:0:1:0 sdh 8:112 active ready running
| `- 2:0:1:0 sdv 65:80 active ready running
`-+- policy='round-robin 0' prio=10 status=enabled
|- 0:0:0:0 sda 8:0 active ready running
`- 2:0:0:0 sdo 8:224 active ready running
vote2 (36005076300828c785000000000000001) dm-2 IBM,2145
size=10G features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=50 status=active
| |- 0:0:0:1 sdb 8:16 active ready running
| `- 2:0:0:1 sdp 8:240 active ready running
`-+- policy='round-robin 0' prio=10 status=enabled
|- 0:0:1:1 sdi 8:128 active ready running
`- 2:0:1:1 sdw 65:96 active ready running
vote1 (36005076300828c785000000000000002) dm-1 IBM,2145
size=10G features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=50 status=active
| |- 0:0:1:2 sdj 8:144 active ready running
| `- 2:0:1:2 sdx 65:112 active ready running
`-+- policy='round-robin 0' prio=10 status=enabled
|- 0:0:0:2 sdc 8:32 active ready running
`- 2:0:0:2 sdq 65:0 active ready running
mpathh (36005076300828c78500000000000000a) dm-5 IBM,2145
size=243G features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=50 status=active
| |- 0:0:1:6 sdn 8:208 active ready running
| `- 2:0:1:6 sdab 65:176 active ready running
`-+- policy='round-robin 0' prio=10 status=enabled
|- 0:0:0:6 sdg 8:96 active ready running
`- 2:0:0:6 sdu 65:64 active ready running
data3 (36005076300828c785000000000000009) dm-6 IBM,2145
size=1.0T features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=50 status=active
| |- 0:0:0:5 sdf 8:80 active ready running
| `- 2:0:0:5 sdt 65:48 active ready running
`-+- policy='round-robin 0' prio=10 status=enabled
|- 0:0:1:5 sdm 8:192 active ready running
`- 2:0:1:5 sdaa 65:160 active ready running
data2 (36005076300828c785000000000000008) dm-3 IBM,2145
size=1.0T features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=50 status=active
| |- 0:0:1:4 sdl 8:176 active ready running
| `- 2:0:1:4 sdz 65:144 active ready running
`-+- policy='round-robin 0' prio=10 status=enabled
|- 0:0:0:4 sde 8:64 active ready running
`- 2:0:0:4 sds 65:32 active ready running
data1 (36005076300828c785000000000000007) dm-4 IBM,2145
size=1.0T features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=50 status=active
| |- 0:0:0:3 sdd 8:48 active ready running
| `- 2:0:0:3 sdr 65:16 active ready running
`-+- policy='round-robin 0' prio=10 status=enabled
|- 0:0:1:3 sdk 8:160 active ready running
`- 2:0:1:3 sdy 65:128 active ready running
第二次
[root@db2 ~]# multipath -rr
reload: vote3 (36005076300828c785000000000000000) undef IBM,2145
size=10G features='1 queue_if_no_path' hwhandler='0' wp=undef
|-+- policy='round-robin 0' prio=50 status=undef
| |- 0:0:1:0 sda 8:0 active ready running
| `- 2:0:1:0 sdv 65:80 active ready running
`-+- policy='round-robin 0' prio=10 status=undef
|- 2:0:0:0 sdo 8:224 active ready running
`- 0:0:0:0 sdh 8:112 active ready running
reload: vote2 (36005076300828c785000000000000001) undef IBM,2145
size=10G features='1 queue_if_no_path' hwhandler='0' wp=undef
|-+- policy='round-robin 0' prio=50 status=undef
| |- 2:0:0:1 sdp 8:240 active ready running
| `- 0:0:0:1 sdi 8:128 active ready running
`-+- policy='round-robin 0' prio=10 status=undef
|- 0:0:1:1 sdb 8:16 active ready running
`- 2:0:1:1 sdw 65:96 active ready running
reload: vote1 (36005076300828c785000000000000002) undef IBM,2145
size=10G features='1 queue_if_no_path' hwhandler='0' wp=undef
|-+- policy='round-robin 0' prio=50 status=undef
| |- 0:0:1:2 sdc 8:32 active ready running
| `- 2:0:1:2 sdx 65:112 active ready running
`-+- policy='round-robin 0' prio=10 status=undef
|- 2:0:0:2 sdq 65:0 active ready running
`- 0:0:0:2 sdj 8:144 active ready running
reload: data1 (36005076300828c785000000000000007) undef IBM,2145
size=1.0T features='1 queue_if_no_path' hwhandler='0' wp=undef
|-+- policy='round-robin 0' prio=50 status=undef
| |- 2:0:0:3 sdr 65:16 active ready running
| `- 0:0:0:3 sdk 8:160 active ready running
`-+- policy='round-robin 0' prio=10 status=undef
|- 0:0:1:3 sdd 8:48 active ready running
`- 2:0:1:3 sdy 65:128 active ready running
reload: data2 (36005076300828c785000000000000008) undef IBM,2145
size=1.0T features='1 queue_if_no_path' hwhandler='0' wp=undef
|-+- policy='round-robin 0' prio=50 status=undef
| |- 0:0:1:4 sde 8:64 active ready running
| `- 2:0:1:4 sdz 65:144 active ready running
`-+- policy='round-robin 0' prio=10 status=undef
|- 2:0:0:4 sds 65:32 active ready running
`- 0:0:0:4 sdl 8:176 active ready running
reload: mpathh (36005076300828c78500000000000000a) undef IBM,2145
size=243G features='1 queue_if_no_path' hwhandler='0' wp=undef
|-+- policy='round-robin 0' prio=50 status=undef
| |- 0:0:1:6 sdg 8:96 active ready running
| `- 2:0:1:6 sdab 65:176 active ready running
`-+- policy='round-robin 0' prio=10 status=undef
|- 2:0:0:6 sdu 65:64 active ready running
`- 0:0:0:6 sdn 8:208 active ready running
reload: data3 (36005076300828c785000000000000009) undef IBM,2145
size=1.0T features='1 queue_if_no_path' hwhandler='0' wp=undef
|-+- policy='round-robin 0' prio=50 status=undef
| |- 2:0:0:5 sdt 65:48 active ready running
| `- 0:0:0:5 sdm 8:192 active ready running
`-+- policy='round-robin 0' prio=10 status=undef
|- 0:0:1:5 sdf 8:80 active ready running
`- 2:0:1:5 sdaa 65:160 active ready running
Oct 29 13:35:14 | mpatha: ignoring map
- 启动集群与数据库
集群
Root 进入grid用户的bin目录
crsctl start crs
数据库
SQL> startup
7.查看集群状态
crsctl stat res -t
[root@db2 grid]# crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DGDATA.dg
ONLINE ONLINE db1
ONLINE ONLINE db2
ora.DGVOTE.dg
ONLINE ONLINE db1
ONLINE ONLINE db2
ora.LISTENER.lsnr
ONLINE ONLINE db1
ONLINE ONLINE db2
ora.asm
ONLINE ONLINE db1 Started
ONLINE ONLINE db2 Started
ora.gsd
OFFLINE OFFLINE db1
OFFLINE OFFLINE db2
ora.net1.network
ONLINE ONLINE db1
ONLINE ONLINE db2
ora.ons
ONLINE ONLINE db1
ONLINE ONLINE db2
ora.registry.acfs
ONLINE ONLINE db1
ONLINE ONLINE db2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE db1
ora.cvu
1 ONLINE ONLINE db1
ora.db1.db
1 OFFLINE OFFLINE
2 OFFLINE OFFLINE
ora.db1.vip
1 ONLINE ONLINE db1
ora.db2.vip
1 ONLINE ONLINE db2
ora.dlscw.db
1 ONLINE ONLINE db2 Open
2 ONLINE ONLINE db1 Open
ora.oc4j
1 ONLINE ONLINE db1
ora.scan1.vip
1 ONLINE ONLINE db1
[root@db2 grid]#
集群状态正常。
- 查看数据库连接数
SQL> select inst_id,username,count(*) from gv$session where username is not null group by inst_id,username;
INST_ID USERNAME COUNT(*)
---------- ------------------------------ ----------
1 DLSHS 4
1 LC0019999 3
2 SYS 3
2 DLSHS 2
2 LC0019999 5
1 SYS 3
6 rows selected.
正常
与应用沟通确认,正常。