11g静默安装

1. path部署

#!/bin/bash
export PATH=$PATH###set firewalld&selinux
os=`cat /etc/redhat-release|awk '{print $4}'|awk -F'.' '{print $1}'`
if [ ${os} == "7" ];then
systemctl disable firewalld && systemctl stop firewalld
systemctl disable abrt-ccpp
systemctl disable abrtd
systemctl disable atd
systemctl disable auditd
systemctl disable cpuspeed
systemctl disable cups
systemctl disable dnsmasq
systemctl disable firstboot
systemctl disable lvm2-monitor
systemctl disable netconsole
systemctl disable netfs
systemctl disable ntpd
systemctl disable ntpdate
systemctl disable portreserve
systemctl disable postfix
systemctl disable rdisc
systemctl disable restorecond
systemctl disable saslauthd
systemctl disable wdaemon
systemctl disable wpa_supplicant
systemctl disable NetworkManager
systemctl disable blk-availability
systemctl disable cpuspeed
systemctl disable lvm2-monitor
systemctl disable restorecond
systemctl disable netconsole
if [ `getenforce` == "Enforcing" ];then
setenforce 0
sed -i "s!SELINUX=enforcing!SELINUX=disabled!g" /etc/selinux/config
elif [ `getenforce` == "Permissive" ];then
sed -i "s!SELINUX=enforcing!SELINUX=disabled!g" /etc/selinux/config
else
continue
fi
else
chkconfig iptables off && chkconfig ip6tables off && service iptables stop && service ip6tables stop
chkconfig abrt-ccpp off
chkconfig abrtd off
chkconfig atd off
chkconfig auditd off
chkconfig cpuspeed off
chkconfig cups off
chkconfig dnsmasq off
chkconfig firstboot off
chkconfig lvm2-monitor off
chkconfig netconsole off
chkconfig netfs off
chkconfig ntpd off
chkconfig ntpdate off
chkconfig portreserve off
chkconfig postfix off
chkconfig rdisc off
chkconfig restorecond off
chkconfig saslauthd off
chkconfig wdaemon off
chkconfig wpa_supplicant off
chkconfig NetworkManager off
chkconfig blk-availability off
chkconfig cpuspeed off
chkconfig lvm2-monitor off
chkconfig restorecond off
chkconfig netconsole off
if [ `getenforce` == "Enforcing" ];then
setenforce 0
sed -i "s!SELINUX=enforcing!SELINUX=disabled!g" /etc/selinux/config
elif [ `getenforce` == "Permissive" ];then
sed -i "s!SELINUX=enforcing!SELINUX=disabled!g" /etc/selinux/config
else
continue
fi
fi###set the ip in hosts
hostname=`hostname`
ip=`ifconfig enp0s8 | grep -w  'inet' | awk '{print $2}'`
a=`hostname`
echo "${ip} ${a}" >> /etc/hosts###create group&user
ora_user=oracle
ora_group=('oinstall' 'dba' 'oper')
for i in ${ora_group[@]}
do
a=`grep '${i}' /etc/group`
if [ ! -n ${a} ];then
groupdel ${i} && groupadd ${i}
else
groupadd ${i}
fi
done
a=`grep 'oracle' /etc/passwd`
if [ ! -n ${a} ];then
userdel -r ${ora_user} && useradd ${ora_user} -g ${ora_group[0]} -G ${ora_group[1]},${ora_group[2]} ${ora_user}
else
useradd -g ${ora_group[0]} -G ${ora_group[1]},${ora_group[2]} ${ora_user}
fi
echo "oracle" | passwd --stdin ${ora_user}
###create directory and grant priv
count=0
while [ $count -lt 3 ]
do
read -p "Please input the ORACLE_SID(e.g:orcl):" S1
read -p "Please input the ORACLE_SID again(e.g:orcl):" S2
if [ "${S1}" == "${S2}" ];then
export ORACLE_SID=${S1}
break
else
echo "You input ORACLE_SID not same."
count=$[${count}+1]
fi
done
count=0
while [ $count -lt 3 ]
do
read -p "Please input the ORACLE_BASE(e.g:/data/app/oracle):" S1
read -p "Please input the ORACLE_BASE again(e.g:/data/app/oracle):" S2
if [ "${S1}" == "${S2}" ];then
export ORACLE_BASE=${S1}
break
else
echo "You input ORACLE_BASE not same."
count=$[${count}+1]
fi
done
count=0
while [ $count -lt 3 ]
do
read -p "Please input the ORACLE_HOME(e.g:/data/app/oracle/product/11.2.0/db_1):" S1
read -p "Please input the ORACLE_HOME again(e.g:/data/app/oracle/product/11.2.0/db_1):" S2
if [ "${S1}" == "${S2}" ];then
export ORACLE_HOME=${S1}
break
else
echo "You input ORACLE_HOME not same."
count=$[${count}+1]
fi
done
if [ ! -d ${ORACLE_HOME} ];then
mkdir -p ${ORACLE_HOME}
else
continue
fi
if [ ! -d ${ORACLE_BASE}/oradata ];then
mkdir -p ${ORACLE_BASE}/oradata
else
continue
fi
if [ ! -d ${ORACLE_BASE}/recovery ];then
mkdir -p ${ORACLE_BASE}/recovery
else
continue
fi
ora_dir=`echo ${ORACLE_HOME}|awk -F '/' '{print $2}'`
last_dir=`echo ${ORACLE_HOME}|awk -F '/' '{print $NF}'`###install require packages
yum -y install elfutils-libelf-devel binutils compat-libcap1 compat-libstdc++-33 gcc gcc-c++ glibc glibc-devel libaio libaio-devel libgcc libstdc++ libstdc++-devel libXi libXtst make sysstat unixODBC unixODBC-devel zip unzip tree###set the sysctl,limits and profile
a=`grep 'fs.aio-max-nr' /etc/sysctl.conf`
if [ ! -n "${a}" ];then
cat << EOF >> /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
EOF
else
continue
fi
a=`grep 'oracle' /etc/security/limits.conf`
if [ ! -n "${a}" ];then
cat << EOF >> /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
EOF
else
continue
fi
a=`grep 'ORACLE_SID' /home/${ora_user}/.bash_profile`
if [ ! -n "${a}" ];then
cat << EOF >> /home/${ora_user}/.bash_profile
export ORACLE_SID=${ORACLE_SID}
export ORACLE_BASE=${ORACLE_BASE}
export ORACLE_HOME=\$ORACLE_BASE/product/11.2.0/db_1
export PATH=\$PATH:\$ORACLE_HOME/bin
EOF
else
continue
fi
a=`grep 'oracle' /etc/profile`
if [ ! -n "${a}" ];then
cat << EOF >> /etc/profile
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
EOF
else
continue
fi
a=`grep 'pam_limits.so' /etc/pam.d/login`
if [ ! -n "${a}" ];then
cat << EOF >> /etc/pam.d/login
session required /lib/security/pam_limits.so
session required pam_limits.so
EOF
else
continue
fi
sysctl -p && source /home/${ora_user}/.bash_profile###unzip the install package and set response file
count=0
while [ $count -lt 2 ]
do
read -p "Please input the zip file location(e.g:/oracle/db.zip):" zfile
if [ ! -f ${zfile} ];then
echo "You input location not found zip file."
else
export zfile=${zfile}
unzip ${zfile} -d /${ora_dir} && chown -R ${ora_user}:${ora_group[0]} /${ora_dir} && chmod -R 775 /${ora_dir}
fi
count=$[${count}+1]
donefree_m=`free -m | grep 'Mem:'|awk '{print $2}'`
db_response_file=`find / -type f -name db_install.rsp`
data_dir=${ORACLE_BASE}/data
recovery_dir=${ORACLE_BASE}/recovery
cd `find / -type f -name db_install.rsp | sed -n 's:/[^/]*$::p'` && cd ../
install_dir=`pwd`
sed -i "s!oracle.install.option=!oracle.install.option=INSTALL_DB_SWONLY!g" ${db_response_file}
sed -i "s!ORACLE_HOSTNAME=!ORACLE_HOSTNAME=${hostname}!g" ${db_response_file}
sed -i "s!UNIX_GROUP_NAME=!UNIX_GROUP_NAME=${ora_group[0]}!g" ${db_response_file}
sed -i "s!INVENTORY_LOCATION=!INVENTORY_LOCATION=${ORACLE_BASE}/oraInventory!g" ${db_response_file}
sed -i "s!SELECTED_LANGUAGES=en!SELECTED_LANGUAGES=en,zh_CN!g" ${db_response_file}
sed -i "s!ORACLE_HOME=!ORACLE_HOME=${ORACLE_HOME}!g" ${db_response_file}
sed -i "s!ORACLE_BASE=!ORACLE_BASE=${ORACLE_BASE}!g" ${db_response_file}
sed -i "s!oracle.install.db.InstallEdition=!oracle.install.db.InstallEdition=EE!g" ${db_response_file}
sed -i "s!oracle.install.db.DBA_GROUP=!oracle.install.db.DBA_GROUP=${ora_group[1]}!g" ${db_response_file}
sed -i "s!oracle.install.db.OPER_GROUP=!oracle.install.db.OPER_GROUP=${ora_group[2]}!g" ${db_response_file}
sed -i "s!oracle.install.db.config.starterdb.type=!oracle.install.db.config.starterdb.type=GENERAL_PURPOSE!g" ${db_response_file}
sed -i "s!oracle.install.db.config.starterdb.globalDBName=!oracle.install.db.config.starterdb.globalDBName=${ORACLE_SID}!g" ${db_response_file}
sed -i "s!oracle.install.db.config.starterdb.SID=!oracle.install.db.config.starterdb.SID=${ORACLE_SID}!g" ${db_response_file}
sed -i "s!oracle.install.db.config.starterdb.characterSet=AL32UTF8!oracle.install.db.config.starterdb.characterSet=AL32UTF8!g" ${db_response_file}
sed -i "s!oracle.install.db.config.starterdb.memoryLimit=!oracle.install.db.config.starterdb.memoryLimit=$[free_m*8/10]!g" ${db_response_file}
sed -i "s!oracle.install.db.config.starterdb.password.ALL=!oracle.install.db.config.starterdb.password.ALL=wincenter!g" ${db_response_file}
sed -i "s!oracle.install.db.config.starterdb.storageType=!oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE!g" ${db_response_file}
sed -i "s!oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=!oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=${data_dir}!g" ${db_response_file}
sed -i "s!oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=!oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=${recovery_dir}!g" ${db_response_file}
sed -i "s!oracle.installer.autoupdates.option=!oracle.installer.autoupdates.option=SKIP_UPDATES!g" ${db_response_file}
sed -i "s!SECURITY_UPDATES=!SECURITY_UPDATES=true!g" ${db_response_file}
su - oracle -c "${install_dir}/runInstaller -silent -ignoreDiskWarning -ignoreSysPrereqs -ignorePrereq -responseFile ${db_response_file}"#Confiture oracle listener&dbca

