一、自动安装所需软件包
binutils compat-libcap1 compat-libstdc + + * 海湾合作委员会 gcc-c + + glibc glibc-devel ksh libgcc libstdc + + libstdc + +重击 libaio libaio-devel 使 sysstat
# !/bin/bash for 小姐:'cat /根/package.txt ' 做 ,,,,,,,rpm -q 我美元 ,,,,,,,if [$ ?大敌;-eq 0,); ,,,,,,,,,,,,,,,echo “Package 小姐:美元is already intsalled”,在祝辞,/根/package.log 2祝辞,1 ,,,,,,, ,,,,,,,,,,,,,,,yum install -y 我美元 ,,,,,,,,,,,,,,,echo “Package 小姐:美元is 你安装“,,在祝辞/根/package.log 2祝辞,1 ,,,,,,fi
二完成,自动添加用户,用户组
,,,,,自动添加用户组,创建目录,定义甲骨文密码,后面还可以加入环境变量,内核参数等,甲骨文密码设置为oracle
# !/bin/bash , for 小姐:dbaoinstall拷贝 做 ,,,,,,,cat /etc/group |, grep 美元小姐:祝辞,/dev/null2>, 1 ,,,,,,,if [$ ?大敌;-eq 0,); ,,,,,,,,,,,,,,,echo “Group 小姐:美元is already 存在” ,,,,,,, ,,,,,,,,,,,,,,,groupadd -r 我美元 ,,,,,,fi 完成 , id oracle 在/dev/null 2祝辞,1,,,,,echo “User oracle  is already 存在”,| |,useradd -g oinstall -g dba 甲骨文 # set password for oracle 回声“甲骨文”,|,passwd ——stdin oracle # create dictionary for 安装 mkdir -p /u01/应用程序 chown -R 甲骨文:oinstall /u01/应用程序 chmod 775年,-R /u01/应用