Oracle初次安裝自動安裝軟體包

來源:互聯網
上載者:User

Oracle初次安裝自動安裝軟體包

一、Oracle自動安裝所需軟體包

提前配置好yum倉庫

定義package.txt包列表檔案:以官網RHEL6為例,這裡有compat-libstdc++有兩個包,如果不加*,+號後面的compat-libstdc++-33-3.2.3-69.el6.x86_64,compat-libstdc++-296-2.96-144.el6.i686這兩個包無法直接識別,需要以*代表兩個包,安裝過程中如果遇到缺少某一個包,則可以使用命令:yum whatprovides libstdc++.so.5,查看依賴這個庫的包,安裝這個包即可,下面是package.txt檔案

binutils
compat-libcap1
compat-libstdc++*
gcc
gcc-c++
glibc
glibc-devel
ksh
libgcc
libstdc++
libstdc++-devel
libaio
libaio-devel
make
sysstat

編寫安裝指令碼package.sh:將安裝記錄定義到/root/package.log,安裝完成後方便查看安裝狀態

#!/bin/bash
for i in`cat /root/package.txt`
do
        rpm -q $i
        if [ $? -eq 0 ];then
                echo "Package $i is already intsalled" >> /root/package.log 2>&1
        else
                yum install -y $i
                echo "Package $i is now installed"  >>/root/package.log 2>&1
        fi
done

二、自動添加使用者,使用者組

自動添加使用者組,建立目錄,定義oracle密碼,後面還可以加入環境變數,kernel參數等,oracle密碼設定為oracle

#!/bin/bash
 
for i in dbaoinstall
do
        cat /etc/group | grep $i > /dev/null2>&1
        if [ $? -eq 0 ];then
                echo "Group $i is already exist"
        else
                groupadd -r $i
        fi
done
 
id oracle >/dev/null 2>&1  && echo "User Oracle is already exist" || useradd -g oinstall -G dba oracle
#set password for oracle
echo"oracle" | passwd --stdin oracle
#create dictionary for install
mkdir -p /u01/app
chown -R oracle:oinstall  /u01/app
chmod 775 -R /u01/app

  • 1
  • 2
  • 下一頁

相關文章

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.