#!/bin/bash
#Purpose:Create and config oracle install.
#Usage:Log on as the superuser('root')

#1.create groups and users.
groupadd dba -g 111
groupadd oinstall -g 110
useradd oracle -u 110 -g 110 -G 111
echo "oracle" | passwd --stdin oracle

echo "export TMP=/tmp">> /home/oracle/.bash_profile 
echo 'export TMPDIR=$TMP'>>/home/oracle/.bash_profile
echo "export ORACLE_HOSTNAME=localhost.localdomain">> /home/oracle/.bash_profile
echo "export ORACLE_SID=orcl">> /home/oracle/.bash_profile
echo "export ORACLE_BASE=/u01/app/oracle">> /home/oracle/.bash_profile
echo 'export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1'>> /home/oracle/.bash_profile
echo 'export PATH=/usr/sbin:$PATH'>> /home/oracle/.bash_profile
echo 'export PATH=$ORACLE_HOME/bin:$PATH'>> /home/oracle/.bash_profile
echo 'export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib'>> /home/oracle/.bash_profile
echo 'export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib'>> /home/oracle/.bash_profile
echo "export LANG=en_US" >> /home/oracle/.bash_profile
echo "export NLS_LANG=american_america.AL32UTF8" >> /home/oracle/.bash_profile
echo "export NLS_DATE_FORMAT='yyyy-mm-dd hh24:mi:ss'" >> /home/oracle/.bash_profile

echo "The Groups and users has been created"

#2.create directory for oracle.
mkdir -p /u01
mkdir -p /u01/app
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01
chown -R oracle:oinstall /u01/app
chown -R oracle:oinstall /u01/app/oracle

echo "The directory has beeb created."

#3.config limits.
cp /etc/security/limits.conf /etc/security/limits.conf.bak
echo "oracle soft nproc 2047" >>/etc/security/limits.conf
echo "oracle hard nproc 16384" >>/etc/security/limits.conf
echo "oracle soft nofile 1024" >>/etc/security/limits.conf
echo "oracle hard nofile 65536" >>/etc/security/limits.conf

echo "Modifing the /etc/security/limits.conf has been succeed."

#4.config login.
cp /etc/pam.d/login /etc/pam.d/login.bak
echo "session required /lib/security/pam_limits.so" >>/etc/pam.d/login
echo "session required pam_limits.so" >>/etc/pam.d/login
echo "Modifing the /etc/pam.d/login has been succeed."

#5.config profile.
cp /etc/profile /etc/profile.bak
echo 'if [ $USER = "oracle" ]; then' >>  /etc/profile
echo 'if [ $SHELL = "/bin/ksh" ]; then' >> /etc/profile
echo 'ulimit -p 16384' >> /etc/profile
echo 'ulimit -n 65536' >> /etc/profile
echo 'else' >> /etc/profile
echo 'ulimit -u 16384 -n 65536' >> /etc/profile
echo 'fi' >> /etc/profile
echo 'fi' >> /etc/profile
echo "Modifing the /etc/profile has been succeed."

#6.config sysctl.ctl
cp /etc/sysctl.conf /etc/sysctl.conf.bak
echo "fs.aio-max-nr = 1048576" >> /etc/sysctl.conf
echo "fs.file-max = 6815744" >> /etc/sysctl.conf
echo "kernel.shmall = 2097152" >> /etc/sysctl.conf
echo "kernel.shmmax = 1054472192" >> /etc/sysctl.conf
echo "kernel.shmmni = 4096" >> /etc/sysctl.conf
echo "kernel.sem = 250 32000 100 128" >> /etc/sysctl.conf
echo "net.ipv4.ip_local_port_range = 9000 65500" >> /etc/sysctl.conf
echo "net.core.rmem_default = 262144" >> /etc/sysctl.conf
echo "net.core.rmem_max = 4194304" >> /etc/sysctl.conf
echo "net.core.wmem_default = 262144" >> /etc/sysctl.conf
echo "net.core.wmem_max = 1048586" >> /etc/sysctl.conf
echo "net.ipv4.tcp_wmem = 262144 262144 262144" >> /etc/sysctl.conf
echo "net.ipv4.tcp_rmem = 4194304 4194304 4194304" >> /etc/sysctl.conf
echo "Modifing the /etc/sysctl.conf has been succeed."
sysctl -p

