ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Oracle 11g R2 Rhel5.4 x86_64下安装准备工作

Oracle 11g R2 Rhel5.4 x86_64下安装准备工作

原创 Linux操作系统 作者:鲍远森 时间:2011-07-24 13:20:47 0 删除 编辑

Oracle 11g R2 Rhel5.4 x86_64下安装准备工作

一、环境介绍:

1.所需组件:

虚拟机:VitrualBox 4.0.12
OS:RHEL5.4 x86_64
Oracle:oracle 11g r2 64bit

2.节点信息:


二.准备工作:

1.系统包设置:

Oracle在安装linux 5下所需要的安装包:

Asianux Server 3, Oracle Linux 5, and Red Hat Enterprise Linux 5 The following packages (or later versions) must be installed:
binutils-2.17.50.0.6
compat-libstdc++-33-3.2.3
compat-libstdc++-33-3.2.3 (32 bit)
elfutils-libelf-0.125
elfutils-libelf-devel-0.125
gcc-4.1.2
gcc-c++-4.1.2
glibc-2.5-24
glibc-2.5-24 (32 bit)
glibc-common-2.5
glibc-devel-2.5
glibc-devel-2.5 (32 bit)
glibc-headers-2.5
ksh-20060214
libaio-0.3.106
libaio-0.3.106 (32 bit)
libaio-devel-0.3.106
libaio-devel-0.3.106 (32 bit)
libgcc-4.1.2
libgcc-4.1.2 (32 bit)
libstdc++-4.1.2
libstdc++-4.1.2 (32 bit)
libstdc++-devel 4.1.2
make-3.81
numactl-devel-0.9.8.x86_64
sysstat-7.0.2
unixODBC-2.2.11 (32 bit) or later
unixODBC-devel-2.2.11 (64 bit) or later
unixODBC-2.2.11 (64 bit) or later


安装过程:进入对应镜像文件,在root用户下执行:(由于我在安装OS的时候将软件开发的大部分组件都选上,很多rpm包都已经安装过了)

cd /media/RHEL_5.4\ x86_64\ DVD/Server/ rpm -Uvh binutils-2.* rpm -Uvh compat-libstdc++-33* rpm -Uvh elfutils-libelf-0.* rpm -Uvh elfutils-libelf-devel-* rpm -Uvh gcc-4.* rpm -Uvh gcc-c++-4.* rpm -Uvh glibc-2.* rpm -Uvh glibc-common-2.* rpm -Uvh glibc-devel-2.* rpm -Uvh glibc-headers-2.* rpm -Uvh ksh-2* rpm -Uvh libaio-0.* rpm -Uvh libaio-devel-0.* rpm -Uvh libgcc-4.* rpm -Uvh libstdc++-4.* rpm -Uvh libstdc++-devel-4.* rpm -Uvh make-3.* rpm -Uvh sysstat-7.* rpm -Uvh unixODBC-2.* rpm -Uvh unixODBC-devel-2.*

2.系统内核设置:

#vi /etc/sysctl.conf中添加如下信息:kernel.shmall如果设置太小则修改,其它均需要添加到这个文件中。

kernel.shmall = 4294967296 fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmmax = 536870912 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 = 1048586
使此内核更改立即生效:

sysctl -p

3.用户资源限制设置:

配置grid与oracle用户的环境变量和shell限制,#vi /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

4.系统内存设置:

查看系统内存、交换分区信息:

grep MemTotal /proc/meminfo grep SwapTotal /proc/meminfo free

在Linux,Memory Size (SGA and PGA)不能大于/dev/shm,因此需要调大共享内存大小:

查看共享内存大小:

df -h /dev/shm

如果太小,则需要调大共享内存:卸载共享内存,挂载共享内存:

umount tmpfs mount -t tmpfs shmfs -o size=1700m /dev/shm df -h /dev/shm

设置重启后依旧挂载,#vi /etc/fstab 添加:由于在此搭建的是虚拟机环境,因此设置为1.7G。

shms /dev/shm tmpfs size=1700m 0

5.网络安全设置:

禁用SELinux,在"/etc/selinux/config" 修改:

SELINUX=disabled

关闭防火墙:

使用界面工具 (系统 > 管理 > 防火墙)点击禁用,并应用。


6.网络设置:

编辑/etc/hosts文件,添加如下内容:

