Oracle 11gR2 RAC DG 安装前初始化
发表于:2026-11-02 作者:千家信息网编辑
千家信息网最后更新 2026年11月02日,1、preusers.sh脚本#!/bin/bash#Purpose:Create 6 groups named 'oinstall','dba','asmadmin','asmdba','asmop
千家信息网最后更新 2026年11月02日Oracle 11gR2 RAC DG 安装前初始化
1、preusers.sh脚本
#!/bin/bash#Purpose:Create 6 groups named 'oinstall','dba','asmadmin','asmdba','asmoper','oper', plus 2 users named 'oracle','grid'.#Also setting the Environment#variable for oracle user.#variable for grid user.#Usage:Log on as the superuser('root'),and then execute the command:#./1preusers.sh#Author:Asher Huang echo "Now create 6 groups named 'oinstall','dba','asmadmin','asmdba','asmoper','oper'"echo "Plus 2 users named 'oracle','grid',Also setting the Environment" groupadd -g 1000 oinstall groupadd -g 1200 asmadmin groupadd -g 1201 asmdba groupadd -g 1202 asmoper useradd -u 1100 -g oinstall -G asmadmin,asmdba,asmoper -d /home/grid -s /bin/bash -c "grid Infrastructure Owner" grid echo "grid" | passwd --stdin grid echo 'export PS1="`/bin/hostname -s`-> "'>> /home/grid/.bash_profile echo "export TMP=/tmp">> /home/grid/.bash_profile echo 'export TMPDIR=$TMP'>>/home/grid/.bash_profile echo "export ORACLE_SID=+ASM1">> /home/grid/.bash_profile echo "export ORACLE_BASE=/u01/app/grid">> /home/grid/.bash_profileecho "export ORACLE_HOME=/u01/app/11.2.0/grid">> /home/grid/.bash_profileecho "export ORACLE_TERM=xterm">> /home/grid/.bash_profileecho "export NLS_DATE_FORMAT='yyyy/mm/dd hh34:mi:ss'" >> /home/grid/.bash_profileecho 'export TNS_ADMIN=$ORACLE_HOME/network/admin' >> /home/grid/.bash_profileecho 'export PATH=/usr/sbin:$PATH'>> /home/grid/.bash_profileecho 'export PATH=$ORACLE_HOME/bin:$PATH'>> /home/grid/.bash_profileecho 'export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib'>> /home/grid/.bash_profileecho 'export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib'>> /home/grid/.bash_profileecho "export EDITOR=vi" >> /home/grid/.bash_profileecho "export LANG=en_US" >> /home/grid/.bash_profileecho "export NLS_LANG=american_america.AL32UTF8" >> /home/grid/.bash_profileecho "umask 022">> /home/grid/.bash_profile groupadd -g 1300 dba groupadd -g 1301 oper useradd -u 1101 -g oinstall -G dba,oper,asmdba -d /home/oracle -s /bin/bash -c "Oracle Software Owner" oracle echo "oracle" | passwd --stdin oracle echo 'export PS1="`/bin/hostname -s`-> "'>> /home/oracle/.bash_profile echo "export TMP=/tmp">> /home/oracle/.bash_profile echo 'export TMPDIR=$TMP'>>/home/oracle/.bash_profile echo "export ORACLE_HOSTNAME=node1.localdomain">> /home/oracle/.bash_profile echo "export ORACLE_SID=devdb1">> /home/oracle/.bash_profile echo "export ORACLE_BASE=/u01/app/oracle">> /home/oracle/.bash_profileecho 'export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1'>> /home/oracle/.bash_profileecho "export ORACLE_UNQNAME=devdb">> /home/oracle/.bash_profileecho 'export TNS_ADMIN=$ORACLE_HOME/network/admin' >> /home/oracle/.bash_profileecho "export ORACLE_TERM=xterm">> /home/oracle/.bash_profileecho 'export PATH=/usr/sbin:$PATH'>> /home/oracle/.bash_profileecho 'export PATH=$ORACLE_HOME/bin:$PATH'>> /home/oracle/.bash_profileecho 'export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib'>> /home/oracle/.bash_profileecho 'export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib'>> /home/oracle/.bash_profileecho "export EDITOR=vi" >> /home/oracle/.bash_profileecho "export LANG=en_US" >> /home/oracle/.bash_profileecho "export NLS_LANG=american_america.AL32UTF8" >> /home/oracle/.bash_profileecho "export NLS_DATE_FORMAT='yyyy/mm/dd hh34:mi:ss'" >> /home/oracle/.bash_profileecho "umask 022">> /home/oracle/.bash_profile echo "The Groups and users has been created"echo "The Environment for grid,oracle also has been set successfully"2、predir.sh脚本
#!/bin/bash#Purpose:Create the necessary directory for oracle,grid users and change the authention to oracle,grid users.#Usage:Log on as the superuser('root'),and then execute the command:#./2predir.sh#Author:Asher Huang echo "Now create the necessary directory for oracle,grid users and change the authention to oracle,grid users..."mkdir -p /u01/app/gridmkdir -p /u01/app/11.2.0/gridmkdir -p /u01/app/oraclechown -R oracle:oinstall /u01chown -R grid:oinstall /u01/app/gridchown -R grid:oinstall /u01/app/11.2.0chmod -R 775 /u01echo "The necessary directory for oracle,grid users and change the authention to oracle,grid users has been finished"3、prelimits.sh脚本
#!/bin/bash#Purpose:Change the /etc/security/limits.conf.#Usage:Log on as the superuser('root'),and then execute the command:#./3prelimits.sh#Author:Asher Huang echo "Now modify the /etc/security/limits.conf,but backup it named /etc/security/limits.conf.bak before"cp /etc/security/limits.conf /etc/security/limits.conf.bakecho "oracle soft nproc 2047" >>/etc/security/limits.confecho "oracle hard nproc 16384" >>/etc/security/limits.confecho "oracle soft nofile 1024" >>/etc/security/limits.confecho "oracle hard nofile 65536" >>/etc/security/limits.confecho "grid soft nproc 2047" >>/etc/security/limits.confecho "grid hard nproc 16384" >>/etc/security/limits.confecho "grid soft nofile 1024" >>/etc/security/limits.confecho "grid hard nofile 65536" >>/etc/security/limits.confecho "Modifing the /etc/security/limits.conf has been succeed."4、prelogin.sh脚本
#!/bin/bash#Purpose:Modify the /etc/pam.d/login.#Usage:Log on as the superuser('root'),and then execute the command:#./4prelimits.sh#Author:Asher Huang echo "Now modify the /etc/pam.d/login,but with a backup named /etc/pam.d/login.bak"cp /etc/pam.d/login /etc/pam.d/login.bak echo "session required /lib/security/pam_limits.so" >>/etc/pam.d/loginecho "session required pam_limits.so" >>/etc/pam.d/login echo "Modifing the /etc/pam.d/login has been succeed."5、preprofile.sh脚本
#!/bin/bash#Purpose:Modify the /etc/profile.#Usage:Log on as the superuser('root'),and then execute the command:#./5preprofile.sh#Author:Asher Huang echo "Now modify the /etc/profile,but with a backup named /etc/profile.bak"cp /etc/profile /etc/profile.bakecho 'if [ $USER = "oracle" ]||[ $USER = "grid" ]; then' >> /etc/profileecho 'if [ $SHELL = "/bin/ksh" ]; then' >> /etc/profileecho 'ulimit -p 16384' >> /etc/profileecho 'ulimit -n 65536' >> /etc/profileecho 'else' >> /etc/profileecho 'ulimit -u 16384 -n 65536' >> /etc/profileecho 'fi' >> /etc/profileecho 'fi' >> /etc/profileecho "Modifing the /etc/profile has been succeed."6、presysctl.sh脚本
#!/bin/bash#Purpose:Modify the /etc/sysctl.conf.#Usage:Log on as the superuser('root'),and then execute the command:#./6presysctl.sh#Author:Asher Huang echo "Now modify the /etc/sysctl.conf,but with a backup named /etc/sysctl.bak"cp /etc/sysctl.conf /etc/sysctl.conf.bak echo "fs.aio-max-nr = 1048576" >> /etc/sysctl.confecho "fs.file-max = 6815744" >> /etc/sysctl.confecho "kernel.shmall = 2097152" >> /etc/sysctl.confecho "kernel.shmmax = 1054472192" >> /etc/sysctl.confecho "kernel.shmmni = 4096" >> /etc/sysctl.confecho "kernel.sem = 250 32000 100 128" >> /etc/sysctl.confecho "net.ipv4.ip_local_port_range = 9000 65500" >> /etc/sysctl.confecho "net.core.rmem_default = 262144" >> /etc/sysctl.confecho "net.core.rmem_max = 4194304" >> /etc/sysctl.confecho "net.core.wmem_default = 262144" >> /etc/sysctl.confecho "net.core.wmem_max = 1048586" >> /etc/sysctl.confecho "net.ipv4.tcp_wmem = 262144 262144 262144" >> /etc/sysctl.confecho "net.ipv4.tcp_rmem = 4194304 4194304 4194304" >> /etc/sysctl.conf echo "Modifing the /etc/sysctl.conf has been succeed."echo "Now make the changes take effect....."sysctl -p参考博文:http://www.oracleonlinux.cn/2012/06/step-by-step-install-11gr2-rac-on-linux-8/
脚本
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
苏州找大状互联网科技有限公司
互联网科技工作委员会副主任毛军
科技互联网政务服务
港股互联网科技股
期待互联网科技
郑州华宇互联网科技
互联网科技公司有哪些
互联网科技大会
联恩商钥互联网科技有限公司
云创客互联网科技公司
深圳前海聚择互联网科技有限公司
河南猎农互联网科技有限公司
互联网科技研发水平
青海科技产业互联网发展
互联网科技和法律行业
为客找房互联网科技公司怎么样
工业互联网展湾科技股份有限公司
深圳互联网科技的发展
2021世界互联网领先科技成果发布
国产互联网科技公司
广东猪兼强互联网科技有限公司
为想互联网科技
时间互联网络科技
互联网金融 科技创新
顺网科技2021年互联网排名
随着互联网科技发展
重庆威客帮互联网科技
伍佰万互联网科技怎么赚钱
兰石爱特工业互联网科技分公司
互联网科技大佬云集