2. dbca建库

#!/bin/bash
export PATH=$PATHPASSWORD="oracle"
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'`temp=`ls ${ORACLE_BASE}|grep 'data'`
if [ ! -n ${temp} ];then
mkdir ${ORACLE_BASE}/data
export DATAFILE=${ORACLE_BASE}/oradata
else
export DATAFILE=${ORACLE_BASE}/oradata
fi
temp=`ls ${ORACLE_BASE}|grep 'area'`
if [ ! -n ${temp} ];then
mkdir ${ORACLE_BASE}/flash_recovery_area
export RECOVERY=${ORACLE_BASE}/flash_recovery_area
else
export RECOVERY=${ORACLE_BASE}/flash_recovery_area
fi
NETCA=`find / -type f -name netca.rsp`
sed -i "s!INSTALL_TYPE=""typical""!INSTALL_TYPE=""custom""!g" ${NETCA}
MEM=`free -m|grep 'Mem:'|awk '{print $2}'`
TOTAL=$[MEM*8/10]###set listener&tnsnames
su - oracle << EOF
source ~/.bash_profile
${ORACLE_HOME}/bin/netca -silent -responsefile ${NETCA}
dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname ${ORACLE_SID} -sid ${ORACLE_SID} -sysPassword ${PASSWORD} -systemPassword ${PASSWORD} -responseFile NO_VALUE -datafileDestination ${DATAFILE} -redoLogFileSize 1000 -recoveryAreaDestination ${RECOVERY} -storageType FS -characterSet ZHS16GBK -nationalCharacterSet AL16UTF16 -sampleSchema false -memoryPercentage 80 -totalMemory $TOTAL -databaseType OLTP -emConfiguration NONE
EOF

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/128662.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

