1. preusers.sh Script
#!/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 hh24: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"  |&Nbsp;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 hh24: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&NBSp;been set successfully "
2. predir.sh Script
#!/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 Script
#!/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 Script
#!/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/et C/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 Script
#!/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 Script
#!/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
Reference post: http://www.oracleonlinux.cn/2012/06/step-by-step-install-11gr2-rac-on-linux-8/
Oracle 11gR2 RAC DG Pre-installation initialization