REDHAT 5.9安装ORACLE 10.2.0.4 RAC.(非多路径安装),关于多路径安装,以后再单独写一篇blog.
这里说一下网络的问题,做心跳线的时候,如果有条件的话,可以单独在光纤交换机划一个vlan放置在一起,保证心跳机制的稳定
-----------------------------------------------配置yum-------------------------------------
为了装RPM包和多路径的时候可以方便点。
[oracle@rac01 ~]$ cat /etc/yum.repos.d/my.repo
[xxxx]
name=xxxx
baseurl=file:///u01/media/Server/
gpgcheck=0
***********************安装rac的先决条******************************
这个先决条件,网络啊,存储啊,软硬件啊,基本是没什么问题的,有兴趣的可以看官方文档,这里只讲步骤
#####配置hostname######
[root@rac01 ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
10.0.8.95 netrac01-vip
10.0.8.96 netrac02-vip
10.0.8.97 netrac01
10.0.8.98 netrac02
192.168.101.95 netrac01-priv
192.168.101.96 netrac02-priv
配置心跳线的网卡eth1(两个节点都要配置,netrac01是192.168.101.95,netrac02是192.168.101.96)
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.101.95
NETMASK=255.255.255.0
HWADDR=00:1A:64:DB:7A:F2
1.建立用户
# /usr/sbin/groupadd -g 700 oinstall
# /usr/sbin/groupadd -g 701 dba
# /usr/sbin/groupadd -g 702 oper
# /usr/sbin/useradd -u 700 -g oinstall -G dba oracle
# passwd oracle
2.配置互信
su - oracle
mkdir ~/.ssh
chmod 700 ~/.ssh
chmod 700
/usr/bin/ssh-keygen -t rsa
/usr/bin/ssh-keygen -t dsa
touch ~/.ssh/authorized_keys
cd ~/.ssh
ls
[oracle@node1 .ssh]$ ssh netrac01 cat /home/oracle/.ssh/id_rsa.pub >> authorized_keys
oracle@node1's password:
[oracle@node1 .ssh]$ ssh netrac01 cat /home/oracle/.ssh/id_dsa.pub >> authorized_keys
[oracle@node1 .ssh$ ssh netrac02 cat /home/oracle/.ssh/id_rsa.pub >> authorized_keys
oracle@node2s password:
[oracle@node1 .ssh$ ssh netrac02 cat /home/oracle/.ssh/id_dsa.pub >>authorized_keys
oracle@node2's password:
scp authorized_keys netrac02:/home/oracle/.ssh/
测试互信
[oracle@rac01 .ssh]$ ssh rac01 date
[oracle@rac01 .ssh]$ ssh rac02 date
3.安装包
rpm -q \binutils-2.17.50.0.6 compat-libstdc++-33-3.2.3 elfutils-libelf elfutils-libelf-devel gcc \
gcc-c++ glibc glibc-common-2.5 glibc-devel-2.5 glibc-headers-2.5 ksh libaio libaio-devel libgcc-4.1.2 libstdc++-4.1.2 libstdc++-devel \
make-3.81 sysstat-7.0.2 unixODBC-2.2.11 unixODBC-devel-2.2.11
yum install libaio-devel sysstat-7.0.2
# rpm -q binutils compat-db compat-gcc-32-c++ compat-libstdc++-296 compat-libstdc++-33 control-center gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers glibc-kernheaders gnome-libs libaio libstdc++ libstdc++-devel libgcc make pdksh sysstat util-linux
yum install compat-gcc-32-c++ glibc-kernheaders gnome-libs pdksh
上述包缺了什么装什么
4.配置四个文件sysctl ,limit,login,profile
*. cat /etc/sysctl.conf
kernel.shmall = 11112097152
kernel.shmmax = 17179869184
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
生效方式:/sbin/sysctl -p
*.cat /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
*.cat /etc/pam.d/login
session required /lib/security/pam_limits.so
*./etc/profile
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
5.建立目录
mkdir -p /u01/app/oracle
mkdir -p /u01/app/oracle/product/11.2.0/db_1
mkdir -p /u01/app/oracle/crs
chown -R oracle:oinstall /u01/app/
6.配置用户环境变量
export ORACLE_BASE=/u01/app/oracle
export ORA_CRS_HOME=/u01/app/oracle/crs
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export NLS_LANG=" AMERICAN_AMERICA.zhs16gbk"
export ORACLE_SID=arpdb1
export PATH=$ORACLE_HOME/bin:$PATH:$ORA_CRS_HOME/bin:/usr/bin:/usr/X11R6/bin:/bin:/sbin
export LD_LIBRARY_PATH=$ORA_CRS_HOME/lib:$ORACLE_HOME/lib:/usr/lib:/usr/local/lib
export TNS_ADMIN=$ORACLE_HOME/network/admin
使得环境变量生效
source /home/oracle/.bash_profile
7.Hangcheck-timer模块的安装和配置
insmod /lib/modules/2.6.18-348.el5/kernel/drivers/char/hangcheck-timer.ko
hangcheck_tick=30 hangcheck_margin=180
查看模块是否成功插入
lsmod | grep hang
再它写到自启动脚本中
vi /etc/rc.d/rc.local
insmod /lib/modules/2.6.18-348.el5/kernel/drivers/char/hangcheck-timer.ko
hangcheck_tick=30 hangcheck_margin=180
8.1.共享存储划分(非多路径方式)
/dev/sdc5 512M //ocr
/dev/sdc6 512M //ocr
/dev/sdc7 512M //Voting Disks
/dev/sdc8 512M //Voting Disks
/dev/sdc9 512M //Voting Disks
/dev/sdc2 //ASM
8.2 划分裸盘(非多路径方式)
vi /etc/rc.local (一下操作都要放置在rc.local中,每次都可以自动重启挂载和赋予权限)
######
#Oracle Cluster Registry OCR devices
######
chown root:oinstall /dev/sdc5
chown root:oinstall /dev/sdc6
chmod 660 /dev/sdc5
chmod 660 /dev/sdc6
sleep 2
raw /dev/raw/raw1 /dev/sdc5
raw /dev/raw/raw2 /dev/sdc6
sleep 2
chown root:oinstall /dev/raw/raw1
chown root:oinstall /dev/raw/raw2
chmod 660 /dev/raw/raw1
chmod 660 /dev/raw/raw2
######
#Oracle Cluster Voting Disks
######
chown oracle:oinstall /dev/sdc7
chown oracle:oinstall /dev/sdc8
chown oracle:oinstall /dev/sdc9
chmod 660 /dev/sdc7
chmod 660 /dev/sdc8
chmod 660 /dev/sdc9
sleep 2
raw /dev/raw/raw3 /dev/sdc7
raw /dev/raw/raw4 /dev/sdc8
raw /dev/raw/raw5 /dev/sdc9
sleep 2
chown oracle:oinstall /dev/raw/raw3
chown oracle:oinstall /dev/raw/raw4
chown oracle:oinstall /dev/raw/raw5
chmod 660 /dev/raw/raw3
chmod 660 /dev/raw/raw4
chmod 660 /dev/raw/raw5
9.ASM安装
*.以root用户登录
*.安装rpm包
*.创建vol
rpm -ivh oracleasm-support-2.1.8-1.el5.x86_64.rpm
rpm -ivh oracleasm-2.6.18-348.el5-2.0.5-1.el5.x86_64.rpm
rpm -ivh oracleasmlib-2.0.4-1.el5.x86_64.rpm
asm配置
# /etc/init.d/oracleasm configure
Default user to own the driver interface: oracle
Default group to own the driver interface: dba
Start Oracle Automatic Storage Management
Library driver on boot (y/n):y
创建asm盘
# /etc/init.d/oracleasm createdisk VOL1 /dev/sdc2
/etc/init.d/oracleasm createdisk VOL2 /dev/sdd1
/etc/init.d/oracleasm createdisk VOL3 /dev/sdd2
查看asm盘
# /etc/init.d/oracleasm scandisks
# /etc/init.d/oracleasm listdisks
10.时间同步
两个节点都要配置
[root@rac02 ~]# crontab -l
0 1 * * * /usr/sbin/ntpdate **.**.**.** (前提有个时间服务器)
----------配置VNC------------
vncserver
Password:
Verify: # 验证密码;
进入root主目录下的.vnc隐含目录, 找到 xstartup文件并编辑:# cd /root/.vnc
# vi xstartup
# twm & (注释掉该行)
startkde & (添加该行)
# killall Xvnc
# vncserver
11.软件安装
[root@node1 ~]# xhost +
Access control disabled, clients can connect from any host
*解压文件
cpio -idmv
[root@node1 ~]# su - oracle
[root@node1 ~]# su - oracle
[oracle@node1 ~]$ cd /data/software/database/
[oracle@node1 database]$ ./runInstaller
改一下redhat版本,把5.9改成了4.9,这样检测可以通过
[root@rac01 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 4.9 (Tikanga)
剩下的是图形界面安装了,师兄只能帮你到这了,剩下的可以看任何一本书,都应该可以满足图形界面的安装方式。