方法/步骤
检测所要安装的数据包
linux-udly:~ # rpm -qa | grep binutils
binutils-2.20.0-0.7.9
linux-udly:~ # rpm -qa | grep gcc
gcc-4.3-62.198
gcc43-c++-4.3.4_20091019-0.7.35
linux-udly:~ # rpm -qa | grep glibc
glibc-2.11.1-0.17.4
linux-udly:~ # rpm -qa | grep libaio
libaio-0.3.109-0.1.46
libaio-devel-0.3.109-0.1.46
linux-udly:~ # rpm -qa | grep libgcc
libgcc43-4.3.4_20091019-0.7.35
linux-udly:~ # rpm -qa | grep libstdc
libstdc++-devel-4.3-62.198
libstdc++43-4.3.4_20091019-0.7.35
libstdc++43-32bit-4.3.4_20091019-0.7.35
libstdc++43-devel-4.3.4_20091019-0.7.35
libstdc++43-devel-32bit-4.3.4_20091019-0.7.35
linux-udly:~ # rpm -qa | grep make
make-3.81-128.20
linux-udly:~ # rpm -qa | grep sysstat
sysstat-8.1.5-7.9.56
以上没有的安装包,都需要进行安装
linux-udly:~ # rpm –ivh xxx
创建用户组
linux-udly:~ # groupadd oinstall
linux-udly:~ # groupadd dba
创建oracle用户
linux-udly:~ #mkdir /home/oracle
linux-udly:~ # useradd -g oinstall -G dba -d /home/oracle oracle
linux-udly:~ # passwd oracle
linux-udly:~ # chown -R oracle:oinstall /home/oracle/
创建oracle数据库安装目录
linux-udly:/opt # pwd
/opt
linux-udly:/opt # mkdir -p oracle
linux-udly:/opt # chown -R oracle:oinstall /opt/oracle
1、 验证某些参数是否正确
linux-udly:/opt # cat /etc/nsswitch.conf | grep hosts
hosts: files mdns4_minimal [NOTFOUND=return] dns
linux-udly:/opt # hostname
linux-udly
linux-udly:/opt # cat /etc/hosts
127.0.0.1 localhost
配置/etc/sysctl.conf文件,加入以下内容,保存之后执行 sysctl -p
linux-udly:/opt # vi /etc/sysctl.conf
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
配置/etc/security/limits.conf文件,加入以下内容
linux-udly:/opt #vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
配置/etc/profile文件,加入以下内容,然后执行 source /etc/profile
linux-udly:/opt #vi /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
切换用户:
linux-udly:/opt # su - oracle
oracle@linux-udly:~> pwd
/home/oracle
oracle@linux-udly:~>
设置环境变量:修改/home/oracle/.bash_profile文件,加入以下内容
export PATH
ORACLE_BASE=/opt/oracle
ORACLE_HOME=$ORACLE_BASE/oracle
ORACLE_SID=dbbha
PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH
解压数据库文件
oracle@linux-udly:~> su - root 切换到root用户
??:
linux-udly:~ # unzip linux.x64_11gR2_database_2of2.zip (此文件已上传到此目录,下同)
linux-udly:~ # unzip linux.x64_11gR2_database_1of2.zip
linux-utdu:~ # mv -f database/ /opt/oracle/ (database移至/opt/oracle/)
linux-utdu:~ # cd /opt/oracle/
linux-utdu:/oracle # chown -R oracle:oinstall database/
致此准备工作已完成!