您的位置:首页 > 数据库 > Oracle

oracle 的安装脚本

2016-05-06 14:48 393 查看
==[root@oracle ~]# cat 1.preusers.sh ==
#!/bin/bash
#Purpose:Create 3 groups named 'oinstall','dba','oper', plus 1 users named 'oracle'.
#Also setting the Environment
#variable for oracle user.
#variable for grid user.
#Usage:Log on as the superuser('root'),and then execute the command:#./1preusers.sh
#Author:bao

echo "Now create 3 groups named 'oinstall','dba','oper'"
echo "Plus 1 users named 'oracle',Also setting the Environment"
groupadd -g 1000 oinstall
groupadd -g 1300 dba
groupadd -g 1301 oper

useradd -u 1101 -g oinstall -G dba,oper -d /home/oracle -s /bin/bash -c "Oracle Software Owner" oracle

echo "yizhenuplooking" | passwd --stdin oracle

cat >>/home/oracle/.bash_profile <<EOF
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=\$ORACLE_BASE/product/11201/db1
export ORACLE_SID=esbtest
export ORACLE_OWNER=oracle
export PATH=\$PATH:\$ORACLE_HOME/bin:\$HOME/bin
export PATH=\$ORACLE_HOME/bin:\$ORACLE_HOME/Apache/Apache/bin:\$PATH
LD_LIBRARY_PATH=\$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
CLASSPATH=\$ORACLE_HOME/JRE:\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib
CLASSPATH=\$CLASSPATH:\$ORACLE_HOME/network/jlib
export CLASSPATH
export ORA_NLS33=\$ORACLE_HOME/nls/admin/data
export LANG=en_US
EOF
source /home/oracle/.bash_profile
echo "192.168.220.98 oracle" >> /etc/hosts
echo "The Groups and users has been created"
echo "The Environment for oracle also has been set successfully"

==[root@oracle ~]# cat 2predir.sh ==
#!/bin/bash
#Purpose:Create the necessary directory for oracle users and change the authention to oracle users.
#Usage:Log on as the superuser('root'),and then execute the command:#./2predir.sh
#Author:bao

echo "Now create the necessary directory for oracle users and change the authention to oracle users..."
mkdir -p /opt/oracle
chown -R oracle:oinstall /opt
chmod -R 775 /opt
mkdir -p /opt/oracle/oradata
mkdir -p /opt/oracle/product/11201/db1
mkdir /opt/oraInventory/
chown oracle:oinstall /opt/oracle/ -R
chown oracle:oinstall /opt/oraInventory/ -R
echo "The necessary directory for oracle users and change the authention to oracle users has been finished"

==[root@oracle ~]# cat 3.prelimits.sh ==
#!/bin/bash
#Purpose:Change the /etc/security/limits.conf.
#Usage:Log on as the superuser('root'),and then execute the command:#./3prelimits.sh
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
cat >>/etc/security/limits.conf <<EOF
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
EOF

==[root@oracle ~]# cat 4.presysctl.sh ==
#!/bin/bash
#Purpose:Modify the /etc/sysctl.conf.
#Usage:Log on as the superuser('root'),and then execute the command:
#./4presysctl.sh

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

cat >>/etc/sysctl.conf <<EOF
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 = 1048586
EOF

/sbin/sysctl -p

==[root@oracle ~]# cat 5preyum.sh ==
#!/bin/bash
yum -y install binutils compat-db compat-libstdc++-296 compat-libstdc++-33 control-center gcc gcc-c++ glibc glibc-common libstdc++ libstdc++-devel make pdksh sysstat xscreensaver setarch libaio libaio-devel libXp elfutils-libelf-devel
sleep 5
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/pdksh-5.2.14-37.el5_8.1.x86_64.rpm rpm -ivh pdksh-5.2.14-37.el5_8.1.x86_64.rpm

安装的时候参考: http://www.cnblogs.com/smail-bao/p/oracle.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: