【RAC】RAC_for_linux迁移之更换主机设备

RAC迁移之更换主机设备

一、状况描述
      在生产系统中,服务器设备难免会出现故障,由于设备老化、机器性能减低及其他原因,下面我们介绍怎么样替换RAC中每个节点的主机。

      替换RAC主机节点,由以下几种方式:
   1
添加新节点、剔除原有故障节点

   2 搭建新软件环境、挂接原有存储设备

   3 使用数据同步软件(OGGDG等),实现数据转换。

由于本次停机时间较短、原设备故障频繁(设备自动重启),所以我们使用第二种方法对RAC环境进行迁移(本文档由实验环境完成,故有些地方不符合生产环境管理)。

二、环境检查:

查看ASM实例信息和磁盘组状况

SQL> select status,instance_name from gv$instance;

 

STATUS       INSTANCE_NAME

------------ ----------------

STARTED      +ASM1

STARTED      +ASM2

SQL> show parameter pfile

 

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

spfile                               string      /dev/raw/raw3

 

 

SQL>  select group_number,disk_number,path from v$asm_disk;

 

GROUP_NUMBER DISK_NUMBER PATH

------------ ----------- --------------------

           0           1 /dev/raw/raw3

           0           4 /dev/raw/raw2

           1           0 /dev/raw/raw4

           1           2 /dev/raw/raw6

           1           1 /dev/raw/raw5

 

SQL> select GROUP_NUMBER,NAME from v$asm_diskgroup;

 

GROUP_NUMBER NAME

------------ ------------------------------

           1 DATA

 

查看数据库实例信息,版本为10.2.0.5

SQL> select * from v$version;

 

BANNER

----------------------------------------------------------------

Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi

PL/SQL Release 10.2.0.5.0 - Production

CORE    10.2.0.5.0      Production

TNS for Linux: Version 10.2.0.5.0 - Production

NLSRTL Version 10.2.0.5.0 - Production

 

SQL>
SQL> archive log list;

Database log mode              Archive Mode

Automatic archival             Enabled

Archive destination            +DATA

Oldest online log sequence     31

Next log sequence to archive   32

Current log sequence           32

SQL> show parameter db_r

 

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

db_recovery_file_dest                string      +DATA

db_recovery_file_dest_size           big integer 4G

db_recycle_cache_size                big integer 0

dbwr_io_slaves                       integer     0

 

查看各实例参数文件

[oracle@soul01 dbs]$ cat init+ASM1.ora

spfile="/dev/raw/raw3"

[oracle@soul01 dbs]$ cat initxysoul1.ora

SPFILE='+DATA/xysoul/spfilexysoul.ora'

 

 

通过xpinfo工具,查看磁盘对于信息 (由于此次模拟环境为虚拟机,下面LDev号为模仿)

Device File

CU:LDev

/dev/sdb5

01:b2

/dev/sdb6

01:b3

/dev/sdb7

02:46

/dev/sdb8

02:a4

/dev/sdb9

02:a5

/dev/sdb10

02:a6

查看用户环境变量及裸设备配置信息

[oracle@soul01 ~]$ cat  .bash_profile
export PATH

export ORACLE_BASE=/opt/oracle/product/10.2.0

export ORACLE_HOME=$ORACLE_BASE/db_1

export CRS_HOME=$ORACLE_BASE/crs

export ORACLE_SID=xysoul1

export PATH=$ORACLE_HOME/bin:.:$CRS_HOME/bin:.:$PATH

[oracle@soul01 ~]$ cat /etc/udev/rules.d/60-raw.rules

# Enter raw device bindings here.

#

# An example would be:

#   ACTION=="add", KERNEL=="sda", RUN+="/bin/raw /dev/raw/raw1 %N"

# to bind /dev/raw/raw1 to /dev/sda, or

#   ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="1", RUN+="/bin/raw /dev/raw/raw2 %M %m"

# to bind /dev/raw/raw2 to the device with major 8, minor 1.

#ORC

ACTION=="add",KERNEL=="sdb5",RUN+="/bin/raw /dev/raw/raw1 %N"

#Vote disk

