大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
创新互联专注于岳阳县网站建设服务及定制,我们拥有丰富的企业做网站经验。 热诚为您提供岳阳县营销型网站建设,岳阳县网站制作、岳阳县网页设计、岳阳县网站官网定制、成都小程序开发服务,打造岳阳县网络公司原创品牌,更为您提供岳阳县网站排名全网营销落地服务。
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 修改主机名
1.2.4 网络配置
1.2.5 磁盘准备
1.2.6 配置目录、用户等
1.2.7 使用udev管理磁盘
1.2.8 系统内核参数修改
1.2.9 为 Linux 系统配置本地 YUM 源
1.2.10 安装grid
1.2.11 使用netmgr建立监听
1.2.12 开始搭建 Oracle 数据库
1.2.13 使用 netmgr 建立监听--Oracle用户不需要创建
1.2.14 使用 dbca 创建数据库
1.2.15 配置ORACLE自动启动
1.2.16 验证
1.3 启动crs
1.4 报错:
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 实例无法加载diskgroups,ORA-15110: no diskgroups mounted
1.4.5 在启动DB时报错ORA-27154 ORA-27300 ORA-27301 ORA-27302
1.4.6 ORA-29786: SIHA attribute GET failed
1.4.7 11gR2手动创建ASM实例ORA-29786错误解决方法
1.4.8 ORACLE dbca 找不到asm disks
1.4.9 ora-15077,ASM磁盘组不能挂载
Readme
看到群上还有人纠结ASM的安装,我很痛心,不过想想自己当时安装的时候花了将近一周的时间才安装好,主要是白天上班,又没有网络,所以只好晚上安装了,自己开始安装的时候是11.2.0.1.0,这个版本安装有很多bug,虽然安装成功了但是很痛苦,后来参加OCP培训,老师给了11.2.0.3.0版本,安装的时候很顺利,没有报错了。
第一次安装的时候,涉及到ASMlib,udev神马的一堆,学习Oracle没有好的导师痛苦呀,最后经过大量百度,自己摸索才把这一推问题解决了。大家看这篇博文的时候注意文档的层次结构,很郁闷,发表博文不能很好的把文章结构发出来。。。文章最后收录了一些安装过程中可能会出现的一些问题,供大家参考,如果有什么意见请大家留言或加QQ,谢谢大家的来访。
在Red Hat Enterprise Linux (RHEL)6以前,Oracle均是使用ASMLib这个内核支持库配置ASM。ASMLIB是一种基于Linux module,专门为Oracle Automatic Storage Management特性设计的内核支持库(kernel support library)。但是,在2011年5月,甲骨文发表了一份Oracle数据库ASMLib的声明,声明中称甲骨文将不再提供Red Hat Enterprise Linux (RHEL)6的ASMLib和相关更新。
甲骨文在这份声明中表示,ASMLib更新将通过Unbreakable Linux Network (ULN)来发布,并仅对Oracle Linux客户开放。ULN虽然为甲骨文和红帽的客户服务,但如果客户想要使用ASMlib,就必须使用Oracle的kernel来替换掉红帽的。
这份声明详见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已不再现实,另外ASMLib也有一定的缺点,详见文档说明:
http://www.oracledatabase12g.com/archives/why-asmlib-and-why-not.html
因此,目前在Red Hat Enterprise Linux (RHEL)6上使用Oracle+ASM,已不再使用ASMLib,而是采用udev设备文件来配置ASM。
udev 是Linux2.6 内核里的一个功能,它替代了原来的devfs,成为当前Linux 默认的设备管理工具。udev 以守护进程的形式运行,通过侦听内核发出来的uevent 来管理/dev目录下的设备文件。不像之前的设备管理工具,udev 在用户空间(user space) 运行,而不在内核空间(kernel space) 运行。
ASMLIB是一种基于Linux module,专门为Oracle Automatic Storage Management特性设计的内核支持库(kernel support library)。
长久以来我们对ASMLIB的认识并不全面,这里我们来具体了解一下使用ASMLIB的优缺点。
理论上我们可以从ASMLIB API中得到的以下益处:
虽然从理论上我们可以从ASMLIB中得到性能收益,但实践过程中这种优势是几乎可以忽略的,没有任何性能报告显示ASMLIB对比Linux上原生态的udev设备管理服务有任何性能上的优势。在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."的评论,实际上使用ASMLIB和直接使用裸设备(raw device)在性能上没有什么差别。
ASMLIB可能带来的缺点:
结论:我个人的观点是尽可能不要使用ASMLIB,当然这不是DBA个人所能决定的事情。另一方面这取决于个人习惯,在rhel 4的早期发行版本中没有提供udev这样的设备管理服务,这导致在rhel 4中大量的ASM+RAC组合的系统使用ASMLIB ,经网友指出udev作为kernel 2.6的新特性被引入,在rhel4的初始版本中就已经加入了udev绑定服务,但是在rhel4时代实际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中那么你已经有充分的理由利用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
实验环境:
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
软件:
在正式安装开始前,请先检查你的软硬件条件是否满足安装需要。
硬件上可以使用命令查看内存情况和 CPU 特性:
#more /proc/meminfo
#more /proc/cpuinfo
其中内存的要求是不低于 1G
下面的不是必须的,可选使用
#df –k /dev/shm 检查共享内存
#df –k /tmp 检查临时磁盘空间
#more /proc/version 检查操作系统版本
#uname –r 检查内核版本
内存
# 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 ~]#
可以统一检查:
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
我们可以看到没有安装过的包会已is not installed 出现:
[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 ~]#
如果部分包不存在
可以批量更新安装,但如果依赖关系缺失,可能需要多执行两遍
或者手工调整
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 逐个检查,因为是官方要求,所以为了不在安装时出现不必要的麻烦,还是确认都全部安装为好。
虽然我是全新安装的系统也存在 3 个包没安装: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 建议顺便安装下面两个包:
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表示主机设置为zijuan.
注意:修改主机名后,需要重启系统后生效,或者切换个用户然后切换回来就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
注意将主机名对应到真实ip地址,否则oracle有可能将监听程序仅仅建立在127.0.0.1上
如果要配置em的话,这里最后把系统的ip地址设置成静态的ip地址,不然可能导致em访问的时候改变了数据库服务器的ip地址,从而导致其它问题的出现,具体静态ip地址配置参考( o()︿))o 唉。。。。这一块内容还没有写博客,大家可以百度或者私聊我)
这里我们准备5块硬盘
1块硬盘安装操作系统
234块用于实现ASM 存储数据
5块硬盘用于存储FRA
1.1.编辑虚拟机配置
1.2.添加硬件
1.3.添加第一块硬盘
1.4.创建新的虚拟磁盘
1.5.选择磁盘类型
1.6.设置磁盘大小
1.7.完成
1.8.
添加第二、三、四、五块磁盘:重复步骤 1~7
1.9.
这里5块磁盘添加完毕后,为了避免后边再重启一次,可以先把后边需要的一个步骤做了,就是找到虚拟机的配置文件,在最后添加一行disk.EnableUUID="TRUE",这里注意修改文件的时候一定要在关机的状态下修改该参数文件。
磁盘添加完成后,启动虚拟机,作为 root用户登录系统,格式化新添加的两块磁盘。
[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
磁盘分区完成后,查看所有磁盘情况。
注意这里只做磁盘的分区,并不做磁盘的格式化和挂载
利用 /usr/sbin/groupadd 命令
------这里Oracle用户可能已经安装过的,没有影响:
代码:
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
注意以下两点:
首先切换到root用户下:
5.1.不同的操作系统,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文件,如果该文件不存在,则创建该文件并添加如下行:
[root@localhost ~]# vi /etc/scsi_id.config
options=--whitelisted --replace-whitespace
[root@localhost ~]#
5.3.如果是使用 VMware虚拟机,直接输入 scsi_id命令可能无法获取 id,需修改 VMware文件参数,这一步如果在添加磁盘的时候做过这一步的话就可以跳过了,直接获取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
使用文本编辑器编辑该文件,在尾部新增一行参数:
disk.EnableUUID="TRUE"
保存文件,重新启动虚拟机。这里注意修改文件的时候一定要在关机的状态下修改,或者 scsi_id -g -u /dev/sdc来获得uuid,-g -u参数在rhel6以后已经不用了
[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"
根据步骤 5 获取的 ID 修改 RESULT 值
这里需要注意,一个KERNEL就是一行,不能换行的,我之前就是犯了这个错误的
添加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创建数据库实例的时候找不见磁盘组。
该步骤慢一点,大约可能需要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
这步当然也可以使用其它软件来替代上传软件包:
[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.检查安装脚本是否具有可执行权限
[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]$
如果无可执行权限,执行以下命令进行授权:
[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. 执行安装脚本 /home/grid/grid/runInstaller
首先打开Xmanager - Passive软件,然后在 Xshell会话设置如下:
[grid@rhel_linux_asm grid]$ clear
[grid@rhel_linux_asm grid]$ export DISPLAY=192.168.1.100:0.0---这里的ip地址就是本机的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.
执行修复脚本:
[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
这些软件包其实已安装,只不过因为 Oracle Linux 6.4自带的软件包版本高于检查版本,所以检查不通过,忽略即可。
Oracle Linux 6.4的安装光盘中无 pdksh软件包,安装 ksh软件包即可。
# yum install -y ksh
因为没有 NTP时钟服务器,所以 NTP检查不通过,忽略即可。
17.6.4.
17.7.
17.8.
17.9.安装时间较长,请耐心等待。
安装过程中会弹出对话框,提示你以 root身份执行两个脚本:
[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: --单实例安装需执行以下脚本
/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.
截图如下:
下边按照要求执行脚本:
[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 -- 报错
Failed to create keys in the OLR, rc = 32512, 32512
OLR configuration failed
[root@localhost ~]#
解决报错:
17.9.1.检查操作系统中 libcap.so是否已安装
如果是 64位系统,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. 重新执行 /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