#Public Network - (eth0) 192.168.1.201 rac1 192.168.1.202 rac2 #Private Network - (eth1) 192.168.0.201 rac1-priv 192.168.0.202 rac2-priv #Public Virtual IP - (eth0:1) 192.168.1.203 rac1-vip 192.168.1.204 rac2-vip # Single Client Access Name (SCAN) 192.168.1.205 rac-scan 192.168.1.206 rac-scan 192.168.1.207 rac-scan

7.用户及组设置:

创建组及用户:在root用户下执行下面的命令:

groupadd -g 1000 oinstall groupadd -g 1100 asmadmin groupadd -g 1200 dba groupadd -g 1300 asmdba groupadd -g 1301 asmoper useradd -u 1100 -g oinstall -G asmadmin,asmdba,asmoper -d /home/grid grid useradd -u 1101 -g oinstall -G dba,asmdba -d /home/oracle oracle passwd oracle passwd grid

通过下面的命令检查oracle及grid用户是否已添加至相应的组中:

id oracle id grid

创建安装目录:

mkdir -p /u01/app/grid mkdir -p /u01/app/11.2.0/grid chown -R grid:oinstall /u01 mkdir -p /u01/app/oracle chown oracle:oinstall /u01/app/oracle chmod -R 775 /u01

分别在两节点修改grid用户的环境变量,注意在两个节点上需要修改ORACLE_SID:

ORACLE_SID=+ASM1; export ORACLE_SID JAVA_HOME=/usr/local/java; export JAVA_HOME ORACLE_BASE=/u01/app/grid; export ORACLE_BASE ORACLE_HOME=/u01/app/11.2.0/grid; export ORACLE_HOME ORACLE_PATH=/u01/app/oracle/common/oracle/sql; export ORACLE_PATH ORACLE_TERM=xterm; export ORACLE_TERM NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; export NLS_DATE_FORMAT TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11 PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin PATH=${PATH}:/u01/app/common/oracle/bin export PATH LD_LIBRARY_PATH=$ORACLE_HOME/lib LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib export LD_LIBRARY_PATH CLASSPATH=$ORACLE_HOME/JRE CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib export CLASSPATH THREADS_FLAG=native; export THREADS_FLAG export TEMP=/tmp export TMPDIR=/tmp umask 022

分别在两节点上修改oracle用户的环境变量:在两个节点上需要修改ORACLE_SID:

ORACLE_HOSTNAME=racdb1; export ORACLE_HOSTNAME ORACLE_UNQNAME=racdb; export ORACLE_UNQNAME ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME ORACLE_SID=rac1; 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 fi

8.存储设置:

查看存储设备是否挂接:

在服务器上挂载共享存储阵列,在这里使用的是虚拟机的虚拟存储。可以通过 ls -l /dev/sd* 查看磁盘:(其中sda盘为系统盘,sdb-sdg为挂载共享盘)

[root@rac1 ~]# ls -l /dev/sd* brw-r----- 1 root disk 8, 0 07-24 16:00 /dev/sda brw-r----- 1 root disk 8, 1 07-24 16:00 /dev/sda1 brw-r----- 1 root disk 8, 2 07-24 16:00 /dev/sda2 brw-r----- 1 root disk 8, 16 07-24 16:00 /dev/sdb brw-r----- 1 root disk 8, 32 07-24 16:00 /dev/sdc brw-r----- 1 root disk 8, 48 07-24 16:00 /dev/sdd brw-r----- 1 root disk 8, 64 07-24 16:00 /dev/sde brw-r----- 1 root disk 8, 80 07-24 16:00 /dev/sdf brw-r----- 1 root disk 8, 96 07-24 16:00 /dev/sdg

磁盘分区:

依次将挂载的6个共享磁盘进行分区:

[root@rac1 ~]# fdisk /dev/sdb Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. The number of cylinders for this disk is set to 1305. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-1305, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-1305, default 1305): Using default value 1305 Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks.

创建ASM磁盘:

ASM使用硬盘有两种方式:第一是使用ASMLib(方便管理),第二种是不使用ASMLib,而是使用raw devices,在这里我们使用ASMLib。

ASMLib下载地址:http://www.oracle.com/technetwork/server-storage/linux/downloads/rhel5-084877.html

