Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1149005
  • 博文数量: 231
  • 博客积分: 2500
  • 博客等级: 少校
  • 技术积分: 2662
  • 用 户 组: 普通用户
  • 注册时间: 2009-11-03 16:35
个人简介

学无止境

文章分类

全部博文(231)

文章存档

2014年(7)

2013年(103)

2011年(11)

2010年(53)

2009年(57)

分类: Oracle

2009-12-18 11:04:08

内存至少1024MB。
swap区,内存2G以内是2倍,2-8G是相同,8G以上为内存的0.75倍。
400MB的/tmp
3.5G磁盘空间。


按默认的rpm安装之后,还差以下rpm包,有一些包是关联需要的。
rpm -ivh glibc-kernheaders-2.4-9.1.103.EL.i386.rpm
rpm -ivh glibc-headers-2.3.4-2.41.i386.rpm
rpm -ivh glibc-devel-2.3.4-2.41.i386.rpm
rpm -ivh gcc-3.4.6-10.i386.rpm
rpm -ivh libstdc++-devel-3.4.6-10.i386.rpm
rpm -ivh gcc-c++-3.4.6-10.i386.rpm
rpm -ivh sysstat-5.0.5-19.el4.i386.rpm

向/etc/hosts添加以下内容:
192.168.1.161 RAC10g1
192.168.1.162 RAC10g2
192.168.1.171 RAC10g1-vip
192.168.1.172 RAC10g2-vip
192.168.94.11 RAC10g1-priv
192.168.94.12 RAC10g2-priv

/etc/sysctl.conf
设置kernel参数,其中kernel.shmmax为物理内存大小-1bytes。
kernel.shmmax = 1059323903
kernel.shmall = 2097152
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 = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144


/etc/security/limits.conf
* soft nproc 2047
* hard nproc 16384
* soft nofile 1024
* hard nofile 65536


/etc/pam.d/login
session required /lib/security/pam_limits.so
session required pam_limits.so


/etc/modprobe.conf
增加以下内容:
options hangcheck-timer hangcheck_tick=30 hangcheck_margin=180
执行命令使其生效:
modprobe -v hangcheck-timer

/etc/rc.d/rc.local
insmod /lib/modules/2.6.9-78.ELsmp/kernel/drivers/char/hangcheck-timer.ko hangcheck_tick=30 hangcheck_margin=180

 


[root@rac1 ~]# groupadd -g 200 oinstall
[root@rac1 ~]# groupadd -g 201 dba
[root@rac1 ~]# groupadd -g 202 oper
[root@rac1 ~]# useradd -u 200 -g oinstall -G dba,oper oracle
[root@rac1 ~]# passwd oracle


/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

[root@rac1 ~]# mkdir -p /u01/oracle/ora10g
[root@rac1 ~]# mkdir -p /u01/oracle/oradata/ora10g
[root@rac1 ~]# mkdir -p /u01/oracle/crs
[root@rac1 ~]# chown -R oracle:oinstall /u01
[root@rac1 ~]# chmod -R 775 /u01
[root@rac1 ~]# chown -R root:oinstall  /u01/oracle/crs


划共享存储,准备裸设备。

 

lvcreate -n ocr -L 300 vg02
lvcreate -n vote -L 300 vg02
lvcreate -n system -L 500 vg02
lvcreate -n sysaux -L 500 vg02
lvcreate -n undotbs1 -L 500 vg02
lvcreate -n undotbs2 -L 500 vg02
lvcreate -n temp -L 250 vg02
lvcreate -n users -L 120 vg02
lvcreate -n redo1_1 -L 120 vg02
lvcreate -n redo1_2 -L 120 vg02
lvcreate -n redo1_3 -L 120 vg02
lvcreate -n redo1_4 -L 120 vg02
lvcreate -n redo2_1 -L 120 vg02
lvcreate -n redo2_2 -L 120 vg02
lvcreate -n redo2_3 -L 120 vg02
lvcreate -n redo2_4 -L 120 vg02
lvcreate -n control1 -L 110 vg02
lvcreate -n control2 -L 110 vg02
lvcreate -n control3 -L 110 vg02
lvcreate -n spfile -L 5 vg02
lvcreate -n pwdfile -L 5 vg02
lvcreate -n redo1_5 -L 120 vg02
lvcreate -n redo2_5 -L 120 vg02

