Solaris裸裝置安裝三節點RAC102(五)

yangtingkun發表於2011-01-30

利用裸裝置安裝Solaris上的三節點Oracle 10.2 RAC

這一篇主要介紹RAC環境下安裝10204的補丁。

Solaris裸裝置安裝三節點RAC102(一):http://yangtingkun.itpub.net/post/468/512772

Solaris裸裝置安裝三節點RAC102(二):http://yangtingkun.itpub.net/post/468/512835

Solaris裸裝置安裝三節點RAC102(三):http://yangtingkun.itpub.net/post/468/512883

Solaris裸裝置安裝三節點RAC102(四):http://yangtingkun.itpub.net/post/468/512919

 

 

解壓下載的補丁包p6810189_10204_SOLARIS64.zip到指定的目錄,並將其解壓縮。

在安裝補丁之前,首先要關閉所有Oracle的服務。包括資料庫、監聽、ASM服務、Clusterware服務等。

首先檢查資料庫狀態:

bash-2.03$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on 星期五 5 14 14:46:27 2010

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


連線到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options

SQL> set pages 100 lines 120
SQL> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
PL/SQL Release 10.2.0.1.0 - Production
CORE    10.2.0.1.0      Production
TNS for Solaris: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production

SQL> select instance_name, status     
  2  from v$instance;

INSTANCE_NAME    STATUS
---------------- ------------
testrac1         OPEN

SQL> select instance_number, instance_name, status
  2  from gv$instance;

INSTANCE_NUMBER INSTANCE_NAME    STATUS
--------------- ---------------- ------------
              1 testrac1         OPEN
              3 testrac3         OPEN
              2 testrac2         OPEN

下面準備安裝補丁,為了方便選擇非ROLLING方式安裝。另外,對於Oracle10.2.0.4的補丁集,要求CLUSTERWARE的版本必須高於或等於資料庫的版本。因此必須先對CLUSTERWARE進行升級,否則無法升級資料庫。

確保isqlplus服務和資料管理器都已經關閉。

透過srvctl命令來關閉資料庫和監聽:

bash-2.03$ srvctl stop db -d testrac
bash-2.03$ srvctl stop listener -n racnode1
bash-2.03$ srvctl stop listener -n racnode2
bash-2.03$ srvctl stop listener -n racnode3

在所有的節點上切換為root使用者執行下列操作,關閉Cluster相關程式:

bash-2.03$ su -
Password:
Sun Microsystems Inc.   SunOS 5.8       Generic Patch   October 2001
You have new mail.
# /data/oracle/product/10.2/crs/bin/crsctl stop crs
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.

利用ps –ef來檢查,是否所有的Oracle相關程式都已經關閉。確認後,可以開始安裝。

Oracle推薦在安裝之前對系統進行備份。這個備份指定是Oracle軟體。

下面進入圖形介面開始補丁的安裝。

# xhost +
access control disabled, clients can connect from any host
# su - oracle
Sun Microsystems Inc.   SunOS 5.8       Generic Patch   October 2001
$ cd /data/patch/Disk1
$ ./runInstaller

點選next,首先需要升級CLUSTERWARE,因此目錄選擇OraCrs10g_home1目錄。

下面是Cluster InstallationLocal Installation的選擇,由於只裝了RAC環境,這裡Oracle自動選擇了Cluster,並且無法修改。點選next

出現彙總頁面,點選Install開始安裝。

安裝完成後,使用root使用者執行CRS_HOME/install/root102.sh

# /data/oracle/product/10.2/crs/install/root102.sh
Creating pre-patch directory for saving pre-patch clusterware files
Completed patching clusterware files to /data/oracle/product/10.2/crs
Relinking some shared libraries.
ar: writing /data/oracle/product/10.2/crs/lib/libn10.a
ar: writing /data/oracle/product/10.2/crs/lib32/libn10.a
ar: writing /data/oracle/product/10.2/crs/lib/libn10.a
Relinking of patched files is complete.
WARNING: directory '/data/oracle/product/10.2' is not owned by root
WARNING: directory '/data/oracle/product' is not owned by root
WARNING: directory '/data/oracle' is not owned by root
Preparing to recopy patched init and RC scripts.
Recopying init and RC scripts.
Startup will be queued to init within 30 seconds.
Starting up the CRS daemons.
Waiting for the patched CRS daemons to start.
  This may take a while on some systems.
.
10204 patch successfully applied.
clscfg: EXISTING configuration version 3 detected.
clscfg: version 3 is 10G Release 2.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node :
node 1: racnode1 racnode1-priv racnode1
Creating OCR keys for user 'root', privgrp 'other'..
Operation successful.
clscfg -upgrade completed successfully

在另外的兩個節點上重複剛才的CLUSTERWARE補丁的安裝操作。

需要注意,由於執行了前面的root102.sh,使得資料庫重新啟動,因此需要在安裝之前再次關閉資料庫和監聽:

bash-2.03$ srvctl stop db -d testrac
bash-2.03$ srvctl stop listener -n racnode1
bash-2.03$ srvctl stop listener -n racnode2
bash-2.03$ srvctl stop listener -n racnode3

再次執行runInstaller,這次選擇對資料庫軟體進行升級,因此選擇OraDb10g_home1目錄。

仍然是Cluster InstallationLocal Installation的選擇,這裡仍然沒有辦法修改,點選繼續,出現彙總頁面,點選Install開始資料庫補丁的安裝。

安裝完成,需要在三個節點分別以root身份執行root.sh

# /data/oracle/product/10.2/database/root.sh
Running Oracle10 root.sh script...

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /data/oracle/product/10.2/database

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin.  Overwrite it? (y/n) [n]: y
   Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n) [n]: y
   Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n) [n]: y
   Copying coraenv to /usr/local/bin ...

Entries will be added to the /var/opt/oracle/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.

執行完指令碼,點選ok,點選Exit完成patch的安裝。

下面可以透過手工執行指令碼的方式,也可以選擇DBUA來進行資料庫的升級。

以前類似的情況都是使用手工方式,手工升級需要修改cluster_database引數,然後單節點啟動,執行catupgrd.sql後,再將引數修改回來。這裡選擇DBUA進行升級。在圖形介面直接執行dbua

bash-2.03$ dbua

首先確認升級的資料庫TESTRAC,並輸入SYS使用者的密碼。

DBUA會自動收集要升級的資料庫的相關資訊,隨後選擇升級後編譯失敗物件的並行度。

如果沒有備份過資料庫可以在隨後的介面中選擇備份的路徑。

選擇是否設定閃回區,這裡不設定閃回。

最後出現彙總資訊,確認後開始升級過程。

檢查一下V$VERSION檢視:

bash-2.03$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on 星期五 5 14 19:39:47 2010

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


連線到:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

SQL> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE    10.2.0.4.0      Production
TNS for Solaris: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production

SQL> select instance_name, status
  2  from gv$instance;

INSTANCE_NAME    STATUS
---------------- ------------
testrac1         OPEN
testrac3         OPEN
testrac2         OPEN

至此,10.2.0.4的補丁已經安裝成功。

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/4227/viewspace-686539/,如需轉載,請註明出處,否則將追究法律責任。

相關文章