一、 操作系统
1、 1、安装操作系统
2、 2、安装必须包
3、 3、设置IP
检查设置的IP
[root@localhost ~]# ifconfig
如果没有设置,按以下步骤设置:
设置即时IP
[root@localhost ~]# ifconfig eth0 200.100.100.12 netmask 255.255.255.0
[root@localhost ~]# ifconfig eth1 10.0.0.2 netmask 255.255.255.0
设置永久IP
[root@localhost network-scripts]# cd /etc/sysconfig/network-scripts
[root@localhost network-scripts]# vi ifcfg-eth0
4、 设置Hosts
[root@localhost ~]# vi /etc/hosts
5、 设置网关
用#netstat –rn检查Public网卡的网关设置
用#route命令设置网关
[root@node2 rpm]# route add -net 200.100.100.0 netmask 255.255.255.0 gw 200.100.100.100
默认网关的设置通过修改vi /etc/sysconfig/network文件
6、 关闭防火墙
一定要关闭防火墙,否则安装CRS会抱错。
7、 调整系统参数
(1) 调整 /etc/sysctl.conf
增加以下项
kernel.shmmni = 4096
fs.file-max = 65536
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=4194304
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=262144
[root@localhost sysconfig]# cp /etc/sysctl.conf /etc/sysctl.conf-bak
[root@localhost sysconfig]# vi /etc/sysctl.conf
运行#sysctl –p命令使
参数立即生效:
(2) 调整 /etc/security/limits.conf
在文件中增加以下内容:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
[root@localhost etc]# vi /etc/security/limits.conf
(3) 调整 /etc/selinux/config
此参数安装时如果指定,不需要调整
SELINUX=disabled
#vi /etc/selinux/config
(4) 调整 /etc/pam.d/login
在文件中增加以下内容:
# Customer parameters
session required /lib/security/pam_limits.so
session required pam_limits.so
[root@localhost pam.d]# vi /etc/pam.d/login
(5) 调整 /etc/modprobe.conf
增加以下内容
# customer parameter
options hangcheck-timer hangcheck_tick=30 hangcheck_margin=180
[root@localhost ~]#modprobe -v hangcheck-timer
insmod /lib/modules/2.6.18-8.el5xen/kernel/drivers/char/hangcheck-timer.ko hangcheck_tick=30 hangcheck_margin=180
(6) 修改版本号
因为默认rhel5.1不支持10.2,0.1,所以要修改一些参数
编辑/etc/redhat-release文件替换现在的版本信息(Red Hat Enterprise Linux Server release 5 (Tikanga))
redhat-4
(7) 修改安装环境为英文
[root@localhost sysconfig]# cp /etc/sysconfig/i18n /etc/sysconfig/i18n-bak
[root@localhost sysconfig]# vi /etc/sysconfig/i18n
改为以下内容
LANG="en_US"
LANGUAGE="en_US"
SUPPORTED="zh_CN.GB18030:zh_CN:zh:en_US.UTF-8:en_US:en"
SYSFONT="lat0-sun16"
SYSFONTACM="8859-15"
备注:如修改中文乱码提示,可按以下修改,但最终Oracle安装前要改为英文环境。
[root@localhost sysconfig]# vi i18n
LANG="zh_CN.UTF-8"
LANGUAGE="zh_CN.UTF-8:zh_CN.GB18030:zh_CN.GB2312:zh_CN"
SUPPORTED="zh_CN.UTF-8:zh_CN.GB18030:zh_CN:zh:en_US.UTF-8:en_US:en"
SYSFONT="lat0-sun16"
export LC_ALL="zh_CN.GB18030"
LANG="zh_CN.UTF-8"
(8) 同步node2
[root@localhost ~]# scp /etc/hosts node2:/etc/.
[root@localhost ~]# scp /etc/hosts node2:/etc/.
[root@localhost ~]# scp /etc/sysctl.conf node2:/etc/.
[root@localhost ~]# scp /etc/security/limits.conf node2:/etc/security/.
[root@localhost ~]# scp /etc/selinux/config node2:/etc/selinux/.
[root@localhost ~]# scp /etc/pam.d/login node2:/etc/pam.d/.
[root@localhost ~]# scp /etc/modprobe.conf node2:/etc/.
[root@localhost ~]# scp /etc/redhat-release node2:/etc/.
[root@localhost ~]# scp /etc/sysconfig/i18n node2:/etc/sysconfig/.
[root@localhost ~]# sysctl -p
[root@localhost ~]# scp /etc/modprobe.conf node2:/etc/.
[root@localhost ~]# modprobe -v hangcheck-timer
二、 Oracle环境
1、 创建用户组和用户
[root@localhost home]# groupadd oinstall -g 201
[root@localhost home]# groupadd dba -g 202
[root@localhost home]# groupadd oper -g 203
[root@localhost home]# useradd oracle -u 200 -g oinstall -G dba,oper
[root@localhost home]# passwd oracle
[root@localhost home]# mkdir -p /u01/crs/oracle/product/10.2.0/crs
[root@localhost home]# mkdir -p /u01/app/oracle/product/10.2.0/db_1
[root@localhost home]# chown -R oracle:oinstall /u01
[root@localhost sysconfig]# id oracle
2、 配置环境变量
在Redhat-5版本下进行如下配置
[oracle@localhost ~]$ vi .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
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME
ORACLE_SID=LKL; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_BASE/product/10.2.0/crs/bin:$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
这是以前在Redhat-4版本下进行的配置
# .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_SID=lkl
export ORACLE_BASE=/home/oracle
export ORACLE_HOME=$ORACLE_BASE/10gR2/db
export ORA_CRS_HOME=$ORACLE_BASE/10gR2/crs
export ORA_ASM_HOME=${ORACLE_BASE}/10gR2/asm
export TNS_ADMIN=$ORACLE_HOME/network/admin
export
PATH=$PATH:$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:$ORA_ASM_HOME/bin:.
同步node2
3、 创建SSH注册
[root@localhost .ssh]# su - oracle
[oracle@localhost ~]$ /usr/bin/ssh-keygen -t rsa
[oracle@localhost ~]$ /usr/bin/ssh-keygen -t dsa
[oracle@localhost ~]$ cd .ssh
[oracle@localhost ~]$ ssh node1 cat /home/oracle/.ssh/id_rsa.pub >> authorized_keys
[oracle@localhost ~]$ ssh node1 cat /home/oracle/.ssh/id_dsa.pub >> authorized_keys
[oracle@localhost ~]$ ssh node2 cat /home/oracle/.ssh/id_rsa.pub >> authorized_keys
[oracle@localhost ~]$ ssh node2 cat /home/oracle/.ssh/id_dsa.pub >> authorized_keys
[oracle@localhost .ssh]$ scp /home/oracle/.ssh/authorized_keys node2:/home/oracle/.ssh/.
验证:
[oracle@localhost .ssh]$ ssh node1.date
[oracle@localhost .ssh]$ ssh node2 date
[oracle@localhost .ssh]$ ssh node1.lkl.com date
[oracle@localhost .ssh]$ ssh node2.lkl.com date
[oracle@localhost .ssh]$ ssh node1-priv date
[oracle@localhost .ssh]$ ssh node1-priv.lkl.com date
[oracle@localhost .ssh]$ ssh node2-priv date
[oracle@localhost .ssh]$ ssh node2-priv.lkl.com date
三、 共享存储
1、 分区
基本命令:#fdisk –l
#fdisk /dev/sda
Disk /dev/sda doesn't contain a valid partition table
上面显示有两个设备C0d0本地磁盘 146.7G
Sda为磁盘阵列 1599.9G 尚未分区为磁盘
分区规划
OraData 1000G
CRS OCR 300M
第一个分区1024000M ORADATA
第二个分区:300M CRS
第三个分区:300M OCR
如果分区被重复安装,asm分区可能会找不到,执行以下命令清除磁盘头:
Dd if=/dev/zero of=/dev/sda1 bs=1024 count=4
2、 配置共享存储
修改文件/etc/udev/rules.d/60-raw.rules
添加以下内容:
ACTION=="add", KERNEL=="sda1", RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="sda2", RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", KERNEL=="sda3", RUN+="/bin/raw /dev/raw/raw3 %N"
KERNEL=="raw1",OWNER=="oracle",GROUP=="oinstall",MODE=="0600"
KERNEL=="raw2",OWNER=="oracle",GROUP=="oinstall",MODE=="0600"
KERNEL=="raw3",OWNER=="oracle",GROUP=="oinstall",MODE=="0600"
同步node2
[root@localhost rules.d]# scp 60-raw.rules node2:/etc/udev/rules.d/.
重启操作系统reboot
重启后/dev/raw就看到了
3、 其他分区例子
[root@localhost ~]# fdisk -l
Disk /dev/cciss/c0d0: 146.7 GB, 146778685440 bytes
255 heads, 63 sectors/track, 17844 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/cciss/c0d0p1 * 1 13 104391 83 Linux
/dev/cciss/c0d0p2 14 17844 143227507+ 8e Linux LVM
Disk /dev/sda: 1599.9 GB, 1599999983616 bytes
255 heads, 63 sectors/track, 194522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
[root@localhost ~]# fdisk /dev/sda
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 194522.
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): p
Disk /dev/sda: 1599.9 GB, 1599999983616 bytes
255 heads, 63 sectors/track, 194522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7320672/viewspace-1023316/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/7320672/viewspace-1023316/