如何将苹果手机照片导出?教你3个导出照片的必备技巧!

照片是我们记录生活&#xff0c;以及留下美好瞬间的最佳方式之一。通过手机照片&#xff0c;我们可以随时随地回忆过去的点点滴滴&#xff0c;还能将其分享给朋友和家人。因此&#xff0c;照片对于大家来说具有不可替代的价值与意义。 为了防止手机照片丢失&#xff0c;部分小…

多路IO—POll函数,epoll服务器开发流程

引言 "在计算机网络编程中&#xff0c;多路IO技术是非常常见的一种技术。其中&#xff0c;Poll函数和Epoll函数是最为常用的两种多路IO技术。这两种技术可以帮助服务器端处理多个客户端的并发请求&#xff0c;提高了服务器的性能。本文将介绍Poll和Epoll函数的使用方法&am…

算法通关村第四关-黄金挑战基础计算器问题

大家好我是苏麟 , 今天带来栈的比较难的问题 . 计算器问题 基础计算器 LeetCode 224 描述 : 给你一个字符串表达式 s &#xff0c;请你实现一个基本计算器来计算并返回它的值。 s 由数字、、-、(、)、和 组成s 表示一个有效的表达式 不能用作一元运算(例如&#xff0c; …

高效处理异常值的算法:One-class SVM模型的自动化方案