注意事项:ASMLib必须要与OS服务器的内核版本一致。linux内核可通过#uname -r 查看。

安装ASMLib:

[root@rac1 opt]# uname -r 2.6.18-164.el5 [root@rac1 opt]# ls oracleasm-2.6.18-164.el5-2.0.5-1.el5.x86_64.rpm oracleasmlib-2.0.4-1.el5.x86_64.rpm oracleasm-support-2.1.7-1.el5.x86_64.rpm [root@rac1 opt]# rpm -iv oracleasm-support-2.1.7-1.el5.x86_64.rpm \ > oracleasm-2.6.18-164.el5-2.0.5-1.el5.x86_64.rpm \ > oracleasmlib-2.0.4-1.el5.x86_64.rpm warning: oracleasm-support-2.1.7-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159 Preparing packages for installation... oracleasm-support-2.1.7-1.el5 oracleasm-2.6.18-164.el5-2.0.5-1.el5 oracleasmlib-2.0.4-1.el5

启动oracleasm:

/etc/init.d/oracleasm start

设置ASM的所属用户及组:

[root@rac1 opt]# /etc/init.d/oracleasm configure -i 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 without typing an answer will keep that current value. Ctrl-C will abort. Default user to own the driver interface []: grid Default group to own the driver interface []: asmadmin Start Oracle ASM library driver on boot (y/n) [n]: y Scan for Oracle ASM disks on boot (y/n) [y]: Writing Oracle ASM library driver configuration: done Initializing the Oracle ASMLib driver: [ OK ] Scanning the system for Oracle ASMLib disks: [ OK ]

创建ASM磁盘:

[root@rac1 opt]# /etc/init.d/oracleasm createdisk DBDISK1 /dev/sdb1 Marking disk "DBDISK1" as an ASM disk: [ OK ] [root@rac1 opt]# /etc/init.d/oracleasm createdisk DBDISK2 /dev/sdc1 Marking disk "DBDISK2" as an ASM disk: [ OK ] [root@rac1 opt]# /etc/init.d/oracleasm createdisk DBDISK3 /dev/sdd1 Marking disk "DBDISK3" as an ASM disk: [ OK ] [root@rac1 opt]# /etc/init.d/oracleasm createdisk DBDISK4 /dev/sde1 Marking disk "DBDISK4" as an ASM disk: [ OK ] [root@rac1 opt]# /etc/init.d/oracleasm createdisk DBDISK5 /dev/sdf1 Marking disk "DBDISK5" as an ASM disk: [ OK ] [root@rac1 opt]# /etc/init.d/oracleasm createdisk VOTEDISK5 /dev/sdg1 Marking disk "VOTEDISK5" as an ASM disk: [ OK ] [root@rac1 opt]# ls -l /dev/oracleasm/disks/ 总计 0 brw-rw---- 1 grid asmadmin 8, 17 07-24 16:49 DBDISK1 brw-rw---- 1 grid asmadmin 8, 33 07-24 16:49 DBDISK2 brw-rw---- 1 grid asmadmin 8, 49 07-24 16:49 DBDISK3 brw-rw---- 1 grid asmadmin 8, 65 07-24 16:49 DBDISK4 brw-rw---- 1 grid asmadmin 8, 81 07-24 16:49 DBDISK5 brw-rw---- 1 grid asmadmin 8, 97 07-24 16:49 VOTEDISK5

扫描ASM磁盘:对磁盘进行更改或者在别的节点挂载这些共享磁盘,建议对这些磁盘进行扫描。

[root@rac1 opt]# /etc/init.d/oracleasm scandisks Scanning the system for Oracle ASMLib disks: [ OK ]

9.NTP时间设置:

由于没有ntp服务器,这里采用rac1节点启动ntp服务,rac2节点同步rac1。




10.DNS Server设置:

参考:http://blog.csdn.net/tianlesoftware/article/details/6006247

在这里采用Rac1节点搭建DNS Server,Rac2设置客户端方式。、

查看服务器是否安装以下DNS包,若没有则安装。

bind-9.3.6-4.P1.el5.x86_64.rpm --提供核心的二进制程序 bind-chroot-9.3.6-4.P1.el5.x86_64.rpm --提供安装性 caching-nameserver-9.3.6-4.P1.el5.x86_64.rpm --提供模板文件

