Redhat 5.4 Orcle RAC 数据库 从10.2.0.1升级到 10.2.0.4
?
?????? 之前安裝的是兩個(gè)節(jié)點(diǎn)的RAC 平臺(tái)。 數(shù)據(jù)庫(kù)版本是10.2.0.1. 這個(gè)實(shí)驗(yàn)的目的就是將這個(gè)數(shù)據(jù)庫(kù)版本從10.2.0.1 升級(jí)到 10.2.0.4. ?升級(jí)包可以從Oracle metalink上進(jìn)行下載,這個(gè)下載需要Oracle 付費(fèi)的帳號(hào)。 網(wǎng)絡(luò)可能也有資源下載。 10.2.0.4的patch number 是:p6810189。
?
?????? 兩個(gè)節(jié)點(diǎn)的RAC 安裝,參考Blog:
????????????? Redhat 5.4 + ASM + RAW+ Oracle 10g RAC 安裝文檔
????????????? http://blog.csdn.net/tianlesoftware/archive/2010/09/09/5872593.aspx
?
升級(jí)過(guò)程和單節(jié)點(diǎn)的升級(jí)差不多。 10g 單節(jié)點(diǎn)的升級(jí)參考Blog:
?????? Oracle 10g upgrade from 10.2.0.1 to 10.2.0.4
?????? http://blog.csdn.net/tianlesoftware/archive/2010/04/21/5507762.aspx
?
?
RAC 環(huán)境下的升級(jí)分三步。 這個(gè)在patch 包里的readme 文檔里有詳細(xì)的說(shuō)明。
?????? 1. 升級(jí)clusterware? -- > 升級(jí)包中安裝程序里選擇CRS_HOME后安裝
?????? 2. 升級(jí)數(shù)據(jù)庫(kù)軟件? -- >升級(jí)包中安裝程序里選擇ORACLE_HOME后安裝
?????? 3. 升級(jí)實(shí)例??? -- > 可以使用腳本 或者直接運(yùn)行DBUA 實(shí)現(xiàn), 如果用腳本,參考單節(jié)點(diǎn)的升級(jí)
?
?
RAC 的升級(jí)分滾動(dòng)升級(jí)升級(jí)和非滾動(dòng)升級(jí)。
?????? 滾動(dòng)升級(jí)就是每次升級(jí)一個(gè)節(jié)點(diǎn)。
?????? 非滾動(dòng)就是一次升級(jí)所有節(jié)點(diǎn)。
?
?這個(gè)patch包的readme文檔也有說(shuō)明。這次升級(jí)用的是非滾動(dòng)升級(jí)。 即一次性搞定所有節(jié)點(diǎn)。
?
注意:
?????? 如果是生產(chǎn)庫(kù),在升級(jí)之前做好備份。 備份數(shù)據(jù)庫(kù)(如:RMAN),備份ORA_CRS_HOME 目錄,備份ORACLE_HOME目錄。 雖然很少會(huì)出現(xiàn)問(wèn)題,但是如果出現(xiàn)問(wèn)題,誰(shuí)來(lái)為我們的錯(cuò)誤買單,所以作為一個(gè)DBA 要銘記于心的就是備份。
?
一.? 從客戶端查看現(xiàn)在的版本
?
1.1 修改tnsnames.Ora 文件,增加一下內(nèi)容:
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)
?(SERVICE_NAME=ORCL)
?(
?? FAILOVER_MODE=
? (TYPE=session)
? (METHOD=basic)
? (RETRIES=180)
? (DELAY=5)
?)
?
)
)
?
1.2 ?客戶端用sqlplus 連接數(shù)據(jù)庫(kù), 查看數(shù)據(jù)庫(kù)版本信息
?
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>
?
查看版本其實(shí)沒(méi)必要這么復(fù)雜,這里是額外的演示一下客戶端如何連接RAC.
?
?
二. 升級(jí)Clusterware 軟件
?
2.1 將升級(jí)包mout到linux系統(tǒng)
??? 用root用戶登陸系統(tǒng),執(zhí)行如下命令:
??? mount -o username=administrator,password=12345678 //10.85.10.80/Software /mnt
?
2.2 停止相關(guān)的進(jìn)程
?
??? 2.2.1每個(gè)節(jié)點(diǎn)分別停止?EM和?isqlplus
?????? [oracle@rac1 bin]$ emctl stop dbconsole
?????? [oracle@rac1 bin]$ isqlplusctl stop
?
??? 2.2.2 ?停止相關(guān)進(jìn)程
?????? 這個(gè)可以用srvctl 命令來(lái)一個(gè)一個(gè)進(jìn)行,也可以用crs_stop -all 進(jìn)行。
????
??? 這部分內(nèi)容參考Blog:
?????? Oracle RAC 啟動(dòng)與關(guān)閉
?? http://blog.csdn.net/tianlesoftware/archive/2010/03/05/5349003.aspx
?
[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 停止每個(gè)節(jié)點(diǎn)上的CRS
[root@rac1 ~]# /u01/app/oracle/product/crs/bin/crsctl stop crs
?
?
2.3 用Xmanger 工具運(yùn)行runInstaller
?
2.3.1 先在Xmanager 工具里面指定DISPLAY 變量
??? [oracle@rac1 ~]$ export DISPLAY=10.85.10.80:0.0
?
2.3.2 進(jìn)行升級(jí)包的目錄,運(yùn)行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
?????? -- 因?yàn)槲矣玫氖莚edhat 5,所以忽略了版本檢查
?
2.3.3 在可視化的安裝窗口選擇CRS_HOME??辞宄?#xff0c;不要選錯(cuò)了。然后一下步進(jìn)行安裝。
?
?
2.3.4 安裝結(jié)束會(huì)提示運(yùn)行2個(gè)腳本
?
???
??? 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 <nodenumber>: <nodename> <private interconnect name> <hostname>
node 2: rac1 rac1-priv rac1
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
clscfg -upgrade completed successfully
?
?
三. 升級(jí)數(shù)據(jù)庫(kù)軟件
??? 上升級(jí)clusterware的時(shí)候,升級(jí)結(jié)束的時(shí)候會(huì)啟動(dòng)CRS服務(wù)。 我們?cè)谏?jí)數(shù)據(jù)庫(kù)的時(shí)候需要關(guān)閉這些服務(wù)。
?
3.1 停止相關(guān)進(jìn)程
??? [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 工具運(yùn)行runInstaller
?
3.2.1 先在Xmanager 工具里面指定DISPLAY 變量
??? [oracle@rac1 ~]$ export DISPLAY=10.85.10.80:0.0
?
3.2.2 進(jìn)行升級(jí)包的目錄,運(yùn)行runInstaller
???
??? 在可視化的安裝窗口選擇ORACLE_HOME。看清楚,不要選錯(cuò)了。然后一下步進(jìn)行安裝。
?
?
3.2.3? 安裝結(jié)束會(huì)提示用root用戶在所有節(jié)點(diǎn)上運(yùn)行一個(gè)腳本
??? /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.
?
?
四. 升級(jí)實(shí)例
?
升級(jí)實(shí)例有兩種方法:
??? 1. DBUA
??? 2. 手動(dòng)執(zhí)行腳本
?
4.1 用腳本升級(jí)
?
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. |
?
$ srvctl start listener -n node
?? $ sqlplus /nolog
?? SQL> CONNECT SYS AS SYSDBA
?? Enter password: SYS_password
?? SQL> STARTUP NOMOUNT
?? SQL> ALTER SYSTEM SET CLUSTER_DATABASE=FALSE SCOPE=spfile;
?? SQL> SHUTDOWN
SQL> STARTUP UPGRADE
SQL> SPOOL patch.log
SQL> @?/rdbms/admin/catupgrd.sql
SQL> SPOOL OFF
This list provides the version and status of each SERVER component in the database.
SQL> SHUTDOWN IMMEDIATE
SQL> STARTUP
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 |
?
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.
$ rman catalog username/password@alias
?SQL> ALTER SYSTEM SET CLUSTER_DATABASE=TRUE SCOPE=spfile;
SQL> SHUTDOWN
SQL> STARTUP
$ srvctl start service -d db_name -s service_name
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升級(jí)
??? 使用DBUA工具的話,會(huì)把升級(jí)的一些代碼封裝起來(lái),我們只需要在界面上點(diǎn)點(diǎn)就可以了。所以比較方便。在一個(gè)節(jié)點(diǎn)運(yùn)行DBUA即可。 會(huì)同時(shí)升級(jí)2個(gè)節(jié)點(diǎn)的實(shí)例。
?
4.2.1 啟動(dòng)相關(guān)的進(jìn)程
??? [oracle@rac1 bin]$ crs_start -all
?
?
4.2.2 運(yùn)行dbua?
?
[oracle@rac1 ~]$ export DISPLAY=192.168.1.111:0.0
[oracle@rac1 ~]$ dbua
?
說(shuō)明:
?????? (1)啟動(dòng)dbua工具后,會(huì)提示選擇升級(jí)ASM還是數(shù)據(jù)庫(kù),這里是從10.2.0.1的基礎(chǔ)上升級(jí),不需要升級(jí)ASM,直接跳過(guò),如低于此版本而是必須先升級(jí)ASM。
??? (2)運(yùn)行過(guò)程中有選項(xiàng)是否編譯無(wú)效的對(duì)象。默認(rèn)勾上。在升級(jí)之后會(huì)自己編譯無(wú)效對(duì)象。
??? (3)運(yùn)行需要一個(gè)小時(shí)左右。
???
?安裝結(jié)束后會(huì)提示安裝日志存放目錄:
??? /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/dbua/orcl/upgrade/
?
?
?
五. 驗(yàn)證
??? 我們還是從客戶端來(lái)驗(yàn)證,監(jiān)聽(tīng)之前已經(jīng)配好了。
?
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行。
?
?
順便驗(yàn)證一下RAC的性能,我們看到現(xiàn)在連的是oracl2. 我們上服務(wù)器,把這個(gè)實(shí)例停掉。在查看連哪個(gè)實(shí)例。
?
[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>
?
我們?cè)诳蛻舳嗽诓樵円幌驴纯?#xff1a;
SQL> select instance_name from V$instance;
?
INSTANCE_NAME
--------------------------------
orcl1
?
注意:這里自動(dòng)切換到了orcl1 實(shí)例。 這個(gè)就體現(xiàn)RAC的價(jià)值,當(dāng)一個(gè)實(shí)例宕掉后,不會(huì)影響系統(tǒng)的運(yùn)行。
?
至此,RAC的升級(jí)結(jié)束。
?
?
?
?
------------------------------------------------------------------------------
Blog: http://blog.csdn.net/tianlesoftware
網(wǎng)上資源: http://tianlesoftware.download.csdn.net
相關(guān)視頻:http://blog.csdn.net/tianlesoftware/archive/2009/11/27/4886500.aspx
DBA1 群:62697716(滿); DBA2 群:62697977(滿)
DBA3 群:63306533;???? 聊天 群:40132017
--加群需要在備注說(shuō)明SGA的組成部分,否則拒絕申請(qǐng)
轉(zhuǎn)載于:https://www.cnblogs.com/hibernate315/archive/2010/09/16/2399192.html
總結(jié)
以上是生活随笔為你收集整理的Redhat 5.4 Orcle RAC 数据库 从10.2.0.1升级到 10.2.0.4的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: ASP.NET使用母版页后动态加载JS/
- 下一篇: 有人喜欢爱情测试小游戏么