linux OS install oracle database的更多相关文章

  1. Oracle安装部署之linux OS install oracle database安装脚本

    #!/bin/bash#Purpose:Create and config oracle install.#Usage:Log on as the superuser('root') #1.creat ...

  2. Linux 平台安装Oracle Database 12c

    1)下载Oracle Database 12cRelease 1安装介质 官方的下载地址: 1:http://www.oracle.com/technetwork/database/enterpris ...

  3. Install Oracle Database client in silent mode

    下面通过在工作中的使用,总结出不同版本Oracle client的静默(silent)安装方法. Oracle Database client 12.2.0.1 1. reponse file con ...

  4. Install Oracle 11G Release 2 (11.2) on Oracle Linux 7 (OEL7)

    Install Oracle 11G Release 2 (11.2) on Oracle Linux 7 (OEL7) This article presents how to install Or ...

  5. Quick and Easy Installation of Oracle Database 12c on Oracle Linux in Oracle VM VirtualBox

    发贴人 Sergio-Oracle 于2018-4-18 23:10:15在Oracle Linux Introduction How Does This Work? Requirements Bef ...

  6. 使用 Oracle GoldenGate 在 Microsoft SQL Server 和 Oracle Database 之间复制事务

    使用 Oracle GoldenGate 在 Microsoft SQL Server 和 Oracle Database 之间复制事务 作者:Nikolay Manchev 分步构建一个跨这些平台的 ...

  7. (转)oracle linux 7 安装oracle 12c

    原文:https://blog.csdn.net/jiuyun1986/article/details/53589446 https://blog.csdn.net/admin_root1/artic ...

  8. Oracle Database 11G R2 标准版 企业版 下载地址(转)

    转自:http://blog.itpub.net/628922/viewspace-759245/ 不需要注册,直接复制到迅雷或其他下载软件中即可下载. oracle 11.2.0.3 下载地址: L ...

  9. Oracle Database 11g Release 2 Standard Edition and Enterprise Edition Software Downloads

    Oracle Database 11g Release 2 Standard Edition and Enterprise Edition Software DownloadsOracle 数据库 1 ...

随机推荐

  1. Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005.

    Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} fai ...

  2. rpm常用命令

    * 手动安装 rpm 包  `rpm-ivh xxxxx.rpm`  参数:   --force 即使覆盖其他包的文件也没强迫安装   --nodeps 即使依赖包没安装,也被强制安装 * 查看 rp ...

  3. 如何将数据库中的表导入到PowerDesigner中

    1.        打开PowerDesigner12,在菜单中按照如下方式进行操作file->Reverse Engineer->DataBase 点击后,弹出 New Physical ...

  4. PHP图片裁剪_图片缩放_PHP生成缩略图

    在制作网页过程中,为了排版整齐美观,对网页中的图片处理成固定大小尺寸的图片,或是要截去图片边角中含有水印的图片,对于图片量多,每天更新大量图,靠人工PS处理是不现实的,那么有没有自动处理图片的程序了! ...

  5. tomcat 性能优化

    tomcat 性能优化tomcat默认参数是为开发环境制定,而非适合生产环境,尤其是内存和线程的配置,默认都很低,容易成为性能瓶颈. tomcat内存优化linux修改TOMCAT_HOME/bin/ ...

  6. 解决 Oracle exp导出表数据时空表不能导出的问题

    一.不能导出空表的原因 1.Oracle11g默认对空表不分配segment,故使用exp导出Oracle11g数据库时,空表不会导出. 2.设置deferred_segment_creation 参 ...

  7. jquery之右下角消息提示框

    messager.js (function (jQuery) { var window; var obj = new Object(); obj.version = '@1.0'; obj.title ...

  8. 在Windows server 2008 R2上安装Python3.5

    最近弄了台机器,把以前的一些东西移植到这台机器上去,先远程看一下机器(其实就是一台虚拟机)配置,系统版本是Windows server2008R2 Enterprise,64位,4G内存,E7-885 ...

  9. grep及正则表达式

    文本搜索工具:grep,egrep,fgrep GREP介绍 grep: 根据模式条件搜索文本,并将符合模式的文本行显示出来.  过滤条件:文本字符和正则表达式的元字符组合而成匹配条件 以正则表达式的 ...

  10. centos下postgresql的安装与配置[转]

    本文摘自:http://blog.chinaunix.net/uid-24846094-id-78490.html 一.安装(以root身份进行) 1.检出最新的postgresql的yum配置从ht ...