Linux安装 oracle 11g r2

Posted 六楼外的风景

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux安装 oracle 11g r2相关的知识,希望对你有一定的参考价值。


[c-sharp]
  view plain copy
  1. OS:Fedora 15  
  2. DB:Oracle 11gR2  
  3. 将Oracle安装到home/oracle_11目录  

配置过程:本文来自Oracle官方文档+网上资料

Oracle官方文档:http://www.oracle.com/pls/db112/homepage

1. 以root用户登录到Linux

2. 检查机器硬件要求

2.1 内存要求

[c-sharp]  view plain copy
  1. 至少需要1GB的内存  
  2. 查看机器内存大小  
  3. # grep MemTotal /proc/meminfo  

2.2 swap空间要求

[c-sharp]  view plain copy
  1. 内存大小                 swap空间大小  
  2. 1 GB ~ 2 GB             内存大小*1.5  
  3. 2 GB ~ 16 GB            内存大小  
  4. > 16 GB          16 GB  
  5. 查看swap空间大小  
  6. # grep SwapTotal /proc/meminfo  

2.3 空闲硬盘要求

[c-sharp]  view plain copy
  1. /tmp目录需要1 GB的空闲空间  
  2. 查看/tmp目录的空闲空间  
  3. # df -h /tmp  
  4. 安装Oracle软件需要的硬盘空间  
  5. Enterprise Edition   3.95(software files)+1.7(data files)  
  6. Standard Edition     3.88(software files)+1.5(data files)  
  7. 查看机器中每个磁盘的空闲空间  
  8. # df -h  

3. 检查操作系统软件要求

Oracle官方文档中包含了多个Linux系统的要求,详细请参考官方文档

Fedora 15 (RHEL 5.x)的软件要求列表如下:

[c-sharp]  view plain copy
  1. binutils-2.17.50.0.6  
  2. compat-libstdc++-33-3.2.3  
  3. elfutils-libelf-0.125  
  4. elfutils-libelf-devel-0.125  
  5. elfutils-libelf-devel-static-0.125  
  6. gcc-4.1.2  
  7. gcc-c++-4.1.2  
  8. glibc-2.5-24  
  9. glibc-common-2.5  
  10. glibc-devel-2.5  
  11. glibc-headers-2.5  
  12. kernel-headers-2.6.18  
  13. ksh-20060214  
  14. libaio-0.3.106  
  15. libaio-devel-0.3.106   
  16. libgcc-4.1.2  
  17. libgomp-4.1.2  
  18. libstdc++-4.1.2   
  19. libstdc++-devel-4.1.2  
  20. make-3.81  
  21. numactl-devel-0.9.8.i386  
  22. sysstat-7.0.2  
  23. 查看系统是否安装了该软件包  
  24. # rpm -q package_name  

4. 创建安装Oracle需要的系统组和用户

[c-sharp]  view plain copy
  1. 创建Oracle Inventory 组  
  2. # groupadd oinstall  
  3. 创建OSDBA 组  
  4. # groupadd dba  
  5. 创建Oracle软件创建者  
  6. # useradd -g oinstall -G dba oracle  
  7. 修改oracle用户的密码  
  8. # passwd oracle  

5. 配置系统内核参数值

[c-sharp]  view plain copy
  1. 编辑/etc/sysctl.conf文件  
  2. vim /etc/sysctl.conf  
  3. 在打开的文件底部添加下面内容  
  4. fs.aio-max-nr = 1048576  
  5. fs.file-max = 6815744  
  6. kernel.shmall = 2097152  
  7. kernel.shmmax = 536870912  
  8. kernel.shmmni = 4096  
  9. kernel.sem = 250 32000 100 128  
  10. net.ipv4.ip_local_port_range = 9000 65500  
  11. net.core.rmem_default = 262144  
  12. net.core.rmem_max = 4194304  
  13. net.core.wmem_default = 262144  
  14. net.core.wmem_max = 1048586  
  15. 改变当前系统内核参数值(让/etc/sysctl.conf立即生效)  
  16. # sysctl -p  

6. 检查Oracle安装用户(oracle)资源限制

[c-sharp]  view plain copy
  1. 修改/etc/security/limits.conf文件  
  2. vim /etc/security/limits.conf  
  3. 在打开的文件底部添加下面内容  
  4. oracle              soft    nproc   2047  
  5. oracle              hard    nproc   16384  
  6. oracle              soft    nofile  1024  
  7. oracle              hard    nofile  65536  
  8. oracle              soft    stack   10240  

7. 创建安装Oracle软件所需要的目录

[c-sharp]  view plain copy
  1. # mkdir -p /home/oracle_11/app/  
  2. # chown -R oracle:oinstall /home/oracle_11/app/  
  3. # chmod -R 775 /home/oracle_11/app/  

8. 配置安装Oracle安装用户(oracle)的环境

[c-sharp]  view plain copy
  1. 编辑 /home/oracle/.bash_profile  
  2. vim /home/oracle/.bash_profile  
  3. 在打开的文件中添加下面内容  
  4. umask 022  
  5. export ORACLE_BASE=/home/oracle_11/app  
  6. export ORACLE_HOME=$ORACLE_BASE/oracle/product/11.2.0/db_1  
  7. export ORACLE_SID=orcl --Oracle实例名,可修改  
  8. export PATH=$PATH:HOME/bin:$ORACLE_HOME/bin  
  9. 编辑 /etc/pam.d/login  
  10. vim /etc/pam.d/login  
  11. 在打开的文件中添加下面内容  
  12. session required /lib/security/pam_limits.so  
  13. session required pam_limits.so  
  14. 编辑 /etc/profile  
  15. vim /etc/profile  
  16. 在打开的文件中添加下面内容  
  17. if [ $USER = "oracle" ]; then  
  18.    if [ $SHELL = "/bin/ksh" ]; then  
  19.       ulimit -p 16384  
  20.       ulimit -n 65536  
  21.    else  
  22.       ulimit -u 16384 -n 65536  
  23.    fi  
  24. fi  

9. 查看系统是否支持图形界面

[c-sharp]  view plain copy
  1. 查看root用户下是否已设置DISPLAY变量  
  2. # echo $DISPLAY  
  3. 如果有值出现,则说明已设置DISPLAY变量;否则,就需要手动设置DISPLAY  

10. 开始安装Oracle软件

[c-sharp]  view plain copy
  1. # cd /tmp  
  2. # unzip linux_11gR2_database_1of2.zip linux_11gR2_database_2of2.zip  
  3. # xhost +  
  4. # su - oracle  
  5. $ export DISPLAY=:0  
  6. $ cd /database  
  7. $ ./runInstaller  
  8. 接下来系统会启动Oracle图形安装界面,安装过程和Windows下一样  

在安装过程中,会提示在root用户下运行两个脚本文件(具体是哪两个,不记得了,按提示操作即可)。

Linux下的Oracle在安装结束后是处于运行状态的。重启机器后,Oracle不会像在Windows下那样将Oracle添加到Windows服务,在linux下需要手动启动Orcle服务

[c-sharp]  view plain copy
  1. (c)2006-2024 SYSTEM All Rights Reserved IT常识