1. 复制named.conf 文件

由于安装了chroot环境,所以DNS主配置文件应该在/var/named/chroot/etc目录下面。

[root@rac1 Server]# cd /var/named/chroot/etc/ [root@rac1 etc]# ls localtime named.rfc1912.zones named.caching-nameserver.conf rndc.key [root@rac1 etc]#

named.caching-nameserver.conf这个文件是不能修改的,创建一个named.conf文件,然后编辑named.conf文件,当有了named.conf,将不在读取这个文件。

[root@rac1 etc]# cp -p named.caching-nameserver.conf named.conf [root@rac1 etc]# ls -l 总计 28 -rw-r--r-- 1 root root 3519 2006-02-27 localtime -rw-r----- 1 root named 1230 2009-07-30 named.caching-nameserver.conf -rw-r----- 1 root named 1230 2009-07-30 named.conf -rw-r----- 1 root named 955 2009-07-30 named.rfc1912.zones -rw-r----- 1 root named 113 07-23 22:08 rndc.key

编辑named.conf文件,修改:

listen-on port 53 { 127.0.0.1; }; allow-query { localhost; }; match-clients { localhost; }; match-destinations { localhost; }; allow-query-cache { localhost; }; 中的内容修改成{ any; } 注意两边空格,然后保存退出

编辑named.rfc1912.zones文件,添加正反向解析:

这里需要注意的是,反向解析从左到右读取ip地址时是以相反的方向解释的,所以需要将ip地址反向排列。这里,192.168.1.*网段的反向解析域名为"1.168.192.in-addr.arpa”

zone "oracle11grac.com" IN { type master; file "rac.oracle11grac.zone"; allow-update { none; }; }; zone "1.168.192.in-addr.arpa" IN { type master; file "rac.oracle11grac.local"; allow-update { none; }; };

复制模版文件为数据库文件:

[root@rac1 etc]# cd /var/named/chroot/var/named/ [root@rac1 named]# ls data named.broadcast named.local localdomain.zone named.ca named.zero localhost.zone named.ip6.local slaves [root@rac1 named]# cp -p localhost.zone rac.oracle11grac.zone [root@rac1 named]# cp -p named.local rac.oracle11grac.local

更改数据库文件:

更改正向解析数据库文件:

[root@rac1 named]# vi rac.oracle11grac.zone $TTL 86400 @ IN SOA oracle11grac.com root.oracle11grac.com ( 42 ; serial (d. adams) 3H ; refresh 15M ; retry 1W ; expiry 1D ) ; minimum IN NS oracle11grac.com rac-scan IN A 192.168.1.205 rac-scan IN A 192.168.1.206 rac-scan IN A 192.168.1.207

更改反向解析数据库文件:

[root@rac1 named]# vi rac.oracle11grac.local $TTL 86400 @ IN SOA oracle11grac.com. root.oracle11grac.com. ( 1997022700 ; Serial 28800 ; Refresh 14400 ; Retry 3600000 ; Expire 86400 ) ; Minimum IN NS oracle11grac.com. 205 IN PTR rac-scan 206 IN PTR rac-scan 207 IN PTR rac-scan

重启DNS服务:

[root@rac1 named]# service named restart 停止 named: [确定] 启动 named: [确定] [root@rac1 named]#

DNS客户端配置,并测试。其中192.168.1.201为DNS服务器的IP地址。

[root@rac1 named]# vi /etc/resolv.conf #; generated by /sbin/dhclient-script. #nameserver 202.96.94.98 #nameserver 202.96.64.68 nameserver 192.168.1.201 [root@rac1 named]# vi rac.oracle11grac.local [root@rac1 named]# nslookup rac-scan.oracle11grac.com Server: 192.168.1.201 Address: 192.168.1.201#53 Name: rac-scan.oracle11grac.com Address: 192.168.1.206 Name: rac-scan.oracle11grac.com Address: 192.168.1.207 Name: rac-scan.oracle11grac.com Address: 192.168.1.205 [root@rac1 named]# nslookup 192.168.1.205 Server: 192.168.1.201 Address: 192.168.1.201#53 205.1.168.192.in-addr.arpa name = rac-scan.1.168.192.in-addr.arpa.

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

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

注册时间:2011-07-12

  • 博文量
    13
  • 访问量
    297907