一、修改配置文件

1.1、修改/etc/security/limits.conf文件,修改用户的SHELL的限制。

输入命令:vi /etc/security/limits.conf,将下列内容加入该文件

  1. oracle soft nproc
  2. oracle hard nproc
  3. oracle soft nofile
  4. oracle hard nofile

1.2、修改/etc/pam.d/login 文件。

输入命令:vi  /etc/pam.d/login,将下列内容加入该文件

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

1.3、修改linux内核,修改/etc/sysctl.conf文件。

输入命令: vi  /etc/sysctl.conf ,将下列内容加入该文件。

  1. fs.file-max =
  2. fs.aio-max-nr =
  3. kernel.shmall =
  4. kernel.shmmax =
  5. kernel.shmmni =
  6. kernel.sem =
  7. net.ipv4.ip_local_port_range =
  8. net.core.rmem_default =
  9. net.core.rmem_max =
  10. net.core.wmem_default =
  11. net.core.wmem_max =

并用#符号注释掉原有的配置。

# Controls the maximum shared segment size, in bytes

#kernel.shmmax = 68719476736

# Controls the maximum number of shared memory segments, in pages

#kernel.shmall = 4294967296

输入命令:sysctl  -p,使/etc/sysctl.conf配置文件立即生效。

1.4、修改/etc/profile。

输入命令:vi  /etc/profile,将下列内容加入该文件。

  1. if [ $USER = "oracle" ]; then
  2. if [ $SHELL = "/bin/ksh" ]; then
  3. ulimit -p
  4. ulimit -n
  5. else
  6. ulimit -u -n
  7. fi
  8. fi

1.5、创建用户和组。

创建用户组oinstall、dba

创建oracle用户,主组为oinstall,副组dba,输入命令:

  1. groupadd oinstall
  2. groupadd dba
  3. useradd -g oinstall -G dba -m oracle

副组的参数是大写G,别弄错,否则安装时会出现错误:

[FATAL] [INS-35341] User is not a member of the following chosen OS groups

设置用户oracle密码,输入两次密码,输入命令:

  1. passwd oracle

1.6、创建数据库软件目录和数据文件存放目录。

  1. mkdir /home/oracle/app
  2. mkdir /home/oracle/app/oracle
  3. mkdir /home/oracle/app/oradata
  4. mkdir /home/oracle/app/oraInventory
  5. mkdir /home/oracle/app/fast_recovery_area
  6. mkdir /home/oracle/app/oracle/product

修改目录权限,更改目录属主为Oracle用户所有,输入命令:

  1. chown -R oracle:oinstall /home/oracle/app

1.7、配置oracle用户的环境变量。

用命令su - oracle切换到oracle用户下。

  1. su - oracle

输入命令:vi .bash_profile,将下列内容加入该文件。

  1. umask
  2. export ORACLE_BASE=/home/oracle/app
  3. export ORACLE_HOME=$ORACLE_BASE/oracle/product/11.2./dbhome_1
  4. export ORACLE_SID=orcl
  5. export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
  6. export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib

1.8、上传Oracle安装文件

上传Oracle安装文件到Linux服务器。

linux.x64_11gR2_database_1of2.zip

linux.x64_11gR2_database_2of2.zip

上传到/tmp目录下面。

1.9、解压安装文件

进入tmp目录,使用unzip命令解压文件。

  1. [root@localhost /]# cd /tmp
  2. [root@localhost tmp]# unzip linux.x64_11gR2_database_1of2.zip
  3. [root@localhost tmp]# unzip linux.x64_11gR2_database_2of2.zip

解压完成后,在tmp目录下会有一个database的文件夹。

1.10、创建/etc/oraInst.loc文件,否则安装时会报错:

SEVERE: [FATAL] [INS-32038] The operating system group specified for central inventory (oraInventory) ownership is invalid.

  1. vi /etc/oraInst.loc
  2. inventory_loc=/home/oracle/app/oraInventory
  3. inst_group=oinstall

1.11、安装未安装的package

  1. yum install binutils compat-libstdc++- elfutils-libelf elfutils-libelf-devel expat gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers libaio libaio-devel libgcc libstdc++ libstdc++-devel make pdksh sysstat unixODBC unixODBC-devel

二、安装Oracle 11.2产品

