Oracle Database 10g Release 2(10.2.0.1)指令碼自動化安裝

來源:互聯網
上載者:User

#!/bin/sh
#The scripts is for RHEL5U1
#author is kevin
#date 2011-06-06

for i in  libXp-1.0.0-8    openmotif-2.3.0-0.3.el5 compat-db-4.2.52-5.1 compat-gcc-34-3.4.6-4 compat-libf2c-34-3.4.6-4  compat-gcc-34-g77-3.4.6-4 compat-gcc-34-c++-3.4.6-4 compat-libstdc++-296-2.96-138 compat-libstdc++-33-3.2.3-61
do
yum install -y $i
done

Oracle_PASSWD=oracle
# oracle使用者密碼
SETUP_FILE_PATH=/u01/oracle
# 10g安裝程式目錄
INSTALL_TO_PATH=/u01
# 安裝路徑
#----------------------------------------
grep oracle /etc/passwd &> /dev/null

# 檢查是否已經安裝
if [ $? -eq 0 ]
then
clear
echo "oracle user is already existEOF"
exit 1
fi
###################調整核心參數#############################
cat >> /etc/sysctl.conf << EOF
kernel.sem = 250 32000 100 128
fs.file-max = 65546
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 1048576
net.core.wmem_max = 1048576
EOF
sysctl -p
# 提交配置參數
###################建立安裝使用者及組#########################
#off Selinux
groupadd dba && groupadd oinstall
useradd -g oinstall -G dba -m oracle
echo $ORACLE_PASSWD | passwd oracle --stdin
mkdir -p $INSTALL_TO_PATH
chown -R oracle.oinstall $INSTALL_TO_PATH
##=============================================
cat >> /etc/pam.d/login << EOF
# Add content for oracle install
session required pam_limits.so
EOF
# turn on limits for oracle 10g
cat >> /etc/security/limits.conf << EOF
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 4096
oracle hard nofile 65535
EOF
##=============================================
echo 'Red Hat Enterprise Linux Server release 4 (Tikanga)' > /etc/RedHat-release
echo '
#--------------------------------------
# Set for Oracle10g Install           ;
#--------------------------------------
trap " " 0 1 2 3 5 9 15
trap clear 0
export TMP=/tmp
export TMPDIR=$TMP
' >> /home/oracle/.bash_profile
#============
echo "export ORACLE_BASE=$INSTALL_TO_PATH" >> /home/oracle/.bash_profile
#============
echo '
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=orcl
export ORACLE_TERM=oinstall
export PATH=$ORACLE_HOME/bin:$PATH
export LANG=en_US
' >> /home/oracle/.bash_profile

# 使用者ROOT登入在字元介面下
clear
echo "you can su - oracle in X and run runInstaller to install oracle now"
#su - oracle
#startx -- :1
#./runInstaller
# 開始安裝ORACLE

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.