编写一个shell脚本,实现在Redhat7.5上自动化安装部署oralce11gR2
时间: 2023-03-13 07:24:32 浏览: 123
答:在Redhat 7.5上自动化安装部署Oracle 11gR2的shell脚本如下:#!/bin/bash
#安装Oracle 11gR2
echo "正在安装Oracle 11gR2"
yum -y install oracle-11g-r2#配置环境变量
echo "正在配置Oracle 11gR2环境变量"
export ORACLE_HOME=/opt/oracle/product/11.2.0/dbhome_1
export ORACLE_BASE=/opt/oracle
export ORACLE_SID=orcl
export PATH=$ORACLE_HOME/bin:$PATH#配置Oracle
echo "正在配置Oracle 11gR2"
/opt/oracle/product/11.2.0/dbhome_1/bin/netca /silent /responsefile /opt/oracle/product/11.2.0/dbhome_1/netca.rsp#创建数据库
echo "正在创建Oracle 11gR2数据库"
dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbName orcl -sid orcl -responseFile NO_VALUE -totalMemory 2048 -emConfiguration NONE -pdbAdminPassword oracle -sysPassword oracle -systemPassword oracleecho "Oracle 11gR2安装部署完毕!"
阅读全文