背景
有些项目会用到oracle,以前大佬写的脚本不好用,拿来改一改,能用起来先,回头再适配更高版本的oracle。如果使用过程中有什么问题,还请批评指正。
脚本
#!/bin/bash
#################### Steup 1 Install oracle software ####################
#script_name: oracle12.2.0.1_install.sh
#Author: Ahai.Chen
#Email:chenjf_xm@163.com
#auto_install_oracle12c version=12.2.0.1
# attentions1:
# 1.上传12c软件安装包至随意路径下,脚本提示路径是 /opt
#
# linuxx64_12201_database.zip
#
# 2.预设oracle用户的密码为 Ahai.com 请根据需要修改
#####################################
#ORACLE_OS_PWD= #
#if [ "$ORACLE_OS_PWD" = "" ]; then #
# ORACLE_OS_PWD="Ahai.com" #
#fi #
#####################################
# 3.执行
# chmod + oracle12.2.0.1_install.sh
# sh -x oracle12.2.0.1_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 ];thenaction "Please run this script as root." /bin/falseexit 1
fi##set oracle password
ORACLE_OS_PWD=
if [ "$ORACLE_OS_PWD" = "" ]; thenORACLE_OS_PWD="Ahai.com"
fi###自行判断时钟源源是否正常,正常才会继续开始安装依赖包
read -p "请自行判断时钟源同步是否正常,正常才会继续,请输入 [y/Y/yes/n/N/no]: " timeconfirm && \
[[ $timeconfirm =~ ^[yY]([eE][sS])?$ ]] || { echo "退出,请同步好时钟源为北京时间再来"; exit 0; }###自行判断yum源是否正常,正常才会继续开始安装依赖包
read -p "请自行判断yum源是否正常,正常才会继续,请输入 [y/Y/yes/n/N/no]: " yumconfirm && \
[[ $yumconfirm =~ ^[yY]([eE][sS])?$ ]] || { echo "退出,请准备好yum源再来"; exit 0; }
echo "start to install require packages..."###install require packages
echo -e "\033[34mInstallNotice >>\033[0m \033[32moracle install dependency \033[05m...\033[0m"
yum -y install binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33*i686 compat-libstdc++-33*.devel \compat-libstdc++-33 compat-libstdc++-33*.devel elfutils-libelf elfutils-libelf-devel gcc gcc-c++ \glibc glibc*.i686 glibc-devel glibc-devel*.i686 ksh libaio libaio*.i686 libaio-devel libaio-devel*.devel \libgcc libgcc*.i686 libstdc++ libstdc++*.i686 libstdc++-devel libstdc++-devel*.devel libXi libXi*.i686 \libXtst libXtst*.i686 make sysstat unixODBC unixODBC*.i686 unixODBC-devel unixODBC-devel*.i686 zip unzip tree \vim lrzsz epel-release net-tools wget ntpdate ntp
if [[ $? == 0 ]];thenecho -e "\033[34mInstallNotice >>\033[0m \033[32myum install dependency successed\033[0m"
elseecho -e "\033[34mInstallNotice >>\033[0m \033[32myum install dependency faild, pls check your network\033[0m"exit
fi###set firewalld & optimize the os system & set selinux
echo "################# Optimize system parameters ##########################"
firewall_status=`systemctl status firewalld | grep Active |awk '{print $3}'`
if [ ${firewall_status} == "(running)" ];thenfirewall-cmd --permanent --zone=public --add-port=1521/tcp && firewall-cmd --reload
elsesystemctl start firewalldfirewall-cmd --permanent --zone=public --add-port=1521/tcp && firewall-cmd --reload
fi
echo "[ OK ] 在firewall上开放1521端口完成"SELINUX=`cat /etc/selinux/config |grep ^SELINUX=|awk -F '=' '{print $2}'`
if [ ${SELINUX} == "enforcing" ];thensed -i "s@SELINUX=enforcing@SELINUX=disabled@g" /etc/selinux/config
elseif [ ${SELINUX} == "permissive" ];thensed -i "s@SELINUX=permissive@SELINUX=disabled@g" /etc/selinux/configfi
fi
setenforce 0
echo "[ OK ] 更改selinux为disabled完成"echo "================更改为中文字符集================="\cp /etc/locale.conf /etc/locale.conf.$(date +%F)
#cat >>/etc/locale.conf<<EOF
#LANG="zh_CN.UTF-8"
##LANG="en_US.UTF-8"
#EOF
sudo sed -i -E '/^LANG=/s|^|#|; /^#LANG="zh_CN\.UTF-8"/s/^#//; /^LANG=/!b; s/.*/LANG="zh_CN.UTF-8"/' /etc/locale.conf
#正则匹配规则解释
#sudo sed -i -E \
# -e '/^LANG=/s|^|#|' \ # 注释掉所有 LANG= 开头的行
# -e '/^#LANG="zh_CN\.UTF-8"/s/^#//' \ # 取消注释 zh_CN.UTF-8 的行
# -e '/^LANG=/!b' \ # 如果不是 LANG= 开头的行,跳过后面的命令
# -e 's/.*/LANG="zh_CN.UTF-8"/' # 将匹配到的行替换为 LANG="zh_CN.UTF-8"
#/etc/locale.conf
#为了确保即使没有找到未注释的LANG="zh_CN.UTF-8"设置,它也会被正确添加到文件中,再加一条检查和追加
grep -q '^LANG="zh_CN.UTF-8"$' /etc/locale.conf || echo 'LANG="zh_CN.UTF-8"' | sudo tee -a /etc/locale.conf > /dev/null
source /etc/locale.conf
grep -q '^LANG="zh_CN.UTF-8"$' /etc/locale.conf && \
echo "[ OK ] 更改字符集zh_CN.UTF-8完成" || \
echo "[FAILED] 更改字符集zh_CN.UTF-8未成功完成"###set the ip in hosts
echo "############################ Ip&Hosts Configuration #######################################"
hostname=`hostname`
HostIP=`ip a|grep 'inet '|grep -v '127.0.0.1'|awk '{print $2}'|awk -F '/' '{print $1}'`
for i in ${HostIP}
doA=`grep "${i}" /etc/hosts`if [ ! -n "${A}" ];thenecho "${i} ${hostname}" >> /etc/hosts elsebreakfi
done
cat /etc/hosts
echo "[ OK ] 主机名和ip加入/etc/hosts完成"###create group&user
echo "############################ Create Group&User #######################################"
ora_user=oracle
ora_group=('oinstall' 'dba' 'oper')
for i in ${ora_group[@]}
doB=`grep '${i}' /etc/group`if [ ! -n ${B} ];thengroupdel ${i} && groupadd ${i}else groupadd ${i}fi
done
echo "[ OK ] 'oinstall' 'dba' 'oper' 组创建完成"C=`grep 'oracle' /etc/passwd`
if [ ! -n ${C} ];thenuserdel -r ${ora_user} && useradd -u 501 -g ${ora_group[0]} -G ${ora_group[1]},${ora_group[2]} ${ora_user}
elseuseradd -u 501 -g ${ora_group[0]} -G ${ora_group[1]},${ora_group[2]} ${ora_user}
fi
echo "${ORACLE_OS_PWD}" | passwd --stdin ${ora_user}
echo "[ OK ] 'oracle' 系统用户创建完成,设置密码为${ORACLE_OS_PWD}"<<!
ORACLE_SID=upp
ORACLE_BASE=/apps/oracle/oracle
ORACLE_HOME=/apps/oracle/oracle/product/12c/dbhome_1
!###create directory and grant priv
echo "############################ Create DIR & set privileges & set OracleSid ##################"
echo "############################ Create OracleBaseDi #######################################"
echo "############################ Create OracleHomeDir #######################################"
count=0
while [ $count -lt 3 ]
doread -p "Please input the ORACLE_SID(e.g:orcl):" S1read -p "Please input the ORACLE_SID again(e.g:orcl):" S2if [ "${S1}" == "${S2}" ];thenexport ORACLE_SID=${S1}breakelseecho "You input ORACLE_SID not same."count=$[${count}+1]fi
donecount=0
while [ $count -lt 3 ]
doread -p "Please input the ORACLE_BASE(e.g:/u01/oracle):" S1read -p "Please input the ORACLE_BASE again(e.g:/u01/oracle):" S2if [ "${S1}" == "${S2}" ];thenexport ORACLE_BASE=${S1}breakelse echo "You input ORACLE_BASE not same."count=$[${count}+1]fi
donecount=0
while [ $count -lt 3 ]
doread -p "Please input the ORACLE_HOME(e.g:/u01/oracle/product/12c/dbhome_1):" S1read -p "Please input the ORACLE_HOME again(e.g:/u01/oracle/product/12c/dbhome_1):" S2if [ "${S1}" == "${S2}" ];thenexport ORACLE_HOME=${S1}breakelse echo "You input ORACLE_HOME not same."count=$[${count}+1]fi
doneif [ ! -d ${ORACLE_HOME} ];thenmkdir -p ${ORACLE_HOME}
fi
if [ ! -d ${ORACLE_BASE}/data ];thenmkdir -p ${ORACLE_BASE}/data
fi
if [ ! -d ${ORACLE_BASE}/recovery ];thenmkdir -p ${ORACLE_BASE}/recovery
fi
echo "[ OK ] ORACLE_SID实例名${ORACLE_SID}确认完成"
echo "[ OK ] ORACLE_BASE路径${ORACLE_BASE}确认完成并完成目录创建"
echo "[ OK ] ORACLE_HOME路径${ORACLE_HOME}确认完成并完成目录创建"
echo "[ OK ] ORACLE数据路径${ORACLE_BASE}/data确认完成并完成目录创建"
echo "[ OK ] ORACLE归档路径${ORACLE_BASE}/recovery确认完成并完成目录创建"#ORACLE_BASE的上一级目录(比如u01)
ora_dir=`echo ${ORACLE_BASE}|awk -F '/' '{print $2}'`###set the sysctl,limits and profile
echo "############################ Configure environment variables #######################################"egrep -q "^\s*kernel\.shmmax\s*.+(\s*#.*)?\s*$" /etc/sysctl.conf && sed -ri "s/^\s*kernel\.shmmax\s*.+(\s*#.*)?\s*$/kernel.shmmax = 68719476736/" /etc/sysctl.conf || echo "kernel.shmmax = 68719476736" >> /etc/sysctl.conf
egrep -q "^\s*kernel\.shmmni\s*.+(\s*#.*)?\s*$" /etc/sysctl.conf && sed -ri "s/^\s*kernel\.shmmni\s*.+(\s*#.*)?\s*$/kernel.shmmni = 4096/" /etc/sysctl.conf || echo "kernel.shmmni = 4096" >> /etc/sysctl.conf
egrep -q "^\s*kernel\.shmall\s*.+(\s*#.*)?\s*$" /etc/sysctl.conf && sed -ri "s/^\s*kernel\.shmall\s*.+(\s*#.*)?\s*$/kernel.shmall = 16777216/" /etc/sysctl.conf || echo "kernel.shmall = 16777216" >> /etc/sysctl.conf
egrep -q "^\s*kernel\.sem\s*.+(\s*#.*)?\s*$" /etc/sysctl.conf && sed -ri "s/^\s*kernel\.sem\s*.+(\s*#.*)?\s*$/kernel.sem = 1010 129280 1010 128/" /etc/sysctl.conf || echo "kernel.sem = 1010 129280 1010 128" >> /etc/sysctl.conf
egrep -q "^\s*net\.ipv4\.ip_local_port_range\s*.+(\s*#.*)?\s*$" /etc/sysctl.conf && sed -ri "s/^\s*net\.ipv4\.ip_local_port_range\s*.+(\s*#.*)?\s*$/net.ipv4.ip_local_port_range = 5000 65000/" /etc/sysctl.conf || echo "net.ipv4.ip_local_port_range = 5000 65000" >> /etc/sysctl.conf
egrep -q "^\s*net\.core\.rmem_default\s*.+(\s*#.*)?\s*$" /etc/sysctl.conf && sed -ri "s/^\s*net\.core\.rmem_default\s*.+(\s*#.*)?\s*$/net.core.rmem_default = 4194304/" /etc/sysctl.conf || echo "net.core.rmem_default = 4194304" >> /etc/sysctl.conf
egrep -q "^\s*net\.core\.rmem_max\s*.+(\s*#.*)?\s*$" /etc/sysctl.conf && sed -ri "s/^\s*net\.core\.rmem_max\s*.+(\s*#.*)?\s*$/net.core.rmem_max = 4194304/" /etc/sysctl.conf || echo "net.core.rmem_max = 4194304" >> /etc/sysctl.conf
egrep -q "^\s*net\.core\.wmem_default\s*.+(\s*#.*)?\s*$" /etc/sysctl.conf && sed -ri "s/^\s*net\.core\.wmem_default\s*.+(\s*#.*)?\s*$/net.core.wmem_default = 262144/" /etc/sysctl.conf || echo "net.core.wmem_default = 262144" >> /etc/sysctl.conf
egrep -q "^\s*net\.core\.wmem_max\s*.+(\s*#.*)?\s*$" /etc/sysctl.conf && sed -ri "s/^\s*net\.core\.wmem_max\s*.+(\s*#.*)?\s*$/net.core.wmem_max = 1048576/" /etc/sysctl.conf || echo "net.core.wmem_max = 1048576" >> /etc/sysctl.conf
egrep -q "^\s*fs\.aio-max-nr\s*.+(\s*#.*)?\s*$" /etc/sysctl.conf && sed -ri "s/^\s*fs\.aio-max-nr\s*.+(\s*#.*)?\s*$/fs.aio-max-nr = 1048576/" /etc/sysctl.conf || echo "fs.aio-max-nr = 1048576" >> /etc/sysctl.conf
egrep -q "^\s*fs\.file-max\s*.+(\s*#.*)?\s*$" /etc/sysctl.conf && sed -ri "s/^\s*fs\.file-max\s*.+(\s*#.*)?\s*$/fs.file-max = 6815744/" /etc/sysctl.conf || echo "fs.file-max = 6815744" >> /etc/sysctl.conf/sbin/sysctl -p
echo "[ OK ] sysctl内核配置完成"set_limits () {
declare -A limits=(["oracle soft nproc"]="16384"["oracle hard nproc"]="16384"["oracle soft nofile"]="65536"["oracle hard nofile"]="65536"["oracle soft memlock"]="4000000"["oracle hard memlock"]="4000000"
)for limit in "${!limits[@]}"; dovalue=${limits[$limit]}egrep -q "^\\s*${limit//\//\\/}\\s+.+(\s*#.*)?\$" /etc/security/limits.conf && \sed -ri "s/^\\s*${limit//\//\\/}\\s+.+(\s*#.*)?\$/$(echo $limit | sed 's/\//\\\//g') $value/" /etc/security/limits.conf || \echo "$limit $value" | sudo tee -a /etc/security/limits.conf > /dev/null
done
echo "[ OK ] /etc/security/limits.conf配置完成"
}
set_limitsset_profile () {
F=`grep 'ORACLE_SID' /home/${ora_user}/.bash_profile`
if [ ! -n "${F}" ];then
cat << EOF >> /home/${ora_user}/.bash_profile
export ORACLE_SID=${ORACLE_SID}
export ORACLE_BASE=${ORACLE_BASE}
export ORACLE_HOME=${ORACLE_HOME}
export PATH=\$PATH:\$ORACLE_HOME/bin
EOF
elsetail -4 /home/${ora_user}/.bash_profile
fiG=`grep 'oracle' /etc/profile`
if [ ! -n "${G}" ];then
cat << EOF >> /etc/profile
if [ \$USER = "oracle" ];thenif [ \$SHELL = "/bin/ksh" ];thenulimit -p 16384ulimit -n 65536elseulimit -u 16384 -n 65536fi
fi
EOF
elsetail -8 /etc/profile
fi
echo "[ OK ] oracle环境变量bash_profile和全局变量profile配置完成"
}
set_profile###unzip the install package and set response file
echo "############################ unzip the install package #######################################"
unzip_package () {
count=0
while [ $count -lt 3 ]
doread -p "Please input the zip file location(e.g:/opt/linuxx64_12201_database.zip):" zfileoneif [ ! -f ${zfileone} ];thenecho "You input location not found zip file."count=$[${count}+1]elseexport zfileone=${zfileone}breakfi
doneif [ ! -d /${ora_dir}/database ];then unzip ${zfileone} -d /${ora_dir}
elseecho "发现安装目录下有解压包"read -p "是否删除重新解压,请输入 [y/Y/yes/n/N/no]: " pgkcheck && \if [[ $pgkcheck =~ ^[yY]([eE][sS])?$ ]]; then# 如果用户选择了 'y', 'Y', 'yes' 或 'YES'echo "正在删除旧的解压文件并重新解压..."rm -rf "/${ora_dir}/database"unzip "${zfileone}" -d "/${ora_dir}"else# 如果用户选择了其他选项echo "ok,不删除,沿用之前解压的安装包继续安装"fi
fichown -R ${ora_user}:${ora_group[0]} /${ora_dir} && chmod -R 775 /${ora_dir}
}unzip_package
echo "[ OK ] 解压安装包${zfileone}完成"###set Oracle install.db.starterdb installSysPassword
echo "############################ set installSysPassword #######################################"
count=0
while [ $count -lt 3 ]
doread -p "Please input the installSysPassword(e.g:orcl20200202):" S1read -p "Please input the installSysPassword again(orcl20200202):" S2if [ "${S1}" == "${S2}" ];thenexport installSysPassword=${S1}breakelse echo "You input installSysPassword not same."count=$[${count}+1]fi
done
echo "[ OK ] 安装系统密码配置完成"#installSysPassword=Oracle20241211
###set Response File
echo "############################ set ResponseFile #######################################"
free_m=`free -m | grep 'Mem:'|awk '{print $2}'`
db_response_file=`find /${ora_dir} -type f -name db_install.rsp`
data_dir=${ORACLE_BASE}/data
recovery_dir=${ORACLE_BASE}/recovery
db_response_file_path=`find / -type f -name db_install.rsp | sed -n 's:/[^/]*$::p'`install_dir=${db_response_file_path%/*}MEM=`free -m|grep 'Mem:'|awk '{print $2}'`
TOTAL=$[MEM*8/10]
echo "The memory size of this server is ${MEM}M,Suggest setting 80% of the server to Oracle, such as ${TOTAL}"select_memory_size() {echo "请选择内存大小:"echo "1. 1024 MB"echo "2. 2048 MB"echo "3. 5120 MB"echo "4. 8192 MB"echo "5. 自定义输入 (MB)"read -p "请输入选项 [1-5]: " optioncase $option in1) Memory=1024 ;;2) Memory=2048 ;;3) Memory=5120 ;;4) Memory=8192 ;;5) read -p "Please enter a custom memory size (MB): " custom_memory# 检查输入是否为正整数if ! [[ "$custom_memory" =~ ^[0-9]+$ ]]; thenecho "错误: 输入不是一个有效的正整数."exit 1fiMemory=$custom_memory;;*) echo "无效选项"; exit 1 ;;esacecho "The memory size you have chosen is: ${Memory} MB"
}select_memory_size
echo "[ OK ] 内存大小配置完成"#cd `find / -type f -name db_install.rsp | sed -n 's:/[^/]*$::p'` && cd ../
#install_dir=`pwd`
egrep -q "^\s*oracle\.install\.option\s*.+(\s*#.*)?\s*$" ${db_response_file} && sed -ri "s/^\s*oracle\.install\.option\s*.+(\s*#.*)?\s*$/oracle.install.option=INSTALL_DB_SWONLY/" ${db_response_file} || echo "oracle.install.option=INSTALL_DB_SWONLY" >> ${db_response_file}
egrep -q "^\s*UNIX_GROUP_NAME\s*.+(\s*#.*)?\s*$" ${db_response_file} && sed -ri "s/^\s*UNIX_GROUP_NAME\s*.+(\s*#.*)?\s*$/UNIX_GROUP_NAME=${ora_group[0]}/" ${db_response_file} || echo "UNIX_GROUP_NAME=${ora_group[0]}" >> ${db_response_file}
egrep -q "^\s*INVENTORY_LOCATION\s*.+(\s*#.*)?\s*$" ${db_response_file} && sed -ri "s|^\s*INVENTORY_LOCATION\s*.+(\s*#.*)?\s*$|INVENTORY_LOCATION=${ORACLE_BASE}\/oraInventory|" ${db_response_file} || echo "INVENTORY_LOCATION=${ORACLE_BASE}/oraInventory" >> ${db_response_file}
egrep -q "^\s*ORACLE_HOME\s*.+(\s*#.*)?\s*$" ${db_response_file} && sed -ri "s|^\s*ORACLE_HOME\s*.+(\s*#.*)?\s*$|ORACLE_HOME=${ORACLE_HOME}|" ${db_response_file} || echo "ORACLE_HOME=${ORACLE_HOME}" >> ${db_response_file}
egrep -q "^\s*ORACLE_BASE\s*.+(\s*#.*)?\s*$" ${db_response_file} && sed -ri "s|^\s*ORACLE_BASE\s*.+(\s*#.*)?\s*$|ORACLE_BASE=${ORACLE_BASE}|" ${db_response_file} || echo "ORACLE_BASE=${ORACLE_BASE}" >> ${db_response_file}#oracle.install.option=INSTALL_DB_SWONLY
#UNIX_GROUP_NAME=oinstall
#INVENTORY_LOCATION=/apps/oracle/oracle/oraInventory
#ORACLE_HOME=/apps/oracle/oracle/product/12c/dbhome_1
#ORACLE_BASE=/apps/oracle/oracle#sed -i "s!ORACLE_HOSTNAME=!ORACLE_HOSTNAME=${hostname}!g" ${db_response_file}
#sed -i "s!SELECTED_LANGUAGES=en!SELECTED_LANGUAGES=en,zh_CN!g" ${db_response_file}egrep -q "^\s*oracle\.install\.db\.InstallEdition\s*.+(\s*#.*)?\s*$" ${db_response_file} && sed -ri "s/^\s*oracle\.install\.db\.InstallEdition\s*.+(\s*#.*)?\s*$/oracle.install.db.InstallEdition=EE/" ${db_response_file} || echo "oracle.install.db.InstallEdition=EE" >> ${db_response_file}
egrep -q "^\s*oracle\.install\.db\.OSDBA_GROUP\s*.+(\s*#.*)?\s*$" ${db_response_file} && sed -ri "s/^\s*oracle\.install\.db\.OSDBA_GROUP\s*.+(\s*#.*)?\s*$/oracle.install.db.OSDBA_GROUP=${ora_group[1]}/" ${db_response_file} || echo "oracle.install.db.OSDBA_GROUP=${ora_group[1]}" >> ${db_response_file}
egrep -q "^\s*oracle\.install\.db\.OSOPER_GROUP\s*.+(\s*#.*)?\s*$" ${db_response_file} && sed -ri "s/^\s*oracle\.install\.db\.OSOPER_GROUP\s*.+(\s*#.*)?\s*$/oracle.install.db.OSOPER_GROUP=${ora_group[2]}/" ${db_response_file} || echo "oracle.install.db.OSOPER_GROUP=${ora_group[2]}" >> ${db_response_file}
egrep -q "^\s*oracle\.install\.db\.OSBACKUPDBA_GROUP\s*.+(\s*#.*)?\s*$" ${db_response_file} && sed -ri "s/^\s*oracle\.install\.db\.OSBACKUPDBA_GROUP\s*.+(\s*#.*)?\s*$/oracle.install.db.OSBACKUPDBA_GROUP=${ora_group[1]}/" ${db_response_file} || echo "oracle.install.db.OSBACKUPDBA_GROUP=${ora_group[1]}" >> ${db_response_file}
egrep -q "^\s*oracle\.install\.db\.OSDGDBA_GROUP\s*.+(\s*#.*)?\s*$" ${db_response_file} && sed -ri "s/^\s*oracle\.install\.db\.OSDGDBA_GROUP\s*.+(\s*#.*)?\s*$/oracle.install.db.OSDGDBA_GROUP=${ora_group[1]}/" ${db_response_file} || echo "oracle.install.db.OSDGDBA_GROUP=${ora_group[1]}" >> ${db_response_file}
egrep -q "^\s*oracle\.install\.db\.OSKMDBA_GROUP\s*.+(\s*#.*)?\s*$" ${db_response_file} && sed -ri "s/^\s*oracle\.install\.db\.OSKMDBA_GROUP\s*.+(\s*#.*)?\s*$/oracle.install.db.OSKMDBA_GROUP=${ora_group[1]}/" ${db_response_file} || echo "oracle.install.db.OSKMDBA_GROUP=${ora_group[1]}" >> ${db_response_file}
egrep -q "^\s*oracle\.install\.db\.OSRACDBA_GROUP\s*.+(\s*#.*)?\s*$" ${db_response_file} && sed -ri "s/^\s*oracle\.install\.db\.OSRACDBA_GROUP\s*.+(\s*#.*)?\s*$/oracle.install.db.OSRACDBA_GROUP=${ora_group[1]}/" ${db_response_file} || echo "oracle.install.db.OSRACDBA_GROUP=${ora_group[1]}" >> ${db_response_file}#oracle.install.db.OSDBA_GROUP=dba
#oracle.install.db.OSOPER_GROUP=oper
#oracle.install.db.OSBACKUPDBA_GROUP=dba
#oracle.install.db.OSDGDBA_GROUP=dba
#oracle.install.db.OSKMDBA_GROUP=dba
#oracle.install.db.OSRACDBA_GROUP=dbaegrep -q "^\s*oracle\.install\.db\.config\.starterdb\.type\s*.+(\s*#.*)?\s*$" ${db_response_file} && sed -ri "s/^\s*oracle\.install\.db\.config\.starterdb\.type\s*.+(\s*#.*)?\s*$/oracle.install.db.config.starterdb.type=GENERAL_PURPOSE/" ${db_response_file} || echo "oracle.install.db.config.starterdb.type=GENERAL_PURPOSE" >> ${db_response_file}
egrep -q "^\s*oracle\.install\.db\.config\.starterdb\.globalDBName\s*.+(\s*#.*)?\s*$" ${db_response_file} && sed -ri "s/^\s*oracle\.install\.db\.config\.starterdb\.globalDBName\s*.+(\s*#.*)?\s*$/oracle.install.db.config.starterdb.globalDBName=${ORACLE_SID}/" ${db_response_file} || echo "oracle.install.db.config.starterdb.globalDBName=${ORACLE_SID}" >> ${db_response_file}
egrep -q "^\s*oracle\.install\.db\.config\.starterdb\.SID\s*.+(\s*#.*)?\s*$" ${db_response_file} && sed -ri "s/^\s*oracle\.install\.db\.config\.starterdb\.SID\s*.+(\s*#.*)?\s*$/oracle.install.db.config.starterdb.SID=${ORACLE_SID}/" ${db_response_file} || echo "oracle.install.db.config.starterdb.SID=${ORACLE_SID}" >> ${db_response_file}#oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
#oracle.install.db.config.starterdb.globalDBName=${ORACLE_SID}
#oracle.install.db.config.starterdb.SID=${ORACLE_SID}egrep -q "^\s*oracle\.install\.db\.config\.starterdb\.characterSet\s*.+(\s*#.*)?\s*$" ${db_response_file} && sed -ri "s/^\s*oracle\.install\.db\.config\.starterdb\.characterSet\s*.+(\s*#.*)?\s*$/oracle.install.db.config.starterdb.characterSet=ZHS16GBK/" ${db_response_file} || echo "oracle.install.db.config.starterdb.characterSet=ZHS16GBK" >> ${db_response_file}
egrep -q "^\s*oracle\.install\.db\.config\.starterdb\.memoryOption\s*.+(\s*#.*)?\s*$" ${db_response_file} && sed -ri "s/^\s*oracle\.install\.db\.config\.starterdb\.memoryOption\s*.+(\s*#.*)?\s*$/oracle.install.db.config.starterdb.memoryOption=true/" ${db_response_file} || echo "oracle.install.db.config.starterdb.memoryOption=true" >> ${db_response_file}
egrep -q "^\s*oracle\.install\.db\.config\.starterdb\.memoryLimit\s*.+(\s*#.*)?\s*$" ${db_response_file} && sed -ri "s/^\s*oracle\.install\.db\.config\.starterdb\.memoryLimit\s*.+(\s*#.*)?\s*$/oracle.install.db.config.starterdb.memoryLimit=${Memory}/" ${db_response_file} || echo "oracle.install.db.config.starterdb.memoryLimit=${Memory}" >> ${db_response_file}#oracle.install.db.config.starterdb.characterSet=ZHS16GBK
#oracle.install.db.config.starterdb.memoryOption=true
#oracle.install.db.config.starterdb.memoryLimit=${Memory}egrep -q "^\s*oracle\.install\.db\.config\.starterdb\.password\.ALL\s*.+(\s*#.*)?\s*$" ${db_response_file} && sed -ri "s/^\s*oracle\.install\.db\.config\.starterdb\.password\.ALL\s*.+(\s*#.*)?\s*$/oracle.install.db.config.starterdb.password.ALL=${installSysPassword}/" ${db_response_file} || echo "oracle.install.db.config.starterdb.password.ALL=${installSysPassword}" >> ${db_response_file}
egrep -q "^\s*oracle\.install\.db\.config\.starterdb\.storageType\s*.+(\s*#.*)?\s*$" ${db_response_file} && sed -ri "s/^\s*oracle\.install\.db\.config\.starterdb\.storageType\s*.+(\s*#.*)?\s*$/oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE/" ${db_response_file} || echo "oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE" >> ${db_response_file}
egrep -q "^\s*oracle\.install\.db\.config\.starterdb\.fileSystemStorage\.dataLocation\s*.+(\s*#.*)?\s*$" ${db_response_file} && sed -ri "s|^\s*oracle\.install\.db\.config\.starterdb\.fileSystemStorage\.dataLocation\s*.+(\s*#.*)?\s*$|oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=${data_dir}|" ${db_response_file} || echo "oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=${data_dir}" >> ${db_response_file}
egrep -q "^\s*oracle\.install\.db\.config\.starterdb\.fileSystemStorage\.recoveryLocation\s*.+(\s*#.*)?\s*$" ${db_response_file} && sed -ri "s|^\s*oracle\.install\.db\.config\.starterdb\.fileSystemStorage\.recoveryLocation\s*.+(\s*#.*)?\s*$|oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=${recovery_dir}|" ${db_response_file} || echo "oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=${recovery_dir}" >> ${db_response_file}#oracle.install.db.config.starterdb.password.ALL=Oracle20241211
#oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE
#oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=/apps/oracle/oracle/data
#oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=/apps/oracle/oracle/recoveryegrep -q "^\s*SECURITY_UPDATES_VIA_MYORACLESUPPORT\s*.+(\s*#.*)?\s*$" ${db_response_file} && sed -ri "s/^\s*SECURITY_UPDATES_VIA_MYORACLESUPPORT\s*.+(\s*#.*)?\s*$/SECURITY_UPDATES_VIA_MYORACLESUPPORT=false/" ${db_response_file} || echo "SECURITY_UPDATES_VIA_MYORACLESUPPORT=false" >> ${db_response_file}
egrep -q "^\s*DECLINE_SECURITY_UPDATES\s*.+(\s*#.*)?\s*$" ${db_response_file} && sed -ri "s/^\s*DECLINE_SECURITY_UPDATES\s*.+(\s*#.*)?\s*$/DECLINE_SECURITY_UPDATES=true/" ${db_response_file} || echo "DECLINE_SECURITY_UPDATES=true" >> ${db_response_file}#SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
#DECLINE_SECURITY_UPDATES=true#sed -i "s!oracle.installer.autoupdates.option=!oracle.installer.autoupdates.option=SKIP_UPDATES!g" ${db_response_file}echo "[ OK ] ${db_response_file}配置完成"###starting to install oracle software
echo "############################ Oracle Installing #######################################"
oracle_out='/tmp/oracle.out'
touch ${oracle_out}
chown ${ora_user}:${ora_group[0]} ${oracle_out}
#su - oracle -c "${install_dir}/runInstaller -silent -ignoreDiskWarning -ignoreSysPrereqs -ignorePrereq -responseFile ${db_response_file}" > ${oracle_out} 2>&1
su - oracle -c "${install_dir}/runInstaller -silent -ignoreSysPrereqs -ignorePrereq -responseFile ${db_response_file}" > ${oracle_out} 2>&1
echo -e "\033[34mInstallNotice >>\033[0m \033[32moracle install starting \033[05m...\033[0m"
sleep 60
installActionslog=`find /tmp -name installActions*`
echo "You cat check the oracle install log command: tail -100f ${installActionslog}"
while true; dogrep '[FATAL] [INS-10101]' ${oracle_out} &> /dev/nullif [[ $? == 0 ]];thenecho -e "\033[34mInstallNotice >>\033[0m \033[31moracle start install has [ERROR]\033[0m"cat ${oracle_out}exitfisleep 120cat /tmp/oracle.out | grep shif [[ $? == 0 ]];then`cat /tmp/oracle.out | grep sh | awk -F ' ' '{print $2}' | head -1`if [[ $? == 0 ]]; thenecho -e "\033[34mInstallNotice >>\033[0m \033[32mScript orainstRoot.sh run successed\033[0m"`cat /tmp/oracle.out | grep sh | awk -F ' ' '{print $2}' | tail -1`if [[ $? == 0 ]];thenecho -e "\033[34mInstallNotice >>\033[0m \033[32mScript root.sh run successed\033[0m"breakelseecho -e "\033[34mInstallNotice >>\033[0m \033[31mScript root.sh run faild\033[0m"fielseecho -e "\033[34mInstallNotice >>\033[0m \033[31mScript orainstRoot.sh run faild\033[0m"fifi
doneecho "####################### Oracle software 安装完成 ##############################"# install listener && dbca
echo "############################ install oracle listener && dbca #######################################"
echo "############################ set oracle schema sysPassword #######################################"
count=0
while [ $count -lt 3 ]
doecho "a.Oracle 建议, 输入的口令长度不应少于 8 个字符, 至少包含 1 个大写字符, 1 个小写字符和 1 个数字 [0-9]。"echo "b.Oracle建议不要将sid或者其有关的关键字用作口令一部分" read -p "Please input the SYSPASSWORD(e.g:orcl20200202):" S1read -p "Please input the SYSPASSWORD again(e.g:orcl20200202):" S2if [ "${S1}" == "${S2}" ];thenexport SYSPASSWORD="${S1}"breakelse echo "You input SYSPASSWORD not same."count=$[${count}+1]fi
done
echo "############################ set oracle app_user #######################################"
count=0
while [ $count -lt 3 ]
doread -p "Please input the USER_NAME(e.g:orcl):" S1read -p "Please input the USER_NAME again(e.g:orcl):" S2if [ "${S1}" == "${S2}" ];thenexport USER_NAME=${S1}breakelse echo "You input USER_NAME not same."count=$[${count}+1]fi
done
echo "############################ set oracle app_passwd #######################################"
count=0
while [ $count -lt 3 ]
doecho "a.Oracle 建议, 输入的口令长度不应少于 8 个字符, 至少包含 1 个大写字符, 1 个小写字符和 1 个数字 [0-9]。"echo "b.Oracle建议不要将sid或者其有关的关键字用作口令一部分" read -p "Please input the USER_PASSWD(e.g:orcl2020):" S1read -p "Please input the USER_PASSWD again(e.g:orcl202):" S2if [ "${S1}" == "${S2}" ];thenexport USER_PASSWD="${S1}"breakelse echo "You input USER_PASSWD not same."count=$[${count}+1]fi
done
echo "############################ set app_user tmp_dbf #######################################"
count=0
while [ $count -lt 3 ]
doread -p "Please input the TMP_DBF(e.g:orcl_temp):" S1read -p "Please input the TMP_DBF again(e.g:orcl_temp):" S2if [ "${S1}" == "${S2}" ];thenexport TMP_DBF=${S1}breakelse echo "You input TMP_DBF not same."count=$[${count}+1]fi
done
echo "############################ set app_user data_dbf #######################################"
count=0
while [ $count -lt 3 ]
doread -p "Please input the DATA_DBF(e.g:orcl_data):" S1read -p "Please input the DATA_DBF again(e.g:orcl_data):" S2if [ "${S1}" == "${S2}" ];thenexport DATA_DBF=${S1}breakelse echo "You input DATA_DBF not same."count=$[${count}+1]fi
done
ORACLE_SID=`su - oracle -c 'source ~/.bash_profile && echo $ORACLE_SID'`
ORACLE_BASE=`su - oracle -c 'source ~/.bash_profile && echo $ORACLE_BASE'`
ORACLE_HOME=`su - oracle -c 'source ~/.bash_profile && echo $ORACLE_HOME'`
ora_dir=`echo ${ORACLE_BASE}|awk -F '/' '{print $2}'`
DB_SHUT=${ORACLE_HOME}/bin/dbshut
DB_START=${ORACLE_HOME}/bin/dbstart
DATA_DIR=${ORACLE_BASE}/data
BACKUP_DIR=${ORACLE_BASE}/backup[ ! -f $BACKUP_DIR ] && mkdir $BACKUP_DIRCDB_SQL="
sqlplus / as sysdba << EOF
create temporary tablespace $TMP_DBF tempfile '$DATA_DIR/$ORACLE_SID/${TMP_DBF}.dbf' size 200m autoextend on next 200m maxsize unlimited extent management local;
create tablespace $DATA_DBF logging datafile '$DATA_DIR/$ORACLE_SID/${DATA_DBF}.dbf' size 20G autoextend on next 512m maxsize unlimited extent management local;
create user $USER_NAME identified by $USER_PASSWD default tablespace $DATA_DBF temporary tablespace $TMP_DBF;
grant connect,resource to $USER_NAME;
grant create view to $USER_NAME;
grant create public synonym to $USER_NAME;
grant drop public synonym to $USER_NAME;
grant unlimited tablespace to $USER_NAME;
create or replace directory dir_dump as '$BACKUP_DIR';
grant read,write on directory dir_dump to $USER_NAME;
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
alter system set processes=500 scope=spfile;
alter system set sessions=572 scope=spfile;
shutdown immediate;
startup mount;
alter database archivelog;
alter database open;
exit
EOF
"temp=`ls ${ORACLE_BASE}|grep 'data'`
if [ ! -n ${temp} ];thenmkdir ${ORACLE_BASE}/dataexport DATAFILE=${ORACLE_BASE}/data
elseexport DATAFILE=${ORACLE_BASE}/data
fi
temp=`ls ${ORACLE_BASE}|grep 'area'`
if [ ! -n ${temp} ];thenmkdir ${ORACLE_BASE}/flash_recovery_areaexport RECOVERY=${ORACLE_BASE}/flash_recovery_area
elseexport RECOVERY=${ORACLE_BASE}/flash_recovery_area
fi
#NETCA=`find / -type f -name netca.rsp`
NETCA=`find /${ora_dir} -type f -name netca.rsp`netca_response_file=`find /${ora_dir} -type f -name netca.rsp`#sed -i "s!INSTALL_TYPE=""typical""!INSTALL_TYPE=""custom""!g" ${netca_response_file}egrep -q "^INSTALL_TYPE\s*.+(\s*#.*)?\s*$" ${netca_response_file} && sed -ri "s|^INSTALL_TYPE\s*.+(\s*#.*)?\s*$|INSTALL_TYPE=\"\"custom\"\"|" ${netca_response_file} || echo "INSTALL_TYPE=\"\"custom\"\"" >> ${netca_response_file}###set listener&tnsnames
echo "############################ Oracle listener&dbca #######################################"
su - oracle << EOF
source ~/.bash_profile
${ORACLE_HOME}/bin/netca -silent -responsefile ${netca_response_file}
dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname ${ORACLE_SID} -sid ${ORACLE_SID} -sysPassword ${SYSPASSWORD} -systemPassword ${SYSPASSWORD} -responseFile NO_VALUE -datafileDestination ${DATAFILE} -redoLogFileSize 1000 -recoveryAreaDestination ${RECOVERY} -storageType FS -characterSet ZHS16GBK -nationalCharacterSet AL16UTF16 -sampleSchema false -totalMemory ${Memory} -databaseType OLTP -emConfiguration NONE
EOFecho "[ OK ] Oracle_listener && dbca配置完成"#${ORACLE_HOME}/bin/netca -silent -responsefile ${netca_response_file}
#dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname ${ORACLE_SID} -sid ${ORACLE_SID} -sysPassword ${SYSPASSWORD} -systemPassword ${SYSPASSWORD} -responseFile NO_VALUE -datafileDestination ${DATAFILE} -redoLogFileSize 1000 -recoveryAreaDestination ${RECOVERY} -storageType FS -characterSet ZHS16GBK -nationalCharacterSet AL16UTF16 -sampleSchema false -memoryPercentage 80 -totalMemory $TOTAL -databaseType OLTP -emConfiguration NONEsed -i "s!${ORACLE_SID}:${ORACLE_HOME}:N!${ORACLE_SID}:${ORACLE_HOME}:Y!g" /etc/oratab
egrep -q "^${ORACLE_SID}\s*.+(\s*#.*)?\s*$" /etc/oratab && sed -ri "s|^${ORACLE_SID}\s*.+(\s*#.*)?\s*$|${ORACLE_SID}\:${ORACLE_HOME}\:Y|" /etc/oratab || echo "INSTALL_TYPE=\"\"custom\"\"" >> /etc/oratab
AUTO_START_CONFIG=`cat /etc/oratab|grep ${ORACLE_SID} |awk -F ':' '{print $NF}'`
AUTO_START_CONFIG_expected='Y'if [ ${AUTO_START_CONFIG} = ${AUTO_START_CONFIG_expected} ];thenecho "[ OK ] 允许系统启动或关闭时自动管理数据库实例配置完成!"
elseecho "[ falsed ] 允许系统启动或关闭时自动管理数据库实例配置失败!"exit 1
fi#set oracle to use dbstart & dbshut to control the dbsoftware#sed -i "s/ORACLE_HOME_LISTNER=\$1/ORACLE_HOME_LISTNER=\$ORACLE_HOME/g" ${DB_SHUT}
#sed -i "s/ORACLE_HOME_LISTNER=\$1/ORACLE_HOME_LISTNER=\$ORACLE_HOME/g" ${DB_START}
egrep -q "^ORACLE_HOME_LISTNER\s*.+(\s*#.*)?\s*$" ${DB_START} && sed -ri "s|^ORACLE_HOME_LISTNER\s*.+(\s*#.*)?\s*$|ORACLE_HOME_LISTNER=$ORACLE_HOME|" ${DB_START} && echo "[ OK ] ${DB_START}配置ORACLE_HOME_LISTNER完成"|| (echo "ORACLE_HOME_LISTNER no in ${DB_START},please check";echo "[ faild ] ${DB_START}配置ORACLE_HOME_LISTNER失败";exit 1)
egrep -q "^ORACLE_HOME_LISTNER\s*.+(\s*#.*)?\s*$" ${DB_SHUT} && sed -ri "s|^ORACLE_HOME_LISTNER\s*.+(\s*#.*)?\s*$|ORACLE_HOME_LISTNER=$ORACLE_HOME|" ${DB_SHUT} && echo "[ OK ] ${DB_SHUT}配置ORACLE_HOME_LISTNER完成"|| (echo "ORACLE_HOME_LISTNER no in ${DB_SHUT},please check";echo "[ faild ] ${DB_SHUT}配置ORACLE_HOME_LISTNER失败";exit 1)#set oracle start&stop sys_service
echo "############################ Oracle sys_service #######################################"
su - oracle -c "touch /home/oracle/oracle":
cat >/etc/init.d/oracle <<EOF
#!/bin/sh
# chkconfig: 35 80 10
# description: Oracle auto start-stop script.
# Set ORACLE_HOME to be equivalent to the \$ORACLE_HOME
# Oracle database in ORACLE_HOME.
LOGFILE=/home/oracle/oracle
ORACLE_HOME=$ORACLE_HOME
ORACLE_OWNER=oracle
LOCK_FILE=/var/lock/subsys/oracle
if [ ! -f $ORACLE_HOME/bin/dbstart ]
thenecho "Oracle startup: cannot start"exit
fi
case "\$1" in
'start')
# Start the Oracle databases:
echo "Starting Oracle Databases ... "
echo "-------------------------------------------------" >> \${LOGFILE}
date +" %T %a %D : Starting Oracle Databases as part of system up." >> \${LOGFILE}
echo "-------------------------------------------------" >> \${LOGFILE}
su - \$ORACLE_OWNER -c "\$ORACLE_HOME/bin/dbstart" >> \${LOGFILE}
echo "Done"# Start the Listener:
echo "Starting Oracle Listeners ... "
echo "-------------------------------------------------" >> \${LOGFILE}
date +" %T %a %D : Starting Oracle Listeners as part of system up." >> \${LOGFILE}
echo "-------------------------------------------------" >> \${LOGFILE}
su - \$ORACLE_OWNER -c "\$ORACLE_HOME/bin/lsnrctl start" >> \${LOGFILE}
echo "Done."
echo "-------------------------------------------------" >> \${LOGFILE}
date +" %T %a %D : Finished." >> \${LOGFILE}
echo "-------------------------------------------------" >> \${LOGFILE}
touch \$LOCK_FILE
;;'stop')
# Stop the Oracle Listener:
echo "Stoping Oracle Listeners ... "
echo "-------------------------------------------------" >> \${LOGFILE}
date +" %T %a %D : Stoping Oracle Listener as part of system down." >> \${LOGFILE}
echo "-------------------------------------------------" >> \${LOGFILE}
su - \$ORACLE_OWNER -c "\$ORACLE_HOME/bin/lsnrctl stop" >> \${LOGFILE}
echo "Done."
rm -f \$LOCK_FILE# Stop the Oracle Database:
echo "Stoping Oracle Databases ... "
echo "-------------------------------------------------" >> \${LOGFILE}
date +" %T %a %D : Stoping Oracle Databases as part of system down." >> \${LOGFILE}
echo "-------------------------------------------------" >> \${LOGFILE}
su - \$ORACLE_OWNER -c "\$ORACLE_HOME/bin/dbshut" >> \${LOGFILE}
echo "Done."
echo ""
echo "-------------------------------------------------" >> \${LOGFILE}
date +" %T %a %D : Finished." >> \${LOGFILE}
echo "-------------------------------------------------" >> \${LOGFILE}
;;'restart')
\$0 stop
\$0 start
;;
esac
EOF
#set privileges
chmod +x /etc/init.d/oracle
chkconfig oracle on
# check oracle service
service oracle start
if [ $? -ne 0 ];thenaction "oracle service start failed." /bin/falseexit 2
fiservice oracle stop
if [ $? -ne 0 ];thenaction "oracle service stop failed." /bin/falseexit 3
fiservice oracle restart
if [ $? -ne 0 ];thenaction "oracle service restart failed." /bin/falseexit 4
fi#set create app_user && app_passwd && tablespace && grant
echo "############################ Oracle sys_service #######################################"
su - oracle -c "${CDB_SQL}"
if [ $? -eq 0 ];then#echo -e "\e[30 CDB_SQL execute successed & restart the oracle_service \e[0m"echo "[ OK ] CDB_SQL execute successed & restart the oracle_service"service oracle restart
else#action "oracle create app_user && app_passwd failed." /bin/falseecho "[ FAILED ] create app_user && app_passwd && tablespace && grant failed."exit 5
fiecho "####################### oracle listener && dbca 安装完成 请记录数据库信息 ##############################"echo "##### oracle用户系统登录密码: #####"
echo -e "\e[1;38;5;208m Oracle用户系统登录密码: $ORACLE_OS_PWD \e[0m"echo "##### 数据库实例名: #####"
echo -e "\e[1;38;5;208m 数据库实例名: $ORACLE_SID \e[0m"echo "##### 数据库install.db.starterdb密码: #####"
echo -e "\e[1;38;5;208m 数据库install.db.starterdb密码: $installSysPassword \e[0m"echo "##### 数据库实例的sys管理用户密码: #####"
echo -e "\e[1;38;5;208m 数据库实例的sys管理用户密码: $SYSPASSWORD \e[0m"echo "##### 数据库应用连接用户名: #####"
echo -e "\e[1;38;5;208m 数据库应用连接用户名: $USER_NAME \e[0m"echo "##### 数据库应用连接用户名对应的密码: #####"
echo -e "\e[1;38;5;208m 数据库应用连接用户名对应的密码: $USER_PASSWD \e[0m"echo "##### 数据库临时表空间名: #####"
echo -e "\e[1;38;5;208m 数据库临时表空间名: $TMP_DBF \e[0m"echo "##### 数据库数据表空间名: #####"
echo -e "\e[1;38;5;208m 数据库数据表空间名: $DATA_DBF \e[0m"