本文共 5532 字,大约阅读时间需要 18 分钟。
Installing Oracle Software 安装Oracle软件
一般先安装GI,在安装DB。版本查询 metalink.oracle.com mos文件
1、在root用户中执行脚本
echo "192.168.132.120 dbserver" >> /etc/hostsecho "======================================"echo "The next will be created directory and group with users."echo "======================================"read -p "Press any key to continue:" varmkdir /u01/app/grid/product/11.2.0/grid -pmkdir /u01/app/oracle/product/11.2.0/db_1 -pgroupadd dbauseradd -g dba griduseradd -g dba oracleecho "Set password for oracle:"passwd oracleecho "Set password for grid:"passwd gridchown -R grid:dba /u01/appchown -R oracle:dba /u01/app/oraclechmod -R 775 /u01echo "======================================"echo "Setting local ISOforyum source."echo "======================================"mount -t iso9660 /dev/sr0 /mediamkdir /etc/yum.repos.d/bakmv /etc/yum.repos.d/. /etc/yum.repos.d/bak/echo "======================================"echo "create yum configure file."echo "======================================"cat << EOF >/etc/yum.repos.d/OLE6.repo[base]name=Ole64baseurl=file:///mediagpgcheck=0gpgkey=file:///media/RPM-GPG-KEY-oracleenabled=1EOFyum clean allyum makecache#install packagesfor Oracle GRID 11204echo "======================================"echo "The next will be installed depend on the package."echo "======================================"read -p "Press enter to continue:" varyum install -y binutilscompat-libstdc++-33 compat-libcap1 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibccommonglibc-devel libaio libaio-devel-0.libgcclibstdc++ libstdc++-devel make numactl sysstat libXp unixODBCunixODBC-devel readline xorg-x11-apps#disabled firewall and selinuxecho "======================================"echo "To disable the firewall and Selinux"echo "======================================"service iptables stopchkconfig iptables offecho "SELINUX=disabled" > /etc/selinux/configecho "SELINUXTYPE=targeted" >> /etc/selinux/configsetenforce 0#create partition for disksecho "======================================"echo "The next will be create partition for /dev/sdc."echo "======================================"fdisk /dev/sdcecho "======================================"echo "The next will be create partition for /dev/sdd."echo "======================================"fdisk /dev/sddecho "======================================"echo "The next will be create partition for /dev/sde."echo "======================================"fdisk /dev/sdeecho "======================================"echo "The next will be create partition for /dev/sdf."echo "======================================"fdisk /dev/sdfecho "======================================"echo "The next will be create partition for /dev/sdg."echo "======================================"fdisk /dev/sdgecho "======================================"echo "The next will be create partition for /dev/sdh."echo "======================================"fdisk /dev/sdhecho "======================================"echo "The next will be create partition for /dev/sdi."echo "======================================"fdisk /dev/sdiecho "======================================"echo "The next will be create partition for /dev/sdj."echo "======================================"fdisk /dev/sdjecho "======================================"echo " create udev raw configuration file:"echo "======================================"cat << EOF >/etc/udev/rules.d/60-raw.rulesACTION=="add", KERNEL=="sdc1", RUN+="/bin/raw /dev/raw/raw1 %N"KERNEL=="raw1", OWNER="grid",GROUP="dba", MODE="0666"ACTION=="add", KERNEL=="sdd1", RUN+="/bin/raw /dev/raw/raw2 %N"KERNEL=="raw2", OWNER="grid",GROUP="dba", MODE="0666"ACTION=="add", KERNEL=="sde1", RUN+="/bin/raw /dev/raw/raw3 %N"KERNEL=="raw3", OWNER="grid",GROUP="dba", MODE="0666"ACTION=="add", KERNEL=="sdf1", RUN+="/bin/raw /dev/raw/raw4 %N"KERNEL=="raw4", OWNER="grid",GROUP="dba", MODE="0666"ACTION=="add", KERNEL=="sdg1", RUN+="/bin/raw /dev/raw/raw5 %N"KERNEL=="raw5", OWNER="grid",GROUP="dba", MODE="0666"ACTION=="add", KERNEL=="sdh1", RUN+="/bin/raw /dev/raw/raw6 %N"KERNEL=="raw6", OWNER="grid",GROUP="dba", MODE="0666"ACTION=="add", KERNEL=="sdi1", RUN+="/bin/raw /dev/raw/raw7 %N"KERNEL=="raw7", OWNER="grid",GROUP="dba", MODE="0666"ACTION=="add", KERNEL=="sdj1", RUN+="/bin/raw /dev/raw/raw8 %N"KERNEL=="raw8", OWNER="grid",GROUP="dba", MODE="0666"EOFecho "======================================"echo "start_udev"echo "======================================"start_udevecho "======================================"echo "Check the UDEV RAW equipment to create results"echo "======================================"raw -qa2、GRID用户执行下述脚本cat << EOF >>/home/grid/test.txtexport ORACLE_SID=+ASMexport ORACLE_BASE=/u01/app/gridexport ORACLE_HOME=/u01/app/grid/product/11.2.0/gridexport PATH=$PATH:$ORACLE_HOME/binaliassqlplus='rlwrap sqlplus'alias asmcmd='rlwrap asmcmd'EOFsource /home/grid/.bash_profileenv|grep ORA3、oracle用户执行下述脚本cat << EOF >>/home/oracle/.bash_profileexport ORACLE_SID=tech1export ORACLE_BASE=/u01/app/oracleexport ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1export PATH=$PATH:$ORACLE_HOME/binaliassqlplus='rlwrap sqlplus'aliasrman='rlwrap rman'EOFsource /home/oracle/.bash_profileenv|grep ORApartprobe 使能分区立即生效
ls /dev/raw/*1、创建组,用户2、创建目录,权限3、系统,防火墙,selinux4、准备ASM disk5、环境变量 添加grid 用户下, ASMCA 创建快速恢复区grid 用户下, crs_stat -t (6个在线,2个离线即OK)转载于:https://blog.51cto.com/3938853/2160296