一、引言 数据清洗和异常值处理在数据分析和机器学习任务中扮演着关键的角色。清洗数据可以提高数据质量&#xff0c;消除噪声和错误&#xff0c;从而确保后续分析和建模的准确性和可靠性。而异常值则可能对数据分析结果产生严重影响&#xff0c;导致误导性的结论和决策。因此&…

C++类和对象下(初始化列表,静态成员,explicit关键字,友元)

C类和对象下[初始化列表,静态成员,explicit关键字,友元] 一.初始化列表1.为什么会有初始化列表2.初始化列表的语法形式3.没有默认构造函数的自定义成员变量4.初始化列表是成员变量定义的地方5.初始化列表可以跟函数体内定义搭配使用6.初始化列表执行的顺序7.总结建议 二.静态成…

当风格遇上浴缸:浴室装饰的秘诀

浴室不再仅仅是个洗漱的地方&#xff0c;如今它们是室内设计的一部分&#xff0c;有时甚至是焦点。浴室的装饰风格可以塑造整个房间的氛围&#xff0c;而浴缸通常是浴室内最引人注目的元素之一。在这里&#xff0c;我们将简单探讨不同室内设计风格与浴缸如何融合&#xff0c;让…

Qt与Rnn循环神经网络231101

#include <vector> #include <cmath> #include <random> #include<iostream>// Sigmoid激活函数 double sigmoid(double x) {return 1.0 / (1.0 + exp(-x)); }// RNN单元 class RNNCell { private:int input_size;int hidden_size;std::vector<std:…

asr翱捷LORA系列芯片选型参考推荐ASR6601/asr6505/asr6501/asr6500

ASR6601 SoC是国内首颗支持LoRa的LPWAN SoC。ASR6601芯片中集成的超低功耗收发机&#xff0c;除了支持LoRa调制方式外&#xff0c;还可以支持FSK收发、MSK收发和BPSK发射等。在3.3V电源供电的情况下&#xff0c;通过高功率PA&#xff0c;最大可发射22dBM的输出功率。ASR6601与A…

Vue项目中element使用组件按需引入的方法导致eslint检测出错

提示&#xff1a;记录项目中出现的问题及解决办法 文章目录 前言一、Vue3 前言 在Vue项目中elementui使用组件按需引入的方法导致eslint检测出错 一、Vue3 按照官网中element-plus的组件按需引入的方法配置后&#xff0c;我们只需要在 “.eslintrc.cjs” 文件中加入以下参数就…

PlantSimulation安装帮助文档端口被占用的解决办法

PlantSimulation安装帮助文档端口被占用的解决办法 从PlantSimulaiton&#xff08;TPS&#xff09;2201开始帮助文档开始使用在线&#xff0c;如果使用本地则需要安装本地文档服务器。但是在安装过程中你可能会遇到&#xff0c;5000断开被占用的情况。解决办法如下&#xff1a…