ACTION=="add",KERNEL=="sdb6",RUN+="/bin/raw /dev/raw/raw2 %N"

#ASM SPFILE

ACTION=="add",KERNEL=="sdb7",RUN+="/bin/raw /dev/raw/raw3 %N"

#DATA ASM DISK

ACTION=="add",KERNEL=="sdb8",RUN+="/bin/raw /dev/raw/raw4 %N"

ACTION=="add",KERNEL=="sdb9",RUN+="/bin/raw /dev/raw/raw5 %N"

ACTION=="add",KERNEL=="sdb10",RUN+="/bin/raw /dev/raw/raw6 %N"

KERNEL=="raw1", OWNER="root", GROUP="oinstall", MODE="640"

KERNEL=="raw2", OWNER="oracle", GROUP="oinstall", MODE="644"

KERNEL=="raw[3-6]", OWNER="oracle", GROUP="oinstall", MODE="660"

 

备注:由于linux系统dev下设备随着服务器启动而动态生成,为防止磁盘顺序的变化,可以使用一下,语句
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id", RESULT=="36006016047602e006db422dd3f5de111", NAME="raw1",OWNER="oracle", GROUP="dba",MODE="0660"
   查看id

redhat5

命令: /sbin/scsi_id -g -u -s /block/sdb/sdb1

redhat6

命令: /sbin/scsi_id -g -u /dev/sdb1

查看网络

[oracle@soul01 ~]$ cat /etc/sysconfig/network-scripts/ifcfg-eth0

# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)

DEVICE=eth0

BOOTPROTO=none

ONBOOT=yes

HWADDR=00:0c:29:96:32:13

TYPE=Ethernet

NETMASK=255.255.255.0

IPADDR=192.168.8.41

GATEWAY=192.168.8.1

USERCTL=no

IPV6INIT=no

PEERDNS=yes

[oracle@soul01 ~]$ cat /etc/sysconfig/network-scripts/ifcfg-eth1

# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)

DEVICE=eth1

BOOTPROTO=none

ONBOOT=yes

HWADDR=00:0c:29:96:32:1d

TYPE=Ethernet

NETMASK=255.255.255.0

IPADDR=10.0.0.41

USERCTL=no

IPV6INIT=no

PEERDNS=yes

 

查看hosts信息及oracle用户信息

[oracle@soul01 ~]$ cat /etc/hosts

# Do not remove the following line, or various programs

# that require network functionality will fail.

127.0.0.1       localhost

192.168.8.41    soul01

192.168.8.42    soul02

192.168.8.43    soul01-vip

192.168.8.44    soul02-vip

10.0.0.41       soul01-priv

10.0.0.42       soul02-priv

[oracle@soul01 ~]$ id

uid=1001(oracle) gid=501(oinstall) groups=501(oinstall),502(dba)

[oracle@soul01 ~]$

 

 

三、新环境准备及检查

配置新RAC环境,RAC安装在本次文档中不再做详细说明。

查看hosts文件

[root@soul01 db_1]# cat /etc/hosts

# Do not remove the following line, or various programs

# that require network functionality will fail.

127.0.0.1               localhost

192.168.8.141           soul01

192.168.8.142           soul02

192.168.8.143           soul01-vip

192.168.8.144           soul02-vip

10.0.0.141              soul01-priv

10.0.0.142              soul02-priv

 

确认数据库版本及用户信息、配置oracle环境变量

[oracle@soul01 ~]$ sqlplus /nolog

 

SQL*Plus: Release 10.2.0.5.0 - Production on Wed Dec 4 05:33:17 2013

 

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

 

SQL> exit

[oracle@soul01 ~]$ id

uid=1001(oracle) gid=501(oinstall) groups=501(oinstall),502(dba)

[oracle@soul01 ~]$ cat ~/.bash_profile

# .bash_profile

 

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

        . ~/.bashrc

fi

 

# User specific environment and startup programs

 

PATH=$PATH:$HOME/bin

 

export PATH

export ORACLE_BASE=/oracle

export ORACLE_HOME=$ORACLE_BASE/db_1

