Oracle 11gR2安装教程

2018-02-03 10:24:49来源:oschina作者:kolbe人点击

分享
一、安装操作系统

本教程使用的是Redhat Server 6.7 x86_64 版

二、配置用户及基本参数
1、新建用户
[[email protected] ~]# groupadd oinstall
[[email protected] ~]# groupadd dba
[[email protected] ~]# useradd -g oinstall -G dba oracle
[[email protected] ~]# passwd oracle2、新建目录
[[email protected] ~]# mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1
[[email protected] ~]# mkdir -p /u01/app/oraInventory
[[email protected] ~]# chown -R oracle:oinstall /u01/app
[[email protected] ~]# chmod -R 775 /u01/app3、调整内核参数

编辑/etc/sysctl.conf文件,设置相关参数的系统默认值。如果该文件中已有相关参数的设置,则确保参数值不小于如下对应值;如果还没有相关参数的设置,则按照如下格式添加相应的参数设置行;修改好后需要重启系统生效


[[email protected] ~]# vim /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
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 = 10485864、调整用户限制

编辑/etc/security/limits.conf文件,修改操作系统对oracle用户资源的限制。在该文件中添加如下行


[[email protected] ~]# vim /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle hard stack 102405、修改Oracle用户环境变量
[[email protected] ~]# vim /home/oracle/.bash_profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=ami
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_TERM=xterm
export TNS_ADMIN=$ORACLE_HOME/network/admin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/oracm/lib:$ORACLE_HOME/lib
export CLASSPATH=$CLASSPATH:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/jlib:$ORACLE_HOME/network/lib
export LANG=en_US.gbk
export NLS_LANG=american_america.ZHS16GBK
export EDITOR=vim6、安装依赖包

官方文档中要求在Linux 6操作系统中,必须安装如下包


binutils-2.20.51.0.2-5.11.el6 (x86_64)
compat-libcap1-1.10-1 (x86_64)
compat-libstdc++-33-3.2.3-69.el6 (x86_64)
compat-libstdc++-33-3.2.3-69.el6.i686
gcc-4.4.4-13.el6 (x86_64)
gcc-c++-4.4.4-13.el6 (x86_64)
glibc-2.12-1.7.el6 (i686)
glibc-2.12-1.7.el6 (x86_64)
glibc-devel-2.12-1.7.el6 (x86_64)
glibc-devel-2.12-1.7.el6.i686
ksh
libgcc-4.4.4-13.el6 (i686)
libgcc-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6.i686
libstdc++-devel-4.4.4-13.el6 (x86_64)
libstdc++-devel-4.4.4-13.el6.i686
libaio-0.3.107-10.el6 (x86_64)
libaio-0.3.107-10.el6.i686
libaio-devel-0.3.107-10.el6 (x86_64)
libaio-devel-0.3.107-10.el6.i686
make-3.81-19.el6
sysstat-9.0.4-11.el6 (x86_64)

注:安装gcc时,需要按照 mpfr -> ppl -> cpp -> cloog-ppl -> gcc



7、修改Host文件

添加IP地址及主机名到hosts文件中


[[email protected] ~] vim /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.1 oracle 三、运行安装程序
1、运行主安装程序
1)下载安装包并上传到操作系统

已经上传到百度云盘,可直接点击跳转到百度云下载


linux.x64_11gR2_database_1of2.zip


linux.x64_11gR2_database_2of2.zip

2)解压缩安装包,并运行安装程序
[[email protected] ~] unzip linux.x64_11gR2_database_1of2.zip
[[email protected] ~] unzip linux.x64_11gR2_database_2of2.zip
[[email protected] ~] cd database
[[email protected] ~] ./runInstaller Step 1: 钩掉 I wish to receive security updates via My Oracle Support,点 Next


Step 2: 选择 Install database software only,点击 Next


Step 3: 选择 Single instance database installation,点击 Next


Step 4: 选择 English(United Kingdom)、Simplified Chinese、Traditinal Chinese点击Next


Step 5: 选择 Enterprise Edition,点击Next


Step 6: 按默认目录,点击Next


Step 7: 点击Next


Step 8: 点击Next


Step 9: 钩选 Ignore All


Step 10: 点击 Finish


Step 11: 等待执行结果,并使用root用户登陆系统,执行两个脚本文件



使用root用户登陆系统,执行以下两个脚本


/u01/app/oraInventory/orainstRoot.sh


/u01/app/oracle/product/11.2.0/db_1/root.sh


执行完后,点击OK按钮



Step 12: 安装成功

2、配置监听
[[email protected] ~] netca
Step 1:


Step 2:


Step 3:


Step 4:


Step 5:

Step 6:


Step 7:


Step 8:

3、配置数据库
[[email protected] ~] dbca Step 1:


Step 2:


Step 3:


Step 4:


Step 5:


Step 6:


Step 7:


Step 8:


Step 9:


Step 10:


Step 11:


Step 12:


Step 13:


Step 14:


Step 15:


Step 16:


至此,Oracle就安装完毕了