C# 发送邮件

1.安装 NuGet 包 2.代码如下 SendMailUtil using MimeKit; using Srm.CMER.Application.Contracts.CmerInfo; namespace Srm.Mail { public class SendMailUtil { public async static Task<string> SendEmail(SendEmialDto sendEmialDto,List<strin…

java APP自动化测试AppIum

一、前言 二、Appium环境搭建 2.1 JDK安装 2.2 Android SDK安装配置 2.3 模拟器安装及配置 2.4 Appium Desktop安装及使用 2.5 Appium配置连接模拟器 三、实战基本脚本编写 3.1 创建Maven项目并配置 3.2 简单Demo 四、写在最后 一、前言 随着移动互联网的发展&#xff0c;AP…

mac录屏快捷键指南,轻松录制屏幕内容!

“大家知道mac电脑有录屏快捷键吗&#xff0c;现在录屏不太方便&#xff0c;每次都花很多时间&#xff0c;要是有录屏快捷键&#xff0c;应该会快速很多&#xff0c;可是哪里都找不到&#xff0c;有人知道吗&#xff1f;帮帮我&#xff01;” 苹果的mac电脑以其精美的设计和卓…

Java使用pdfbox进行pdf和图片之间的转换

简介 pdfbox是Apache开源的一个项目,支持pdf文档操作功能。 官网地址: Apache PDFBox | A Java PDF Library 支持的功能如下图.引入依赖 <dependency><groupId>org.apache.pdfbox</groupId><artifactId>pdfbox-app</artifactId><version>…

AIGC|把Azure Open AI和Jira集成起来,实现智能化项目管理

目录 一、Jira与Azure OpenAI介绍 二、Jira和Azure OpenAI的REST API对接 三、利用Chats插件实现对话的过程 四、总结 一、Jira与Azure OpenAI介绍 Jira是一款由澳大利亚公司Atlassian开发的项目管理工具&#xff0c;主要用于追踪问题、管理需求、构建报告和管理故障等事项…

ruby语言怎么写个通用爬虫程序?

Ruby语言爬虫是指使用Ruby编写的网络爬虫程序&#xff0c;用于自动化地从互联网上获取数据。其中&#xff0c;CRawler是一个基于文本的小型地牢爬虫&#xff0c;它被设计为可扩展&#xff0c;所有游戏数据均通过JSON文件提供&#xff0c;程序仅处理游戏引擎。除此之外&#xff…

EasyExcel复杂表头数据导入

目录 表头示例导入代码数据导出 表头示例 导入代码 Overridepublic void importExcel(InputStream inputStream) {ItemExcelListener itemExcelListener new ItemExcelListener();EasyExcel.read(inputStream, ImportItem.class, itemExcelListener).headRowNumber(2).sheet()…

OSPF 高级特性3

一、OSPF安全特性 1、OSPF报文验证&#xff1a; 区域验证模式&#xff1a;在区域下配置一致的密码才能加入同一个区域。 [r3-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher 123456 接口验证模式&#xff1a;链路两端的接口必须配置一致的密码才能建立邻居关系 [r5-Gig…

回归预测 | Matlab实现SO-CNN-SVM蛇群算法优化卷积神经网络-支持向量机的多输入单输出回归预测

Matlab实现SO-CNN-SVM蛇群算法优化卷积神经网络-支持向量机的多输入单输出回归预测 目录 Matlab实现SO-CNN-SVM蛇群算法优化卷积神经网络-支持向量机的多输入单输出回归预测效果一览基本介绍程序设计参考资料 效果一览 基本介绍 1.SO-CNN-SVM蛇群算法优化卷积神经网络-支持向量…

oracel处理XML时,报ORA-31011、ORA-19202。

原字段为clob&#xff0c; 查询 SELECT XMLTYPE(字段) FROM TABLE_A报错如下&#xff1a; ORA-31011: XML 语法分析失败 ORA-19202: XML 处理 LPX-00217: invalid character 12 (U000C) Error at line 1559时出错 ORA-06512: 在 "SYS.XMLTYPE", line 272 ORA-0651…