標籤:des 使用 os 檔案 io for re c
1、系統kernel參數設定
cat >> /etc/sysctl.conf << "EOF"##### for Oracle_11gR2 #####fs.aio-max-nr = 1048576 fs.file-max = 6815744 # kernel.shmall=2097152 # kernel.shmmax=4195057664kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 262144 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 1048586EOF
RHEL 6中shmall和shmmax已配置,使用預設設定即可,shmmax一般設為系統記憶體的一半,4195057664=4GB
修改之後執行命令生效:
/sbin/sysctl -p
2、修改使用者限制
cat >> /etc/security/limits.conf << "EOF"##### for Oracle_11gR2 #####oracle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536EOFecho "session required pam_limits.so">>/etc/pam.d/login
3、修改系統設定檔
cat >> /etc/profile << "EOF"##### for Oracle_11gR2 #####if [ $USER = "oracle" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi fi EOFcat >> /etc/csh.login << "EOF"##### for Oracle_11gR2 #####if( $USER == "oracle" ) then limit maxproc 16384 limit descriptors 65536 umask 022 endif EOF
4、建立oracle使用者,準備oracle安裝目錄
/usr/sbin/groupadd oinstall /usr/sbin/groupadd dba /usr/sbin/useradd -m -g oinstall -G dba oracle echo "oracle"|passwd --stdin oraclemkdir -p /opt/oracle/ chown -R oracle:oinstall /opt/oracle/chmod -R 775 /opt/oracle/ mkdir -p /opt/oraInventory chown -R oracle:oinstall /opt/oraInventorychmod -R 775 /opt/oraInventory
5、修改oracle使用者設定檔
cat >> /home/oracle/.bash_profile << "EOF"##### for Oracle_11gR2 #####if [ $USER = "oracle" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi fi umask 022export TMP=/tmp export TMPDIR=/tmpexport ORACLE_BASE=/opt/oracleexport ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1export ORACLE_SID=orclexport ORACLE_UNQNAME=$ORACLE_SID export ORACLE_TERM=xtermexport LANG=en_US.UTF8export NLS_LANG=american_america.AL32UTF8#export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"export TNS_ADMIN=$ORACLE_HOME/network/adminexport LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/usr/X11R6/lib:$ORACLE_HOME/rdbms/libexport CLASS_PATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlibexport PATH=$ORACLE_HOME/bin:$PATHEOF
6、配置hosts檔案
echo "192.168.0.10 oracle11g oracle11g.local" >> /etc/hosts
7、修改RHEL版本號碼,完成Oracle安裝再修改回來
sed -i ‘/Red Hat Enterprise Linux Server release 6.5 (Santiago)/s/^/#/‘ /etc/redhat-releasesed -i ‘a Red Hat Enterprise Linux Server release 5.0 (Tikanga)‘ /etc/redhat-release
8、關閉SELinux、防火牆
sed -i ‘/SELINUX=enforcing/s/^/#/‘ /etc/selinux/configsed -i ‘/#SELINUX=enforcing/a SELinux=disabled‘ /etc/selinux/config
防火牆通過RHEL圖形化管理工具禁用,完成後重啟系統