1、安装RHEL6.5,组件选择“桌面”
2、配置yum源
mkdir /mnt/cdrom
mount /dev/cdrom
/mnt/cdrom
cd /etc/yum.repos.d/
#进入yum配置目录
vi crom.repo
#编辑配置文件,添加以下内容
[cdrom]
name=cdrom
baseurl=file:///mnt/cdrom
enabled=1
gpgcheck=0
如无法通过yum安装
那么:
关闭yum进程:rm -f /var/run/yum.pid
清除yum:yum clean all
3、vim /etc/security/limits.conf
oracle soft nofile
1024
oracle hard nofile
65536
oracle soft nproc
2047
oracle hard nproc
16384
一般limits.conf的加载需要编辑/etc/pam.d/login加入:
session required
/lib64/security/pam_limits.so但通过实验在RHEL6.5上似乎不需要再编辑/etc/pam.d/login也可以加载了。
4、编辑/etc/sysctl.conf
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 524288
kernel.shmmax = 2147483647
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
kernel.shmmax:
32位linux系统:可取最大值为4GB(4294967296bytes)-1byte,即4294967295。建议值为多于内存的一半,所以如果是32为系统,一般可取值为4294967295。32位系统对SGA大小有限制,所以SGA肯定可以包含在单个共享内存段中。
64位linux系统:可取的最大值为物理内存值-1byte,建议值为多于物理内存的一半,一般取值大于SGA_MAX_SIZE即可,可以取物理内存-1byte。例如,如果为12GB物理内存,可取12*1024*1024*1024-1=12884901887,SGA肯定会包含在单个共享内存段中。
kernel.shmall:
该参数控制可以使用的共享内存的总页数。Linux共享内存页大小为4KB,共享内存段的大小都是共享内存页大小的整数倍。一个共享内存段的最大大小是16G,那么需要共享内存页数是16GB/4KB=16777216KB
/4KB=4194304(页),也就是64Bit系统下16GB物理内存,设置kernel.shmall =
4194304才符合要求(几乎是原来设置2097152的两倍)。这时可以将shmmax参数调整到16G了,同时可以修改SGA_MAX_SIZE和SGA_TARGET为12G(您想设置的SGA最大大小,当然也可以是2G~14G等,还要协调PGA参数及OS等其他内存使用,不能设置太满,比如16G)
5、关闭selinux,配置"/etc/selinux/config"
SELINUX=disabled
6、关闭防火墙
# service iptables stop
# chkconfig iptables off
7、创建用户和组和目录
groupadd -g 6000 oinstall
groupadd -g 6001 dba
useradd -g oinstall -G dba oracle
passwd oracle
mkdir /s01
mkdir
/s01/orabase
chown oracle:oinstall /s01
chown oracle:oinstall /s01/orabase
8、配置oracle用户的环境变量
vi/home/oracle/.bash_profile
export
ORACLE_HOME=/s01/orabase/app/oracle/product/11.2.0/dbhome_1
export
PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:/sbin:/bin:/usr/sbin:/usr/bin
export ORACLE_SID=demo
export
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32
export ORACLE_BASE=/s01/orabase
export ORA_NLS10=$ORACLE_HOME/nls/data
9、修改/etc/hosts
加入 ip hostname
10、安装ftp和vncserver
yum install ftp*
yum install tigervnc*
11、启动vnc
#vncserver
12、通过VNC进入图形化界面
#xhost +
$./runInstall
13、根据提示安装需要的软件包 yum install ……
cdrom中缺少pdksh-5.2.14-30.x86_64.rpm,需要下载了安装
rpm
-ivh pdksh-5.2.14-30.x86_64.rpm
14、如果提示虚拟内存不够
首先先建立一个分区,采用dd命令比如
dd if=/dev/zero of=/home/swap bs=1024 count=512000
这样就会创建/home/swap这么一个分区文件。文件的大小是512000个block,一般情况下1个block为1K,所以这里空间是512M。接着再把这个分区变成swap分区。
/sbin/mkswap -f /home/swap
再接着使用这个swap分区。使其成为有效状态。
/sbin/swapon /home/swap
现在再用free -m或cat
/proc/swap命令查看一下内存和swap分区大小,就发现增加了512M的空间了。不过当计算机重启了以后,发现swap还是原来那么大,新的swap没有自动启动,还要手动启动。那我们需要修改/etc/fstab文件,增加如下一行
/home/swap swap
swap defaults 0 0
15、让oracle开机自启动
1)vi
/s01/orabase/app/oracle/product/11.2.0/dbhome_1/bin/oracledb
2)加入以下
#!/bin/bash
# chkconfig: - 85 15
# description: oracle is a World Wide Web
server.
## /etc/init.d/oracledb
## Run-level Startup script for the Oracle
Listener and Instances
# It relies on the information on
/etc/oratab
export ORACLE_BASE=/s01/orabase
export
ORACLE_HOME=/s01/orabase/app/oracle/product/11.2.0/dbhome_1
export ORACLE_OWNR=oracle
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_SID=oracle
if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d
$ORACLE_HOME ]
then
echo "Oracle startup: cannot
start"
exit 1
fi
case "$1" in
start)
# Oracle listener and instance
startup
echo -n "Starting Oracle: "
su $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl
start"
su $ORACLE_OWNR -c "$ORACLE_HOME/bin/dbstart
$ORACLE_HOME"
touch /var/lock/oracle
echo "OK"
;;
stop)
# Oracle listener and instance
shutdown
echo -n "Shutdown Oracle: "
su $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl
stop"
su $ORACLE_OWNR -c "$ORACLE_HOME/bin/dbshut
$ORACLE_HOME"
rm -f /var/lock/oracle
echo "OK"
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: `basename $0`
start|stop|restart|reload"
exit 1
esac
exit 0
3)chmod
+x /s01/orabase/app/oracle/product/11.2.0/dbhome_1/bin/oracledb
4)加软链接
ln -s
/s01/orabase/app/oracle/product/11.2.0/dbhome_1/bin/oracledb
/etc/rc.d/init.d/oracledb
5)添加服务
chkconfig --add oracledb
6)保证/etc/oratab
为"Y"
7)启停
service
oracledb stop/start/restart