CentOS6.5内 Oracle 11GR2静默安装
一、修改配置文件
1.1、修改/etc/security/limits.conf文件,修改用户的SHELL的限制。
输入命令:vi /etc/security/limits.conf,将下列内容加入该文件
- oracle soft nproc
- oracle hard nproc
- oracle soft nofile
- oracle hard nofile
1.2、修改/etc/pam.d/login 文件。
输入命令:vi /etc/pam.d/login,将下列内容加入该文件
- session required /lib/security/pam_limits.so
- session required pam_limits.so
1.3、修改linux内核,修改/etc/sysctl.conf文件。
输入命令: vi /etc/sysctl.conf ,将下列内容加入该文件。
- fs.file-max =
- fs.aio-max-nr =
- kernel.shmall =
- kernel.shmmax =
- kernel.shmmni =
- kernel.sem =
- net.ipv4.ip_local_port_range =
- net.core.rmem_default =
- net.core.rmem_max =
- net.core.wmem_default =
- 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,将下列内容加入该文件。
- if [ $USER = "oracle" ]; then
- if [ $SHELL = "/bin/ksh" ]; then
- ulimit -p
- ulimit -n
- else
- ulimit -u -n
- fi
- fi
1.5、创建用户和组。
创建用户组oinstall、dba
创建oracle用户,主组为oinstall,副组dba,输入命令:
- groupadd oinstall
- groupadd dba
- useradd -g oinstall -G dba -m oracle
副组的参数是大写G,别弄错,否则安装时会出现错误:
[FATAL] [INS-35341] User is not a member of the following chosen OS groups
设置用户oracle密码,输入两次密码,输入命令:
- passwd oracle
1.6、创建数据库软件目录和数据文件存放目录。
- mkdir /home/oracle/app
- mkdir /home/oracle/app/oracle
- mkdir /home/oracle/app/oradata
- mkdir /home/oracle/app/oraInventory
- mkdir /home/oracle/app/fast_recovery_area
- mkdir /home/oracle/app/oracle/product
修改目录权限,更改目录属主为Oracle用户所有,输入命令:
- chown -R oracle:oinstall /home/oracle/app
1.7、配置oracle用户的环境变量。
用命令su - oracle切换到oracle用户下。
- su - oracle
输入命令:vi .bash_profile,将下列内容加入该文件。
- umask
- export ORACLE_BASE=/home/oracle/app
- export ORACLE_HOME=$ORACLE_BASE/oracle/product/11.2./dbhome_1
- export ORACLE_SID=orcl
- export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
- 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命令解压文件。
- [root@localhost /]# cd /tmp
- [root@localhost tmp]# unzip linux.x64_11gR2_database_1of2.zip
- [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.
- vi /etc/oraInst.loc
- inventory_loc=/home/oracle/app/oraInventory
- inst_group=oinstall
1.11、安装未安装的package
- 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软件中获取文件模板
- [root@localhost tmp]# cd database/response/
- [root@localhost response]# ls
- 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文件
- [root@localhost response]# vi db_install.rsp
- [root@localhost response]# grep -Ev "^$|^#" db_install.rsp
- oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
- oracle.install.option=INSTALL_DB_AND_CONFIG
- ORACLE_HOSTNAME=oracle
- UNIX_GROUP_NAME=oinstall
- INVENTORY_LOCATION=/home/oracle/app/oraInventory
- SELECTED_LANGUAGES=en,zh_CN
- ORACLE_HOME=/home/oracle/app/oracle/product/11.2./dbhome_1
- ORACLE_BASE=/home/oracle/app
- oracle.install.db.InstallEdition=EE
- oracle.install.db.isCustomInstall=false
- 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.
- oracle.install.db.DBA_GROUP=dba
- oracle.install.db.OPER_GROUP=oinstall
- oracle.install.db.CLUSTER_NODES=
- oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
- oracle.install.db.config.starterdb.globalDBName=orcl
- oracle.install.db.config.starterdb.SID=orcl
- oracle.install.db.config.starterdb.characterSet=AL32UTF8
- oracle.install.db.config.starterdb.memoryOption=true
- oracle.install.db.config.starterdb.memoryLimit=
- oracle.install.db.config.starterdb.installExampleSchemas=false
- oracle.install.db.config.starterdb.enableSecuritySettings=true
- oracle.install.db.config.starterdb.password.ALL=1Password
- oracle.install.db.config.starterdb.password.SYS=
- oracle.install.db.config.starterdb.password.SYSTEM=
- oracle.install.db.config.starterdb.password.SYSMAN=
- oracle.install.db.config.starterdb.password.DBSNMP=
- oracle.install.db.config.starterdb.control=DB_CONTROL
- oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=
- oracle.install.db.config.starterdb.dbcontrol.enableEmailNotification=false
- oracle.install.db.config.starterdb.dbcontrol.emailAddress=xxxx@xxxx.com
- oracle.install.db.config.starterdb.dbcontrol.SMTPServer=
- oracle.install.db.config.starterdb.automatedBackup.enable=false
- oracle.install.db.config.starterdb.automatedBackup.osuid=
- oracle.install.db.config.starterdb.automatedBackup.ospwd=
- oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE
- oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=/home/oracle/app/oradata
- oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=/home/oracle/app/fast_recovery_area
- oracle.install.db.config.asm.diskGroup=
- oracle.install.db.config.asm.ASMSNMPPassword=
- MYORACLESUPPORT_USERNAME=
- MYORACLESUPPORT_PASSWORD=
- SECURITY_UPDATES_VIA_MYORACLESUPPORT=
- DECLINE_SECURITY_UPDATES=true
- PROXY_HOST=
- PROXY_PORT=
- PROXY_USER=
- PROXY_PWD=
2.3 改用oracle用户登录,静默安装
- cd /tmp/database
- ./runInstaller -silent -ignorePrereq -responseFile /tmp/database/response/db_install.rsp
可以通过查看日志文件,来知晓安装进度。
如果是测试环境的VM可能会出现tmpfs比MEMORY_TARGET小,导致oracle没办法起来。ORA-00845: MEMORY_TARGET not supported on this system。
- mount -o remount,size=4G /dev/shm
2.4、启动数据库:
- [oracle@oracle ~]$ sqlplus / as sysdba
- SQL*Plus: Release 11.2.0.1. Production on Wed Dec ::
- Copyright (c) , , Oracle. All rights reserved.
- Connected to an idle instance.
- SQL> start
- SP2-: START, @ or @@ command has no arguments
- SQL> startup
查看监听器状态:
- lsnrctl status
2.5、修改Oracle启动配置文件:
- [root@oracle admin]# vi /etc/oratab
- #
- # This file is used by ORACLE utilities. It is created by root.sh
- # and updated by the Database Configuration Assistant when creating
- # a database.
- # A colon, ':', is used as the field terminator. A new line terminates
- # the entry. Lines beginning with a pound sign, '#', are comments.
- #
- # Entries are of the form:
- # $ORACLE_SID:$ORACLE_HOME:<N|Y>:
- #
- # The first and second fields are the system identifier and home
- # directory of the database respectively. The third filed indicates
- # to the dbstart utility that the database should , "Y", or should not,
- # "N", be brought up at system boot time.
- #
- # Multiple entries with the same $ORACLE_SID are not allowed.
- #
- #
- orcl:/home/oracle/app/oracle/product/11.2./dbhome_1:Y
为了让oracle在系统启动时服务自动启动,修改/etc/rc/loacl文件:
- [root@oracle admin]# vi /etc/rc.local
- #!/bin/sh
- #
- # This script will be executed *after* all the other init scripts.
- # You can put your own initialization stuff in here if you don't
- # want to do the full Sys V style init stuff.
- touch /var/lock/subsys/local
- su - oracle -c "/home/oracle/app/oracle/product/11.2.0/dbhome_1/bin/dbstart"
2.6、打开防火墙端口:
输入命令:vi /etc/sysconfig/iptables编辑防火墙配置:
2.7、创建表空间:
创建临时表空间:
- 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;
创建数据表空间:
- 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;
创建用户并指定表空间:
- SQL> create user mydbuser identified by myDbuser1 default tablespace user_data temporary tablespace user_temp;
- User created.
- SQL> grant connect,resource to mydbuser;
- Grant succeeded.
CentOS6.5内 Oracle 11GR2静默安装的更多相关文章
- CentOS X64上64位Oracle 11gR2 静默安装
CentOS 6.2 X64上64位Oracle 11gR2 静默安装 www.linuxidc.com/Linux/2012-03/56606p4.htm HP-UX静默安装oracle11g过程 ...
- Oracle 11gR2静默安装 & 命令行安装
静默安装 经常搭建Oracle测试环境,有时候觉得OUI(即图形界面)方式甚是繁琐,你得一步一步进行确认,所幸,Oracle支持静默安装.在我看来,它主要有两方面的好处:一.极大地提升了效率,尤其是批 ...
- Oracle 11gR2 静默安装奇怪错误
在静默安装Oracle 11gR2 的时候发现的奇怪错误,有点摸不着头脑 【步骤一】配置静默文件只安装软件 #--------------------------------------------- ...
- Oracle的静默安装 升级和卸载 参考规范
Oracle的静默安装 升级和卸载 参考规范 20180912 V1 一.Oracle的安装 Oracle产品的三种安装方式分别为: 1.图形化(Java向导)安装引导 2.使用应答文件静默安装 3. ...
- Oracle 11g静默安装简明版
环境:RHEL 6.5 + Oracle 11.2.0.4 1. 初步处理应答文件 2. 静默安装软件 3. 静默安装监听 4. 静默dbca建库 说明: 本文默认安装软件前的步骤已经设置完毕 如果没 ...
- Linux平台 Oracle 11gR2 RAC安装Part1:准备工作
一.实施前期准备工作 1.1 服务器安装操作系统 1.2 Oracle安装介质 1.3 共享存储规划 1.4 网络规范分配 二.安装前期准备工作 2.1 各节点系统时间校对 2.2 各节点关闭防火墙和 ...
- Linux平台 Oracle 11gR2 RAC安装Part2:GI安装
三.GI(Grid Infrastructure)安装 3.1 解压GI的安装包 3.2 安装配置Xmanager软件 3.3 共享存储LUN的赋权 3.4 使用Xmanager图形化界面安装GI 3 ...
- 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 ...
- oracle 11gR2 RAC安装手册
--oracle 11gR2 RAC安装手册 -----------------------------2013/10/29 参考三思笔记 http://files.cnblogs.com/jackh ...
随机推荐
- flask中接收post传递数组方法
list = request.form.getlist("表单名")
- thinkphp自动验证分析
thinkphp有一个自动验证的方法验证规则如下 array( array(验证字段1,验证规则,错误提示,[验证条件,附加规则,验证时间]), array(验证字段2,验证规则,错误提示,[验证条件 ...
- Perl一行式:处理行号和单词数
perl一行式程序系列文章:Perl一行式 所有行的行号 $ perl -pe '$_ = "$. $_"' file.log $ perl -ne 'print "$. ...
- JavaScript基础知识梳理,你能回答几道题?
在学习JavaScript的时候,总是这里学一点,那里学一点,很的很零星,很杂,没有很系统的去学习,感觉好像JavaScript的知识点都了解了,但是真正要说起来,又不知道从何说起! 最深刻的体会就是 ...
- “笨方法”学习Python笔记(2)-VS Code作为文本编辑器以及配置Python调试环境
Visual Studio Code 免费跨平台文本编辑器,插件资源丰富,我把其作为Debug的首选. 下载地址:https://code.visualstudio.com/Download 安装之后 ...
- [转]如何将高版本的SQL Server数据库备份到低版本的SQL Server
本文转自:https://blog.csdn.net/wang465745776/article/details/54969676 前提条件备份SQL Server服务器版本为:12.0.2000.8 ...
- vue-element-admin项目install出现的问题
1.需要安装nodejs和git 2. 配置淘宝镜像源(经常是因为墙的原因下载缓慢或者出错) npm config set registry https://registry.npm.taobao.o ...
- iframe实用操作
iframe高度设置为子页面高度 //需要使用Jquery $(document).ready(function () { parent.document.getEleme ...
- 【Java每日一题】20170217
20170216问题解析请点击今日问题下方的“[Java每日一题]20170217”查看(问题解析在公众号首发,公众号ID:weknow619) package Feb2017; public cla ...
- 【Spring】17、spring cache 与redis缓存整合
spring cache,基本能够满足一般应用对缓存的需求,但现实总是很复杂,当你的用户量上去或者性能跟不上,总需要进行扩展,这个时候你或许对其提供的内存缓存不满意了,因为其不支持高可用性,也不具备持 ...