export CRS_HOME=$ORACLE_BASE/crs_1

export ORACLE_SID=xysoul1

export PATH=$ORACLE_HOME/bin:.:$CRS_HOME/bin:.:$PATH

[oracle@soul01 ~]$

 

再次通过xpinfo工具查看磁盘信息(由于此次模拟环境为虚拟机,下面LDev号为模仿)

 

Device File

CU:LDev

/dev/sdc5

01:b2

/dev/sdc6

01:b3

/dev/sdc7

02:46

/dev/sdc8

02:a4

/dev/sdc9

02:a5

/dev/sdc10

02:a6


 编辑文件60-raw.rules,添加如下内容

#ORC

ACTION=="add",KERNEL=="sdc5",RUN+="/bin/raw /dev/raw/raw11 %N"

#Vote disk

ACTION=="add",KERNEL=="sdc6",RUN+="/bin/raw /dev/raw/raw21 %N"

#ASM SPFILE

ACTION=="add",KERNEL=="sdc7",RUN+="/bin/raw /dev/raw/raw3 %N"

#DATA ASM DISK

ACTION=="add",KERNEL=="sdc8",RUN+="/bin/raw /dev/raw/raw4 %N"

ACTION=="add",KERNEL=="sdc9",RUN+="/bin/raw /dev/raw/raw5 %N"

ACTION=="add",KERNEL=="sdc10",RUN+="/bin/raw /dev/raw/raw6 %N"

KERNEL=="raw11", OWNER="root", GROUP="oinstall", MODE="640"

KERNEL=="raw21", OWNER="oracle", GROUP="oinstall", MODE="644"

KERNEL=="raw[3-6]", OWNER="oracle", GROUP="oinstall", MODE="660"

 

执行命令:start_udev

两边对裸设备进行检查:

[root@soul02 /]# raw –qa

/dev/raw/raw1:  bound to major 8, minor 21

/dev/raw/raw2:  bound to major 8, minor 22

/dev/raw/raw3:  bound to major 8, minor 39

/dev/raw/raw4:  bound to major 8, minor 40

/dev/raw/raw5:  bound to major 8, minor 41

/dev/raw/raw6:  bound to major 8, minor 42

/dev/raw/raw11: bound to major 8, minor 37

/dev/raw/raw21: bound to major 8, minor 38

[root@soul02 /]# ls -l /dev/raw/*

crw-r----- 1 root   oinstall 162,  1 Dec  4 05:04 /dev/raw/raw1

crw-r----- 1 root   oinstall 162, 11 Dec  4 05:39 /dev/raw/raw11

crw-r--r-- 1 oracle oinstall 162,  2 Dec  4 05:39 /dev/raw/raw2

crw-r--r-- 1 oracle oinstall 162, 21 Dec  4 05:39 /dev/raw/raw21

crw-rw---- 1 oracle oinstall 162,  3 Dec  4 05:39 /dev/raw/raw3

crw-rw---- 1 oracle oinstall 162,  4 Dec  4 05:39 /dev/raw/raw4

crw-rw---- 1 oracle oinstall 162,  5 Dec  4 05:39 /dev/raw/raw5

crw-rw---- 1 oracle oinstall 162,  6 Dec  4 05:39 /dev/raw/raw6

 

查看目前集群服务

 [oracle@soul01 dbs]$ crs_stat -t

Name           Type           Target    State     Host       

------------------------------------------------------------           

ora....01.lsnr application    ONLINE    ONLINE    soul01     

ora.soul01.gsd application    ONLINE    ONLINE    soul01     

ora.soul01.ons application    ONLINE    ONLINE    soul01     

ora.soul01.vip application    ONLINE    ONLINE    soul01     

ora....02.lsnr application    ONLINE    ONLINE    soul02     

ora.soul02.gsd application    ONLINE    ONLINE    soul02     

ora.soul02.ons application    ONLINE    ONLINE    soul02     

ora.soul02.vip application    ONLINE    ONLINE    soul02 

四、配置ASM、数据库实例并加入集群服务中

