本文以linux 为例
两个网卡 配置网络
etho public
eht1 private
编辑/etc/hosts 文件
127.0.0.1 long1.admin.com long1 localhost.localdomain localhost
211.152.14.110 long1
211.152.14.220 long2
211.152.14.133 vip1
211.152.14.134 vip2
10.99.9.101 node1
10.99.9.202 node2
配置内核参数
在/etc/sysctl.conf中编辑:
#For Oracle
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 2097152
kernel.shmmax = 2147483648
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
然后用执行/sbin/sysctl �Cp
配置oracle 在linux下
设置oracle的shell限制:
在/etc/security/limits.conf文件中加入:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
/etc/pam.d/login
session required /lib/security/pam_limits.so
所需软件包
pm 包清单 ==》也可能有多余的包
rpm -ivh binutils-2.15.92.0.2-22.i386.rpm
rpm -ivh compat-db-4.1.25-9.i386.rpm
rpm -ivh control-center-2.8.0-12.rhel4.5.i386.rpm
rpm -ivh glibc-kernheaders-2.4-9.1.100.EL.i386.rpm
rpm -ivh glibc-headers-2.3.4-2.36.i386.rpm
rpm -ivh glibc-devel-2.3.4-2.36.i386.rpm
rpm -ivh gcc-3.4.6-8.i386.rpm
rpm -ivh libstdc++-devel-3.4.6-8.i386.rpm
rpm -ivh glibc-2.3.4-2.36.i*.rpm
rpm -ivh gnome-libs-1.4.1.2.90-44.1.i386.rpm
rpm -ivh libstdc++-3.4.6-8.i386.rpm
rpm -ivh libstdc++-devel-3.4.6-8.i386.rpm
rpm -ivh make-3.80-6.EL4.i386.rpm
rpm -ivh pdksh-5.2.14-30.3.i386.rpm
rpm -ivh sysstat-5.0.5-14.rhel4.i386.rpm
rpm -ivh xscreensaver-4.18-5.rhel4.13.i386.rpm
rpm -ivh compat-libstdc++-*.rpm
rpm -ivh libstdc++-devel-3.4.6-8.i386.rpm
rpm -ivh zlib-devel-1.2.1.2-1.2.i386.rmp
rpm -ivh libgcj4-devel-4.1.1-53.EL4.i386.rpm
rpm -ivh glibc-devel-2.3.4-2.36.i386.rpm
rpm -ivh libgcj-devel-3.4.6-8.i386.rpm
rpm -ivh libgcj4-devel-4.1.1-53.EL4.i386.rpm
rpm -ivh zlib-devel-1.2.1.2-1.2.i386.rpm
rpm -ivh libgcj4-devel-4.1.1-53.EL4.i386.rpm
rpm -ivh gcc*.rpm
配置共享磁盘 最少10G
fdisk -l
fdisk /dev/sdb
partprobe
配置OCFS2
rpm -ivh ocfs2包
ocfs2-2.6.9-55.EL-1.2.9-1.el4.i686.rpm
ocfs2-2.6.9-55.ELsmp-1.2.9-1.el4.i686.rpm
ocfs2console-1.2.7-1.el4.i386.rpm
ocfs2-tools-1.2.7-1.el4.i386.rpm
fdisk -l /dev/sdb
启动配置程序 ocfs2console (在计算机1上执行
选择 Tasks => Format
Cluster => Configure Nodes
添加集群节点
两个都要添加
此时查看 /etc/ocfs2/cluster.conf
选择 Cluster => Propagate Configuration
输入计算机密码
关闭
执行下面命令
/etc/init.d/o2cb configure
/etc/init.d/o2cb status(所有节点都执行)
/etc/init.d/o2cb status
mkdir -p /orac/orahome
mkdir -p /orac/oradata
mount -t ocfs2 /dev/sdb5 /orac/orahome
mount -t ocfs2 -o datavolume,nointr /dev/sdb6 /orac/oradata
编辑 ::/etc/fstab
/dev/sdb6 /orac/oradata ocfs2 _netdev,datavolume,nointr 0 0
/dev/sdb5 /orac/orahome ocfs2 _netdev 0 0
执行 mounted.ocfs2 -f
创建用户组
groupadd -g 1001 dba
查看 匿名用户
id nobody
groupadd -g 1002 oinstall
useradd -u 1001 -g oinstall -G dba oracle
设置密码
su - oracle
mkdir ~/.ssh
chmod 755 ~/.ssh
使用ssh-keygen命令生成第2版本的SSH协议的RSA密钥
ssh-keygen -t rsa
选择 no
回车
生成DSA密钥
ssh-keygen -t dsa
添加密钥到授权密钥文件
用oracle登录
ssh long2 cat /home/oracle/.ssh/id_rsa.pub >> authorized_keys
ssh long2 cat /home/oracle/.ssh/id_dsa.pub >> authorized_keys
ssh long1 cat /home/oracle/.ssh/id_rsa.pub >> authorized_keys
ssh long1 cat /home/oracle/.ssh/id_dsa.pub >> authorized_keys
scp authorized_keys long:/home/oracle/.ssh/
chmod 644 ~/.ssh/authorized_keys
在计算机2
oracle 上
chmod 644 ~/.ssh/authorized_keys
xhost +127.0.0.1
mkdir -p /orac/crs/10.2.0
chmod -R 777 /orac/crs/10.2.0
chown -R root:oinstall /orac/crs
chown -R oracle:oinstall /orac/crs
chown -R oracle:oinstall /orac/orahome
chmod -R 755 /orac/orahome
chown -R oracle:oinstall /orac/oradata
chmod -R 755 /orac/oradata
切换到oracle 用户
执行安装 (主目录下
编辑 .bashrc /home/oracle/.bashrc
# .bashrc
# User specific aliases and functions
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
export ORACLE_HOME=/orac/orahome/10.2.0/db_1
export ORA_CRS_HOME=/orac/orahome/10.2.0/crs_1
export ORACLE_SID=dbrac1
export ORACLE_TERM=xterm
export LD_ASSUME_KERNEL=2.4.1
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:/sbin
export PATH
然后执行 source .bash_profile
mkdir -p /u01/crs/oracle/product/10.2.0/crs_1
chown -R oracle:oinstall /u01/crs/oracle
chmod -R 775 /u01/crs/oracle
# mkdir -p /u02/oracrs/
# chown -R oracle:oinstall /u02/oracrs/
# chmod -R 775 /u02/oracrs/
绑定裸设备:
#raw /dev/raw/raw1 /dev/sdb1
#raw /dev/raw/raw2 /dev/sdb2
然后在/etc/sysconfig/rawdevices文件里加如下内容:
/dev/raw/raw1 /dev/sdb1
/dev/raw/raw2 /dev/sdb2
权限:
# chown root:oinstall /dev/raw/raw1
# chmod 640 /dev/raw/raw1
# chown oracle:dba /dev/raw/raw2
# chmod 660 /dev/raw/raw2
在/etc/rc.local里加如下内容(如果安装软件时出问题,则把root改为oracle)
chown root:oinstall /dev/raw/raw1
chmod 640 /dev/raw/raw1
chown oracle:dba /dev/raw/raw2
chmod 660 /dev/raw/raw2
以上操作在所有节点上执行
在安装CRS的过程中,安装程序会提示用户输入存放OCR和Vote文件的位置。因此,通常我们会使用以下方法设置文件位置(在所有节点上执行),以oracle用户执行:
$ ln -s /dev/raw/raw1 /u02/oracrs/ocr.crs
$ ln -s /dev/raw/raw2 /u02/oracrs/vote.crs
5.1.3创建oracle安装路径
# mkdir -p /u01/app/oracle
# chown -R oracle:oinstall /u01/app/oracle
# chmod -R 775 /u01/app/oracle
chown �CR oracle:oinstall /home/oracle
在安装CRS之前,确认显示没有问题:
# xhost +
crs/runcluvfy.sh stage -post rac -n rac1,rac2 -verbose
共享磁盘 中 第一块是存放软件的 第二块是存放数据的
安装完集群软件后 安装数据软件不创建数据库
安装完数据软件后 在执行dbca创建数据库
因时间关系 安装详情以后再说