vi /etc/sysconfig/rawdevices

/dev/raw/raw1 /dev/vg02/ocr
/dev/raw/raw2 /dev/vg02/vote
/dev/raw/raw3 /dev/vg02/system
/dev/raw/raw4 /dev/vg02/sysaux
/dev/raw/raw5 /dev/vg02/undotbs1
/dev/raw/raw6 /dev/vg02/undotbs2
/dev/raw/raw7 /dev/vg02/temp
/dev/raw/raw8 /dev/vg02/users
/dev/raw/raw9 /dev/vg02/redo1_1
/dev/raw/raw10 /dev/vg02/redo1_2
/dev/raw/raw11 /dev/vg02/redo1_3
/dev/raw/raw12 /dev/vg02/redo1_4
/dev/raw/raw13 /dev/vg02/redo2_1
/dev/raw/raw14 /dev/vg02/redo2_2
/dev/raw/raw15 /dev/vg02/redo2_3
/dev/raw/raw16 /dev/vg02/redo2_4
/dev/raw/raw17 /dev/vg02/control1
/dev/raw/raw18 /dev/vg02/control2
/dev/raw/raw19 /dev/vg02/control3
/dev/raw/raw20 /dev/vg02/spfile 
/dev/raw/raw21 /dev/vg02/pwdfile
/dev/raw/raw22 /dev/vg02/redo1_5
/dev/raw/raw23 /dev/vg02/redo2_5

 

