OEL5.8 x64 安装oracle数据库环境配置脚本

本文适用环境:RHEL/CentOS/OEL5.8 X64安装过程中选中图形界面,开发包,开发库,老的软件开发包等。

脚本如下:

#!/bin/bash 
# author: koumm 
# desc: RHEL/CentOS/OEL5.8 x64 oracle 10g(10.2.0.5) install script 
# date: 2014-07-28 
# version: v1.0 
# modify:
ORACLE_BASE="/u01/app/oracle" 
ORACLE_HOME="/u01/app/oracle/product/10.2.0/db_1" 
ORACLE_SID="orcl"
# 
cat << EOF 
+--------------------------------------------------------------+ 
| === Welcome to RUN oracle auto configure script === | 
| PWD /root/oracle10g_install.sh | 
+----------------------Author:koumm----------------------------+ 
EOF
cd oracle_install/ora_install_rpm 
rpm -ivh compat-db-4.2.52-5.1.i386.rpm compat-db-4.2.52-5.1.x86_64.rpm 
rpm -ivh libaio-devel-0.3.106-5.x86_64.rpm libaio-devel-0.3.106-5.i386.rpm 
rpm -ivh sysstat-7.0.2-11.el5.x86_64.rpm numactl-devel-0.9.8-12.0.1.el5_6.x86_64.rpm 
rpm -ivh unixODBC-2.2.11-10.el5.x86_64.rpm unixODBC-devel-2.2.11-10.el5.x86_64.rpm unixODBC-libs-2.2.11-10.el5.x86_64.rpm 
rpm -ivh unixODBC-2.2.11-10.el5.i386.rpm unixODBC-devel-2.2.11-10.el5.i386.rpm unixODBC-libs-2.2.11-10.el5.i386.rpm 
rpm -ivh libXp-1.0.0-8.1.el5.i386.rpm libXp-1.0.0-8.1.el5.x86_64.rpm 
rpm -ivh openmotif22-2.2.3-20.x86_64.rpm openmotif-2.3.1-6.el5.x86_64.rpm 
rpm -ivh rlwrap-0.37-1.el5.x86_64.rpm
if [ $? ];then 
cat << EOF 
+--------------------------------------------------------------+ 
| === 1. oracle rpm package installed successfully. === | 
+--------------------------------------------------------------+ 
EOF 
fi
ORACLE_USER=`cat /etc/passwd |grep oracle |awk -F ":" ‘{print $1}‘`
if [ "$ORACLE_USER" != "oracle" ]; then 
groupadd oinstall 
groupadd dba 
useradd -g oinstall -G dba oracle 
echo "abc123" | passwd --stdin oracle 
fi
if [ $? ];then 
cat << EOF 
+--------------------------------------------------------------+ 
| === 2. oracle user group installed successfully. === | 
+--------------------------------------------------------------+ 
EOF
fi
if [ ! -d $ORACLE_HOME ]; then 
mkdir -p $ORACLE_HOME 
chmod -R 775 /u01/app 
chown -R oracle:oinstall /u01 
fi
if [ $? ];then 
cat << EOF 
+--------------------------------------------------------------+ 
| === 3. oracle HOME directory created successfully. === | 
+--------------------------------------------------------------+ 
EOF 
fi
# cd root home directory /root/ 
if [ -e /root/oracle_install/10201_database_linux_x86_64.cpio.gz -a -e /root/oracle_install/p8202632_10205_Linux-x86-64.zip ];then 
echo " === now moving database file database,pack to /u01/app ..." 
chown oracle:oinstall /root/oracle_install/10201_database_linux_x86_64.cpio.gz 
chown oracle:oinstall /root/oracle_install/p8202632_10205_Linux-x86-64.zip 
mv /root/oracle_install/10201_database_linux_x86_64.cpio.gz /u01/app/ 
mv /root/oracle_install/p8202632_10205_Linux-x86-64.zip /u01/app/ 
cd /u01/app 
echo " === now unziping /u01/app/10201_database_linux_x86_64.cpio.gz to /u01/app ..." 
gunzip /u01/app/10201_database_linux_x86_64.cpio.gz 
cpio -idm < /u01/app/10201_database_linux_x86_64.cpio 
echo " === now unziping /u01/app/p8202632_10205_Linux-x86-64.zip to /u01/app ..." 
unzip -qo /u01/app/p8202632_10205_Linux-x86-64.zip -d /u01/app 
chown -R oracle:oinstall /u01/app/database 
chown -R oracle:oinstall /u01/app/Disk1 
echo -e "\033[32;49;1m === oracle database unzip successfull ...\033[39;49;0m" 
else 
echo -e "\033[41;36m no oracle database soft and pack file ... \033[0m" 
fi
sed -i ‘/kernel.shmmax/d‘ /etc/sysctl.conf 
sed -i ‘/kernel.shmall/d‘ /etc/sysctl.conf
cat >> /etc/sysctl.conf << EOF 
kernel.shmall = 2097152 
kernel.shmmax = 2147483648 
kernel.shmmni = 4096 
kernel.sem = 250 32000 100 128 
fs.file-max = 359670 
net.ipv4.ip_local_port_range = 9000 65500 
net.core.rmem_default = 1048576 
net.core.rmem_max = 1048576 
net.core.wmem_default = 262144 
net.core.wmem_max = 262144 
EOF
sysctl -p
if [ $? ];then 
cat << EOF 
+--------------------------------------------------------------+ 
| === 4. linux core updated successfully. === | 
+--------------------------------------------------------------+ 
EOF
fi
sleep 1
cat >> /etc/security/limits.conf << EOF 
oracle soft nproc 2047 
oracle hard nproc 16384 
oracle soft nofile 1024 
oracle hard nofile 65536 
EOF
if [ $? ];then 
cat << EOF 
+--------------------------------------------------------------+ 
| === 5. oracle source limite configured successfully=== | 
+--------------------------------------------------------------+ 
EOF
fi
sleep 1
cat >> /etc/pam.d/login << EOF 
session required /lib64/security/pam_limits.so 
EOF
if [ $? ];then 
cat << EOF 
+--------------------------------------------------------------+ 
| === 6. linux login configured successfully. === | 
+--------------------------------------------------------------+ 
EOF 
fi
sleep 1
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
if [ $? ];then 
cat << EOF 
+--------------------------------------------------------------+ 
| === 7. linux system env configured successfully. === | 
+--------------------------------------------------------------+ 
EOF
fi
sleep 1
cat >> /etc/rc.local << EOF 
# Oracle service start 
su - oracle -c "lsnrctl start" 
su - oracle -c "dbstart" 
EOF
if [ $? ];then 
cat << EOF 
+--------------------------------------------------------------+ 
| === 8. oracle db autostart configured successfully.=== | 
+--------------------------------------------------------------+ 
EOF
fi
sleep 1
cat >> /home/oracle/.bash_profile << EOF 
export EDITOR=vi 
export ORACLE_BASE=/u01/app/oracle 
export ORACLE_HOME=\$ORACLE_BASE/product/10.2.0/db_1 
export ORACLE_SID=orcl 
export PATH=\$ORACLE_HOME/bin:\$PATH 
export NLS_LANG="Simplified Chinese_china.ZHS16GBK" 
export LANG=en_US 
export LC_ALL=en_US 
export LD_LIBRARY_PATH=/lib:/usr/lib:\$ORACLE_HOME/lib 
alias sqlplus="rlwrap sqlplus" 
alias rman="rlwrap rman" 
umask 022 
EOF
if [ $? ];then 
cat << EOF 
+--------------------------------------------------------------+ 
| === 9. oracle user env configured successfully. === | 
+--------------------------------------------------------------+ 
EOF 
fi
sleep 1
cat << EOF 
+--------------------------------------------------------------+ 
| **********************next **************************** | 
| # xhost + | 
| $ su - oracle | 
| $ cd /u01/app/database | 
| $ ./runInstaller -ignoresysprereqs | 
| ******************************************************* | 
+--------------------------------------------------------------+ 
EOF

