Oracle学习笔记之第二节手动安装oracle所需的操作系统并配置环境

前端之家收集整理的这篇文章主要介绍了Oracle学习笔记之第二节手动安装oracle所需的操作系统并配置环境前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

推送OCP过程中,会一直停留在Running post-install scripts,实际背后进行的就是很复杂的安装过程。此节课程将具体介绍安装内容
并手动进行配置出与OCP一台一模一样的环境来。数据库名为rcat。

linux使用小技巧:
echo $HISTSIZE 查看当前能保存的最输入记录大数
HISTSIZE=1000 最大只允许设置1000条
histsize -c 删除linux命令历史记录
vim ~/.bash_histroy 历史命令存放在此文件

1、通过winscp软件把bcpserver中的/usr/sbin/botang-config-push.d/softwarefiles/Lrhel5/IMAGES/issue.iso下载到本地,版本为5.4的linux,也可自行下载linux系统,但必须为5版本
2、通过vmware软件安装虚拟机
#根据bcpserver中vim /var/ftp/pub/workstation.cfg自定义分区
part /boot --size 100
part swap --size 1024
part pv.O11grhel501 --size 44984
volgroup O11grhel5 pv.O11grhel501
logvol / --vgname=O11grhel5 --size=10900 --name=root
logvol /u01 --vgname=O11grhel5 --size=34000 --name=u01
part pv.O11grhel502 --size 2750
part pv.O11grhel503 --size 2750
part pv.O11grhel504 --size 2750
part pv.O11grhel505 --size 2750
part pv.O11grhel506 --size 6000
#以下是实验环境写死必须这么配置
IP必须手动配置192.168.0.90/24
主机名station90.example.com
#到了选包安装页面时候
software development要装
然后选择
customize now
自定义定制包,一些不必要程序可不装,比如自带Jdk
但Development中的legacy software development 要装
装完后重启,要注意防火墙和SELinux要关闭,然后在重启完成操作系统的安装

