标签:oracle安装 centos6 自动化安装脚本 linux vwware tools安装
步骤一、安装VMware Tools:全屏界面安装oracle更为方便。
①umount ? /media/CentOS 7 x86_64
②VMware——虚拟机选项——安装tools
③自动挂载
④进入 ?/media/VMware\ Tools/解压该目录下的压缩包放到指定目录下:
????tar ?zxvf ?vmwaretools-10.1.6-5214329.tar.gz ?-C ?/tmp/
⑤进入/tmp/目录,压缩包解压生成目录:vmware-tools-distrib/执行该目录下文件:
????./vmware-install.pl【安装,一直回车直到结束】
⑥安装好,重新启动:init ?3——init ?5
⑦Ctrl+Alt+enter进入全屏界面
步骤二、安装Oracle:
(1)将这两个包拷贝到虚拟机上:
????p13390677_112040_Linux-x86-64_1of7
????p13390677_112040_Linux-x86-64_2of7
(2)执行orainst_11g自动化安装脚本前的准备工作:
????①首先配置好yum源
vim?/etc/yum.repos.d/base.repo ????[base] ????name=Centos ????baseurl=http://172.17.0.1/centos/CentOS-6.9-x86_64/ ????gpgcheck=0 ????[epel] ????name=EPEL ????baseurl=http://172.17.0.1/fedora-epel/6/x86_64/ ????gpgcheck=0 ????enable=1
②解压两个压缩包:
????oracle安装包解压后生成的database目录放置到/root下。
????查看database目录下内容:
③保证网上的ip地址为静态,设置如下:
?#vim?ifcfg-eth0 ????DEVICE=eth0 ????ONBOOT=yes ????BOOTPROTO=static ????IPADDR=172.17.151.127?? ????PREFIX=16 ????DNS1=172.17.0.1?? ????#vim?ifcfg-eth1 ????DEVICE=eth1 ????TYPE=Ethernet ????ONBOOT=yes ????BOOTPROTO=none ????IPADDR=192.168.41.129 ????PREFIX=24 ????HWADDR=00:0C:29:EB:72:4C
?④主机名要可以解析:ip地址与主机名写入/etc/hosts。
?vim?/etc/hosts ????192.168.41.129??centos6.localdomain
?注意:这个脚本针对企业版6的11g安装,不适用于12g,或者是centos7
(3)执行脚本:./orainst_11g。
(4)脚本执行后,database目录内容复制到oracle目录下的strange目录下
【脚本有bug,没有全复制过来,所以手动将/root/database/下内容复制过来】
(5)切换oracle用户:
?????xhost??+ ????su?-?oracle
(6)进入database下,执行脚本runinsatll。开始进行oracle安装。
(7)安装过程需要注意的地方:
????①安装到check部分,
????????错误1:缺少软件包
????????????解决:下载pdksh-5.2.14-30.x86_64.rpm包到虚拟机
????????????????rpm -e ksh
????????????????rpm -ivh pdksh-5.2.14-30.x86_64.rpm
????????????????yum install ksh
????????错误2:内核参数不匹配
????? ? ??解决:?修改内核参数:vim /etc/sysctl.conf
????????????????kernel.shmmax = 1043634176
????????????????生效: sysctl -p
????②继续执行到该处,需要打开一个新的终端,在root用户下,执行两个脚本:
????? . /u01/app/oracle/11.2.0/db_1/root.sh
?????. /u01/app/oraInventory/orainstRoot.sh
?(8)安装成功。
步骤三、安装oracle数据库:
(1)切换到oracle用户下,执行dbca,开始安装oracle数据库,保证是图形化界面。
????xhost??+ ????su??-??oracle ????dbca
(2)运行到此步骤,执行以下命令,开启进程。
?????su?-?oracle ????lsnrctl?start ????netstat?-tulnpa?|grep?-w?1521
? ? ??
(3)安装过程大致选择步骤如下。
?(4)安装完成,登录如下所示,则安装成功。
附加:orainst_11g自动化安装脚本
#!/bin/bash PKG=" unixODBC unixODBC-devel binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel elfutils-libelf-devel-static gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers kernel-headers ksh libaio libaio-devel libgcc libgomp libstdc++ libstdc++-devel make numactl-devel sysstat " PACKINSTALL= for?PACKAGE?in?$PKG?;do ????rpm?-q?$PACKAGE?||?PACKINSTALL="$PACKINSTALL?$PACKAGE" done echo if?[?-z?"$PACKINSTALL"?];then ???true ??else ???echo?"The?followling?packages?will?be?install:?$PACKINSTALL?" ???read?-p?"Continue??(y/N):?"?answer ???case?$answer?in ????????([yY]|[Yy][Ee][Ss]) ?????????????echo?1 ?????????????yum?-y?install?$PACKINSTALL?;; ????????(*);; ???esac fi cat?/etc/group?|grep?oinstall?&>?/dev/null?||?/usr/sbin/groupadd?oinstall cat?/etc/group?|grep?dba?&>?/dev/null?||?/usr/sbin/groupadd?dba id?oracle?&>?/dev/null? if?[?$??=?0?];then ?groups?oracle?|?grep?dba?&>?/dev/null?||?/usr/sbin/usermod?-g?oinstall?-G?dba?oracle else ?/usr/sbin/useradd?-g?oinstall?-G?dba?oracle ?echo?oracle?|passwd?--stdin?oracle fi KELNUM=$(cat?/etc/sysctl.conf?|grep?-v?^#?|grep?-v?^$?|grep?-E?"fs.aio-max-nr|fs.file-max|kernel.shmall|kernel.shmmax|kernel.shmmni|kernel.sem|net.ipv4.ip_local_port_range|net.core.rmem_default|net.core.rmem_max|net.core.wmem_default|net.core.wmem_max"?|awk?‘{print?$1}‘?|sort?-u?|wc?-l?) if?[?$KELNUM?-lt?11?];then cat?>>?/etc/sysctl.conf?<<EOF fs.aio-max-nr?=?1048576 fs.file-max?=?6815744 kernel.shmall?=?2097152 kernel.shmmax?=?536870912 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 fi grep?oracle?/etc/security/limits.conf?&>?/dev/null? ??if?[?$??!=?0?];then cat?>>?/etc/security/limits.conf?<<?EOF oracle??????????????soft????nproc???2047 oracle??????????????hard????nproc???16384 oracle??????????????soft????nofile??1024 oracle??????????????hard????nofile??65536 oracle??????????????soft????stack???1024 EOF ?fi grep?pam_limits.so?/etc/pam.d/login?&>?/dev/null ??if?[?$??!=?0?];then cat?>>?/etc/pam.d/login?<<EOF session?required?pam_limits.so EOF ??fi [?-d?/u01/app?]?||?(?mkdir?-p?/u01/app/?;?chown?-R?oracle:oinstall?/u01/app/?;?chmod?-R?775?/u01/app?) grep?-i?oracle?~oracle/.bash_profile?&>?/dev/null ??if?[?$??!=?0?];then cat?>>?~oracle/.bash_profile?<<EOF export?ORACLE_BASE=/u01/app/oracle export?ORACLE_HOME=\$ORACLE_BASE/11.2.0/db_1 export?ORACLE_SID=orcl export?PATH=\$PATH:\$ORACLE_HOME/bin EOF ??fi xhost?+ [?-d?~oracle/database?]?||?mv?/root/database?~oracle? cd?~oracle;su?-?oracle?-c?‘database/runInstaller‘
标签:oracle安装 centos6 自动化安装脚本 linux vwware tools安装
原文地址:http://blog.51cto.com/13250262/2049176