ITPub博客

首页 > Linux操作系统 > Linux操作系统 > OEL 6.4+ASM+11.2.0.4安装

OEL 6.4+ASM+11.2.0.4安装

原创 Linux操作系统 作者:DBA_oracle_java 时间:2013-09-09 21:00:12 0 删除 编辑
1.安装oracle所需要的rpm包
在OEL5中,可以使用oracle-validated来安装oracle所需要的rpm包,但是在OEL6中oracle没有推出类似于OEL5的oracle-validated
而是是使用了oracle-rdbms-server-11gR2-preinstall
相关链接:https://blogs.oracle.com/linux/entry/oracle_rdbms_server_11gr2_pre

使用如下步骤下载public-yum-ol6.repo文件
# cd /etc/yum.repos.d
# wget https://public-yum.oracle.com/public-yum-ol6.repo

不过如果你的机器不能上网的话,上面的方法就不行了。好在从oracle linux6.3开始,该功能支持本地光盘了。
[root@localhost ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda6             5.9G  4.6G  934M  84% /
tmpfs                 1.2G  340K  1.2G   1% /dev/shm
/dev/sda5             1.5G   35M  1.4G   3% /tmp
/dev/sda1             9.9G  151M  9.2G   2% /u01
/dev/sda2             9.9G  151M  9.2G   2% /u02
/dev/sr0              3.5G  3.5G     0 100% /media/OL6.4 x86_64 Disc 1 20130225
/dev/sr0              3.5G  3.5G     0 100% /mnt/cdrom
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# mv public-yum-ol6.repo public-yum-ol6.repo.bak
[root@localhost yum.repos.d]# touch public-yum-ol6.repo
[oel6]
name = Enterprise Linux 6.4 DVD
baseurl=file:///mnt/cdrom/Server
gpgcheck=0
enabled=1
[root@localhost yum.repos.d]# yum install oracle-rdbms-server-11gR2-preinstall
Loaded plugins: security
oel6                                                     | 3.7 kB     00:00 ... 
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package oracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-7.el6 will be installed
--> Processing Dependency: compat-libstdc++-33 for package: oracle-rdbms-server-11gR2-preinstall-1.0-7.el6.x86_64
--> Processing Dependency: libaio-devel for package: oracle-rdbms-server-11gR2-preinstall-1.0-7.el6.x86_64
--> Processing Dependency: compat-libcap1 for package: oracle-rdbms-server-11gR2-preinstall-1.0-7.el6.x86_64
--> Processing Dependency: ksh for package: oracle-rdbms-server-11gR2-preinstall-1.0-7.el6.x86_64
--> Running transaction check
---> Package compat-libcap1.x86_64 0:1.10-1 will be installed
---> Package compat-libstdc++-33.x86_64 0:3.2.3-69.el6 will be installed
---> Package ksh.x86_64 0:20100621-19.el6 will be installed
---> Package libaio-devel.x86_64 0:0.3.107-10.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================
 Package                                             Arch                  Version                        Repository           Size
====================================================================================================================================
Installing:
 oracle-rdbms-server-11gR2-preinstall                x86_64                1.0-7.el6                      oel6                 15 k
Installing for dependencies:
 compat-libcap1                                      x86_64                1.10-1                         oel6                 17 k
 compat-libstdc++-33                                 x86_64                3.2.3-69.el6                   oel6                183 k
 ksh                                                 x86_64                20100621-19.el6                oel6                686 k
 libaio-devel                                        x86_64                0.3.107-10.el6                 oel6                 13 k

Transaction Summary
====================================================================================================================================
Install       5 Package(s)

Total download size: 913 k
Installed size: 2.3 M
Is this ok [y/N]: y
Is this ok [y/N]: y
Downloading Packages:
------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                               7.7 MB/s | 913 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : ksh-20100621-19.el6.x86_64                                                                                       1/5 
  Installing : libaio-devel-0.3.107-10.el6.x86_64                                                                               2/5 
  Installing : compat-libstdc++-33-3.2.3-69.el6.x86_64                                                                          3/5 
  Installing : compat-libcap1-1.10-1.x86_64                                                                                     4/5 
  Installing : oracle-rdbms-server-11gR2-preinstall-1.0-7.el6.x86_64                                                            5/5 
  Verifying  : oracle-rdbms-server-11gR2-preinstall-1.0-7.el6.x86_64                                                            1/5 
  Verifying  : compat-libcap1-1.10-1.x86_64                                                                                     2/5 
  Verifying  : compat-libstdc++-33-3.2.3-69.el6.x86_64                                                                          3/5 
  Verifying  : libaio-devel-0.3.107-10.el6.x86_64                                                                               4/5 
  Verifying  : ksh-20100621-19.el6.x86_64                                                                                       5/5 

Installed:
  oracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-7.el6                                                                           

Dependency Installed:
  compat-libcap1.x86_64 0:1.10-1              compat-libstdc++-33.x86_64 0:3.2.3-69.el6        ksh.x86_64 0:20100621-19.el6       
  libaio-devel.x86_64 0:0.3.107-10.el6       

Complete!


2.调整系统参数
2.1调整/etc/security/limits.conf

下面我们需要对参数做一些调整,其中oracle部分的参数已经由oracle-rdbms-server-11gR2-preinstall设置好,先只需要加入grid用户的设置

[root@ASMDB ~]# cat /etc/security/limits.conf
# End of file

# oracle-rdbms-server-11gR2-preinstall setting for nofile soft limit is 1024
oracle   soft   nofile    1024
grid soft   nofile    1024
# oracle-rdbms-server-11gR2-preinstall setting for nofile hard limit is 65536
oracle   hard   nofile    65536
grid hard   nofile    65536
# oracle-rdbms-server-11gR2-preinstall setting for nproc soft limit is 2047
oracle   soft   nproc    2047
grid soft   nproc    2047
# oracle-rdbms-server-11gR2-preinstall setting for nproc hard limit is 16384
oracle   hard   nproc    16384
grid hard   nproc    16384
# oracle-rdbms-server-11gR2-preinstall setting for stack soft limit is 10240KB
oracle   soft   stack    10240
grid soft   stack    10240
# oracle-rdbms-server-11gR2-preinstall setting for stack hard limit is 32768KB
oracle   hard   stack    32768
grid   hard   stack    32768


3.创建所需要的用户及组
[root@localhost ~]# cat /etc/group | grep oinstall
oinstall:x:54321:
[root@localhost ~]# cat /etc/group | grep dba
dba:x:54322:

[root@localhost ~]# groupadd oper
[root@localhost ~]# groupadd asmadmin
[root@localhost ~]# groupadd asmdba
[root@localhost ~]# groupadd asmope
[root@localhost ~]#  useradd -g oinstall -G asmadmin,asmdba,asmoper,dba -c "Grid Infrastructure Owner" grid
[root@localhost ~]# usermod -G dba,oper,asmdba -c "Database Owner" oracle

[root@localhost ~]# id grid
uid=500(grid) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54324(asmadmin),54325(asmdba),54326(asmoper)
[root@localhost ~]# id oracle
uid=501(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(oper),54325(asmdba)

4.设置用户环境变量
[oracle@localhost ~]$ cat .bash_profile 
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
export ORACLE_BASE=/u02/app/oracle
export ORACLE_HOME=$ORACLE_BASE/products/11.2.0
export TNS_ADMIN=$ORACLE_HOME/network/admin
export ORACLE_SID=asmdb
export PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$ORACLE_BASE/products/crs/bin:.
echo -ne "\033]0;${USER}@${HOSTNAME%%.*}\007"
export PS1='${LOGNAME}@${HOSTNAME}:${PWD}>'
stty erase ^H

[grid@localhost ~]$ cat .bash_profile 
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
export ORACLE_HOME=/u01/app/11.2.0/grid
export TNS_ADMIN=$ORACLE_HOME/network/admin
export ORACLE_SID=+ASM1
export PATH=$PATH:$ORACLE_HOME/bin
echo -ne "\033]0;${USER}@${HOSTNAME%%.*}\007"
export PS1='${LOGNAME}@${HOSTNAME}:${PWD}>'
stty erase ^H

5.创建目录
[root@localhost /]# chown -R grid:oinstall /u01/
[root@localhost /]# chown -R oracle:oinstall /u02/
oracle@ASMDB:/home/oracle>mkdir -p $ORACLE_BASE
oracle@ASMDB:/home/oracle>mkdir -p $ORACLE_HOME

grid@ASMDB:/home/grid>mkdir -p $ORACLE_HOME

##关闭防火墙
[root@ASMDB ~]# service  iptables stop
iptables: Flushing firewall rules: [  OK  ]
iptables: Setting chains to policy ACCEPT: filter [  OK  ]
iptables: Unloading modules: [  OK  ]
[root@ASMDB ~]# chkconfig iptables off

6.关闭selinux
[root@ASMDB ~]# cat /etc/selinux/config | grep SELINUX
# SELINUX= can take one of these three values:
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
SELINUXTYPE=targeted 

7.配置ASM盘
使用5块裸盘做ASM盘,规划如下
---------------------------------
+DATA | 5G,5G |  normal          | 
+RECO | 2G    |  external |
+FRA  | 3G    |  external |
+DBFS | 1G    |  external |
--------------------------------     
7.1确认设备名称
[root@ASMDB ~]# ls -l /dev/sd*
brw-rw---- 1 root disk 8,  0 Sep  7 00:46 /dev/sda
brw-rw---- 1 root disk 8,  1 Sep  7 00:46 /dev/sda1
brw-rw---- 1 root disk 8,  2 Sep  7 00:46 /dev/sda2
brw-rw---- 1 root disk 8,  3 Sep  7 00:46 /dev/sda3
brw-rw---- 1 root disk 8,  4 Sep  7 00:46 /dev/sda4
brw-rw---- 1 root disk 8,  5 Sep  7 00:46 /dev/sda5
brw-rw---- 1 root disk 8,  6 Sep  7 00:46 /dev/sda6
brw-rw---- 1 root disk 8, 16 Sep  7 00:46 /dev/sdb
brw-rw---- 1 root disk 8, 32 Sep  7 00:46 /dev/sdc
brw-rw---- 1 root disk 8, 48 Sep  7 00:46 /dev/sdd
brw-rw---- 1 root disk 8, 64 Sep  7 00:46 /dev/sde

7.2绑定物理设备
# /bin/raw /dev/raw/raw1 /dev/sdb
/dev/raw/raw1:  bound to major 8, minor 16
# /bin/raw /dev/raw/raw2 /dev/sdc
/dev/raw/raw2:  bound to major 8, minor 32
# /bin/raw /dev/raw/raw3 /dev/sdd
/dev/raw/raw3:  bound to major 8, minor 48
# /bin/raw /dev/raw/raw4 /dev/sde
/dev/raw/raw4:  bound to major 8, minor 64

7.3配置UDEV规则文件
# vi /etc/udev/rules.d/60-raw.rules
#ADD
ACTION=="add",KERNEL=="/dev/sdb",  RUN+="/bin/raw /dev/raw/raw1 %N",OWNER="grid", GROUP="asmadmin", MODE="0660"
ACTION=="add",KERNEL=="/dev/sdc",  RUN+="/bin/raw /dev/raw/raw2 %N",OWNER="grid", GROUP="asmadmin", MODE="0660"
ACTION=="add",KERNEL=="/dev/sdd",  RUN+="/bin/raw /dev/raw/raw3 %N",OWNER="grid", GROUP="oinstall", MODE="0660"
ACTION=="add",KERNEL=="/dev/sde",  RUN+="/bin/raw /dev/raw/raw4 %N",OWNER="grid", GROUP="oinstall", MODE="0660"
KERNEL=="raw*", WNER="grid", GROUP="asmadmin", MODE="0660"
chown grid:oinstall /dev/raw/raw*

7.4配置raw的控制文件
# vi /etc/sysconfig/rawdevices
#ADD
/dev/raw/raw1 /dev/sdb
/dev/raw/raw2 /dev/sdc
/dev/raw/raw3 /dev/sdd
/dev/raw/raw4 /dev/sde

7.5配置开机绑定并赋权限
# vi /etc/rc.local 
#ADD
/bin/raw /dev/raw/raw1 /dev/sdb
/bin/raw /dev/raw/raw2 /dev/sdc
/bin/raw /dev/raw/raw3 /dev/sdd
/bin/raw /dev/raw/raw4 /dev/sde
chown grid:asmadmin /dev/raw/raw*
chmod 0660 /dev/raw/raw*

8.安装grid自带RPM包
# CVUQDISK_GRP=oinstall; export CVUQDISK_GRP
# rpm -ivh cvuqdisk-1.0.9-1.rpm

./runcluvfy.sh stage -pre crsinst -n ASMDB -fixup -verbose
QQ交流群:300392987

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26169542/viewspace-772434/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2013-07-02

  • 博文量
    31
  • 访问量
    116864