創(chuàng)新互聯(lián)專注于岳陽(yáng)縣網(wǎng)站建設(shè)服務(wù)及定制,我們擁有豐富的企業(yè)做網(wǎng)站經(jīng)驗(yàn)。 熱誠(chéng)為您提供岳陽(yáng)縣營(yíng)銷型網(wǎng)站建設(shè),岳陽(yáng)縣網(wǎng)站制作、岳陽(yáng)縣網(wǎng)頁(yè)設(shè)計(jì)、岳陽(yáng)縣網(wǎng)站官網(wǎng)定制、成都小程序開發(fā)服務(wù),打造岳陽(yáng)縣網(wǎng)絡(luò)公司原創(chuàng)品牌,更為您提供岳陽(yáng)縣網(wǎng)站排名全網(wǎng)營(yíng)銷落地服務(wù)。
1.1.1 ASMLib
1.1.2 什么是 udev
1.1.3 Why ASMLIB and why not
1.2 在 RHEL 6.4 上安裝 Oracle 11gR2 + ASM --使用udev
1.2.1 檢查硬件
1.2.2 安裝軟件包檢查
1.2.3 修改主機(jī)名
1.2.4 網(wǎng)絡(luò)配置
1.2.5 磁盤準(zhǔn)備
1.2.6 配置目錄、用戶等
1.2.7 使用udev管理磁盤
1.2.8 系統(tǒng)內(nèi)核參數(shù)修改
1.2.9 為 Linux 系統(tǒng)配置本地 YUM 源
1.2.10 安裝grid
1.2.11 使用netmgr建立監(jiān)聽
1.2.12 開始搭建 Oracle 數(shù)據(jù)庫(kù)
1.2.13 使用 netmgr 建立監(jiān)聽--Oracle用戶不需要?jiǎng)?chuàng)建
1.2.14 使用 dbca 創(chuàng)建數(shù)據(jù)庫(kù)
1.2.15 配置ORACLE自動(dòng)啟動(dòng)
1.2.16 驗(yàn)證
1.3 啟動(dòng)crs
1.4 報(bào)錯(cuò):
1.4.1 Oracle 11gR2 RAC ohasd failed to start 解決方法
1.4.2 CRS-4639: Could not contact Oracle High Availability Services
1.4.3 ORA-29701: unable to connect to Cluster Synchronization Service
1.4.4 asm 實(shí)例無(wú)法加載diskgroups,ORA-15110: no diskgroups mounted
1.4.5 在啟動(dòng)DB時(shí)報(bào)錯(cuò)ORA-27154 ORA-27300 ORA-27301 ORA-27302
1.4.6 ORA-29786: SIHA attribute GET failed
1.4.7 11gR2手動(dòng)創(chuàng)建ASM實(shí)例ORA-29786錯(cuò)誤解決方法
1.4.8 ORACLE dbca 找不到asm disks
1.4.9 ora-15077,ASM磁盤組不能掛載
Readme
看到群上還有人糾結(jié)ASM的安裝,我很痛心,不過想想自己當(dāng)時(shí)安裝的時(shí)候花了將近一周的時(shí)間才安裝好,主要是白天上班,又沒有網(wǎng)絡(luò),所以只好晚上安裝了,自己開始安裝的時(shí)候是11.2.0.1.0,這個(gè)版本安裝有很多bug,雖然安裝成功了但是很痛苦,后來(lái)參加OCP培訓(xùn),老師給了11.2.0.3.0版本,安裝的時(shí)候很順利,沒有報(bào)錯(cuò)了。
第一次安裝的時(shí)候,涉及到ASMlib,udev神馬的一堆,學(xué)習(xí)Oracle沒有好的導(dǎo)師痛苦呀,最后經(jīng)過大量百度,自己摸索才把這一推問題解決了。大家看這篇博文的時(shí)候注意文檔的層次結(jié)構(gòu),很郁悶,發(fā)表博文不能很好的把文章結(jié)構(gòu)發(fā)出來(lái)。。。文章最后收錄了一些安裝過程中可能會(huì)出現(xiàn)的一些問題,供大家參考,如果有什么意見請(qǐng)大家留言或加QQ,謝謝大家的來(lái)訪。
在Red Hat Enterprise Linux (RHEL)6以前,Oracle均是使用ASMLib這個(gè)內(nèi)核支持庫(kù)配置ASM。ASMLIB是一種基于Linux module,專門為Oracle Automatic Storage Management特性設(shè)計(jì)的內(nèi)核支持庫(kù)(kernel support library)。但是,在2011年5月,甲骨文發(fā)表了一份Oracle數(shù)據(jù)庫(kù)ASMLib的聲明,聲明中稱甲骨文將不再提供Red Hat Enterprise Linux (RHEL)6的ASMLib和相關(guān)更新。
甲骨文在這份聲明中表示,ASMLib更新將通過Unbreakable Linux Network (ULN)來(lái)發(fā)布,并僅對(duì)Oracle Linux客戶開放。ULN雖然為甲骨文和紅帽的客戶服務(wù),但如果客戶想要使用ASMlib,就必須使用Oracle的kernel來(lái)替換掉紅帽的。
這份聲明詳見Oracle Metalink文檔:
Oracle ASMLib Software Update Policy for Red Hat Enterprise Linux Supported by Red Hat [ID 1089399.1]
Software Update Policy for ASMLib running on future releases of Red Hat Enterprise Linux Red Hat Enterprise Linux 6 (RHEL6)For RHEL6 or Oracle Linux 6, Oracle will only provide ASMLib software and updates when configuredUnbreakable Enterprise Kernel (UEK). Oracle will not provide ASMLib packages for kernels distributedby Red Hat as part of RHEL 6 or the Red Hat compatible kernel in Oracle Linux 6. ASMLib updates will be delivered via Unbreakable Linux Network(ULN) which is available to customers with Oracle Linux support. ULN works with both Oracle Linux or Red Hat Linux installations, but ASMlib usage will require replacing any Red Hat kernel with UEK
因此,在Red Hat Enterprise Linux (RHEL)6上使用ASMLib已不再現(xiàn)實(shí),另外ASMLib也有一定的缺點(diǎn),詳見文檔說(shuō)明:
http://www.oracledatabase12g.com/archives/why-asmlib-and-why-not.html
因此,目前在Red Hat Enterprise Linux (RHEL)6上使用Oracle+ASM,已不再使用ASMLib,而是采用udev設(shè)備文件來(lái)配置ASM。
udev 是Linux2.6 內(nèi)核里的一個(gè)功能,它替代了原來(lái)的devfs,成為當(dāng)前Linux 默認(rèn)的設(shè)備管理工具。udev 以守護(hù)進(jìn)程的形式運(yùn)行,通過偵聽內(nèi)核發(fā)出來(lái)的uevent 來(lái)管理/dev目錄下的設(shè)備文件。不像之前的設(shè)備管理工具,udev 在用戶空間(user space) 運(yùn)行,而不在內(nèi)核空間(kernel space) 運(yùn)行。
ASMLIB是一種基于Linux module,專門為Oracle Automatic Storage Management特性設(shè)計(jì)的內(nèi)核支持庫(kù)(kernel support library)。
長(zhǎng)久以來(lái)我們對(duì)ASMLIB的認(rèn)識(shí)并不全面,這里我們來(lái)具體了解一下使用ASMLIB的優(yōu)缺點(diǎn)。
理論上我們可以從ASMLIB API中得到的以下益處:
雖然從理論上我們可以從ASMLIB中得到性能收益,但實(shí)踐過程中這種優(yōu)勢(shì)是幾乎可以忽略的,沒有任何性能報(bào)告顯示ASMLIB對(duì)比Linux上原生態(tài)的udev設(shè)備管理服務(wù)有任何性能上的優(yōu)勢(shì)。在Oracle官方論壇上有一篇討論ASMLIB性能收益的帖子,你可以從中看到"asmlib wouldn't necessarily give you much of an io performance benefit, it's mainly for ease of management as it will find/discover the right devices for you, the io effect of asmlib is large the same as doing async io to raw devices."的評(píng)論,實(shí)際上使用ASMLIB和直接使用裸設(shè)備(raw device)在性能上沒有什么差別。
ASMLIB可能帶來(lái)的缺點(diǎn):
結(jié)論:我個(gè)人的觀點(diǎn)是盡可能不要使用ASMLIB,當(dāng)然這不是DBA個(gè)人所能決定的事情。另一方面這取決于個(gè)人習(xí)慣,在rhel 4的早期發(fā)行版本中沒有提供udev這樣的設(shè)備管理服務(wù),這導(dǎo)致在rhel 4中大量的ASM+RAC組合的系統(tǒng)使用ASMLIB ,經(jīng)網(wǎng)友指出udev作為kernel 2.6的新特性被引入,在rhel4的初始版本中就已經(jīng)加入了udev綁定服務(wù),但是在rhel4時(shí)代實(shí)際udev的使用并不廣泛(In Linux 2.6, a new feature was introduced to simplify device management and hot plug capabilities. This feature is called udev and is a standard package in RHEL4 or OracleEnterprise Linux 4 (OEL4) as well as Novell's SLES9 and SLES10.)。如果是在RHEL/OEL 5中那么你已經(jīng)有充分的理由利用udev而放棄ASMLIB。
Reference:ASMLIB Performance vs UdevRAC+ASM 3 years in production Stories to shareHow To Setup ASM & ASMLIB On Native Linux Multipath Mapper disks? [ID 602952.1]ASMLib and Linux block devices
實(shí)驗(yàn)環(huán)境:
OS: Oracle Linux Server release 6.4 x64或 RHEL6.4
Database: Oracle Database 11gR2 x64 (11.2.0.1.0)
VMware: VMware Workstation 10.0.0 build-812388
軟件:
在正式安裝開始前,請(qǐng)先檢查你的軟硬件條件是否滿足安裝需要。
硬件上可以使用命令查看內(nèi)存情況和 CPU 特性:
#more /proc/meminfo
#more /proc/cpuinfo
其中內(nèi)存的要求是不低于 1G
下面的不是必須的,可選使用
#df –k /dev/shm 檢查共享內(nèi)存
#df –k /tmp 檢查臨時(shí)磁盤空間
#more /proc/version 檢查操作系統(tǒng)版本
#uname –r 檢查內(nèi)核版本
內(nèi)存
# grep MemTotal /proc/meminfo
交換空間
# grep SwapTotal /proc/meminfo
磁盤空間
# df -ah
# free
#free -m
Minimum: 1 GB of RAM
Recommended: 2 GB of RAM or more
?
To determine the RAM size, enter the following command:
# grep MemTotal /proc/meminfo
swap檢查
Between 1 GB and 2 GB 1.5 times the size of the RAM
Between 2 GB and 16 GB Equal to the size of the RAM
More than 16 GB 16 GB
# grep SwapTotal /proc/meminfo
To determine the available RAM and swap space, enter the following command:
# free -m
?The following tables describe the disk space requirements for software files and data files for each installation type on Linux x86:
Installation Type Requirement for Software Files (GB)
Enterprise Edition 3.95
Standard Edition 3.88
Installation Type Disk Space for Data Files (GB)
Enterprise Edition 1.7
Standard Edition 1.5
[root@yutian ~]# cat /proc/version
Linux version 2.6.18-164.el5 (mockbuild@x86-002.build.bos.redhat.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)) #1 SMP Tue Aug 18 15:51:54 EDT 2009
[root@yutian ~]# lsb_release -id
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 5.4 (Tikanga)
[root@yutian ~]#
可以統(tǒng)一檢查:
rpm -q binutils \
compat-libstdc++-33 \
elfutils-libelf \
gcc \
gcc-c++ \
glibc \
glibc-common \
glibc-devel \
glibc-headers \
ksh \
libaio \
libaio-devel \
libgomp \
libgcc \
libstdc++ \
libstdc++-devel \
make \
sysstat \
unixODBC \
unixODBC-devel \
numactl-devel
我們可以看到?jīng)]有安裝過的包會(huì)已is not installed 出現(xiàn):
[root@rhel6_lhr ~]# rpm -q binutils \
> compat-libstdc++-33 \
> elfutils-libelf \
> gcc \
> gcc-c++ \
> glibc \
> glibc-common \
> glibc-devel \
> glibc-headers \
> ksh \
> libaio \
> libaio-devel \
> libgomp \
> libgcc \
> libstdc++ \
> libstdc++-devel \
> make \
> sysstat \
> unixODBC \
> unixODBC-devel \
> numactl-devel
binutils-2.20.51.0.2-5.36.el6.x86_64
compat-libstdc++-33-3.2.3-69.el6.x86_64
compat-libstdc++-33-3.2.3-69.el6.i686
elfutils-libelf-0.152-1.el6.x86_64
gcc-4.4.7-4.el6.x86_64
gcc-c++-4.4.7-4.el6.x86_64
glibc-2.12-1.132.el6.x86_64
glibc-common-2.12-1.132.el6.x86_64
glibc-devel-2.12-1.132.el6.x86_64
glibc-headers-2.12-1.132.el6.x86_64
package ksh is not installed
libaio-0.3.107-10.el6.x86_64
libaio-devel-0.3.107-10.el6.x86_64
libaio-devel-0.3.107-10.el6.i686
libgomp-4.4.7-4.el6.x86_64
libgcc-4.4.7-4.el6.x86_64
libstdc++-4.4.7-4.el6.x86_64
libstdc++-devel-4.4.7-4.el6.x86_64
libstdc++-devel-4.4.7-4.el6.i686
make-3.81-20.el6.x86_64
sysstat-9.0.4-22.el6.x86_64
unixODBC-2.2.14-12.el6_3.x86_64
unixODBC-2.2.14-12.el6_3.i686
unixODBC-devel-2.2.14-12.el6_3.i686
unixODBC-devel-2.2.14-12.el6_3.x86_64
package numactl-devel is not installed
[root@rhel6_lhr ~]#
如果部分包不存在
可以批量更新安裝,但如果依賴關(guān)系缺失,可能需要多執(zhí)行兩遍
或者手工調(diào)整
rpm -qa | grep binutils-
rpm -qa | grep compat-libstdc++-
rpm -qa | grep elfutils-libelf-
rpm -qa | grep elfutils-libelf-devel-
rpm -qa | grep glibc-
rpm -qa | grep glibc-common-
rpm -qa | grep glibc-devel-
rpm -qa | grep gcc-
rpm -qa | grep gcc-c++-
rpm -qa | grep libaio-
rpm -qa | grep libaio-devel-
rpm -qa | grep libgcc-
rpm -qa | grep libstdc++-
rpm -qa | grep libstdc++-devel-
rpm -qa | grep make-
rpm -qa | grep sysstat-
rpm -qa | grep unixODBC-
rpm -qa | grep unixODBC-devel-
binutils-2.17.50.0.6-2.el5
compat-libstdc++-33-3.2.3-61
elfutils-libelf-0.125-3.el5
elfutils-libelf-devel-0.125
glibc-2.5-12
glibc-common-2.5-12
glibc-devel-2.5-12
gcc-4.1.1-52
gcc-c++-4.1.1-52
libaio-0.3.106
libaio-devel-0.3.106
libgcc-4.1.1-52
libstdc++-4.1.1
libstdc++-devel-4.1.1-52.e15
make-3.81-1.1
sysstat-7.0.0
unixODBC-2.2.11
unixODBC-devel-2.2.11
# rpm -qa | grep make gcc glibc compat openmotif21 setarch 等等
建議你用 rpm –q packagename 逐個(gè)檢查,因?yàn)槭枪俜揭?,所以為了不在安裝時(shí)出現(xiàn)不必要的麻煩,還是確認(rèn)都全部安裝為好。
雖然我是全新安裝的系統(tǒng)也存在 3 個(gè)包沒安裝:Libaio-devel numactl-devel sysstat
掛載 Linux 5 光盤,查找包的完整路徑名稱:
[root@localhost ~]# mkdir /media/cdrom ; mount /dev/cdrom /media/cdrom
[root@localhost ~]# ll /media/cdrom/Server/ |grep libaio-devel
[root@localhost ~]# ll /media/cdrom/Server/ |grep numactl-devel
[root@localhost ~]# ll /media/cdrom/Server/ |grep sysstat
安裝 RPM 包:
[root@localhost ~]# rpm -ivh /media/cdrom/Server/libaio-devel-0.3.106-3.2.i386.rpm
[root@localhost ~]# rpm -ivh /media/cdrom/Server/numactl-devel-0.9.8-7.el5.i386.rpm
[root@localhost ~]# rpm -ivh /media/cdrom/Server/sysstat-7.0.2-3.el5.i386.rpm
rpm -ivh compat-libstdc++-33-3.2.3-69.el6.i686.rpm --force --nodeps
[root@localhost RHEL_6.5 x86_64 Disc 1]# pwd
/media/RHEL_6.5 x86_64 Disc 1
[root@localhost RHEL_6.5 x86_64 Disc 1]#
另外,為了支持 ODBC 建議順便安裝下面兩個(gè)包:
unixODBC-2.2.11 (32 bit) or later
unixODBC-devel-2.2.11 (32 bit) or later
永久生效:
[root@zijuan /]#vim /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=zijuan
HOSTNAME=zijuan表示主機(jī)設(shè)置為zijuan.
注意:修改主機(jī)名后,需要重啟系統(tǒng)后生效,或者切換個(gè)用戶然后切換回來(lái)就OK
查看/etc/hosts文件中必須包含a fully qualified name for the server
[root@localhost lhr]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.128.131 rhel6_linux_asm
[root@localhost lhr]# hostname
localhost.localdomain
[root@localhost lhr]# hostname rhel6.5_linux
[root@localhost lhr]# hostname
rhel6_linux_asm
修改/etc/hosts文件
[root@oracle ~]#vim/etc/hosts
127.0.0.1 localhost.localdomainlocalhost
::1 localhost6.localdomain6localhost6
192.168.137.112 oracle.domain.comoracle
注意將主機(jī)名對(duì)應(yīng)到真實(shí)ip地址,否則oracle有可能將監(jiān)聽程序僅僅建立在127.0.0.1上
如果要配置em的話,這里最后把系統(tǒng)的ip地址設(shè)置成靜態(tài)的ip地址,不然可能導(dǎo)致em訪問的時(shí)候改變了數(shù)據(jù)庫(kù)服務(wù)器的ip地址,從而導(dǎo)致其它問題的出現(xiàn),具體靜態(tài)ip地址配置參考( o()︿))o 唉。。。。這一塊內(nèi)容還沒有寫博客,大家可以百度或者私聊我)
這里我們準(zhǔn)備5塊硬盤
1塊硬盤安裝操作系統(tǒng)
234塊用于實(shí)現(xiàn)ASM 存儲(chǔ)數(shù)據(jù)
5塊硬盤用于存儲(chǔ)FRA
1.1.編輯虛擬機(jī)配置
1.2.添加硬件
1.3.添加第一塊硬盤
1.4.創(chuàng)建新的虛擬磁盤
1.5.選擇磁盤類型
1.6.設(shè)置磁盤大小
1.7.完成
1.8.
添加第二、三、四、五塊磁盤:重復(fù)步驟 1~7
1.9.
這里5塊磁盤添加完畢后,為了避免后邊再重啟一次,可以先把后邊需要的一個(gè)步驟做了,就是找到虛擬機(jī)的配置文件,在最后添加一行disk.EnableUUID="TRUE",這里注意修改文件的時(shí)候一定要在關(guān)機(jī)的狀態(tài)下修改該參數(shù)文件。
磁盤添加完成后,啟動(dòng)虛擬機(jī),作為 root用戶登錄系統(tǒng),格式化新添加的兩塊磁盤。
[root@localhost share]# fdisk -l | grep "Disk /dev/sd"
Disk /dev/sde: 10.7 GB, 10737418240 bytes
Disk /dev/sdd: 10.7 GB, 10737418240 bytes
Disk /dev/sda: 53.7 GB, 53687091200 bytes
Disk /dev/sdb: 10.7 GB, 10737418240 bytes
Disk /dev/sdc: 10.7 GB, 10737418240 bytes
磁盤分區(qū)完成后,查看所有磁盤情況。
注意這里只做磁盤的分區(qū),并不做磁盤的格式化和掛載
利用 /usr/sbin/groupadd 命令
------這里Oracle用戶可能已經(jīng)安裝過的,沒有影響:
代碼:
groupadd oinstall
groupadd dba
groupadd oper
groupadd asmadmin
groupadd asmoper
groupadd asmdba
--添加用戶到組
useradd -g oinstall -G dba,asmdba,oper,asmadmin oracle
useradd -g oinstall -G asmadmin,asmdba,asmoper,dba grid
--修改密碼
passwd oracle
passwd grid
echo oracle | passwd --stdin lhr
echo grid | passwd --stdin lhr
---查看屬主
[root@rhel_linux_asm ~]# id oracle
uid=501(oracle) gid=502(dba) groups=502(dba),501(oinstall),504(asmadmin),506(asmdba)
[root@rhel_linux_asm ~]# id grid
uid=502(grid) gid=501(oinstall) groups=501(oinstall),502(dba),504(asmadmin),505(asmoper),506(asmdba)
[root@rhel_linux_asm ~]#
代碼:
--root用戶下:
mkdir -p /u01/app/oracle
mkdir -p /u01/app/grid
mkdir -p /u01/app/grid/11.2.0
chown -R grid:oinstall /u01/app/grid --把/u01/app/grid的所有者改為grid
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01
--------Oracle User----切換到Oracle用戶下------
[root@rhel_linux_asm ~]# su - oracle
[grid@rhel_linux_asm ~]$ vi ~/.bash_profile
export ORACLE_SID=orcl
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export TMP=/tmp
export TMPDIR=$TMP
export PATH=$PATH:$ORACLE_HOME/bin
--------Grid User-----切換到grid用戶下-----
cd /home/grid
vim .bash_profile
export ORACLE_SID=+ASM
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/grid/11.2.0
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$ORACLE_HOME/bin:$PATH
umask 022
[oracle@dbserver1 ~]$ source .bash_profile
注意以下兩點(diǎn):
首先切換到root用戶下:
5.1.不同的操作系統(tǒng),scsi_id命令的位置不同。
[root@localhost ~]# cat /etc/issue
Oracle Linux Server release 6.4
Kernel \r on an \m
[root@localhost ~]# which scsi_id
/sbin/scsi_id
[root@localhost ~]#
5.2.編輯 /etc/scsi_id.config文件,如果該文件不存在,則創(chuàng)建該文件并添加如下行:
[root@localhost ~]# vi /etc/scsi_id.config
options=--whitelisted --replace-whitespace
[root@localhost ~]#
5.3.如果是使用 VMware虛擬機(jī),直接輸入 scsi_id命令可能無(wú)法獲取 id,需修改 VMware文件參數(shù),這一步如果在添加磁盤的時(shí)候做過這一步的話就可以跳過了,直接獲取uuid即可
[root@localhost ~]# scsi_id --whitelisted --replace-whitespace --device=/dev/sdb
[root@localhost ~]# scsi_id --whitelisted --replace-whitespace --device=/dev/sdc
D:\VMs\Oracle Database 11gR2\Oracle Database 11gR2.vmx
使用文本編輯器編輯該文件,在尾部新增一行參數(shù):
disk.EnableUUID="TRUE"
保存文件,重新啟動(dòng)虛擬機(jī)。這里注意修改文件的時(shí)候一定要在關(guān)機(jī)的狀態(tài)下修改,或者 scsi_id -g -u /dev/sdc來(lái)獲得uuid,-g -u參數(shù)在rhel6以后已經(jīng)不用了
[root@localhost share]# scsi_id --whitelisted --replace-whitespace --device=/dev/sdb
36000c29fbe57659626ee89b4fba07616
[root@localhost share]# scsi_id --whitelisted --replace-whitespace --device=/dev/sdc
36000c29384cde894e087e5f0fcaa80f4
[root@localhost share]# scsi_id --whitelisted --replace-whitespace --device=/dev/sdd
36000c29022aee23728231ed9b1f9743d
[root@localhost share]# scsi_id --whitelisted --replace-whitespace --device=/dev/sde
36000c2938f431664218d1d2632ff1352
[root@localhost ~]# vi /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c29fe0fc917d7e9982742a28ce7c", NAME="asm-diskb", OWNER="grid",GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c293ffc0900fd932348de4b6baf8", NAME="asm-diskc", OWNER="grid",GROUP="asmadmin", MODE="0660"
根據(jù)步驟 5 獲取的 ID 修改 RESULT 值
這里需要注意,一個(gè)KERNEL就是一行,不能換行的,我之前就是犯了這個(gè)錯(cuò)誤的
添加4塊硬盤:
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c29346c1344ffb26f0e5603d519e", NAME="asm-diskb", OWNER="grid",GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c29d08ee059a345571054517cd03", NAME="asm-diskc", OWNER="grid",GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c295037a910bfb765af8f400aa07", NAME="asm-diskd", OWNER="grid",GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c2982bda048f642acd3c429ec983", NAME="asm-diske", OWNER="grid",GROUP="asmadmin", MODE="0660"
注意:這里的GROUP="asmadmin", 最好修改成GROUP="asmdba",不然最后可能用dbca創(chuàng)建數(shù)據(jù)庫(kù)實(shí)例的時(shí)候找不見磁盤組。
該步驟慢一點(diǎn),大約可能需要30秒左右吧,等等等等。。。。。。
[root@localhost ~]# start_udev
Starting udev: [ OK ]
[root@localhost ~]#
[root@localhost ~]# ll /dev/asm*
brw-rw---- 1 grid asmadmin 8, 17 Oct 17 14:26 /dev/asm-diskb
brw-rw---- 1 grid asmadmin 8, 33 Oct 17 14:26 /dev/asm-diskc
[root@localhost ~]# tail -8 /etc/security/limits.conf
# add by lhr for oracle and grid on 2014-05-02
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
[root@localhost ~]# tail -1 /etc/pam.d/login
session required pam_limis.so
[root@localhost ~]#
[root@localhost ~]# tail -9 /etc/profile
if [ /$USER = "oracle" ] || [ /$USER = "grid" ]; then
if [ /$SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
Configuring Kernel Parameters for Linux
vim /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
生效
# /sbin/sysctl -p
這步當(dāng)然也可以使用其它軟件來(lái)替代上傳軟件包:
[root@localhost ~]# ll /home/grid/
total 1028228
-rw-r--r-- 1 root root 1052897657 Oct 16 13:22 linux.x64_11gR2_grid.zip
[root@localhost ~]#
[root@localhost grid]# unzip linux.x64_11gR2_grid.zip
[root@localhost grid]# ll
total 1028232
drwxr-xr-x 8 root root 4096 Aug 21 2009 grid
-rw-r--r-- 1 root root 1052897657 Oct 16 13:22 linux.x64_11gR2_grid.zip
[root@localhost grid]#
安裝過程中的日志生成地址:
/u01/app/oraInventory/logs/installActions2014-06-14_10-32-53PM.log
16.1.檢查安裝腳本是否具有可執(zhí)行權(quán)限
[grid@localhost grid]$ id
uid=501(grid) gid=500(oinstall) groups=500(oinstall),501(dba),503(asmadmin),504(asmoper),505(asmdba)
[grid@localhost grid]$ ll runInstaller
-rwxr-xr-x 1 root root 3227 Aug 15 2009 runInstaller
[grid@localhost grid]$
如果無(wú)可執(zhí)行權(quán)限,執(zhí)行以下命令進(jìn)行授權(quán):
[root@localhost ~]# chown -R grid:oinstall /home/grid/grid/
[root@localhost ~]# ll /home/grid/grid/runInstaller
-rwxr-xr-x 1 grid oinstall 3227 Aug 15 2009 /home/grid/grid/runInstaller
[root@localhost ~]#
16.2. 執(zhí)行安裝腳本 /home/grid/grid/runInstaller
首先打開Xmanager - Passive軟件,然后在 Xshell會(huì)話設(shè)置如下:
[grid@rhel_linux_asm grid]$ clear
[grid@rhel_linux_asm grid]$ export DISPLAY=192.168.1.100:0.0---這里的ip地址就是本機(jī)的ip地址(ipconfig)
[grid@rhel_linux_asm grid]$ xhost +
access control disabled, clients can connect from any host
[grid@rhel_linux_asm grid]$ ls
doc install response rpm runcluvfy.sh runInstaller sshsetup stage welcome.html
[grid@rhel_linux_asm grid]$ ./runInstaller
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 120 MB. Actual 31642 MB Passed
Checking swap space: must be greater than 150 MB. Actual 383 MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2014-04-29_10-53-18PM. Please wait ...[grid@rhel_linux_asm grid]$
截圖如下:
17.安裝過程
[grid@localhost ~]$ /home/grid/grid/runInstaller
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 120 MB. Actual 38826 MB Passed
Checking swap space: must be greater than 150 MB. Actual 4095 MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2013-10-17_03-31-41PM. Please wait ...[grid@localhost ~]$
17.1.
17.2.
17.3.
17.4.
17.5.
17.6.
17.6.1.檢查安裝條件
17.6.2.
執(zhí)行修復(fù)腳本:
[root@localhost ~]# /tmp/CVU_11.2.0.1.0_grid/runfixup.sh
Response file being used is :/tmp/CVU_11.2.0.1.0_grid/fixup.response
Enable file being used is :/tmp/CVU_11.2.0.1.0_grid/fixup.enable
Log file location: /tmp/CVU_11.2.0.1.0_grid/orarun.log
Setting Kernel Parameters...
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
17.6.3. 安裝缺失軟件包
# yum install -ypackage_name
這些軟件包其實(shí)已安裝,只不過因?yàn)?Oracle Linux 6.4自帶的軟件包版本高于檢查版本,所以檢查不通過,忽略即可。
Oracle Linux 6.4的安裝光盤中無(wú) pdksh軟件包,安裝 ksh軟件包即可。
# yum install -y ksh
因?yàn)闆]有 NTP時(shí)鐘服務(wù)器,所以 NTP檢查不通過,忽略即可。
17.6.4.
17.7.
17.8.
17.9.安裝時(shí)間較長(zhǎng),請(qǐng)耐心等待。
安裝過程中會(huì)彈出對(duì)話框,提示你以 root身份執(zhí)行兩個(gè)腳本:
[root@localhost ~]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
[root@localhost ~]#/u01/app/11.2.0/grid/root.sh
Running Oracle 11g root.sh script...
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /u01/app/11.2.0/grid
Enter the full pathname of the local bin directory: [/usr/local/bin]: -- 輸入回車
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
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.
Toconfigure Grid Infrastructurefor a Stand-Alone Server run the following command as the root user: --單實(shí)例安裝需執(zhí)行以下腳本
/u01/app/11.2.0/grid/perl/bin/perl -I/u01/app/11.2.0/grid/perl/lib -I/u01/app/11.2.0/grid/crs/install /u01/app/11.2.0/grid/crs/install/roothas.pl
To configure Grid Infrastructure for a Cluster perform the following steps:
1. Provide values for Grid Infrastructure configuration parameters in the file - /u01/app/11.2.0/grid/crs/install/crsconfig_params. For details on how to do this, see the installation guide.
2. Run the following command as the root user:
/u01/app/11.2.0/grid/perl/bin/perl -I/u01/app/11.2.0/grid/perl/lib -I/u01/app/11.2.0/grid/crs/install /u01/app/11.2.0/grid/crs/install/rootcrs.pl
To update inventory properties for Grid Infrastructure, perform the following
steps. If a pre-11.2 home is already configured, execute the following:
11.2_Home/oui/bin/runInstaller -updateNodeList -silent -local CRS=false ORACLE_HOME=pre-11.2_Home
Always execute the following to register the current home:
11.2_Home/oui/bin/runInstaller -updateNodeList -silent -local CRS=true ORACLE_HOME=11.2_Home.
If either home is shared, provide the additional argument -cfs.
截圖如下:
下邊按照要求執(zhí)行腳本:
[root@localhost ~]# /u01/app/11.2.0/grid/perl/bin/perl -I/u01/app/11.2.0/grid/perl/lib -I/u01/app/11.2.0/grid/crs/install /u01/app/11.2.0/grid/crs/install/roothas.pl
2013-10-17 16:18:19: Checking for super user privileges
2013-10-17 16:18:19: User has super user privileges
2013-10-17 16:18:19: Parsing the host name
Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params
Creating trace directory
/u01/app/11.2.0/grid/bin/clscfg.bin: error while loading shared libraries: libcap.so.1: cannot open shared object file:No such file or directory -- 報(bào)錯(cuò)
Failed to create keys in the OLR, rc = 32512, 32512
OLR configuration failed
[root@localhost ~]#
解決報(bào)錯(cuò):
17.9.1.檢查操作系統(tǒng)中 libcap.so是否已安裝
如果是 64位系統(tǒng),i686和 x86_64都要安裝。
# yum install -y libcap*.i686
# yum install -y libcap*.x86_64
[root@localhost ~]# rpm -qa | grep libcap
libcap-ng-0.6.4-3.el6_0.1.i686
libcap-2.16-5.5.el6.x86_64
libcap-devel-2.16-5.5.el6.x86_64
libcap-devel-2.16-5.5.el6.i686
libcap-ng-0.6.4-3.el6_0.1.x86_64
libcap-2.16-5.5.el6.i686
libcap-ng-devel-0.6.4-3.el6_0.1.i686
libcap-ng-devel-0.6.4-3.el6_0.1.x86_64
[root@localhost ~]#
17.9.2. 檢查 libcap.so 文件
[root@localhost ~]# ll /lib64/libcap.so*
lrwxrwxrwx 1 root root 11 Oct 17 16:28 /lib64/libcap.so -> libcap.so.2
lrwxrwxrwx. 1 root root 14 Oct 16 15:22 /lib64/libcap.so.2 -> libcap.so.2.16
-rwxr-xr-x 1 root root 19016 Oct 13 2011 /lib64/libcap.so.2.16
[root@localhost ~]#
17.9.3.
[root@localhost ~]# ln -s /lib64/libcap.so.2.16 /lib64/libcap.so.1
[root@localhost ~]#ln -s /lib64/libcap.so.2 /lib64/libcap.so
[root@localhost ~]# ll /lib64/libcap.so*
lrwxrwxrwx 1 root root 11 Oct 17 16:28 /lib64/libcap.so -> libcap.so.2
lrwxrwxrwx 1 root root 21 Oct 17 17:01 /lib64/libcap.so.1 -> /lib64/libcap.so.2.16
lrwxrwxrwx. 1 root root 14 Oct 16 15:22 /lib64/libcap.so.2 -> libcap.so.2.16
-rwxr-xr-x 1 root root 19016 Oct 13 2011 /lib64/libcap.so.2.16
[root@localhost ~]#
17.9.4. 重新執(zhí)行 /u01/app/11.2.0/grid/root.sh 腳本
[root@localhost ~]# /u01/app/11.2.0/grid/root.sh
Running Oracle 11g root.sh script...
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /u01/app/11.2.0/grid