注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

mmicky 的博客

追逐刹那的惊艳

 
 
 

日志

 
 

ASM安装Oracle11R2系列(三:ASMLib配置)  

2013-04-30 13:01:03|  分类: ORACLE |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
前言:使用ASMLib必须下载和Linux版本配套的ASMLib,而且Oracle貌似以后不再提供后续的ASMLib,本测试是以前记录下了,在发布本博的时候没重新测试,理论上应该是可以正常使用的。

1:增加虚拟硬盘组:
vmware-vdiskmanager.exe -c -s 2GB -a lsilogic -t 2 E:\MyVM\ASMDisk\Disk1.vmdk
vmware-vdiskmanager.exe -c -s 4GB -a lsilogic -t 2 E:\MyVM\ASMDisk\Disk2.vmdk
vmware-vdiskmanager.exe -c -s 4GB -a lsilogic -t 2 E:\MyVM\ASMDisk\Disk3.vmdk
 
2:修改虚拟机配置文件,增加以下参数,注意已经存在的参数就不必增加了。
disk.locking="FALSE"    
diskLib.dataCacheMaxSize = "0"
disk.EnableUUID = "TRUE"
 
scsi1.present = "TRUE"
scsi1.sharedBus = "Virtual"
scsi1.virtualDev = "lsilogic"
 
scsi1:0.present = "TRUE"
scsi1:0.mode = "independent-persistent"
scsi1:0.fileName = "E:\MyVM\ASMDisk\Disk1.vmdk"
scsi1:1.present = "TRUE"
scsi1:1.mode = "independent-persistent"
scsi1:1.fileName = "E:\MyVM\ASMDisk\Disk2.vmdk"
scsi1:2.present = "TRUE"
scsi1:2.mode = "independent-persistent"
scsi1:2.fileName = "E:\MyVM\ASMDisk\Disk3.vmdk"

3:Oracle Linux 6.3需要安装的组件
    Base System > Base
    Base System > Client management tools
    Base System > Compatibility libraries
    Base System > Hardware monitoring utilities
    Base System > Large Systems Performance
    Base System > Network file system client
    Base System > Performance Tools
    Base System > Perl Support
    Servers > Server Platform
    Servers > System administration tools
    Desktops > Desktop
    Desktops > Desktop Platform
    Desktops > Fonts
    Desktops > General Purpose Desktop
    Desktops > Graphical Administration Tools
    Desktops > Input Methods
    Desktops > X Window System
    Development > Additional Development
    Development > Development Tools
    Applications > Internet Browser

4:增加新的硬盘到虚拟机,并对磁盘操作
[root@TestServer ~]# ls /dev/sd*
[root@TestServer ~]# fdisk /dev/sdb
[root@TestServer ~]# mkfs.ext4 /dev/sdb1
[root@TestServer ~]# fdisk /dev/sdc
[root@TestServer ~]# mkfs.ext4 /dev/sdc1
[root@TestServer ~]# fdisk /dev/sdd
[root@TestServer ~]# mkfs.ext4 /dev/sdd1
可以查看磁盘信息和逻辑盘的UUID
[root@TestServer ~]# ls /dev/sd*
[root@TestServer ~]# blkid

5:创建用户组和用户
[root@TestServer ~]# groupadd -g 1000 oinstall
[root@TestServer ~]# groupadd -g 1100 asmadmin
[root@TestServer ~]# groupadd -g 1200 dba
[root@TestServer ~]# groupadd -g 1300 asmdba
[root@TestServer ~]# groupadd -g 1301 asmoper
[root@TestServer ~]# useradd -u 1100 -g oinstall -G asmadmin,asmdba,asmoper,dba grid
[root@TestServer ~]# useradd -u 1101 -g oinstall -G dba,asmdba oracle
[root@TestServer ~]# mkdir -p /app/grid
[root@TestServer ~]# mkdir -p /app/11.2.0/grid
[root@TestServer ~]# chown -R grid:oinstall /app
[root@TestServer ~]# mkdir -p /app/oracle
[root@TestServer ~]# mkdir -p /app/oracle/product/11.2.0/db_1
[root@TestServer ~]# chown -R oracle:oinstall /app/oracle
[root@TestServer ~]# chmod -R 775 /app
[root@TestServer ~]# passwd oracle
[root@TestServer ~]# passwd grid

6:检查所需的软件包
oracle所需的软件包详见《Oracle Quick Installation Guide for Linux x86》,比如Oracle Linux5.4需要以下软件包:
binutils-2.20.51.0.2-5.11.el6.i686
compat-libcap1-1.10-1.i686
compat-libstdc++-33-3.2.3-69.el6.i686
gcc-4.4.4-13.el6.i686
gcc-c++-4.4.4-13.el6.i686
glibc-2.12-1.7.el6.i686
glibc-devel-2.12-1.7.el6.i686
ksh
libgcc-4.4.4-13.el6.i686
libstdc++-4.4.4-13.el6.i686
libstdc++-devel-4.4.4-13.el6.i686
libaio-0.3.107-10.el6.i686
libaio-devel-0.3.107-10.el6.i686
make-3.81-19.el6.i686
sysstat-9.0.4-11.el6.i686
unixODBC-2.2.14-11.el6.i686 or later
unixODBC-devel-2.2.14-11.el6.i686 or later
elfutils-libelf-devel-0.152-1.el6.x86_64.rpm
elfutils-libelf-0.152-1.el6.x86_64.rpm