3、安装数据库环境与下载数据库11.2.0.3
cd /etc/yum.repos.d/
rm -rf *
vim /etc/yum.repo.d/base.repo
[base]
name=RHEL base
baseurl=ftp://192.168.0.254/pub/Server
gpgcheck=0
[VT]
name=RHEL VT
baseurl=ftp://192.168.0.254/pub/VT
gpgcheck=0
wq!
#安装一些基础包
yum -y install libaio
yum -y install libaio-devel
yum -y groupinstall "Development tools"
yum -y install unixODBC
yum -y install unixODBC-devel
yum -y install oracleasm\*
yum -y install openmotif22.i386
yum -y install pdksh.i386
yum -y install sysstat.i386
#创建oracle用户用户组,设置环境变量
groupadd oinstall
groupadd dba
groupadd oper
groupadd asmadmin
groupadd asmdba
groupadd asmoper
useradd -g oinstall -G dba,oper,asmadmin,asmdba,asmoper -d /home/oracle oracle
echo "oracle" | passwd --stdin oracle
su - oracle
echo "export ORACLE_BASE=/u01/app/oracle" >> /home/oracle/.bash_profile
echo 'export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1' >> /home/oracle/.bash_profile
echo "export ORACLE_SID=rcat" >> /home/oracle/.bash_profile
su - root
#安装compat包
mkdir -p /stage/OSPATCHS/rhel5/
wget -P /stage/OSPATCHS/rhel5/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OSPATCHS/rhel5/compat-db-4.2.52-5.1.i386.rpm
wget -P /stage/OSPATCHS/rhel5/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OSPATCHS/rhel5/compat-gcc-34-3.4.6-4.i386.rpm
wget -P /stage/OSPATCHS/rhel5/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OSPATCHS/rhel5/compat-gcc-34-c++-3.4.6-4.i386.rpm
wget -P /stage/OSPATCHS/rhel5/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OSPATCHS/rhel5/compat-gcc-34-g77-3.4.6-4.i386.rpm
wget -P /stage/OSPATCHS/rhel5/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OSPATCHS/rhel5/compat-glibc-2.3.4-2.26.i386.rpm
wget -P /stage/OSPATCHS/rhel5/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OSPATCHS/rhel5/compat-glibc-headers-2.3.4-2.26.i386.rpm
wget -P /stage/OSPATCHS/rhel5/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OSPATCHS/rhel5/compat-libf2c-34-3.4.6-4.i386.rpm
wget -P /stage/OSPATCHS/rhel5/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OSPATCHS/rhel5/compat-libgcc-296-2.96-138.i386.rpm
wget -P /stage/OSPATCHS/rhel5/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OSPATCHS/rhel5/compat-libstdc++-296-2.96-138.i386.rpm
wget -P /stage/OSPATCHS/rhel5/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OSPATCHS/rhel5/compat-libstdc++-33-3.2.3-61.i386.rpm
rpm -ivh --force --nodeps /stage/OSPATCHS/rhel5/*.rpm
mkdir -p /stage/OSPATCHS/all/
wget -P /stage/OSPATCHS/all/ -c --tries=100 --wait=5 http://192.168.0.254/pub/O11g/OSPATCHS/all/flashplayer-11.2.202.297-1.ram0.98.i686.rpm
rpm -ivh --force --nodeps /stage/OSPATCHS/all/*.rpm
#必须把版本改成4才安装oracle软件时候才不会报错,12C以上必须配置5
echo "Red Hat Enterprise Linux Server release 4 (Tikanga)" > /etc/redhat-release
#oracle官方推荐调优参数
echo "fs.file-max = 6815744" >> /etc/sysctl.conf
echo "kernel.sem = 250 32000 100 128" >> /etc/sysctl.conf
echo "kernel.shmall = 2097152" >> /etc/sysctl.conf
echo "kernel.shmmni = 4096" >> /etc/sysctl.conf
echo "net.core.rmem_default=4194304" >> /etc/sysctl.conf
echo "net.core.rmem_max=4194304" >> /etc/sysctl.conf
echo "net.core.wmem_default=1048576" >> /etc/sysctl.conf
echo "net.core.wmem_max=1048576" >> /etc/sysctl.conf
echo "net.ipv4.ip_local_port_range = 9000 65500" >> /etc/sysctl.conf
echo "fs.aio-max-nr = 1048576" >> /etc/sysctl.conf
echo "session required /lib/security/pam_limits.so" >>/etc/pam.d/login
echo "oracle soft nproc 2047" >>/etc/security/limits.conf
echo "oracle hard nproc 16384" >>/etc/security/limits.conf
echo "oracle soft nofile 1024" >>/etc/security/limits.conf
echo "oracle hard nofile 65536" >>/etc/security/limits.conf
echo 'if [ $USER = "oracle" ]; then' >> /etc/profile
echo ' if [ $SHELL = "/bin/ksh" ]; then' >> /etc/profile
echo ' ulimit -p 16384' >> /etc/profile
echo ' ulimit -n 65536' >> /etc/profile
echo ' else' >> /etc/profile
echo ' ulimit -u 16384 -n 65536' >> /etc/profile
echo ' fi' >> /etc/profile
echo 'fi' >> /etc/profile
wget -P /stage/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/ASMLIB/oracleasmlib-2.0.4-1.el5.i386.rpm
rpm -ivh /stage/oracleasmlib-2.0.4-1.el5.i386.rpm
#下载数据库软件
wget -P /stage/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/DATABASES/linux_11gR2_database_1of2.zip
wget -P /stage/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/DATABASES/linux_11gR2_database_2of2.zip
wget -P /stage/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/DATABASES/linux_11gR2_grid.zip
wget -P /stage/ -c --tries=1000 --wait=5 ftp://192.168.0.254/pub/O11g/CLIENT/V17488-01.zip
cd /stage/
unzip linux_11gR2_database_1of2.zip
rm -rf linux_11gR2_database_1of2.zip
unzip linux_11gR2_database_2of2.zip
mkdir -p /u01/loop/device
chown -R oracle:oinstall /u01/loop
rm -rf linux_11gR2_database_2of2.zip
unzip linux_11gR2_grid.zip
#创建几个磁盘组,以回环设备的形式创建。
dd if=/dev/zero of=/u01/loop/device/loop0.img bs=1M count=2750
dd if=/dev/zero of=/u01/loop/device/loop1.img bs=1M count=2750
dd if=/dev/zero of=/u01/loop/device/loop2.img bs=1M count=512
dd if=/dev/zero of=/u01/loop/device/loop3.img bs=1M count=512
dd if=/dev/zero of=/u01/loop/device/loop4.img bs=1M count=512
echo "losetup /dev/loop0 /u01/loop/device/loop0.img" >>/etc/rc.d/rc.local
echo "losetup /dev/loop1 /u01/loop/device/loop1.img" >>/etc/rc.d/rc.local
echo "losetup /dev/loop2 /u01/loop/device/loop2.img" >>/etc/rc.d/rc.local
echo "losetup /dev/loop3 /u01/loop/device/loop3.img" >>/etc/rc.d/rc.local
echo "losetup /dev/loop4 /u01/loop/device/loop4.img" >>/etc/rc.d/rc.local
rm -rf linux_11gR2_grid.zip
#以下是安装sql使能上下键,生产环境绝对不允许安装。

wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OTHERS/alllinux/sqlplus_extentsetup3.0.tgz

tar -C /stage -zxvf /stage/sqlplus_extentsetup3.0.tgz

rm -f /stage/sqlplus_extentsetup3.0.tgz

cd /stage/sqlplus_extentsetup3.0/

./setup.sh

wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/OTHERS/alllinux/service_oraclesetup2.0.tgz
tar -C /stage -zxvf /stage/service_oraclesetup2.0.tgz
rm -f /stage/service_oraclesetup2.0.tgz
cd /stage/service_oraclesetup2.0/
./setup.sh
#安装虚拟机磁带库,可模拟真实磁带库使用。
yum -y install zlib-devel
yum -y install mtx
yum -y install mt-st
yum -y install lsscsi
yum -y install sg3_utils
yum -y install ncompress
wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/mhvtl.tgz
wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/osb-10.3.0.3.0_linux32.zip
wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/osb.txt
wget -P /lib -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/ld-2.5.so
wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/osb.sh
wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/reuseosb.sh
wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/lzo-2.02-2.el5.1.i386.rpm
rpm -ivh /stage/lzo-2.02-2.el5.1.i386.rpm
wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/lzo-devel-2.02-2.el5.1.i386.rpm
rpm -ivh /stage/lzo-devel-2.02-2.el5.1.i386.rpm
wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/copytape-root.sh
wget -P /stage -c --tries=100 --wait=5 http://192.168.0.254/pub/O10g/TAPE/revertape-root.sh
lsscsi -g
cd /stage/
tar zxvf mhvtl.tgz
useradd vtl
echo oracle | passwd --stdin vtl
mkdir /opt/mhvtl
mkdir /etc/mhvtl
chown -R vtl:vtl /opt/mhvtl
chown -R vtl:vtl /etc/mhvtl
make distclean
cd /stage/mhvtl-1.2/kernel
ll -al /opt/mhvtl/
cd /stage/mhvtl-1.2/kernel
make
make install
cd /stage/mhvtl-1.2/
make
make install
service mhvtl start
perl -i -pe 's,CAPACITY=500,CAPACITY=8000,' /etc/mhvtl/mhvtl.conf
chkconfig mhvtl on
service mhvtl stop
service mhvtl start
lsscsi -g
mkdir -p /usr/local/oracle/backup
sed -i.bak 's/192.168.0.254/127.0.0.1/g' /etc/resolv.conf





附上磁带库装完后的样子给大家看哈,可以看出mediumx STK有两个,为控制磁带的机械臂,模拟的很真实。


[root@station90 ~]# lsscsi -g

[0:0:0:0] disk VMware,VMware Virtual S 1.0 /dev/sda /dev/sg0

[1:0:0:0] mediumx STK L700 0102 - /dev/sg9

[1:0:1:0] tape IBM ULT3580-TD5 0102 /dev/st0 /dev/sg1

[1:0:2:0] tape IBM ULT3580-TD5 0102 /dev/st1 /dev/sg2

[1:0:3:0] tape IBM ULT3580-TD4 0102 /dev/st2 /dev/sg3

[1:0:4:0] tape IBM ULT3580-TD4 0102 /dev/st3 /dev/sg4

[1:0:8:0] mediumx STK L80 0102 - /dev/sg10

[1:0:9:0] tape STK T10000B 0102 /dev/st4 /dev/sg5

[1:0:10:0] tape STK T10000B 0102 /dev/st5 /dev/sg6

[1:0:11:0] tape STK T10000B 0102 /dev/st6 /dev/sg7

[1:0:12:0] tape STK T10000B 0102 /dev/st7 /dev/sg8

原文链接:https://www.f2er.com/oracle/212929.html

猜你在找的Oracle相关文章