[Oracle]-Oracle_script

來源:互聯網
上載者:User

標籤:clean   core   ipa   net   add   china   環境   sed   check   

YUM script
#!/bin/bashrm -rf /etc/yum.repos.d/*echo "[yum]name=yumbaseurl=file:///mnt/enabled=1gpgcheck=0" > /etc/yum.repos.d/yum.repomount /dev/cdrom /mnt &> /dev/nullyum clean allyum makecache
 Oracle script
#!/bin/bash#配置ip:sed -i "s/ONBOOT=no/ONBOOT=yes/g" /etc/sysconfig/network-scripts/ifcfg-eth0sed -i "s/BOOTPROTO=dhcp/BOOTPROTO=static/g" /etc/sysconfig/network-scripts/ifcfg-eth0echo "IPADDR=172.16.1.1" >> /etc/sysconfig/network-scripts/ifcfg-eth0echo "NETMASK=255.255.255.0" >>/etc/sysconfig/network-scripts/ifcfg-eth0service network restart &> /dev/null#關閉Selinux:getenforce &> /dev/null#關閉防火牆:service iptables stop &> /dev/null#修改主機名稱:hostname oracle.combash#網域名稱解析:echo  "172.16.1.1     oracle.benet.com" >>  /etc/hosts#調整核心參數:echo "fs.aio-max-nr = 1048576" >>/etc/sysctl.confecho "fs.file-max = 6815744" >>/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.conf#準備系統軟體環境:yum -y install binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers kernel-headers ksh libaio libaio-devel libgcc libgomp libstdc++ libstdc++-devel make numactl-devel sysstat unixODBC unixODBC-devel &> /dev/nullrpm -e ksh &> /dev/nullrpm -ivh pdksh-5.2.14-36.el5.i386.rpm &> /dev/nullrpm -ivh ksh-20100202-1.el5.i386.rpm &> /dev/nullmkdir -p /usr/share/fonts/zh_CN/TrueTypeunzip Oracle字型庫zysong.zip  &> /dev/nullcp zysong.ttf /usr/share/fonts/zh_CN/TrueType/#建立使用者:groupadd -g 66 oinstallgroupadd -g 77 oracleuseradd -g oinstall -G oracle oracleecho ’123.com‘ | passwd --stdin oracle &> /dev/null#賦予許可權:mkdir /opt/oraclechown -R oracle:oinstall /opt/oraclechmod -R 775 /opt/oracle#添加:echo ‘umask 022‘ >>/home/oracle/.bash_profileecho ‘export ORACLE_BASE=/opt/oracle‘ >>/home/oracle/.bash_profileecho ‘export ORACLE_HOME=$ORACLE_BASE/product/11.2/db_1‘ >>/home/oracle/.bash_profileecho ‘export ORACLE_SID=orcl‘ >>/home/oracle/.bash_profileecho ‘export LANG=zh_CN.UTF-8‘ >>/home/oracle/.bash_profileecho ‘export NLS_LANG="SIMPLIFIED CHINESE_CHINA.AL32UTF8"‘ >>/home/oracle/.bash_profileecho ‘export PATH=$ORACLE_HOME/bin:$PATH‘ >>/home/oracle/.bash_profileecho "export DISPLAY=:0.0" >>/home/oracle/.bash_profile#資源限制:echo "session required /lib/security/pam_limits.so" >>/etc/pam.d/loginecho "session required pam_limits.so" >>/etc/pam.d/login#資源限制:echo "oracle soft nproc 8192" >>/etc/security/limits.confecho "oracle hard nproc 16384" >>/etc/security/limits.confecho "oracle soft nofile 32768" >>/etc/security/limits.confecho "oracle hard nofile 65536" >>/etc/security/limits.confecho "oracle soft stack 10240" >>/etc/security/limits.conf
mkdir /mnts
mount /dev/cdrom1 /mntsmkdir /databasecp -r /mnts/* /database/xhost + &> /dev/nullxhost + &> /dev/nullsu - oraclecd /database/./runInstaller

安裝兩個光碟片

centos6.5掛載到/mnt下

Oracle掛載到自訂的/mnts下

注意第一次掛載的事cdrom,第二個是cdrom2

oracle.sh指令碼註:執行完成指令碼 須重新啟動虛擬機器 

重啟之後在root介面重新執行xhost + ,否則會報錯

 

[Oracle]-Oracle_script

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.