系统中需要安装版本不低于以上的软件包,若没有安装则到安装盘下找到相应的软件包进行安装。
    a:查看是否已经安装某个软件包,可以用类似命令: rpm -qa |grep compat
    b:查看所有软件包是否已经安装,可以用类似命令: rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' binutils compat-libcap1  compat-libstdc++-33 gcc gcc-c++ glibc glibc-devel ksh libgcc libstdc++ libstdc++-devel  libaio libaio-devel make sysstat unixODBC unixODBC-devel elfutils-libelf-devel elfutils-libelf
    c:在安装盘Packages目录中未安装的软件包: find /media/{CDNAME}/Packages -name "compat-lib*"
    d:安装未安装的软件包: rpm -ihv compat-libcap1-1.10-1.x86_64.rpm compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm ksh-20100621-16.el6.x86_64.rpm libaio-devel-0.3.107-10.el6.x86_64.rpm unixODBC-2.2.14-11.el6.x86_64.rpm unixODBC-devel-2.2.14-11.el6.x86_64.rpm elfutils-libelf-devel-0.152-1.el6.x86_64.rpm

7:安装ASMlib
    a:查看所有软件包是否已经安装,可以用类似命令: rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n'  oracleasmlib oracleasm-support
    b:安装asmlib(可能在安装过程中需要安装内核软件包,从安装盘中获取):rpm -ihv oracleasmlib-2.0.4-1.el6.x86_64.rpm oracleasm-support-2.1.5-1.el6.x86_64.rpm

8:配置ASM
# /etc/init.d/oracleasm configure
# /etc/init.d/oracleasm createdisk DISK1 /dev/sdb1
# /etc/init.d/oracleasm createdisk DISK2 /dev/sdc1
# /etc/init.d/oracleasm createdisk DISK3 /dev/sdd1
***********************************************************************
***********************************************************************
***********************************************************************
出现错误:
Writing disk header: done
Instantiating disk: failed
Clearing disk header: done
A:原因1:oracleasm configure不正确的造成的,除了/etc/init.d/oracleasm之外,还有一个在/usr/sbin/目录下,默认就调用了这个oracleasm,所以执行oracleasm configure没有任何输出反馈。
所以只要调用/etc/init.d/oracleasm就可以了。

B:Not disabling SELINUX
vi /etc/sysconfig/selinux SELINUX=disabled

Then reboot your system and run getenforce to confirm that
SELINUX is disabled:
root> /usr/sbin/getenforce Disabled
- Ensureingthat /etc/rc.local is read immediately after reboot.
more information,see:
http://www.dba-oracle.com/t_asm_disk_does_not_exist_or_is_not_instantiated.htm
***********************************************************************
***********************************************************************
***********************************************************************
# /etc/init.d/oracleasm scandisks
# /etc/init.d/oracleasm listdisks

9:修改内核参数 /etc/sysctl.conf,要启用运行:# /sbin/sysctl -p
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 1073741824
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

10:修改用户shell限制 /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
grid soft stack 10240

11:为oracle用户修改环境变量,用命令使设置生效:source /home/oracle/.bash_profile
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_HOSTNAME=TestServer; export ORACLE_HOSTNAME
ORACLE_UNQNAME=test1; export ORACLE_UNQNAME
ORACLE_BASE=/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=test1; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi

12:为grid用户修改环境变量,用命令使设置生效:source /home/grid/.bash_profile
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_HOSTNAME=TestServer; export ORACLE_HOSTNAME
ORACLE_BASE=/app/grid; export ORACLE_BASE
ORACLE_HOME=/app/11.2.0/grid; export ORACLE_HOME
ORACLE_SID=+ASM1; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
if [ $USER = "grid" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi

13:在" /etc/pam.d/login"文件中增加或修改如下参数:
session    required     pam_limits.so

14:在" /etc/sysconfig/selinux "文件中修改如下参数:
 SELINUX=disabled

15:在" /etc/hosts"文件中增加本机解析:

192.168.100.91  TestServer (lsnrctl启动时需要)

16:配置service

[root@TestServer ~]# service iptables save

[root@TestServer ~]# service iptables stop

[root@TestServer ~]# chkconfig iptables off

[root@TestServer ~]# service ip6tables save

[root@TestServer ~]# service ip6tables stop

[root@TestServer ~]# chkconfig ip6tables off

[root@TestServer ~]# service postfix stop

[root@TestServer ~]# chkconfig postfix off

17:安装grid Infrastructure和database,详见本系列第四第五部分。
  评论这张
 
阅读(161)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017