小标
2018-08-15
来源 :
阅读 695
评论 0
摘要:本文主要向大家介绍了Oracle数据库之RedHat 6 静默安装Oracle 11gR2,通过具体的内容向大家展现,希望对大家学习Oracle数据库有所帮助。
本文主要向大家介绍了Oracle数据库之RedHat 6 静默安装Oracle 11gR2,通过具体的内容向大家展现,希望对大家学习Oracle数据库有所帮助。
之前看了网上很多篇Linux静默安装Oracle的文章,但安装测试时老觉得有问题,后来直接找来Oracle官方英文文档并仔细阅读研究rsp文件的内容说明,经过自己在虚拟机中的安装测试,使用RedHat 6.5(内核版本:2.6.32-431.el6.x86_64)上静默安装Oracle 11gR2(版本:11.2.0.3),整理出了本文,主要包括了环境要求与准备、静默安装Oracle软件与监听、静默安装Oracle数据库、安装完成后检查、设置Oracle开机自动启动等部分。一、 环境要求与准备1、硬件要求(1)内存Minimum: 1 GB of RAMRecommended: 2 GB of RAM or moreTo determine the RAM size, enter the following command:# grep MemTotal /proc/meminfo (2)SWAPAvailable RAM Swap Space RequiredBetween 1 GB and 2 GB 1.5 ——times the size of the RAMBetween 2 GB and 16 GB ——Equal to the size of the RAMMore than 16 GB ——16 GB# grep SwapTotal /proc/meminfo (3)ASMAutomatic Memory Management feature requires more shared memory ( /dev/shm) and file descriptors#df -h /dev/shm/Note: MEMORY_MAX_TARGET and MEMORY_TARGET cannot be used when LOCK_SGA is enabled or with HugePages on Linux. (4)磁盘空间At least 1 GB of disk space in the /tmp directoryEnterprise Edition ——At least 4.7 GB for Software Files and 1.7 GB for Data FilesStandard Edition ——At least 4.6 GB for Software Files and 1.5 GB for Data Files2、软件要求(1)操作系统要求■ Asianux Server 3 SP2■ Asianux Server 4 SP3■ Oracle Linux 4 Update 7■ Oracle Linux 5 Update 2 (with Red Hat Compatible Kernel)■ Oracle Linux 5 Update 5■ Oracle Linux 6■ Oracle Linux 6 (with Red Hat Compatible Kernel)■ Oracle Linux 7■ Oracle Linux 7 (with the Red Hat Compatible Kernel)■ Red Hat Enterprise Linux 4 Update 7■ Red Hat Enterprise Linux 5 Update 2■ Red Hat Enterprise Linux 6■ Red Hat Enterprise Linux 7■ SUSE Linux Enterprise Server 10 SP2■ SUSE Linux Enterprise Server 11 (2)内核要求■On Red Hat Enterprise Linux 5 Update 52.6.18 or later■On Red Hat Enterprise Linux 62.6.32-71.el6.x86_64 or later■ On Red Hat Enterprise Linux 73.10.0-54.0.1.el7.x86_64 or later (3)依赖包要求Note: Starting with Oracle Database 11g Release 2 (11.2.0.2), all the 32-bit packages, except for gcc-32bit-4.3 , listed in the following table are no longer required for installing a database on Linux x86-64. Only the 64-bit packages are required. However, for any Oracle Database 11g release before 11.2.0.2, both the 32-bit and 64-bit packages listed in the following table are required. The following or later version of packages for Oracle Linux 6, Red Hat Enterprise Linux 6, and Asianux Server 4 must be installed: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.i686gcc-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.i686kshlibgcc-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.i686libstdc++-devel-4.4.4-13.el6 (x86_64)libstdc++-devel-4.4.4-13.el6.i686libaio-0.3.107-10.el6 (x86_64)libaio-0.3.107-10.el6.i686libaio-devel-0.3.107-10.el6 (x86_64)libaio-devel-0.3.107-10.el6.i686make-3.81-19.el6sysstat-9.0.4-11.el6 (x86_64)(4)ODBC要求On Oracle Linux 6, Red Hat Enterprise Linux 6:unixODBC-2.2.14-11.el6 (x86_64) or laterunixODBC-2.2.14-11.el6.i686 or laterunixODBC-devel-2.2.14-11.el6 (x86_64) or laterunixODBC-devel-2.2.14-11.el6.i686 or later3、用户和组要求The following local operating system groups and users are required if you are installing Oracle Database:■ The Oracle Inventory group (typically, oinstall )■ The OSDBA group (typically, dba )■ The Oracle software owner (typically, oracle )■ The OSOPER group (optional. Typically, oper )# grep dba /etc/group# id oracle#groupadd dba#groupadd oinstallIf the oracle user exists:# /usr/sbin/usermod -g oinstall -G dba oracleIf the oracle user does not exist:# /usr/sbin/useradd -g oinstall -G dba oracleset the password: # passwd oracle4、内核参数要求Note: If the current value of any parameter is higher than the value listed in this table, then do not change the value of that parameter.本文原始出处:江健龙的技术博客//jiangjianlong.blog.51cto.com/3735273/1832986修改方法:create or edit the /etc/sysctl.conf file, and add or edit lines similar to the following: fs.aio-max-nr = 1048576fs.file-max = 6815744kernel.sem = 250 32000 100 128net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048576 Note: if any of the current values are larger than theminimum value, then specify the larger value。使生效:# /sbin/sysctl -p或reboot 如果运行 #sysctl -p 命令报错error: "net.bridge.bridge-nf-call-ip6tables" is an unknown keyerror: "net.bridge.bridge-nf-call-iptables" is an unknown keyerror: "net.bridge.bridge-nf-call-arptables" is an unknown key则解决方法为执行如下命令:#modprobe bridge 查看:# /sbin/sysctl -a 5、资源限制要求修改好后必须使用Oracle用户登出再登录才生效$ ulimit -Sn4096$ ulimit -Hn65536$ ulimit -Su2047$ ulimit -Hu16384$ ulimit -Ss10240$ ulimit -Hs32768修改方法:vi /etc/security/limits.conf末尾加入以下内容:oracle soft nproc 2047oracle hard nproc 16384oracle soft nofile 4096oracle hard nofile 65536oracle hard stack 327686、创建安装目录Oracle_Base目录:/u01/app/oracle/Oracle_Home目录:/u01/app/oracle/11gr2Oracle清单目录:/u01/app/oracle/oraInventory7、配置Oracle用户环境变量vi /home/oracle/.bash_profileexport EDITOR=viexport ORACLE_SID=orclexport ORACLE_BASE=/u01/app/oracleexport ORACLE_HOME=$ORACLE_BASE/11gr2export nls_date_format="yyyy-mm-dd hh24:mi:ss"export PATH=/u01/app/oracle/11gr2/bin:$PATH 执行命令ource .bash_profile 使配置生效 8、编辑/etc/profilevi /etc/profile末尾加入:if [ $USER = "oracle" ]; then if [ $SHELL = "/bin/ksh" ]; thenulimit -p 16384ulimit -n 65536elseulimit -u 16384 -n 65536fifi本文原始出处:江健龙的技术博客//jiangjianlong.blog.51cto.com/3735273/1832986二、 静默安装Oracle 软件和监听1、静默安装命令$ /directory_path/runInstaller [-silent] [-noconfig] -responseFile responsefilename■-noconfig suppresses running the configuration assistants during installation,and a software-only installation is performed instead.■ responsefilename is the full path and file name of the installation responsefile that you configured.2、编辑应答文件db_install.rsp更改以下内容,其他不需要改,标橙色的需注意要结合实际环境更改。Oracle版本:11.2.0.3oracle.install.option=INSTALL_DB_SWONLYORACLE_HOSTNAME=rh6UNIX_GROUP_NAME=oinstallSELECTED_LANGUAGES=en,zh_CNORACLE_HOME=/u01/app/oracle/11gr2ORACLE_BASE=/u01/app/oracle/INVENTORY_LOCATION=/u01/app/oraInventoryoracle.install.db.InstallEdition=EEoracle.install.db.DBA_GROUP=dbaoracle.install.db.OPER_GROUP=oinstallDECLINE_SECURITY_UPDATES=trueoracle.install.db.EEOptionsSelection=false3、执行静默安装Oracle命令./runInstaller -silent -noconfig -ignorePrereq -responseFile /oracle11gr2zip/db_install.rsp4、使用root登录执行脚本5、执行静默安装监听命令不需要修改应答文件内容,直接使用介质中的netca.rsp文件[oracle@rh6 database]$ netca /silent /responseFile /oracle11gr2zip/database/response/netca.rsp三、 静默安装Oracle数据库1、编辑dbca.rsp更改以下内容,其他不需要改,标橙色的内容需结合自己实际环境修改RESPONSEFILE_VERSION = "11.2.0"OPERATION_TYPE = "createDatabase"GDBNAME = "orcl"SID = "orcl"TEMPLATENAME = "General_Purpose.dbc"SYSPASSWORD = "p@ssw0rd"SYSTEMPASSWORD = "p@ssw0rd"EMCONFIGURATION = "LOCAL"SYSMANPASSWORD = "p@ssw0rd"DBSNMPPASSWORD = "p@ssw0rd"STORAGETYPE=FSCHARACTERSET = "ZHS16GBK"NATIONALCHARACTERSET= "AL16UTF16"MEMORYPERCENTAGE = "40"TOTALMEMORY = "1024" 2、执行静默安装数据库命令 $dbca -silent -responseFile /oracle11gr2zip/dbca.rsp四、安装完成后检查1、检查监听状态$ lsnrctl status2、检查Oracle进程$ ps -ef |grep ora_ |grep -v grep3、登录Oracle数据库并执行常见查询命令4、登录EM五、配置Oracle开机自动启动1、以Oracle登录,编辑oratabvi /etc/oratab,将N改为Y本文原始出处:江健龙的技术博客 //jiangjianlong.blog.51cto.com/3735273/18329862、 root登录,创建脚本vi /etc/init.d/oracle,创建oracle文件,内容如下:#!/bin/sh# chkconfig: 35 80 10# description: Oracle auto start-stop script. ## Set ORACLE_HOME to be equivalent to the $ORACLE_HOME# from which you wish to execute dbstart and dbshut;## Set ORACLE_OWNER to the user id of the owner of the# Oracle database in ORACLE_HOME.ORACLE_HOME=/u01/app/oracle/11gr2ORACLE_OWNER=oracleif [ ! -f $ORACLE_HOME/bin/dbstart ]then echo "Oracle startup: cannot start" exitficase "$1" in‘start‘)# Start the Oracle databases:echo "Starting Oracle Databases ... "echo "-------------------------------------------------" >> /var/log/oracledate +" %T %a %D : Starting Oracle Databases as part of system up." >> /var/log/oracleecho "-------------------------------------------------" >> /var/log/oraclesu - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart" >>/var/log/oracleecho "Done" # Start the Listener:echo "Starting Oracle Listeners ... "echo "-------------------------------------------------" >> /var/log/oracledate +" %T %a %D : Starting Oracle Listeners as part of system up." >> /var/log/oracleecho "-------------------------------------------------" >> /var/log/oraclesu - $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl start" >>/var/log/oracleecho "Done."echo "-------------------------------------------------" >> /var/log/oracledate +" %T %a %D : Finished." >> /var/log/oracleecho "-------------------------------------------------" >> /var/log/oracletouch /var/lock/subsys/oracle;;‘stop‘)# Stop the Oracle Listener:echo "Stoping Oracle Listeners ... "echo "-------------------------------------------------" >> /var/log/oracledate +" %T %a %D : Stoping Oracle Listener as part of system down." >> /var/log/oracleecho "-------------------------------------------------" >> /var/log/oraclesu - $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop" >>/var/log/oracleecho "Done."rm -f /var/lock/subsys/oracle # Stop the Oracle Database:echo "Stoping Oracle Databases ... "echo "-------------------------------------------------" >> /var/log/oracledate +" %T %a %D : Stoping Oracle Databases as part of system down." >> /var/log/oracleecho "-------------------------------------------------" >> /var/log/oraclesu - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbshut" >>/var/log/oracleecho "Done."echo ""echo "-------------------------------------------------" >> /var/log/oracledate +" %T %a %D : Finished." >> /var/log/oracleecho "-------------------------------------------------" >> /var/log/oracle;; ‘restart‘)$0 stop$0 start;;esac3、赋予脚本权限4、设置开机启动5、测试脚本效果(1)关闭数据库(2)使用root登录,执行命令service oracle start(3)登录数据库检查,数据库已在运行,监听也正常(4)执行service oracle stop(5)检查监听和数据库都已关闭本文出自 “江健龙的技术博客” 博客,请务必保留此出处//jiangjianlong.blog.51cto.com/3735273/1832986RedHat 6 静默安装Oracle 11gR2原文地址://jiangjianlong.blog.51cto.com/3735273/1832986
本文由职坐标整理并发布,希望对同学们学习Oracle有所帮助,更多内容请关注职坐标数据库Oracle数据库频道!
喜欢 | 0
不喜欢 | 0
您输入的评论内容中包含违禁敏感词
我知道了

请输入正确的手机号码
请输入正确的验证码
您今天的短信下发次数太多了,明天再试试吧!
我们会在第一时间安排职业规划师联系您!
您也可以联系我们的职业规划师咨询:
版权所有 职坐标-一站式AI+学习就业服务平台 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
沪公网安备 31011502005948号