【RAC】RAC_for_linux遷移之更換主機裝置

ddlovefish發表於2014-02-24

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/29306197/viewspace-1086954/,如需轉載,請註明出處,否則將追究法律責任。

相關文章