oracle11g安装前期工作准备脚本

每次安装oracle11g前期重复的工作让我十分讨厌,所以编写了一个前期准备工作的脚本,跑完此脚本后,直接就可以安装oracle介质了!!

注意:

此脚本是在redhat6.4下编写的,脚本中标红的地方,可根据自己的环境修改,依赖包是通过本地yum安装的!

—————————————脚本开始—————————————

#!/bin/sh

cat <<EOF  >  /etc/sysconfig/network

NETWORKING=yes

HOSTNAME=DB88

EOF

hostname DB88

cat <<EOF >  /etc/hosts

127.0.0.1    localhost localhost.localdomain localhost4 localhost4.localdomain4

::1          localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.8.88 DB88

EOF

`sed -i ‘s/ONBOOT=no/ONBOOT=yes/g‘ /etc/sysconfig/network-scripts/ifcfg-eth0`

service iptables stop

setenforce 0

`sed -i ‘s/SELINUX=enforcing/SELINUX=disabled/g‘ /etc/selinux/config`

mount -o loop /dev/cdrom  /mnt

rm -rf /etc/yum.repos.d/*

cat <<EOF > /etc/yum.repos.d/server.repo

[server]

name=server

baseurl=file:///mnt/Server

enabled=1

gpgcheck=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

EOF

yum -y install  binutils-* \

compat-libstdc++-* \

compat-libcap1-* \

elfutils-libelf-* \

elfutils-libelf-devel-* \

gcc* \

gcc-c++-* \

glibc* \

glibc-common-* \

glibc-devel-* \

glibc-headers-* \

ksh-* \

libaio-* \

libaio-devel-* \

libgcc-* \

libstdc++-* \

libstdc++-devel* \

make-* \

sysstat-* \

unixODBC-* \

unixODBC-devel-* \

numactl-devel-* \

pdksh-* \

kernel-headers* \

wget

groupadd oinstall

groupadd dba

useradd -g oinstall -G dba oracle

echo "oracle" | passwd --stdin oracle

echo "umask 022" >>/home/oracle/.bash_profile

echo "stty erase ^H" >>/home/oracle/.bash_profile

echo "PATH=\$PATH:\$HOME/bin" >>/home/oracle/.bash_profile

echo "TMP=/tmp" >>/home/oracle/.bash_profile

echo "TMPDIR=\$TMP" >>/home/oracle/.bash_profile

echo "ORACLE_BASE=/home/oracle/app/oracle" >>/home/oracle/.bash_profile

echo "ORACLE_HOME=\$ORACLE_BASE/product/11.2.0/db_1" >>/home/oracle/.bash_profile

echo "ORACLE_SID=ecom" >>/home/oracle/.bash_profile

echo "ORACLE_TERM=xterm" >>/home/oracle/.bash_profile

echo "PATH=\$PATH:\$HOME/bin:\$ORACLE_HOME/bin" >>/home/oracle/.bash_profile

echo "LD_LIBRARY_PATH=\$ORACLE_HOME/lib:/lib:/usr/lib" >>/home/oracle/.bash_profile

echo "CLASSPATH=\$ORACLE_HOME/JRE:\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib" >>/home/oracle/.bash_profile

echo ‘NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"‘>>/home/oracle/.bash_profile

echo "NLS_LANG=AMERICAN_AMERICA.ZHS16GBK" >>/home/oracle/.bash_profile

echo "export EDITOR=vi" >>/home/oracle/.bash_profile

echo "export TMP TMPDIR ORACLE_TERM CLASSPATH NLS_DATE_FORMAT ORACLE_BASE ORACLE_HOME ORACLE_SID PATH LD_LIBRARY_PATH NLS_LANG EDITOR" >>/home/oracle/.bash_profile

mkdir -p /home/oracle/app/oracle

chmod -R 777 /home/oracle/app/oracle

chown -R oracle.oinstall /home/oracle

cd /tmp

unzip p10404530_112030_Linux-x86-64_1of7.zip

unzip p10404530_112030_Linux-x86-64_2of7.zip

rm -rf p10404530_112030_Linux-x86-64_1of7.zip p10404530_112030_Linux-x86-64_2of7.zip

chmod -R 777 /tmp/database

chown -R oracle.oinstall /tmp/database

echo "Now modify the /etc/security/limits.conf,but backup it named /etc/security/limits.conf.bak before"

cp /etc/security/limits.conf /etc/security/limits.conf.bak

echo "oracle soft nproc 2047" >>/etc/security/limits.conf

echo "oracle hard nproc 16384" >>/etc/security/limits.conf

echo "oracle soft nofile 1024" >>/etc/security/limits.conf

echo "oracle hard nofile 65536" >>/etc/security/limits.conf

echo "grid soft nproc 2047" >>/etc/security/limits.conf

echo "grid hard nproc 16384" >>/etc/security/limits.conf

echo "grid soft nofile 1024" >>/etc/security/limits.conf

echo "grid hard nofile 65536" >>/etc/security/limits.conf

echo "Modifing the /etc/security/limits.conf has been succeed."

echo "Now modify the /etc/pam.d/login,but with a backup named /etc/pam.d/login.bak"

cp /etc/pam.d/login /etc/pam.d/login.bak

echo "session required /lib/security/pam_limits.so" >>/etc/pam.d/login

echo "session required pam_limits.so" >>/etc/pam.d/login

echo "Modifing the /etc/pam.d/login has been succeed."

echo "Now modify the  /etc/profile,but with a backup named  /etc/profile.bak"

cp /etc/profile /etc/profile.bak

echo ‘if [ $USER = "oracle" ]||[ $USER = "grid" ]; then‘ >>  /etc/profile

echo ‘if [ $SHELL = "/bin/ksh" ]; then‘ >> /etc/profile

echo ‘ulimit -p 16384‘ >> /etc/profile

echo ‘ulimit -n 65536‘ >> /etc/profile

echo ‘else‘ >> /etc/profile

echo ‘ulimit -u 16384 -n 65536‘ >> /etc/profile

echo ‘fi‘ >> /etc/profile

echo ‘fi‘ >> /etc/profile

echo "Modifing the /etc/profile has been succeed."

echo "Now modify the /etc/sysctl.conf,but with a backup named /etc/sysctl.bak"

cp /etc/sysctl.conf /etc/sysctl.conf.bak

echo "fs.aio-max-nr = 1048576" >> /etc/sysctl.conf

echo "fs.file-max = 6815744" >> /etc/sysctl.conf

echo "kernel.shmall = 2097152" >> /etc/sysctl.conf

echo "kernel.shmmax = 1054472192" >> /etc/sysctl.conf

echo "kernel.shmmni = 4096" >> /etc/sysctl.conf

echo "kernel.sem = 250 32000 100 128" >> /etc/sysctl.conf

echo "net.ipv4.ip_local_port_range = 9000 65500" >> /etc/sysctl.conf

echo "net.core.rmem_default = 262144" >> /etc/sysctl.conf

echo "net.core.rmem_max = 4194304" >> /etc/sysctl.conf

echo "net.core.wmem_default = 262144" >> /etc/sysctl.conf

echo "net.core.wmem_max = 1048586" >> /etc/sysctl.conf

echo "net.ipv4.tcp_wmem = 262144 262144 262144" >> /etc/sysctl.conf

echo "net.ipv4.tcp_rmem = 4194304 4194304 4194304" >> /etc/sysctl.conf

echo "Modifing the /etc/sysctl.conf has been succeed."

echo "Now make the changes take effect....."

sysctl -p

时间: 2024-10-12 14:11:09

oracle11g安装前期工作准备脚本的相关文章

oracle10g安装前期工作准备脚本

每次安装oracle10g前期重复的工作让我十分讨厌,所以编写了一个前期准备工作的脚本,跑完此脚本后,直接就可以安装oracle介质了!! 注意: 此脚本是在redhat5.5下编写的,脚本中标红的地方,可根据自己的环境修改,依赖包是通过本地yum安装的! -------------脚本开始------------- #!/bin/sh cat <<EOF  >  /etc/sysconfig/network NETWORKING=yes NETWORKING_IPV6=no HOSTN

oracle11g静默安装----&gt;前期工作准备脚本【一】

在某些情况下,服务器无法开启图形,就要用到静默安装这种方式了,此脚本是我之前为O2O商场静默安装oracle11g时,改造的!! 注意: 此脚本是在redhat6.4下编写的,脚本中标红的地方,可根据自己的环境修改,依赖包是通过本地yum安装的! -------------脚本开始------------- #!/bin/sh cat <<EOF  >  /etc/sysconfig/network NETWORKING=yes HOSTNAME=DB88 EOF hostname DB

Linux下oracle11g安装所需要软件包的检测与安装

Linux下oracle11g安装所需要软件包的检测与安装 1 首先在执行脚本之前,你需要把所有需要的包提出出来,然后放到一个名为patch的文件夹下,这个文件夹要和脚本程序在同一个目录下就可以 2 把下面的脚本内容copy到linux下,新建一个脚本文件,然后执行就可以了, 脚本的内容如下: #!/bin/sh count=0 arr=( binutils-2* compat-libstdc++-33* elfutils-libelf-0.* elfutils-libelf-devel-0.*

jQueryMobile 下载安装,工作原理,处理移动设备

下载安装,工作原理,自动增强,视口,事件,响应手持方向,移动浏览仿真器 jQueryMobile 1. 下载安装 http://jquerymobile.com <header> <title>导入</title> <meta name="viewport" content="width=device-width,initial-scale=1"> <script type="text/javascri

oracle11g 安装错误汇总

oracle11g安装错误总结: 1,执行./runInstaller报错如下: You are atempting to install 64-bit Oracle on a 32-bit operating system,this is not support and will not work 查看uname显示确实64位 [[email protected]_master ~]uname -a  Linux oracle_master 2.6.32-220.el6.x86_64 #1 S

Oracle11g安装详细步骤

Oracle11g安装详细步骤,详见附件↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

Zsh安装CMake补全脚本进行CMake命令补全

最近在尝试使用Zsh,发现其补全命令的功能相当厉害.但对CMake命令的补全在默认的5.0.5中好像没有看到,网上找了下关于配置Zsh补全的文章也没有多少.     于是自己动手,发现在Zsh安装目录下有个functions的文件夹,里面都有以_开头的各种补全提示文件,比如_sed,_awk等,于是尝试在网上 下到zsh_cmake补全文件之后,重命名为_cmake放置该文件夹中(注意Windows用户的换行符,在这个上浪费了很多时间,使用 dos2unix可以解决)重新启动Zsh,享受CMak

linux (centos) 安装tomcat (用shell脚本安装为服务)

1.下载tomcat 从http://tomcat.apache.org/download-70.cgi链接下载linux版本(tar.gz) 2.解压,上传及赋权限 解压,用WinSCP把解压的安装文件上传到/home/software/tomcat目录 并用   chmod -R 755 /home/software/tomcat命令账权限. 3.编写安装为服务的脚本并运行 shell脚本如下: #! /bin/sh #shell script takes care of starting

Ubuntu安装编译OpenCV一键脚本(带ffmpeg)

1.切换到用户目录 cd ~ 2.新建一个文件,命名为opencv.sh 脚本如下: version="$(wget -q -O - http://sourceforge.net/projects/opencvlibrary/files/opencv-unix | egrep -m1 -o '\"[0-9](\.[0-9])+' | cut -c2-)" echo "Installing OpenCV" $version mkdir OpenCV cd O