拉链厂家
免费服务热线

Free service

hotline

010-00000000
拉链厂家
热门搜索:
技术资讯
当前位置:首页 > 技术资讯

分享一个安装Oracle的脚本

发布时间:2020-02-11 05:27:10 阅读: 来源:拉链厂家

执行脚本前一定要知道脚本是怎么工作的。

作者不对本脚本造成的任何后果负责。

下面是一个在CentOS 5.8 i386上安装oracle 10g的环境准备脚本

#!/bin/sh

# need to be centos 5.8

echo "install dep. packages"

yum install libgomp glibc-devel kernel-headers glibc-headers \

libstdc++-devel sysstat compat-libstdc++-33 libaio-devel gcc \

gcc-c++ elfutils-libelf-devel-static libtermcap-devel unixODBC-devel \

libaio-devel compat-db compat-gcc-34 compat-gcc-34-c++ gdb libXp libstdc++-devel

echo "add users"

/usr/sbin/groupadd oinstall

/usr/sbin/groupadd dba

/usr/sbin/groupadd oper

/usr/sbin/useradd -g oinstall -G dba,oper oracle

passwd oracle

echo "change nf"

cat 《!SYSCTL! 》 /etc/nf

mall = 2097152

mmax = 2147483648

mmni = 4096

m = 250 32000 100 128

le-max = 65536

_local_port_range = 1024 65000

em_default = 1048576

em_max = 1048576

em_default = 262144

em_max = 262144

!SYSCTL!

/sbin/sysctl -p

echo "change nf"

cat 《!LIMITS! 》 /etc/security/nf

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

!LIMITS!

echo "change pam/login"

cat 《!LOGIN! 》 /etc/pam.d/login

session required /lib/security/pam_

session required pam_

!LOGIN!

echo "change profile"

cat 《!PROFILE! 》 /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

!PROFILE!

echo "mkdir for oracle"

mkdir -p /oracle/product/10.2.0/db_1

mkdir -p /oracle/oraInventory

mkdir -p /oracle/oradata

mkdir -p /oracle/flash_recovery_area

chown -R oracle:oinstall /oracle

chmod -R 775 /oracle

echo "change .bash_profile"

cat 《!BASH! 》 /home/oracle/.bash_profile

ORACLE_BASE=/oracle ; export ORACLE_BASE

ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1 ; export ORACLE_HOME

PATH=$PATH:$ORACLE_HOME/bin ; export PATH

!BASH!

echo redhat-4 > /etc/redhat-release

下面是CentOS 6.2 x86_64安装oracle 11gR2 的环境准备脚本

#!/bin/sh

# preinstall script for oracle 11gR2 in CentOS 6.2 and later

# make sure to understand what it do before run it

# by locke liu

if [ "$UID" -eq "0" ]

then

continue

else

{ echo "need to be root!"

exit 1

}

fi

echo "oracle require 1 GB of RAM , Recommend 2 GB of RAM or more . swap as the size of the RAM "

grep MemTotal /proc/meminfo

grep SwapTotal /proc/meminfo

uname -a

df -h /tmp

df -h /oracle

echo "update you system …"

yum update -y

echo "install dep packages …"

yum install binutils compat-libcap1 compat-libstdc++-33 \

gcc gcc-c++ glibc glibc-devel ksh libgcc libstdc++ \

libstdc++-devel libaio libaio-devel make sysstat unixODBC \

unixODBC-devel java

yum install compat-libstdc++-33.i686 glibc-devel.i686 \

libgcc.i686 libstdc++.i686 glibc.i686 libstdc++-devel.i686 \

libaio.i686 libaio-devel.i686 unixODBC.i686 unixODBC-devel.i686

echo "add users"

/usr/sbin/groupadd oinstall

/usr/sbin/groupadd dba

/usr/sbin/groupadd oper

/usr/sbin/useradd -g oinstall -G dba,oper oracle

passwd oracle

echo "change nf"

cat 《!SYSCTL! 》 /etc/nf

o-max-nr = 1048576

le-max = 6815744

mall = 2097152

mmax = 536870912

mmni = 4096

m = 250 32000 100 128

_local_port_range = 9000 65500

em_default = 262144

em_max = 4194304

em_default = 262144

em_max = 1048576

!SYSCTL!

/sbin/sysctl -p

echo "change nf"

cat 《!LIMITS! 》 /etc/security/nf

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

oracle soft stack 10240

!LIMITS!

echo "mkdir for oracle"

mkdir /oracle

chown -R oracle:oinstall /oracle

chmod -R 775 /oracle

echo "change .bash_profile"

cat 《!BASH! 》 /home/oracle/.bash_profile

ORACLE_BASE=/oracle ; export ORACLE_BASE

ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1 ; export ORACLE_HOME

PATH=$PATH:$ORACLE_HOME/bin ; export PATH

!BASH!

要学会自己修改脚本,根据实际情况执行,还要学会分享你修改之后的脚本。

中山代理记账机构

深圳工作签证作用

中山筹划税务多少钱

广州工作签证代理

工商税务网

代理记账企业

深圳注册公司多少费用

中山工商税务年审

相关阅读