配置实例参数文件,根据源端参数文件,配置目标端参数文件(节点1和节点2

[oracle@soul01 dbs]$ cat init+ASM1.ora

spfile="/dev/raw/raw3"

[oracle@soul01 dbs]$ cat initxysoul1.ora

SPFILE='+DATA/xysoul/spfilexysoul.ora'

 

创建实例日志目录(两个节点分别执行)

[oracle@soul01 dbs]$ mkdir -p /oracle/admin/+ASM/{a,b,c,u}dump

[oracle@soul01 dbs]$ mkdir -p /oracle/admin/xysoul/{a,b,c,u}dump

 

生成ASM参数文件,修改日志目录

[oracle@soul01 dbs]$ export ORACLE_SID=+ASM1

[oracle@soul01 dbs]$ sqlplus / as sysdba

 

SQL*Plus: Release 10.2.0.5.0 - Production on Wed Dec 4 05:48:59 2013

 

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

 

Connected to an idle instance.

 

SQL> create pfile='/tmp/asm.ora' from spfile='/dev/raw/raw3';

 

File created.

 

 

启动ASM实例

[oracle@soul01 dbs]$ echo $ORACLE_SID  

+ASM1

[oracle@soul01 dbs]$ sqlplus / as sysdba

 

SQL*Plus: Release 10.2.0.5.0 - Production on Wed Dec 4 05:56:03 2013

 

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

 

Connected to an idle instance.

 

SQL> create spfile='/dev/raw/raw3' from pfile='/tmp/asm.ora';

 

File created.

 

SQL> startup

ASM instance started

 

Total System Global Area  130023424 bytes

Fixed Size                  2094544 bytes

Variable Size             102763056 bytes

ASM Cache                  25165824 bytes

ASM diskgroups mounted

SQL> select status,instance_name from v$instance;

 

STATUS       INSTANCE_NAME

------------ ----------------

STARTED      +ASM1

 

SQL>

 

查看ASM实例及磁盘等信息

 

SQL> show parameter pfile

 

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

spfile                               string      /dev/raw/raw3

SQL> set lines 999

SQL> col path for a20

SQL>  select group_number,disk_number,path from v$asm_disk;

 

GROUP_NUMBER DISK_NUMBER PATH

------------ ----------- --------------------

           0           0 /dev/raw/raw21

           0           1 /dev/raw/raw3

           0           5 /dev/raw/raw2

           1           1 /dev/raw/raw5

           1           2 /dev/raw/raw6

           1           0 /dev/raw/raw4

 

6 rows selected.

 

SQL> select GROUP_NUMBER,NAME from v$asm_diskgroup;

 

GROUP_NUMBER NAME

------------ ------------------------------

           1 DATA

 

生成数据库实例初始参数文件

[oracle@soul01 dbs]$ echo $ORACLE_SID

xysoul1

[oracle@soul01 dbs]$ sqlplus / as sysdba

 

SQL*Plus: Release 10.2.0.5.0 - Production on Wed Dec 4 06:02:13 2013

 

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

 

Connected to an idle instance.

 

SQL> create pfile='/tmp/xysoul.ora' from spfile='+DATA/xysoul/spfilexysoul.ora';

 

File created.

 

 

修改参数文件(目录路径),并生成SPFILE

[oracle@soul01 dbs]$ sqlplus / as sysdba

 

SQL*Plus: Release 10.2.0.5.0 - Production on Wed Dec 4 06:04:48 2013

 

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

 

Connected to an idle instance.

 

SQL> create spfile='+DATA/xysoul/spfilexysoul.ora' from pfile='/tmp/xysoul.ora';

 

File created.

 

启动数据库实例

[oracle@soul01 dbs]$ sqlplus / as sysdba

 

SQL*Plus: Release 10.2.0.5.0 - Production on Wed Dec 4 06:08:46 2013

 

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

 

Connected to an idle instance.

 

SQL> startup

ORACLE instance started.

 

Total System Global Area  369098752 bytes

Fixed Size                  2096344 bytes

Variable Size             155190056 bytes

Database Buffers          205520896 bytes

Redo Buffers                6291456 bytes

Database mounted.

Database opened.

SQL> show parameter spfile

 

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

spfile                               string      +DATA/xysoul/spfilexysoul.ora

SQL> select status,instance_name from v$instance;

 

STATUS       INSTANCE_NAME

------------ ----------------

OPEN         xysoul1

 

 

[oracle@soul01 dbs]$ crs_stat –t

Name           Type           Target    State     Host       

------------------------------------------------------------

ora....01.lsnr application    ONLINE    ONLINE    soul01     

ora.soul01.gsd application    ONLINE    ONLINE    soul01     

ora.soul01.ons application    ONLINE    ONLINE    soul01     

ora.soul01.vip application    ONLINE    ONLINE    soul01     

ora....02.lsnr application    ONLINE    ONLINE    soul02     

ora.soul02.gsd application    ONLINE    ONLINE    soul02     

ora.soul02.ons application    ONLINE    ONLINE    soul02     

ora.soul02.vip application    ONLINE    ONLINE    soul02

 

ASM实例添加到集群服务中

[oracle@soul01 dbs]$ srvctl add asm -n soul01 -i +ASM1 -o /oracle/db_1

[oracle@soul01 dbs]$ srvctl add asm -n soul02 -i +ASM2 -o /oracle/db_1

[oracle@soul01 dbs]$ crs_stat -t

Name           Type           Target    State     Host       

------------------------------------------------------------

ora....SM1.asm application    OFFLINE   OFFLINE              

ora....01.lsnr application    ONLINE    ONLINE    soul01     

ora.soul01.gsd application    ONLINE    ONLINE    soul01     

ora.soul01.ons application    ONLINE    ONLINE    soul01     

ora.soul01.vip application    ONLINE    ONLINE    soul01     

ora....SM2.asm application    OFFLINE   OFFLINE              

ora....02.lsnr application    ONLINE    ONLINE    soul02     

ora.soul02.gsd application    ONLINE    ONLINE    soul02     

ora.soul02.ons application    ONLINE    ONLINE    soul02     

ora.soul02.vip application    ONLINE    ONLINE    soul02 

 

启动ASM实例

[oracle@soul01 dbs]$ srvctl enable asm -n soul01 -i +ASM1

[oracle@soul01 dbs]$ srvctl enable asm -n soul02 -i +ASM2

[oracle@soul01 dbs]$ crs_stop -all

[oracle@soul01 dbs]$ crs_start -all

[oracle@soul01 dbs]$ crs_stat -t

Name           Type           Target    State     Host       

------------------------------------------------------------

ora....SM1.asm application    ONLINE    ONLINE    soul01     

ora....01.lsnr application    ONLINE    ONLINE    soul01     

ora.soul01.gsd application    ONLINE    ONLINE    soul01     

ora.soul01.ons application    ONLINE    ONLINE    soul01     

ora.soul01.vip application    ONLINE    ONLINE    soul01     

ora....SM2.asm application    ONLINE    ONLINE    soul02     

ora....02.lsnr application    ONLINE    ONLINE    soul02     

ora.soul02.gsd application    ONLINE    ONLINE    soul02     

ora.soul02.ons application    ONLINE    ONLINE    soul02     

ora.soul02.vip application    ONLINE    ONLINE    soul02

 

将数据库添加到集群服务中

[oracle@soul01 dbs]$ srvctl add database -d xysoul -o /oracle/db_1

[oracle@soul01 dbs]$ srvctl add instance -d xysoul -i xysoul1 -n soul01

[oracle@soul01 dbs]$ srvctl add instance -d xysoul -i xysoul2 -n soul02

[oracle@soul01 dbs]$ srvctl modify instance -d xysoul -i xysoul1 -s +ASM1

[oracle@soul01 dbs]$ srvctl modify instance -d xysoul -i xysoul2 -s +ASM2

[oracle@soul01 dbs]$ crs_stat -t

Name           Type           Target    State     Host       

------------------------------------------------------------

ora....SM1.asm application    ONLINE    ONLINE    soul01     

ora....01.lsnr application    ONLINE    ONLINE    soul01     

ora.soul01.gsd application    ONLINE    ONLINE    soul01     

ora.soul01.ons application    ONLINE    ONLINE    soul01     

ora.soul01.vip application    ONLINE    ONLINE    soul01     

ora....SM2.asm application    ONLINE    ONLINE    soul02     

ora....02.lsnr application    ONLINE    ONLINE    soul02     

ora.soul02.gsd application    ONLINE    ONLINE    soul02     

ora.soul02.ons application    ONLINE    ONLINE    soul02     

ora.soul02.vip application    ONLINE    ONLINE    soul02     

ora.xysoul.db  application    OFFLINE   OFFLINE              

ora....l1.inst application    OFFLINE   OFFLINE              

ora....l2.inst application    OFFLINE   OFFLINE  

 

启动数据库实例

[oracle@soul01 dbs]$ crs_stop -all
[oracle@soul01 dbs]$ crs_start -all
[oracle@soul01 dbs]$ crs_stat -t

Name           Type           Target    State     Host       

------------------------------------------------------------

ora....SM1.asm application    ONLINE    ONLINE    soul01     

ora....01.lsnr application    ONLINE    ONLINE    soul01     

ora.soul01.gsd application    ONLINE    ONLINE    soul01     

ora.soul01.ons application    ONLINE    ONLINE    soul01     

ora.soul01.vip application    ONLINE    ONLINE    soul01     

ora....SM2.asm application    ONLINE    ONLINE    soul02     

ora....02.lsnr application    ONLINE    ONLINE    soul02     

ora.soul02.gsd application    ONLINE    ONLINE    soul02     

ora.soul02.ons application    ONLINE    ONLINE    soul02     

ora.soul02.vip application    ONLINE    ONLINE    soul02     

ora.xysoul.db  application    ONLINE    ONLINE    soul01     

ora....l1.inst application    ONLINE    ONLINE    soul01     

ora....l2.inst application    ONLINE    ONLINE    soul02     

 

 

Service 服务,可通过dbca方式,service Management 配置,配置完成后该服务自动加入到集群服务中。

[oracle@soul01 dbs]$ crs_stat -t

Name           Type           Target    State     Host       

------------------------------------------------------------

ora....SM1.asm application    ONLINE    ONLINE    soul01     

ora....01.lsnr application    ONLINE    ONLINE    soul01     

ora.soul01.gsd application    ONLINE    ONLINE    soul01     

ora.soul01.ons application    ONLINE    ONLINE    soul01     

ora.soul01.vip application    ONLINE    ONLINE    soul01     

ora....SM2.asm application    ONLINE    ONLINE    soul02     

ora....02.lsnr application    ONLINE    ONLINE    soul02     

ora.soul02.gsd application    ONLINE    ONLINE    soul02     

ora.soul02.ons application    ONLINE    ONLINE    soul02     

ora.soul02.vip application    ONLINE    ONLINE    soul02     

ora.xysoul.db  application    ONLINE    ONLINE    soul01     

ora....acdb.cs application    ONLINE    ONLINE    soul02     

ora....ul1.srv application    ONLINE    ONLINE    soul01     

ora....ul2.srv application    ONLINE    ONLINE    soul02     

ora....l1.inst application    ONLINE    ONLINE    soul01     

ora....l2.inst application    ONLINE    ONLINE    soul02     

 

 

五、替换ocrvoting盘(此步骤可在集群启动后替换,本文先确认数据库是否可正常启动,再做替换工作)
替换voting

[root@soul01 bin]# ./crsctl add css votedisk /dev/raw/raw21 -force

Now formatting voting disk: /dev/raw/raw21

successful addition of votedisk /dev/raw/raw21.

[root@soul01 bin]#  ./crsctl query css votedisk

 0.     0    /dev/raw/raw2

 1.     0    /dev/raw/raw21

[root@soul01 bin]# ./crsctl delete css votedisk /dev/raw/raw2 -force

successful deletion of votedisk /dev/raw/raw2.

[root@soul01 bin]# ./crsctl query css votedisk

 0.     0    /dev/raw/raw21

 

located 1 votedisk(s).

[root@soul01 bin]#

 

替换OCR

 

[root@soul01 bin]# ./ocrconfig -replace ocrmirror /dev/raw/raw11

[root@soul01 bin]# cat /etc/oracle/ocr.loc

#Device/file  getting replaced by device /dev/raw/raw11

ocrconfig_loc=/dev/raw/raw1

ocrmirrorconfig_loc=/dev/raw/raw11

local_only=false[root@soul01 bin]# ./ocrconfig -replace ocr

[root@soul01 bin]# cat /etc/oracle/ocr.loc

#Device/file /dev/raw/raw1 being deleted

ocrconfig_loc=/dev/raw/raw11

local_only=false[root@soul01 bin]#

 

六、修改主机及虚拟IP地址
停止集群服务、修改监听配置(修改public IP)及hosts文件(修改public IPVIP)。
查看确认集群IP地址设置是否正确

[root@soul02 bin]# ./oifcfg iflist

eth0  192.168.8.0

eth1  10.0.0.0

[root@soul02 bin]# ./oifcfg getif

eth0  192.168.8.0  global  public

eth1  10.0.0.0  global  cluster_interconnect

 

[root@soul02 bin]# ./srvctl modify nodeapps -n soul01 -A 192.168.8.43/255.255.255.0/eth0

[root@soul02 bin]# ./srvctl modify nodeapps -n soul02 -A 192.168.8.44/255.255.255.0/eth0

 

确认IP地址信息

root@soul02 bin]# ifconfig

