Oracle RAC搭建(三)
1)安裝所需軟體包
[root@rac2 ~]# uname -a
Linux rac2 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:54 EDT 2009 i686 i686 i386 GNU/Linux
[root@rac1 asmlib]# ls
oracleasm-2.6.18-164.el5-2.0.5-1.el5.i686.rpm
oracleasmlib-2.0.4-1.el5.i386.rpm
oracleasm-support-2.1.8-1.el5.i386.rpm
[root@rac1 asmlib]# rpm -ivh oracleasm-support-2.1.8-1.el5.i386.rpm
warning: oracleasm-support-2.1.8-1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:oracleasm-support ########################################### [100%]
[root@rac1 asmlib]# rpm -ivh oracleasm-2.6.18-164.el5-2.0.5-1.el5.i686.rpm
warning: oracleasm-2.6.18-164.el5-2.0.5-1.el5.i686.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:oracleasm-2.6.18-164.el########################################### [100%]
[root@rac1 asmlib]# rpm -ivh oracleasmlib-2.0.4-1.el5.i386.rpm
warning: oracleasmlib-2.0.4-1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:oracleasmlib ########################################### [100%]
[root@rac2 asmlib]# rpm -ivh oracleasm-support-2.1.8-1.el5.i386.rpm
[root@rac2 asmlib]# rpm -ivh oracleasm-2.6.18-164.el5-2.0.5-1.el5.i686.rpm
[root@rac2 asmlib]# rpm -ivh oracleasmlib-2.0.4-1.el5.i386.rpm
2).我們將繫結的15G大小的裸裝置raw2和raw3作為建立asm盤
節點1上執行:
[root@rac1 ~]# /etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets ('[]'). Hitting
answer will keep that current value. Ctrl-C will abort.
Default user to own the driver interface []:
Default group to own the driver interface []:
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [ OK ]
Scanning the system for Oracle ASMLib disks: [ OK ]
在節點2上執行:
[root@rac2 ~]# /etc/init.d/oracleasm configure
3)建立ASM盤如下:
在節點rac1上操作如下:
[root@rac1 ~]# /etc/init.d/oracleasm createdisk ASMDISK1 /dev/sdc1
Marking disk "ASMDISK1" as an ASM disk: [ OK ]
[root@rac1 ~]# /etc/init.d/oracleasm createdisk ASMDISK2 /dev/sdd1
Marking disk "ASMDISK2" as an ASM disk: [ OK ]
掃描ASM盤:
[root@rac1 ~]# /etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks: [ OK ]
[root@rac1 ~]# /etc/init.d/oracleasm listdisks
ASMDISK1
ASMDISK2
節點2上掃描並檢視ASM盤:
[root@rac2 ~]# /etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks: [ OK ]
[root@rac2 ~]# /etc/init.d/oracleasm listdisks
ASMDISK1
ASMDISK2
2.安裝資料庫軟體:
[oracle@rac1 ~]$ cd /u01/app/database/
[oracle@rac1 database]$ ll
total 28
dr-xr-xr-x 9 oracle oinstall 4096 May 14 09:44 doc
dr-xr-xr-x 5 oracle oinstall 4096 May 14 09:44 install
dr-xr-xr-x 2 oracle oinstall 4096 May 14 09:44 response
-r-xr-xr-x 1 oracle oinstall 1327 May 14 09:44 runInstaller
dr-xr-xr-x 9 oracle oinstall 4096 May 14 09:45 stage
-r-xr-xr-x 1 oracle oinstall 5213 May 14 09:45 welcome.html
[oracle@rac1 database]$ ./runInstaller
此處採用企業級模式:
指定資料庫安裝目錄:
對兩個節點選中:
僅安裝資料庫軟體:
按照提示執行指令碼:
[root@rac1 ~]# /u01/app/oracle/db_1/root.sh
[root@rac2 ~]# /u01/app/oracle/db_1/root.sh
3.對資料庫進行升級:
1)準備工作,兩個節點分別在root下執行/u01/app/oracle/crs/bin/crsctl stop crs
#停止crs,確保除/bin/sh /etc/init.d/init.crsd run該程式外,沒有其他crs程式執行。
[root@rac1 ~]# /u01/app/oracle/crs/bin/crsctl stop crs
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
[root@rac2 ~]# /u01/app/oracle/crs/bin/crsctl stop crs
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
[root@rac1 ~]# ps -ef |grep crs
root 29438 1 0 10:07 ? 00:00:00 /bin/sh /etc/init.d/init.crsd run
root 29715 25495 0 10:07 pts/2 00:00:00 grep crs
[root@rac2 ~]# ps -ef |grep crs
root 5744 1 0 10:07 ? 00:00:00 /bin/sh /etc/init.d/init.crsd run
root 6024 29841 0 10:08 pts/2 00:00:00 grep crs
2)執行補丁包中的runInstaller:
[root@rac1 p6810189_10204_Linux-x86.zip]# unzip p6810189_10204_Linux-x86.zip
[root@rac1 p6810189_10204_Linux-x86]# chown -R oracle:oinstall Disk1/
[root@rac1 p6810189_10204_Linux-x86]# ll
total 1030248
drwxr-xr-x 5 oracle oinstall 4096 Feb 22 2008 Disk1
-rw-r--r-- 1 root root 1053748381 Nov 1 2010 p6810189_10204_Linux-x86.zip
-rw-r--r-- 1 root root 178473 Feb 26 2008 README.html
[root@rac1 Disk1]# ll
total 1784
-rw-r--r-- 1 oracle oinstall 1620786 Feb 22 2008 10204_buglist.htm
drwxr-xr-x 4 oracle oinstall 4096 Feb 17 2008 install
-rw-r--r-- 1 oracle oinstall 178465 Feb 23 2008 patch_note.htm
drwxr-xr-x 2 oracle oinstall 4096 Feb 17 2008 response
-rwxr-xr-x 1 oracle oinstall 1756 Feb 17 2008 runInstaller
drwxr-xr-x 10 oracle oinstall 4096 Feb 22 2008 stage
先對clusterware打補丁:
指定CRS的目錄:
此處預設兩個節點已經選中,只需下一步:
按照提示執行指令碼:
[root@rac1 ~]# /u01/app/oracle/crs/bin/crsctl stop crs
Stopping resources.
Error while stopping resources. Possible cause: CRSD is down.
Stopping CSSD.
Unable to communicate with the CSS daemon.
[root@rac1 ~]# /u01/app/oracle/crs/install/root102.sh
Creating pre-patch directory for saving pre-patch clusterware files
Completed patching clusterware files to /u01/app/oracle/crs
Relinking some shared libraries.
Relinking of patched files is complete.
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.
.
.
.
. . . . . .
Timed out waiting for the CRS daemons to start. Look at the
system message file and the CRS log files for diagnostics.
[root@rac2 ~]# /u01/app/oracle/crs/bin/crsctl stop crs
[root@rac2 ~]# /u01/app/oracle/crs/install/root102.sh
驗證節點的CRS是否已經起來:
[oracle@rac2 ~]$ crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora.rac1.gsd application 0/5 0/0 ONLINE ONLINE rac1
ora.rac1.ons application 0/3 0/0 ONLINE ONLINE rac1
ora.rac1.vip application 0/0 0/0 ONLINE ONLINE rac1
ora.rac2.gsd application 0/5 0/0 ONLINE ONLINE rac2
ora.rac2.ons application 0/3 0/0 ONLINE ONLINE rac2
ora.rac2.vip application 0/0 0/0 ONLINE ONLINE rac2
對資料庫進行升級:
指定之前配置的資料庫軟體目錄:
在彈出的錯誤框中依據提示,root使用者終端執行如下命令:
[root@rac1 ~]# /u01/app/oracle/db_1/root.sh
[root@rac2 ~]# /u01/app/oracle/db_1/root.sh
3)驗證CRS和資料庫的版本是否升級:
[oracle@rac1 OPatch]$ ll
total 48
drwxrwx--- 2 oracle oinstall 4096 May 14 10:20 docs
-rw-r--r-- 1 oracle oinstall 19263 Dec 26 2006 emdpatch.pl
drwxrwx--- 2 oracle oinstall 4096 May 14 10:20 jlib
-rwxr-xr-x 1 oracle oinstall 6315 Nov 23 2007 opatch
-rw-r--r-- 1 oracle oinstall 49 May 14 10:20 opatch.ini
-rw-r--r-- 1 oracle oinstall 2571 Aug 8 2006 opatch.pl
drwxrwx--- 4 oracle oinstall 4096 May 14 10:20 opatchprereqs
[oracle@rac1 OPatch]$ ./opatch lsinventory
Invoking OPatch 10.2.0.4.2
Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/oracle/db_1
Central Inventory : /u01/app/oracle/oraInventory
from : /etc/oraInst.loc
OPatch version : 10.2.0.4.2
OUI version : 10.2.0.4.0
OUI location : /u01/app/oracle/db_1/oui
Log file location : /u01/app/oracle/db_1/cfgtoollogs/opatch/opatch2014-05-14_10-53-55AM.log
Lsinventory Output file location : /u01/app/oracle/db_1/cfgtoollogs/opatch/lsinv/lsinventory2014-05-14_10-53-55AM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (2):
Oracle Database 10g 10.2.0.1.0
Oracle Database 10g Release 2 Patch Set 3 10.2.0.4.0
There are 2 products installed in this Oracle Home.
There are no Interim patches installed in this Oracle Home.
Rac system comprising of multiple nodes
Local node = rac1
Remote node = rac2
--------------------------------------------------------------------------------
OPatch succeeded.
4.配置ASM例項和資料庫例項
1)配置監聽
[oracle@rac1 ~]$ netca
檢查監聽狀態:
[oracle@rac2 ~]$ crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora....C1.lsnr application 0/5 0/0 ONLINE ONLINE rac1
ora.rac1.gsd application 0/5 0/0 ONLINE ONLINE rac1
ora.rac1.ons application 0/3 0/0 ONLINE ONLINE rac1
ora.rac1.vip application 0/0 0/0 ONLINE ONLINE rac1
ora....C2.lsnr application 0/5 0/0 ONLINE ONLINE rac2
ora.rac2.gsd application 0/5 0/0 ONLINE ONLINE rac2
ora.rac2.ons application 0/3 0/0 ONLINE ONLINE rac2
ora.rac2.vip application 0/0 0/0 ONLINE ONLINE rac2
2)配置ASM例項
首先在兩個節點執行檢視ASM磁碟看是否存在:
[oracle@rac1 admin]$ oracleasm listdisks
ASMDISK1
ASMDISK2
[oracle@rac2 ~]$ oracleasm listdisks
ASMDISK1
ASMDISK2
[oracle@rac1 admin]$ dbca
指定磁碟組的名字:
顯示在第二個節點上無法掛載磁碟組,此處先不管它,稍後手動掛載:
磁碟組掛載情況:
配置完成之後檢視ASM,如下:
[oracle@rac1 ~]$ crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora....SM1.asm application 0/5 0/0 ONLINE ONLINE rac1
ora....C1.lsnr application 0/5 0/0 ONLINE ONLINE rac1
ora.rac1.gsd application 0/5 0/0 ONLINE ONLINE rac1
ora.rac1.ons application 0/3 0/0 ONLINE ONLINE rac1
ora.rac1.vip application 0/0 0/0 ONLINE ONLINE rac1
ora....SM2.asm application 0/5 0/0 ONLINE ONLINE rac2
ora....C2.lsnr application 0/5 0/0 ONLINE ONLINE rac2
ora.rac2.gsd application 0/5 0/0 ONLINE ONLINE rac2
ora.rac2.ons application 0/3 0/0 ONLINE ONLINE rac2
ora.rac2.vip application 0/0 0/0 ONLINE ONLINE rac2
在節點rac2上掛載磁碟組,如下;
[oracle@rac2 ~]$ export ORACLE_SID=+ASM2
[oracle@rac2 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Wed May 14 20:52:15 2014
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> select inst_id,name,state from gv$asm_diskgroup;
INST_ID NAME STATE
---------- ------------------------------ -----------
1 RAC_GROUP MOUNTED
2 RAC_GROUP DISMOUNTED
SQL> show parameter asm;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
asm_diskgroups string RAC_GROUP
asm_diskstring string
asm_power_limit integer 1
SQL> alter system set asm_diskstring='/dev/raw/raw2,/dev/raw/raw3';
System altered.
SQL> alter diskgroup RAC_GROUP mount;
alter diskgroup RAC_GROUP mount
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15063: ASM discovered an insufficient number of disks for diskgroup
"RAC_GROUP" #出現掛載不了的情況
重啟節點rac2,檢視是否能夠掛載:
[oracle@rac2 ~]$ export ORACLE_SID=+ASM2
[oracle@rac2 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Wed May 14 21:13:01 2014
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> select inst_id,state,name from gv$asm_diskgroup;
INST_ID STATE NAME
---------- ----------- ------------------------------
1 MOUNTED RAC_GROUP
2 MOUNTED RAC_GROUP #是不是很邪乎,ASM是oracle10g出來的產品,可能存在一些需要改進的地方,此處不再敖述
3)建立資料庫例項
[oracle@rac1 ~]$ dbca
指定建立的是叢集資料庫:
建立資料庫例項:
選中兩個節點:
此處選擇一般用途:
指定全域性資料庫名:
禁用企業管理器:
設定資料庫管理員的密碼:
採用ASM自動儲存管理方式:
輸入之前設定的磁碟組的密碼:
檢視磁碟組掛載情況,此處需要兩個節點都要掛載:
資料庫檔案管理方式採用磁碟組模式:
此處對恢復區先不做配置:
資料庫內容,此處選擇預設,繼續下一步:
資料庫服務,此處選擇預設,繼續下一步:
安裝成功介面:
[oracle@rac1 ~]$ export ORACLE_SID=orcl1
[oracle@rac1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Thu May 15 11:47:03 2014
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> select instance_name,status from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
orcl1 OPEN
[oracle@rac2 ~]$ export ORACLE_SID=orcl2
[oracle@rac2 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Thu May 15 11:48:20 2014
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> select instance_name,status from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
orcl2 OPEN
補充:對於已經建立了資料庫,想從低版本升級到高版本,要先對原有資料庫進行備份,然後刪除資料庫,先對crs進行升級,然後對資料庫進行升級。
注意,在對資料庫進行的升級的時候lsnrctl和ASM要處於offline狀態,否則無法完成資料庫的升級,這是筆者親身經歷過得事情。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29634949/viewspace-1160994/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle RAC搭建(二)Oracle
- Oracle RAC搭建(一)Oracle
- Oracle 11.2 DataGuard RAC To RAC搭建Oracle
- 【TUNE_ORACLE】Oracle 19c RAC搭建番外篇之RAC引數配置參考(三)Oracle
- Oracle RAC+DG搭建Oracle
- 【BUILD_ORACLE】Oracle 19c RAC搭建(三)使用UDEV配置共享儲存UIOracledev
- oracle 10g 之RAC 搭建Oracle 10g
- Oracle RAC + Data Guard 環境搭建Oracle
- 【BUILD_ORACLE】Oracle 19c RAC搭建(六)建立RAC資料庫UIOracle資料庫
- oracle11g 搭建 rac+dgOracle
- ORACLE RAC TO RAC DG搭建過程中可能遇到的問題Oracle
- Oracle 12c 使用RMAN搭建物理備庫(RAC to RAC)Oracle
- Oracle搭建rac到單庫的adgOracle
- VMware 搭建 Oracle10g RAC 筆記Oracle筆記
- Oracle10g VMWare RAC搭建圖解Oracle圖解
- RAC 搭建
- 【TUNE_ORACLE】Oracle 19c RAC搭建番外篇之RAC引數配置參考(五)Oracle
- 【TUNE_ORACLE】Oracle 19c RAC搭建番外篇之RAC引數配置參考(四)Oracle
- 【TUNE_ORACLE】Oracle 19c RAC搭建番外篇之RAC引數配置參考(二)Oracle
- 【TUNE_ORACLE】Oracle 19c RAC搭建番外篇之RAC引數配置參考(一)Oracle
- [WK-T]ORACLE RAC +ASM Backup and Recovery(三)OracleASM
- rac的Oracle Net配置中三種模式Oracle模式
- 搭建 VM + RHLE5 + Oracle10g Rac + ASMOracleASM
- linux4.0下安裝oracle RAC(三)LinuxOracle
- 安裝Oracle 10.2.0.5 RAC for AIX6(三)OracleAI
- 單例項和RAC打造的ORACLE STREAM(三)單例Oracle
- [RAC]ORACLE Database 10g RAC for Administrators學習筆記(三)OracleDatabase筆記
- 【DG】Oracle 19c使用dbca來搭建物理DG--主rac備racOracle
- 【BUILD_ORACLE】Oracle 19c RAC搭建(五)DB軟體安裝UIOracle
- 一步一步搭建oracle 11gR2 rac+dg之共享磁碟設定(三)Oracle
- ORACLE 12C RAC 生產環境搭建介紹Oracle
- Rhel7.3_Oracle12cR2的RAC搭建安裝Oracle
- Windows2008搭建oracle11g racWindowsOracle
- Oracle9.2.0.4 RAC 三節點引數設定Oracle
- 【OCM】Oracle Database 10g: RAC for Administrators(三)OracleDatabase
- Oracle RAC Failove 之三:Server-Side TAFOracleAIServerIDE
- VMWARE+linux+oracle 10g RAC 之三LinuxOracle 10g
- 【BUILD_ORACLE】Oracle 19c RAC搭建(四)Grid軟體安裝UIOracle