运行效果:

OEL5.8 x64 安装oracle数据库环境配置脚本

时间: 2024-12-13 08:10:00

OEL5.8 x64 安装oracle数据库环境配置脚本的相关文章

python操作oracle数据库环境配置

1. 下载安装cx_oracle安装包 Python操作Oracle数据库,首先需要安装cx_Oracle包,下载地址如下:   http://cx-oracle.sourceforge.net/    http://sourceforge.net/projects/cx-oracle/files/5.1.2/ 本系统采用的是CentOS5.x系列的操作系统,python版本是2.4,于是下载支持python2.4版本的安装包. 2. 下载oracle客户端,是oracle官方网站下载. 下载对

CentOS 6.5 x64 安装Tomcat8 并配置两个Tomcat8

1.首先,安装tomcat的前提是已经配置好jdk环境变量,若没配好可以参考我的上一篇博文:CentOS 6.5 x64安装jdk8,当然也可以通过网络搜索安装步骤~~ 2.下载: 可以通过官网下载:http://tomcat.apache.org/download-80.cgi,我下载的是这个. 3.在xftp中,进入/usr/local目录,新建一个文件夹为tomcat8,进入后建立两个文件夹(因为我们要装两个tomcat),分别为tom8081(代表8081端口),tom8082(代表80