/sbin/service rawdevices restart
chown oracle:oinstall /dev/raw/raw*
chown root:oinstall /dev/raw/raw1
chmod 660 /dev/raw/*

 


vi /etc/udev/permissions.d/50-udev.permissions

# raw devices
ram*:root:disk:0660
raw/raw1:root:dba:0660
raw/raw2:oracle:dba:0660
raw/raw3:oracle:dba:0660
raw/raw4:oracle:dba:0660
raw/raw5:oracle:dba:0660
raw/raw6:oracle:dba:0660
raw/raw7:oracle:dba:0660
raw/raw8:oracle:dba:0660
raw/raw9:oracle:dba:0660
raw/raw10:oracle:dba:0660
raw/raw11:oracle:dba:0660
raw/raw12:oracle:dba:0660
raw/raw13:oracle:dba:0660
raw/raw14:oracle:dba:0660
raw/raw15:oracle:dba:0660
raw/raw16:oracle:dba:0660
raw/raw17:oracle:dba:0660
raw/raw18:oracle:dba:0660
raw/raw19:oracle:dba:0660
raw/raw20:oracle:dba:0660
raw/raw21:oracle:dba:0660
raw/raw22:oracle:dba:0660
raw/raw23:oracle:dba:0660

准备裸设备映射文件:/home/oracle/ora10g_raw.conf

system=/dev/raw/raw3
sysaux=/dev/raw/raw4
undotbs1=/dev/raw/raw5
undotbs2=/dev/raw/raw6
temp=/dev/raw/raw7
users=/dev/raw/raw8
redo1_1=/dev/raw/raw9
redo1_2=/dev/raw/raw10
redo1_3=/dev/raw/raw11
redo1_4=/dev/raw/raw12
redo2_1=/dev/raw/raw13
redo2_2=/dev/raw/raw14
redo2_3=/dev/raw/raw15
redo2_4=/dev/raw/raw16
control1=/dev/raw/raw17
control2=/dev/raw/raw18
control3=/dev/raw/raw19
spfile=/dev/raw/raw20
pwdfile=/dev/raw/raw21
redo1_5=/dev/raw/raw22
redo2_5=/dev/raw/raw23

 


.bash_profile


CVUQDISK_GRP=oinstall
export CVUQDISK_GRP
ORACLE_BASE=/u01/oracle
export ORACLE_BASE
ORACLE_HOME=/u01/oracle/ora10g
export ORACLE_HOME
CRS_HOME=/u01/oracle/crs
export CRS_HOME
#两个节点不一样,RAC2上为ora10g2
ORACLE_SID=ora10g1
export ORACLE_SID
TNS_ADMIN=$ORACLE_HOME/network/admin
export TNS_ADMIN
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export NLS_LANG
PATH=$CRS_HOME/bin:$ORACLE_HOME/bin:/bin:/sbin:/usr/ccs/bin:/usr/local/bin:$PATH
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/network/lib:/usr/local/lib:/usr/lib
export LD_LIBRARY_PATH
DBCA_RAW_CONFIG=/home/oracle/ora10g_raw.conf
export DBCA_RAW_CONFIG
umask 022


建立ssh信任:

[oracle@rac1 ~]$ mkdir ~/.ssh
[oracle@rac1 ~]$ chmod 700 ~/.ssh
在每个节点:
/usr/bin/ssh-keygen -t rsa
/usr/bin/ssh-keygen -t dsa
在一节点:
touch ~/.ssh/authorized_keys
ssh RAC10g1 cat /home/oracle/.ssh/id_rsa.pub >> authorized_keys
ssh RAC10g1 cat /home/oracle/.ssh/id_dsa.pub >> authorized_keys
ssh RAC10g2 cat /home/oracle/.ssh/id_rsa.pub >> authorized_keys
ssh RAC10g2 cat /home/oracle/.ssh/id_dsa.pub >> authorized_keys
scp authorized_keys  RAC10g2:/home/oracle/.ssh/
在每个节点:
chmod 600 ~/.ssh/authorized_keys
exec /usr/bin/ssh-agent $SHELL
/usr/bin/ssh-add


用root用户安装cvuqdisk-1.0.1-1.rpm
[root@rac1 ~]# CVUQDISK_GRP=oinstall
[root@rac1 ~]# export CVUQDISK_GRP
[root@rac1 rpm]# rpm -ivh cvuqdisk-1.0.1-1.rpm

CVU验证
./runcluvfy.sh stage -pre crsinst -n rac1,rac2 -verbose
./runcluvfy.sh stage -pre dbinst -n rac1,rac2 –verbose
1.如果出现联通性的错误,应该检查ssh、rlogin或者网络。
2.Could not find a suitable set of interfaces for VIPs错误是由于Bug导致的。
3.compat系列包根据系统具体情况而定,如果存在则错误可以忽略
报错的包有:
compat-gcc-7.3-2.96.128
compat-gcc-c++-7.3-2.96.128
compat-libstdc++-7.3-2.96.128
compat-libstdc++-devel-7.3-2.96.128
在RHEL AS 4的发行注记中提到这些软件包已经被删除,所以它们不需要被安装上了。
在RHEL 5上这些包存在更高版本或已经废弃了。


安装clusterware。
./runInstaller.sh

RHEL 4上在第二个节点上运行crs下的root.sh会遇到如下问题。
Running vipca(silent) for configuring nodeapps
The given interface(s), "eth0" is not public. Public interfaces should be used to configure virtual IPs.
这是由于eth0没有设为public,实际上在第一个节点上也是在安装过程中手动设为public的。
执行完这步之后,不要急于在图形界面上点OK。
在第二个节点上用root用户执行crs/bin/目录下的vipca,会出来图形界面,手动地在eth0上配置vip即可,成功完成后,再回到安装界面上点OK,之后的一步验证就会全部pass。


之后安装数据库软件、升级和建库都与单机环境差不多。
安装是要选择集群安装。
升级时要先升级clusterware。

阅读(1221) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~