Redhat 5.4 Orcle RAC 資料庫 從10.2.0.1升級到 10.2.0.4
之前安裝的是兩個節點的RAC 平臺。 資料庫版本是10.2.0.1. 這個實驗的目的就是將這個資料庫版本從10.2.0.1 升級到 10.2.0.4. 升級包可以從Oracle metalink上進行下載,這個下載需要Oracle 付費的帳號。 網路可能也有資源下載。 10.2.0.4的patch number 是:p6810189。
兩個節點的RAC 安裝,參考Blog:
Redhat 5.4 + ASM + RAW+ Oracle 10g RAC 安裝文件
http://space.itpub.net/?uid-15880878-action-viewspace-itemid-723010
升級過程和單節點的升級差不多。 10g 單節點的升級參考Blog:
Oracle 10g upgrade from 10.2.0.1 to 10.2.0.4
http://space.itpub.net/?uid-15880878-action-viewspace-itemid-723011
RAC 環境下的升級分三步。 這個在patch 包裡的readme 文件裡有詳細的說明。
1. 升級clusterware -- > 升級包中安裝程式裡選擇CRS_HOME後安裝
2. 升級資料庫軟體 -- >升級包中安裝程式裡選擇ORACLE_HOME後安裝
3. 升級例項 -- > 可以使用指令碼 或者直接執行DBUA 實現, 如果用指令碼,參考單節點的升級
RAC 的升級分滾動升級升級和非滾動升級。
滾動升級就是每次升級一個節點。
非滾動就是一次升級所有節點。
這個patch包的readme文件也有說明。這次升級用的是非滾動升級。 即一次性搞定所有節點。
注意:
如果是生產庫,在升級之前做好備份。 備份資料庫(如:RMAN),備份ORA_CRS_HOME 目錄,備份ORACLE_HOME目錄。 雖然很少會出現問題,但是如果出現問題,誰來為我們的錯誤買單,所以作為一個DBA 要銘記於心的就是備份。
一. 從客戶端檢視現在的版本
1.1 修改tnsnames.Ora 檔案,增加一下內容:
RAC =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 110.853.10.1)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.85.10.2)(PORT = 1521))
(LOAD_BALANCE=YES)
(
CONNECT_DATA=
(SERVER=DEDICATED)
(
FAILOVER_MODE=
(TYPE=session)
(METHOD=basic)
(RETRIES=180)
(DELAY=5)
)
)
)
1.2 客戶端用sqlplus 連線資料庫, 檢視資料庫版本資訊
C:/Users/Administrator.DavidDai>sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on 星期三 9月 15 16:32:47 2010
Copyright (c) 1982, 2010, Oracle. All rights reserved.
SQL> conn sys/oracle@rac as sysdba;
已連線。
SQL> select instance_name from V$instance;
INSTANCE_NAME
--------------------------------
orcl2
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SQL>
檢視版本其實沒必要這麼複雜,這裡是額外的演示一下客戶端如何連線RAC.
二. 升級Clusterware 軟體
2.1 將升級包mout到linux系統
用root使用者登陸系統,執行如下命令:
mount -o username=administrator,password=12345678 //10.85.10.80/Software /mnt
2.2 停止相關的程式
2.2.1每個節點分別停止 EM和 isqlplus
[oracle@rac1 bin]$ emctl stop dbconsole
[oracle@rac1 bin]$ isqlplusctl stop
2.2.2 停止相關程式
這個可以用srvctl 命令來一個一個進行,也可以用crs_stop -all 進行。
這部分內容參考Blog:
Oracle RAC 啟動與關閉
http://space.itpub.net/?uid-15880878-action-viewspace-itemid-723009
[oracle@rac1 bin]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.orcl.db application OFFLINE OFFLINE
ora....oltp.cs application OFFLINE OFFLINE
ora....cl1.srv application OFFLINE OFFLINE
ora....cl2.srv application OFFLINE OFFLINE
ora....l1.inst application OFFLINE OFFLINE
ora....l2.inst application OFFLINE OFFLINE
ora....SM2.asm application OFFLINE OFFLINE
ora....C1.lsnr application OFFLINE OFFLINE
ora.rac1.gsd application OFFLINE OFFLINE
ora.rac1.ons application OFFLINE OFFLINE
ora.rac1.vip application OFFLINE OFFLINE
ora....SM1.asm application OFFLINE OFFLINE
ora....C2.lsnr application OFFLINE OFFLINE
ora.rac2.gsd application OFFLINE OFFLINE
ora.rac2.ons application OFFLINE OFFLINE
ora.rac2.vip application OFFLINE OFFLINE
2.2.3 停止每個節點上的CRS
[root@rac1 ~]# /u01/app/oracle/product/crs/bin/crsctl stop crs
2.3.1 先在Xmanager 工具裡面指定DISPLAY 變數
[oracle@rac1 ~]$ export DISPLAY=10.85.10.80:0.0
2.3.2 進行升級包的目錄,執行runInstaller
[oracle@rac1 p6810189_10204_Linux-x86]$ pwd
/mnt/OracleSoftware/p6810189_10204_Linux-x86
[oracle@rac1 p6810189_10204_Linux-x86]$ cd Disk1/
[oracle@rac1 Disk1]$ ls
10204_buglist.htm install patch_note.htm response runInstaller stage
[oracle@rac1 Disk1]$ ./runInstaller -ignoreSysPreReqs
-- 因為我用的是redhat 5,所以忽略了版本檢查
2.3.3 在視覺化的安裝視窗選擇CRS_HOME。看清楚,不要選錯了。然後一下步進行安裝。
2.3.4 安裝結束會提示執行2個指令碼
The installer has detected that your Cluster Ready Services (CRS) installation is shared amongst the following nodes:
rac1
rac2
Because of the shared nature of this installation, you cannot perform. a rolling upgrade of your CRS software.
To complete the installation of this patchset, you must perform. the following tasks:
1. On each node, do the following:
a. Log in as the root user.
b. As root, shutdown the CRS daemons on the node
using the following command:
/u01/app/oracle/product/crs/bin/crsctl stop crs
Repeat this step until the CRS daemons on all the nodes are shutdown.
2. After all the CRS daemons on all the nodes are shutdown,
run the shell script. located at:
/u01/app/oracle/product/crs/install/root102.sh
This script. will automatically start the CRS daemons on the
patched node upon completion.
3. Wait until the script. finishes and then proceed to the
next node and repeat step 2.
[root@rac1 ~]# /u01/app/oracle/product/crs/bin/crsctl stop crs
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
[root@rac1 ~]# /u01/app/oracle/product/crs/install/root102.sh
Creating pre-patch directory for saving pre-patch clusterware files
Completed patching clusterware files to /u01/app/oracle/product/crs
Relinking some shared libraries.
Relinking of patched files is complete.
WARNING: directory '/u01/app/oracle/product' is not owned by root
WARNING: directory '/u01/app/oracle' is not owned by root
WARNING: directory '/u01/app' is not owned by root
WARNING: directory '/u01' 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 2: rac1 rac1-priv rac1
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
clscfg -upgrade completed successfully
三. 升級資料庫軟體
上升級clusterware的時候,升級結束的時候會啟動CRS服務。 我們在升級資料庫的時候需要關閉這些服務。
3.1 停止相關程式
[oracle@rac1 bin]$ crs_stop -all
[oracle@rac1 bin]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.orcl.db application ONLINE OFFLINE
ora....oltp.cs application ONLINE OFFLINE
ora....cl1.srv application ONLINE OFFLINE
ora....cl2.srv application ONLINE OFFLINE
ora....l1.inst application OFFLINE OFFLINE
ora....l2.inst application OFFLINE OFFLINE
ora....SM2.asm application OFFLINE OFFLINE
ora....C1.lsnr application OFFLINE OFFLINE
ora.rac1.gsd application OFFLINE OFFLINE
ora.rac1.ons application OFFLINE OFFLINE
ora.rac1.vip application OFFLINE OFFLINE
ora....SM1.asm application OFFLINE OFFLINE
ora....C2.lsnr application OFFLINE OFFLINE
ora.rac2.gsd application OFFLINE OFFLINE
ora.rac2.ons application OFFLINE OFFLINE
ora.rac2.vip application OFFLINE OFFLINE
3.2 用Xmanger 工具執行runInstaller
3.2.1 先在Xmanager 工具裡面指定DISPLAY 變數
[oracle@rac1 ~]$ export DISPLAY=10.85.10.80:0.0
3.2.2 進行升級包的目錄,執行runInstaller
在視覺化的安裝視窗選擇ORACLE_HOME。看清楚,不要選錯了。然後一下步進行安裝。
3.2.3 安裝結束會提示用root使用者在所有節點上執行一個指令碼
/u01/app/oracle/product/10.2.0/db_1/root.sh
[root@rac1 ~]# /u01/app/oracle/product/10.2.0/db_1/root.sh
Running Oracle10 root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/10.2.0/db_1
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 /etc/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.
四. 升級例項
升級例項有兩種方法:
1. DBUA
2. 手動執行指令碼
4.1 用指令碼升級
After you install the patch set, you must perform. the following steps on every database associated with the upgraded Oracle home:
Note: If you do not run the catupgrd.sql script. as described in this section and you start up a database for normal operation, then ORA-01092: ORACLE instance terminated. Disconnection forced errors will occur and the error ORA-39700: database must be opened with UPGRADE option will be in the alert log. |
- Log in as the Oracle software owner user.
- For Oracle RAC installations, start listener on each node of the cluster as follows:
$ srvctl start listener -n node
- If you are using Automatic Storage Management, start the Automatic Storage Management instance.
- For Oracle RAC installations:
- Use SQL*Plus to log in to the database as the SYS user with SYSDBA privileges:
$ sqlplus /nolog
SQL> CONNECT SYS AS SYSDBA
Enter password: SYS_password
SQL> STARTUP NOMOUNT
-
- Set the CLUSTER_DATABASE initialization parameter to FALSE:
SQL> ALTER SYSTEM SET CLUSTER_DATABASE=FALSE SCOPE=spfile;
-
- Shut down the database:
SQL> SHUTDOWN
- Enter the following SQL*Plus commands:
SQL> STARTUP UPGRADE
SQL> SPOOL patch.log
SQL> @?/rdbms/admin/catupgrd.sql
SQL> SPOOL OFF
- Review the patch.log file for errors and inspect the list of components that is displayed at the end of catupgrd.sql script.
This list provides the version and status of each SERVER component in the database.
- If necessary, rerun the catupgrd.sql script. after correcting any problems.
- Restart the database:
SQL> SHUTDOWN IMMEDIATE
SQL> STARTUP
- Run the utlrp.sql script. to recompile all invalid PL/SQL packages now instead of when the packages are accessed for the first time. This step is optional but recommended.
SQL> @?/rdbms/admin/utlrp.sql
Note: When the 10.2.0.4 patch set is applied to an Oracle Database 10g Standard Edition database, there may be 54 invalid objects after the utlrp.sql script. runs. These objects belong to the unsupported components and do not affect the database operation. Ignore any messages indicating that the database contains invalid recycle bin objects similar to the following: BIN$4lzljWIt9gfgMFeM2hVSoA==$0 |
- Run the following command to check the status of all the components after the upgrade:
SQL> select comp_name, version, status from sys.dba_registry;
In the output of the preceding command, the status of all the components should be VALID for a successful upgrade.
- If you are using the Oracle Recovery Manager catalog, enter the following command:
$ rman catalog username/password@alias
- For Oracle RAC installations:
- Set the CLUSTER_DATABASE initialization parameter to TRUE:
SQL> ALTER SYSTEM SET CLUSTER_DATABASE=TRUE SCOPE=spfile;
-
- Restart the database:
SQL> SHUTDOWN
SQL> STARTUP
-
- Start any database services that you want to use:
$ srvctl start service -d db_name -s service_name
- To configure and secure Enterprise Manager follow these steps:
Ensure the database and Listener are operational.
-
- In the case of a single instance, execute
emca -upgrade db
-
- In the case of Oracle Real Application Clusters (RAC), execute
emca -upgrade db -cluster
4.2 用DBUA升級
使用DBUA工具的話,會把升級的一些程式碼封裝起來,我們只需要在介面上點點就可以了。所以比較方便。在一個節點執行DBUA即可。 會同時升級2個節點的例項。
4.2.1 啟動相關的程式
[oracle@rac1 bin]$ crs_start -all
4.2.2 執行dbua
[oracle@rac1 ~]$ export DISPLAY=192.168.1.111:0.0
[oracle@rac1 ~]$ dbua
說明:
(1)啟動dbua工具後,會提示選擇升級ASM還是資料庫,這裡是從10.2.0.1的基礎上升級,不需要升級ASM,直接跳過,如低於此版本而是必須先升級ASM。
(2)執行過程中有選項是否編譯無效的物件。預設勾上。在升級之後會自己編譯無效物件。
(3)執行需要一個小時左右。
安裝結束後會提示安裝日誌存放目錄:
/u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/dbua/orcl/upgrade/
五. 驗證
我們還是從客戶端來驗證,監聽之前已經配好了。
C:/Users/Administrator.DavidDai>sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on 星期四 9月 16 12:18:32 2010
Copyright (c) 1982, 2010, Oracle. All rights reserved.
SQL> conn sys/oracle@rac as sysdba;
已連線。
SQL> select instance_name from V$instance;
INSTANCE_NAME
--------------------------------
orcl2
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for Linux: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
SQL> select comp_name, version, status from sys.dba_registry;
COMP_NAME VERSION STATUS
-------------------------------------------------- -------------------- --------
Oracle Enterprise Manager 10.2.0.4.0 VALID
Spatial 10.2.0.4.0 VALID
Oracle interMedia 10.2.0.4.0 VALID
OLAP Catalog 10.2.0.4.0 VALID
Oracle XML Database 10.2.0.4.0 VALID
Oracle Text 10.2.0.4.0 VALID
Oracle Expression Filter 10.2.0.4.0 VALID
Oracle Rule Manager 10.2.0.4.0 VALID
Oracle Workspace Manager 10.2.0.4.3 VALID
Oracle Data Mining 10.2.0.4.0 VALID
Oracle Database Catalog Views 10.2.0.4.0 VALID
COMP_NAME VERSION STATUS
-------------------------------------------------- -------------------- --------
Oracle Database Packages and Types 10.2.0.4.0 VALID
JServer JAVA Virtual Machine 10.2.0.4.0 VALID
Oracle XDK 10.2.0.4.0 VALID
Oracle Database Java Packages 10.2.0.4.0 VALID
OLAP Analytic Workspace 10.2.0.4.0 VALID
Oracle OLAP API 10.2.0.4.0 VALID
Oracle Real Application Clusters 10.2.0.4.0 VALID
已選擇18行。
順便驗證一下RAC的效能,我們看到現在連的是oracl2. 我們上伺服器,把這個例項停掉。在檢視連哪個例項。
[oracle@rac1 upgrade]$ export ORACLE_SID=orcl2
[oracle@rac1 upgrade]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.4.0 - Production on Thu Sep 16 00:48:47 2010
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
SQL> conn / as sysdba;
Connected.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
我們在客戶端在查詢一下看看:
SQL> select instance_name from V$instance;
INSTANCE_NAME
--------------------------------
orcl1
注意:這裡自動切換到了orcl1 例項。 這個就體現RAC的價值,當一個例項宕掉後,不會影響系統的執行。
至此,RAC的升級結束。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15880878/viewspace-723012/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle rac 10.2.0.1 升級到 oracle 10.2.0.4Oracle
- Oracle 10g rac升級(10.2.0.1 Rac到10.2.0.4)Oracle 10g
- Oracle RAC ASM 例項 從10.2.0.1 升級到 10.2.0.4 說明OracleASM
- oracle 10.2.0.1 rac 升級到10.2.0.4 rac時,dbua升級的元件列表Oracle元件
- Oracle10g RAC : 10.2.0.1 升級到 10.2.0.4Oracle
- windows 下oracle從10.2.0.1升級到10.2.0.4WindowsOracle
- Oracle 10.2.0.1 升級到 10.2.0.4Oracle
- linux下oracle RAC10.2.0.1升級到10.2.0.4LinuxOracle
- Oracle10g RAC 資料庫升級為10.2.0.4 ,clusterware需要升級到10.2.0.4 ?Oracle資料庫
- oracle 資料庫從10.2.0.4升級到11.2.0.3Oracle資料庫
- (轉)Oracle 10.2.0.1 升級到 10.2.0.4Oracle
- Oracle RAC 10.2.0.1 升級 10.2.0.4 簡單描述Oracle
- linux平臺下oracle從10.2.0.1升級到10.2.0.4LinuxOracle
- 10g資料庫從10.2.0.4升級到10.2.0.5資料庫
- Oracle 10.2.0.1 升級到 10.2.0.4--轉載Oracle
- oracle在linux平臺從10.2.0.1升級到10.2.0.4方法OracleLinux
- oracle 10 rac 升級 10.2.0.1升級到10.2.0.5Oracle
- oracle 之 安裝10.2.0.1 且 升級到 10.2.0.4Oracle
- aix 6.1上rac升級到10.2.0.4AI
- RAC資料庫升級到10.2.0.5資料庫
- windows 2003,oracle 10.2.0.1升級到10.2.0.4WindowsOracle
- rac 升級crs 升級資料庫軟體,升級資料庫資料庫
- oracle 10.2.0.4 rac 升級到oracle 10.2.0.5 rac步驟Oracle
- Oracle database 升級(文件)to 10.2.0.4 from 10.2.0.1OracleDatabase
- Oracle10.2.0.1 升級到Oracle10.2.0.4 簡單步驟Oracle
- RAC 資料庫升級 10.2.0.1.0 到 10.2.0.2.0 之升級catalog資料庫
- linux 上 10g rac 升級到10.2.0.4Linux
- 靜默升級oracle(文件)to 10.2.0.4 from 10.2.0.1Oracle
- Oracle10.2.0.1升級到10.2.0.4碰到的Text file busy問題Oracle
- oracle從10.2.0.4升級到11.2.0.1的三種升級方法Oracle
- Oracle 資料庫 升級為 RACOracle資料庫
- 從10.2.0.1升級到10.2.0.5操作實驗(下)
- 從10.2.0.1升級到10.2.0.5操作實驗(上)
- 靜默升級oracle到10.2.0.4Oracle
- oracle 10.2.0.2升級到10.2.0.4Oracle
- Oracle10.2.0.1到10.2.0.4升級出現了ORA-01092故障Oracle
- Linux下Oracle10.2.0.1升級到oracle10.2.0.4詳細操作記錄LinuxOracle
- Oracle資料庫從 9.2.0.1 到 9.2.0.8升級步驟 for winOracle資料庫