项目地址:https://github.com/domdanrtsey/Oracle12c_autoinstall
详细的使用说明请参看项目中的README.md
另说明:脚本已经自动配置oracle服务自启动,并配置为系统服务,启动与停止时使用root用户操作
停止
#service oracle stop
启动
#service oracle start
#!/bin/bash
#################### Steup 1 Install oracle software ####################
#script_name: oracle_software.sh
#Author: Danrtsey.Shun
#Email:mydefiniteaim@126.com
#auto_install_oracle12c version=12.1.0.2
# attentions1:
# 1.上传12c软件安装包至随意路径下,脚本提示路径是 /opt
#
# linuxamd64_12102_database_1of2.zip
# linuxamd64_12102_database_2of2.zip
#
# 2.预设oracle用户的密码为 Danrtsey.com 请根据需要修改
#####################################
#ORACLE_OS_PWD= #
#if [ "$ORACLE_OS_PWD" = "" ]; then #
# ORACLE_OS_PWD="Danrtsey.com" #
#fi #
#####################################
# 3.执行
# chmod + oracle12.1.0.2_install.sh
# sh -x oracle12.1.0.2_install.sh
#
#################### Steup 2 Install oracle listener & dbca ####################
# attentions2:
########################################
# 1.according to the different environment to set the processes && sessions value
# alter system set processes=500 scope=spfile;
# alter system set sessions=555 scope=spfile;
# 2.ignore these warnings
# /u01/database/response/netca.rsp:LINE30: [GENERAL]: command not found
# /u01/database/response/netca.rsp:LINE62: [oracle.net.ca]: command not found
########################################
export PATH=$PATH
#Source function library.
. /etc/init.d/functions
#Require root to run this script.
uid=`id | cut -d( -f1 | cut -d= -f2`
if [ $uid -ne 0 ];then
action "Please run this script as root." /bin/false
exit 1
fi
##set oracle password
ORACLE_OS_PWD=
if [ "$ORACLE_OS_PWD" = "" ]; then
ORACLE_OS_PWD="Danrtsey.com"
fi
###install require packages
echo -e "