千家信息网

oracle 11g安装

发表于:2026-11-01 作者:千家信息网编辑
千家信息网最后更新 2026年11月01日,硬件准备:物理内存至少为1G,linux虚拟机的容量为60G。cat /etc/redhat-release 和uname -r 两个命令查看内核和版本,支持linux5/6 2.6.32-xxxxx
千家信息网最后更新 2026年11月01日oracle 11g安装

硬件准备:物理内存至少为1G,linux虚拟机的容量为60G。

cat /etc/redhat-release 和uname -r 两个命令查看内核和版本,支持linux5/6 2.6.32-xxxxxx及以上版本。 安装过程中所需文件都放在附件里咯


安装步骤:

  1. 基本配置

    配置ip为10.0.0.1,用setup命令,之后重启网络服务

    关闭安全机制:

    [root@poem ~]# setenforce 0

    [root@poem ~]# /etc/init.d/iptables stop

  2. 修改主机名

    [root@poem Desktop]#hostname jz

    [root@poem Desktop]#vim /etc/sysconfig/network //进入后修改为jz

    [root@poem Desktop]#vim /etc/hosts? //添加 10.0.0.1 jz

    [root@poem Desktop]#init 6 //重启

  3. 软件安装

    1.配置yum源

    2.安装以下软件:

    yum -y install binutils compat-libstdc++-33 compat-libstdc++-33.i686 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc.i686 glibc-common glibc-devel glibc-devel.i686 glibc-headers ksh libaio libaio.i686 libaio-devel libaio-devel.i686 libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel make sysstat unixODBC unixODBC-devel

  4. 建立用户和组

[root@localhost ~]# groupadd oinstall

[root@localhost ~]# useradd dba

[root@localhost ~]# useradd -g oinstall -G dba oracle

[root@localhost ~]# passwd oracle //密码

5.创建oracle 11g的安装目录

[root@localhost ~]# mkdir -p /u01/11g

[root@localhost ~]# chown -R oracle:oinstall /u01/

[root@localhost ~]# chmod -R 775 /u01

6.设置内核参数

[root@localhost ~]# vim /etc/sysctl.conf

[root@localhost ~]# tail -11 /etc/sysctl.conf //末尾添加以下11行

fs.aio-max-nr = 1048576

fs.file-max = 6815744

kernel.shmall = 2097152

kernel.shmmax = 4294967295

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

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 = 1048586

并注释掉或删除以下三行

# net.bridge.bridge-nf-call-ip6tables

# net.bridge.bridge-nf-call-iptables

# net.bridge.bridge-nf-call-arptables

[root@localhost ~]# sysctl -p //重新载入

7.设置环境变量

[root@localhost ~]# vim /home/oracle/.bash_profile

[root@localhost ~]# tail /home/oracle/.bash_profile //在文件中添加以下6行

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH

export ORACLE_BASE=/u01/11g

export ORACLE_HOME=$ORACLE_BASE/product/11.2.0

export ORACLE_SID=ora11g

export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

[root@localhost ~]# source /home/oracle/.bash_profile //加载配置或oracle用户

8.设置PAM资源限制

[root@localhost ~]# vim /etc/security/limits.conf

[root@localhost ~]# tail -5 /etc/security/limits.conf //末尾添加以下5行

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

oracle soft stack 10240


9.安装0racle

1.将软件copy到/home/oracle/目录下,如果空间不够大,解压后删除即可

[root@localhost ~]# pwd

/root

[root@localhost ~]# cd /home/oracle/

[root@localhost oracle]# ll

total 2295600

-rwxrw-rw-. 1 root root 1239269270 Sep 9 01:20 linux.x64_11gR2_database_1of2.zip

-rwxrw-rw-. 1 root root 1111416131 Sep 9 01:31 linux.x64_11gR2_database_2of2.zip

[root@localhost oracle]# unzip linux.x64_11gR2_database_1of2.zip //解压

[root@localhost oracle]# unzip linux.x64_11gR2_database_2of2.zip //解压

2.安装

[root@localhost database]# su - oracle

[oracle@localhost ~]$ cd /home/oracle/database/

[oracle@localhost database]$ ./runInstaller //运行

Starting Oracle Universal Installer...

如果出现问题:must be configured to display at least 256 colors //失败,需要设置256色

则切换到root下:su - root 执行以下两个命令

xhost +

Xdpyinfo

若不成功再在oracle目录下执行如下

export DISPLAY=:0.0

Xdpyinfo 成功即可

[oracle@localhost database]$ ./runInstaller //再重新执行

进入图形化界面,按提示装,见pdf。当出现执行脚本的界面时,另开一个终端

[root@localhost database]# cd /u01/oraInventory/

[root@localhost oraInventory]# ll

[root@localhost oraInventory]# ./orainstRoot.sh

[root@localhost oraInventory]# cd /u01/11g/product/11.2.0/

[root@localhost 11.2.0]# ll

[root@localhost 11.2.0]# ./root.sh

上面命令执行后100%,点close即完成安装

测试

[oracle@localhost ~]$ sqlplus

Enter user-name: SYSTEM

Enter password:

sql>


安装过程中如果出现代码为[INS-20802]的问题,只要点击ok,然后Retry重新加载下就好了。


第一次写博客,多多包涵,感谢提供文件的老师们。


愿你的付出终得回报

0