理解RHEL上安装oracle的配置参数

无论安装什么版本的oracle,在安装之前,都需要配置 /etc/pam.d/login   /etc/profile   /etc/security/limits.conf这三个文件 那这三个文件究竟是做什么用的呢?答案就是设置对oracle用户的shell limits.下面就仔细分析一下这几个文件 首先需要编辑/etc/security/limits.conf文件(用户限制配置文件) oracle soft nproc 2047 oracle hard nproc 16384 oracle

Linux下安装Oracle网络配置检查未执行

问题描述 如图: 完整描述: Checking Network Configuration requirements ... Actual Result: Unknown Host Exception has Occurred :Linux-PC: Linux-PC. Check complete. The overall result of this check is: Not executed <<<< Recommendation: Oracle supports insta

理解RHEL上安装oracle的配置参数 :/etc/security/limits.conf, /etc/profile, /etc/pam.d/login

无论安装什么版本的Oracle,在安装之前,都需要配置 /etc/pam.d/login   /etc/profile   /etc/security/limits.conf这三个文件 那这三个文件究竟是做什么用的呢?答案就是设置对oracle用户的shell limits.下面就仔细分析一下这几个文件 首先需要编辑/etc/security/limits.conf文件(用户限制配置文件) oracle soft nproc 2047 oracle hard nproc 16384 oracle

1. 安装Oracle,配置环境 2. 实现查询From子句 3. 实现查询where子句 4. 实现查询order by子句

一.环境安装1. 登录:以管理员身份登录 sqlplus 登录名/密码 管理员身份登录:sqlplus system/1234562. 登录后,导入案例.下载scott.sql文件,执行下面一行的命令 SQL>@"E:\兄弟连文档\oracle\java 19\day01\script\scott.sql"; 此时我们拥有非管理员的用户:scott3. 激活scott的账号,激活用scott可登录 alter user scott identified by tiger; alt

&quot;RedHat Enterprise Linux 7下安装 Oracle 12C&quot;相关脚本下载

RootSetup.sh #!/bin/bash #Redhat 7 rpm -q binutils compat-libcap1 compat-libstdc++  gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel libXi libXtst make sysstat unixODBC unixODBC-devel /usr/sbin/groupadd oinstall

Oracle Linux 5.8安装Oracle 10.2.0.5 x64

一.正常方式全新安装 1. oracle安装环境准备 (1) 确认安装以下包 # rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE}  (%{ARCH})\n' binutils compat-libstdc++-33 compat-gcc-34-c++ elfutils-libelf elfutils-libelf-devel elfutils-libelf-devel-static gcc gcc-c++ glibc glibc-common glibc-d

oracle_linux_6_64(bit)上安装oracle11gR2数据库环境快速准备神器oracle-rdbms-server-11gR2-preinstall

1.oracle linux上安装oracle数据库环境快速准备介绍 在Linux上安装oracle数据库,在环境准备方面,例如该安装的RPM包,该调整的内核参数等,不仅较为复杂,有些参数值还会因为人工设置的不合理而对日后的运行带来一定的影响,也是整个安装过程中最耗时的部分. 在oracle linux 6_64bit上,提供了oracle-rdbms-server-11gR2-preinstall包,可以自动化的将需要安装的rpm包,需要调整的内核参数自动化的处理,对DBA安装数据库确实节省了