Oracle支持静默安装。在我看来,它主要有两方面的好处:一、极大地提升了效率,尤其是批量安装。二、很多时候,只有终端环境可供使用。

2.0、准备responseFile文件

从Oracle软件中获取文件模板

  1. [root@localhost tmp]# cd database/response/
  2. [root@localhost response]# ls
  3. dbca.rsp db_install.rsp netca.rsp

其中database是Oracle软件解压后生成的目录。可见在response目录下有三个模板,其中dbca.rsp是用来创建数据库的。db_install.rsp是用来安装Oracle软件的。netca.rsp是用来创建监听器的。当然也可在db_install.rsp中直接创建数据库。在这里,为求方便,我们选择db_install.rsp模板一并安装软件,创建数据库。

2.1、编辑responseFile文件

  1. [root@localhost response]# vi db_install.rsp
  2. [root@localhost response]# grep -Ev "^$|^#" db_install.rsp
  3. oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
  4. oracle.install.option=INSTALL_DB_AND_CONFIG
  5. ORACLE_HOSTNAME=oracle
  6. UNIX_GROUP_NAME=oinstall
  7. INVENTORY_LOCATION=/home/oracle/app/oraInventory
  8. SELECTED_LANGUAGES=en,zh_CN
  9. ORACLE_HOME=/home/oracle/app/oracle/product/11.2./dbhome_1
  10. ORACLE_BASE=/home/oracle/app
  11. oracle.install.db.InstallEdition=EE
  12. oracle.install.db.isCustomInstall=false
  13. oracle.install.db.customComponents=oracle.server:11.2.0.1.,oracle.sysman.ccr:10.2.7.0.,oracle.xdk:11.2.0.1.,oracle.rdbms.oci:11.2.0.1.,oracle.network:11.2.0.1.,oracle.network.listener:11.2.0.1.,oracle.rdbms:11.2.0.1.,oracle.options:11.2.0.1.,oracle.rdbms.partitioning:11.2.0.1.,oracle.oraolap:11.2.0.1.,oracle.rdbms.dm:11.2.0.1.,oracle.rdbms.dv:11.2.0.1.,orcle.rdbms.lbac:11.2.0.1.,oracle.rdbms.rat:11.2.0.1.
  14. oracle.install.db.DBA_GROUP=dba
  15. oracle.install.db.OPER_GROUP=oinstall
  16. oracle.install.db.CLUSTER_NODES=
  17. oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
  18. oracle.install.db.config.starterdb.globalDBName=orcl
  19. oracle.install.db.config.starterdb.SID=orcl
  20. oracle.install.db.config.starterdb.characterSet=AL32UTF8
  21. oracle.install.db.config.starterdb.memoryOption=true
  22. oracle.install.db.config.starterdb.memoryLimit=
  23. oracle.install.db.config.starterdb.installExampleSchemas=false
  24. oracle.install.db.config.starterdb.enableSecuritySettings=true
  25. oracle.install.db.config.starterdb.password.ALL=1Password
  26. oracle.install.db.config.starterdb.password.SYS=
  27. oracle.install.db.config.starterdb.password.SYSTEM=
  28. oracle.install.db.config.starterdb.password.SYSMAN=
  29. oracle.install.db.config.starterdb.password.DBSNMP=
  30. oracle.install.db.config.starterdb.control=DB_CONTROL
  31. oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=
  32. oracle.install.db.config.starterdb.dbcontrol.enableEmailNotification=false
  33. oracle.install.db.config.starterdb.dbcontrol.emailAddress=xxxx@xxxx.com
  34. oracle.install.db.config.starterdb.dbcontrol.SMTPServer=
  35. oracle.install.db.config.starterdb.automatedBackup.enable=false
  36. oracle.install.db.config.starterdb.automatedBackup.osuid=
  37. oracle.install.db.config.starterdb.automatedBackup.ospwd=
  38. oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE
  39. oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=/home/oracle/app/oradata
  40. oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=/home/oracle/app/fast_recovery_area
  41. oracle.install.db.config.asm.diskGroup=
  42. oracle.install.db.config.asm.ASMSNMPPassword=
  43. MYORACLESUPPORT_USERNAME=
  44. MYORACLESUPPORT_PASSWORD=
  45. SECURITY_UPDATES_VIA_MYORACLESUPPORT=
  46. DECLINE_SECURITY_UPDATES=true
  47. PROXY_HOST=
  48. PROXY_PORT=
  49. PROXY_USER=
  50. PROXY_PWD=

