oracle 安装脚本
来源:互联网 发布:sql数据库实训心得 编辑:程序博客网 时间:2024/06/05 17:21
#!/bin/sh
groupadd dba
groupadd oper
groupadd oinstall
useradd oracle
usermod -g dba -G dba oracle
passwd oracle <<EOF
oracle
EOF
mkdir -p /u01/app/oracle
chown -R oracle:dba /u01/app/oracle
chmod -R 775 /u01/app
#2 modify ~/.bash_profile
cat > /home/oracle/.bash_profile <<'EOF'
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/db_1
export ORACLE_SID=ora10g
export ORACLE_OWNER=oracle
export ORACLE_TERM=vt100
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
export PATH=$PATH:$ORACLE_HOME/bin:$HOME/bin
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/Apache/Apache/bin:$PATH
export PATH=$PATH:/usr/sbin:/usr/bin;
export NLS_LANG=american_america.ZHS16GBK
export LANG=en_US
export EDITOR=vi
export TNS_ADMIN=$ORACLE_HOME/network/admin
export NLS_DATA_FORMAT="yyyy-mm-dd hh24:mi:ss"
EOF
#3 modify /etc/sysctl.conf
cat > /etc/sysctl.conf <<EOF
# Controls IP packet forwarding
net.ipv4.ip_forward = 0
# Controls source route verification
net.ipv4.conf.default.rp_filter = 1
# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0
# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0
# Controls whether core dumps will append the PID to the core filename
# Useful for debugging multi-threaded applications
kernel.core_uses_pid = 1
# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1
# Controls the maximum size of a message, in bytes
kernel.msgmnb = 65536
# Controls the default maxmimum size of a mesage queue
kernel.msgmax = 65536
#append here for install O11gR2
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 21719476736 ###half of your memory
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
#4 modify /etc/security/limits.conf
# It is the resource limit for the number of processes available to a user.
cat > /etc/security/limits.conf <<EOF
# /etc/security/limits.conf
#
#Each line describes a limit for a user in the form:
#
#<domain> <type> <item> <value>
#
#Where:
#<domain> can be:
# - an user name
# - a group name, with @group syntax
# - the wildcard *, for default entry
# - the wildcard %, can be also used with %group syntax,
# for maxlogin limit
#
#<type> can have the two values:
# - "soft" for enforcing the soft limits
# - "hard" for enforcing hard limits
#
#<item> can be one of the following:
# - core - limits the core file size (KB)
# - data - max data size (KB)
# - fsize - maximum filesize (KB)
# - memlock - max locked-in-memory address space (KB)
# - nofile - max number of open files
# - rss - max resident set size (KB)
# - stack - max stack size (KB)
# - cpu - max CPU time (MIN)
# - nproc - max number of processes
# - as - address space limit
# - maxlogins - max number of logins for this user
# - maxsyslogins - max number of logins on the system
# - priority - the priority to run user process with
# - locks - max number of file locks the user can hold
# - sigpending - max number of pending signals
# - msgqueue - max memory used by POSIX message queues (bytes)
# - nice - max nice priority allowed to raise to
# - rtprio - max realtime priority
#
#<domain> <type> <item> <value>
#
#* soft core 0
#* hard rss 10000
#@student hard nproc 20
#@faculty soft nproc 20
#@faculty hard nproc 50
#ftp hard nproc 0
#@student - maxlogins 4
# End of file
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
EOF
#5 /etc/profile
check_profile=`grep "ulimit -p 16384" /etc/profile`
if [ "$check_profile" == '' ]; then
cat >> /etc/profile <<EOF
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
echo "Negative........../etc/profile ware already modified!!"
fi
#6 /etc/pam.d/login
check_pam=`grep "/lib/security/pam_limits.so" /etc/pam.d/login | awk {'print $3'}`
if [ $? = 0 ];
then
echo "Negative........../etc/pam.d/login ware already modified!!"
else
cat >> /etc/pam.d/login <<!
session required /lib/security/pam_limits.so
session required pam_limits.so
!
fi
cd /mnt/CentOS
yum -y install binutil*
yum -y install compat-libstdc++*
yum -y install elfutils-libelf*
yum -y install elfutils-libelf-devel*
yum -y install elfutils-libelf-devel-static*
yum -y install gcc*
yum -y install gcc-c++*
yum -y install glibc*
yum -y install glibc-common*
yum -y install glibc-devel*
yum -y install glibc-headers*
yum -y install kernel-headers*
yum -y install ksh*
yum -y install libaio*
yum -y install libgcc*
yum -y install libgomp*
yum -y install libstdc++*
yum -y install libstdc++*
yum -y install make*
yum -y install sysstat*
yum -y install libXp*
- oracle 安装脚本
- shell脚本安装oracle
- CentOs中安装Oracle的脚本文件
- linux下”流氓“清理oracle安装脚本
- oracle 10g 预安装脚本
- ORACLE 安装脚本用户及环境
- Oracle安装需要脚本orainstRoot.sh
- oracle静默傻瓜式安装脚本
- Oracle常用脚本——安装前的配置脚本
- Oracle安装(2)通过SHELL脚本快速安装Oracle11gR2软件
- oracle脚本
- oracle 脚本
- Linux下安装Oracle参数自动初始化脚本
- oracle 10g for linux 安装 金牌脚本
- 一键安装ORACLE并建库脚本
- 脚本安装
- 检查Oracle Text 是否安装以及Oracle Text 是否使用的脚本
- oracle脚本一键转hive脚本
- java高新技术—代理
- 令牌桶和漏桶算法(流量整形算法)
- 软件开发最佳实践
- Windows XP下MinGW的安装与配置,dos小技巧
- 5.6.10能用的参数(验证)
- oracle 安装脚本
- poj3481——treap
- 设计模式(18)-Command Pattern
- poj1155TELE - 树形dp
- 在用户空间发生中断时,上下文切换的过程
- shell编程 if语句【转】
- 命令模式简介及应用
- android应用如何自动创建快捷方式到Launcher
- 模板元编程简介