LInux安装oracle11g详细步骤 下载本文

--关闭防火墙 iptables ip6tables chkconfig NetworkManager off service NetworkManager stop

chkconfig iptables off service iptables stop

chkconfig ip6tables off service ip6tables stop

--配置网络

vim /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=\

BOOTPROTO=\ONBOOT=\TYPE=\

IPADDR=\NETMASK=\GATEWAY=\

--配置主机名 vim /etc/hosts

127.0.0.1 localhost HOST 172.30.1.120 localhost HOST --

vim /etc/sysconfig/network

--配置DNS

vim /etc/resolv.conf nameserver 218.2.135.1

--关闭selinux(安装oracle需要关闭selinux,将状态修改为disable,修改完成后需要重启虚拟机)

vim /etc/selinux/config

--重启 reboot

--配置yum源

先将redhat6的镜像文件复制到/opt下,复制的命令是“cp” vim /etc/fstab

/opt/sr0 /media iso9660 defaults,loop 0 0

mount -a

vim /etc/yum.repos.d/rhel-source.repo [rhel-source]

name=Red Hat Enterprise Linux $releasever - $basearch - Source baseurl=file:///media/Server enabled=1 gpgcheck=0

yum clean all yum makecache

--安装包

需要安装i686的包:12个

rpm -qa libXp libXt libXtst openmotif22 compat-db compat-libstdc++-33 compat-libstdc++-296 glibc-devel glibc libstdc++ libaio libgomp ------------------------------------- 需要安装x86_64的包:15个

rpm -qa binutils compat-db compat-libstdc++-33 control-center kernel-headers glibc-headers glibc-common glibc-devel glibc libstdc++ libstdc++-devel make sysstat gcc gcc-c++

需要自己下载安装的包:pdksh http://rpm.pbone.net

yum install -y libXp.i686 yum install -y libXt.i686 yum install -y libXtst.i686 yum install -y openmotif22.i686 yum install -y compat-db.i686

yum install -y compat-libstdc++-33.i686 yum install -y compat-libstdc++-296.i686 yum install -y glibc-devel.i686 yum install -y glibc.i686 yum install -y libaio.i686

yum install -y libaio-devel.i686 yum install -y libgomp.i686 yum install -y unixODBC.i686

yum install -y unixODBC-devel.i686

yum install -y compat-db.x86_64

yum install -y compat-libstdc++-33.x86_64 yum install -y glibc-devel.x86_64 yum install -y libaio-devel.x86_64 yum install -y libstdc++-devel.x86_64 yum install -y gcc.x86_64 yum install -y gcc-c++.x86_64 yum install -y unixODBC.x86_64

yum install -y unixODBC-devel.x86_64

下载合适的pdksh,并安装

rpm -ivh pdksh-5.2.14-2.i386.rpm

--创建用户组、用户 groupadd oinstall groupadd dba groupadd oper

useradd -g oinstall -G dba oracle --给用户oracle设置密码 passwd oracle

Changing password for user oracle. New password:

BAD PASSWORD: it is based on a dictionary word Retype new password:

passwd: all authentication tokens updated successfully.

id oracle

uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba) --修改参数

vim /etc/sysctl.conf #for oracle

kernel.shmall = 2097152

kernel.shmmax = 2147483648

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

fs.file-max = 6815744

net.ipv4.ip_local_port_range = 9000 65500

net.core.rmem_default = 262144

net.core.rmem_max = 4194304

net.core.wmem_default = 262144

net.core.wmem_max = 1048576

vm.hugetlb_shm_group = 501

fs.aio-max-nr = 1048576

--使参数重新加载 sysctl -p ----

vim /etc/security/limits.conf #for oracle

* soft nproc 2047

* hard nproc 16384

* soft nofile 1024

* hard nofile 65536 ----

vim /etc/pam.d/login

session required /lib/security/pam_limits.so session required pam_limits.so

----新建目录,上传并解压oracle11g的安装文件,分配权限。 mkdir -p /opt/app/oracle/product/11.2.0/dbhome_1 mkdir -p /opt/app/oracle/oraInventory

将oracle11g安装文件剪切到/opt/app下,并解压 mv linux.x64_11gR2_database_* /opt/app/oracle/ unzip linux.x64_11gR2_database_1of2.zip unzip linux.x64_11gR2_database_2of2.zip

分配权限

chown -R oracle.oinstall /opt/app/