2.3 改用oracle用户登录,静默安装

  1. cd /tmp/database
  2. ./runInstaller -silent -ignorePrereq -responseFile /tmp/database/response/db_install.rsp

可以通过查看日志文件,来知晓安装进度。

如果是测试环境的VM可能会出现tmpfs比MEMORY_TARGET小,导致oracle没办法起来。ORA-00845: MEMORY_TARGET not supported on this system。

  1. mount -o remount,size=4G /dev/shm

2.4、启动数据库:

  1. [oracle@oracle ~]$ sqlplus / as sysdba
  2.  
  3. SQL*Plus: Release 11.2.0.1. Production on Wed Dec ::
  4.  
  5. Copyright (c) , , Oracle. All rights reserved.
  6.  
  7. Connected to an idle instance.
  8.  
  9. SQL> start
  10. SP2-: START, @ or @@ command has no arguments
  11. SQL> startup

查看监听器状态:

  1. lsnrctl status

2.5、修改Oracle启动配置文件:

  1. [root@oracle admin]# vi /etc/oratab
  2.  
  3. #
  4.  
  5. # This file is used by ORACLE utilities. It is created by root.sh
  6. # and updated by the Database Configuration Assistant when creating
  7. # a database.
  8.  
  9. # A colon, ':', is used as the field terminator. A new line terminates
  10. # the entry. Lines beginning with a pound sign, '#', are comments.
  11. #
  12. # Entries are of the form:
  13. # $ORACLE_SID:$ORACLE_HOME:<N|Y>:
  14. #
  15. # The first and second fields are the system identifier and home
  16. # directory of the database respectively. The third filed indicates
  17. # to the dbstart utility that the database should , "Y", or should not,
  18. # "N", be brought up at system boot time.
  19. #
  20. # Multiple entries with the same $ORACLE_SID are not allowed.
  21. #
  22. #
  23. orcl:/home/oracle/app/oracle/product/11.2./dbhome_1:Y

为了让oracle在系统启动时服务自动启动,修改/etc/rc/loacl文件:

  1. [root@oracle admin]# vi /etc/rc.local
  2.  
  3. #!/bin/sh
  4. #
  5. # This script will be executed *after* all the other init scripts.
  6. # You can put your own initialization stuff in here if you don't
  7. # want to do the full Sys V style init stuff.
  8.  
  9. touch /var/lock/subsys/local
  10. su - oracle -c "/home/oracle/app/oracle/product/11.2.0/dbhome_1/bin/dbstart"

2.6、打开防火墙端口:

输入命令:vi /etc/sysconfig/iptables编辑防火墙配置:

2.7、创建表空间:

创建临时表空间:

  1. create temporary tablespace user_temp tempfile '/home/oracle/app/oradata/orcl/user_temp.dbf' size 50m autoextend on next 50m maxsize 20480m extent management local;

创建数据表空间:

  1. create tablespace user_data logging datafile '/home/oracle/app/oradata/orcl/user_data.dbf' size 50m autoextend on next 50m maxsize 20480m extent management local;

创建用户并指定表空间:

  1. SQL> create user mydbuser identified by myDbuser1 default tablespace user_data temporary tablespace user_temp;
  2.  
  3. User created.
  4.  
  5. SQL> grant connect,resource to mydbuser;
  6.  
  7. Grant succeeded.

CentOS6.5内 Oracle 11GR2静默安装的更多相关文章

  1. CentOS X64上64位Oracle 11gR2 静默安装

    CentOS 6.2 X64上64位Oracle 11gR2 静默安装 www.linuxidc.com/Linux/2012-03/56606p4.htm HP-UX静默安装oracle11g过程 ...

  2. Oracle 11gR2静默安装 & 命令行安装

    静默安装 经常搭建Oracle测试环境,有时候觉得OUI(即图形界面)方式甚是繁琐,你得一步一步进行确认,所幸,Oracle支持静默安装.在我看来,它主要有两方面的好处:一.极大地提升了效率,尤其是批 ...

  3. Oracle 11gR2 静默安装奇怪错误

    在静默安装Oracle 11gR2 的时候发现的奇怪错误,有点摸不着头脑 【步骤一】配置静默文件只安装软件 #--------------------------------------------- ...

  4. Oracle的静默安装 升级和卸载 参考规范

    Oracle的静默安装 升级和卸载 参考规范 20180912 V1 一.Oracle的安装 Oracle产品的三种安装方式分别为: 1.图形化(Java向导)安装引导 2.使用应答文件静默安装 3. ...

  5. Oracle 11g静默安装简明版

    环境:RHEL 6.5 + Oracle 11.2.0.4 1. 初步处理应答文件 2. 静默安装软件 3. 静默安装监听 4. 静默dbca建库 说明: 本文默认安装软件前的步骤已经设置完毕 如果没 ...

  6. Linux平台 Oracle 11gR2 RAC安装Part1:准备工作

    一.实施前期准备工作 1.1 服务器安装操作系统 1.2 Oracle安装介质 1.3 共享存储规划 1.4 网络规范分配 二.安装前期准备工作 2.1 各节点系统时间校对 2.2 各节点关闭防火墙和 ...

  7. Linux平台 Oracle 11gR2 RAC安装Part2:GI安装

    三.GI(Grid Infrastructure)安装 3.1 解压GI的安装包 3.2 安装配置Xmanager软件 3.3 共享存储LUN的赋权 3.4 使用Xmanager图形化界面安装GI 3 ...

  8. Linux平台 Oracle 11gR2 RAC安装Part3:DB安装

    四.DB(Database)安装 4.1 解压DB的安装包 4.2 DB软件安装 4.3 ASMCA创建磁盘组 4.4 DBCA建库 4.5 验证crsctl的状态 Linux平台 Oracle 11 ...

  9. oracle 11gR2 RAC安装手册

    --oracle 11gR2 RAC安装手册 -----------------------------2013/10/29 参考三思笔记 http://files.cnblogs.com/jackh ...

随机推荐

  1. flask中接收post传递数组方法

    list = request.form.getlist("表单名")

  2. thinkphp自动验证分析

    thinkphp有一个自动验证的方法验证规则如下 array( array(验证字段1,验证规则,错误提示,[验证条件,附加规则,验证时间]), array(验证字段2,验证规则,错误提示,[验证条件 ...

  3. Perl一行式:处理行号和单词数

    perl一行式程序系列文章:Perl一行式 所有行的行号 $ perl -pe '$_ = "$. $_"' file.log $ perl -ne 'print "$. ...

  4. JavaScript基础知识梳理,你能回答几道题?

    在学习JavaScript的时候,总是这里学一点,那里学一点,很的很零星,很杂,没有很系统的去学习,感觉好像JavaScript的知识点都了解了,但是真正要说起来,又不知道从何说起! 最深刻的体会就是 ...

  5. “笨方法”学习Python笔记(2)-VS Code作为文本编辑器以及配置Python调试环境

    Visual Studio Code 免费跨平台文本编辑器,插件资源丰富,我把其作为Debug的首选. 下载地址:https://code.visualstudio.com/Download 安装之后 ...

  6. [转]如何将高版本的SQL Server数据库备份到低版本的SQL Server

    本文转自:https://blog.csdn.net/wang465745776/article/details/54969676 前提条件备份SQL Server服务器版本为:12.0.2000.8 ...

  7. vue-element-admin项目install出现的问题

    1.需要安装nodejs和git 2. 配置淘宝镜像源(经常是因为墙的原因下载缓慢或者出错) npm config set registry https://registry.npm.taobao.o ...

  8. iframe实用操作

    iframe高度设置为子页面高度 //需要使用Jquery   $(document).ready(function () {             parent.document.getEleme ...

  9. 【Java每日一题】20170217

    20170216问题解析请点击今日问题下方的“[Java每日一题]20170217”查看(问题解析在公众号首发,公众号ID:weknow619) package Feb2017; public cla ...

  10. 【Spring】17、spring cache 与redis缓存整合

    spring cache,基本能够满足一般应用对缓存的需求,但现实总是很复杂,当你的用户量上去或者性能跟不上,总需要进行扩展,这个时候你或许对其提供的内存缓存不满意了,因为其不支持高可用性,也不具备持 ...