eth0      Link encap:Ethernet  HWaddr 00:0C:29:43:F3:5B 

          inet addr:192.168.8.42  Bcast:192.168.8.255  Mask:255.255.255.0

          inet6 addr: fe80::20c:29ff:fe43:f35b/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:371317 errors:0 dropped:0 overruns:0 frame:0

          TX packets:271387 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:430410535 (410.4 MiB)  TX bytes:74996126 (71.5 MiB)

          Base address:0x2000 Memory:c9020000-c9040000

 

eth0:1    Link encap:Ethernet  HWaddr 00:0C:29:43:F3:5B 

          inet addr:192.168.8.44  Bcast:192.168.8.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          Base address:0x2000 Memory:c9020000-c9040000

 

IP修改完成后,启动集群。查看集群服务及测试连接(生成环境中,让业务人员做相关连接测试):

[oracle@soul01 admin]$ crs_stat –t

Name           Type           Target    State     Host       

------------------------------------------------------------

ora....SM1.asm application    ONLINE    ONLINE    soul01     

ora....01.lsnr application    ONLINE    ONLINE    soul01     

ora.soul01.gsd application    ONLINE    ONLINE    soul01     

ora.soul01.ons application    ONLINE    ONLINE    soul01     

ora.soul01.vip application    ONLINE    ONLINE    soul01     

ora....SM2.asm application    ONLINE    ONLINE    soul02     

ora....02.lsnr application    ONLINE    ONLINE    soul02     

ora.soul02.gsd application    ONLINE    ONLINE    soul02     

ora.soul02.ons application    ONLINE    ONLINE    soul02     

ora.soul02.vip application    ONLINE    ONLINE    soul02     

ora.xysoul.db  application    ONLINE    ONLINE    soul01     

ora....acdb.cs application    ONLINE    ONLINE    soul02     

ora....ul1.srv application    ONLINE    ONLINE    soul01     

ora....ul2.srv application    ONLINE    ONLINE    soul02     

ora....l1.inst application    ONLINE    ONLINE    soul01     

ora....l2.inst application    ONLINE    ONLINE    soul02

 

[oracle@soul01 admin]$ sqlplus sys/oracle@racdb as sysdba

 

SQL*Plus: Release 10.2.0.5.0 - Production on Wed Dec 4 20:48:15 2013

 

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

 

 

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production

With the Partitioning, Real Application Clusters, OLAP, Data Mining

and Real Application Testing options

 

SQL> exit

 

数据访问正常,至此RAC的迁移完成。后续,可根据新服务器性能及数据库情况调整系统、数据参数,使数据库系统达到最佳服务方式。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29487349/viewspace-1084913/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29487349/viewspace-1084913/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值