时间:2021-07-01 10:21:17 帮助过:32人阅读
一、安装前的准备二、安装网格基础架构三、安装数据库软件四、创建监听五、创建数据库实例一、安装前的准备1.1确定操作系统环境#cat/etc/redhat-releaseRedHatEn
一、安装前的准备
1.1 确定操作系统环境
# cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.2 (Santiago) # uname -a Linux ora11g.vnimos.org 2.6.32-220.el6.x86_64 #1 SMP Wed Nov 9 08:03:13 EST 2011 x86_64 x86_64 x86_64 GNU/Linux # free -m total used free shared buffers cached Mem: 2008 1309 699 0 62 875 -/+ buffers/cache: 371 1637 Swap: 509 0 509 # fdisk -l Disk /dev/sda: 32.2 GB, 32212254720 bytes 255 heads, 63 sectors/track, 3916 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 5 40131 83 Linux /dev/sda2 6 2172 17406427+ 8e Linux LVM /dev/sda3 2173 2237 522112+ 82 Linux swap / Solaris /dev/sda4 2238 3916 13486567+ 5 Extended /dev/sda5 2238 2542 2449881 83 Linux /dev/sda6 2543 2847 2449881 83 Linux /dev/sda7 2848 3152 2449881 83 Linux /dev/sda8 3153 3457 2449881 83 Linux /dev/sda9 3458 3765 3077120 83 Linux # df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/Vol0-root 7.6G 3.2G 4.1G 41% / /dev/mapper/Vol0-oracle 8.6G 101M 747M 1% /u01 /dev/sda1 38M 16M 21M 42% /boot tmpfs 1005M 0 1005M 0% /dev/shm
1.2 网络参数的配置
# cat /etc/sysconfig/network NETWORKING=yes NETWORKING_IPV6=no HOSTNAME=ora11g.vnimos.org # service NetworkManager stop # chkconfig NetworkManager off # cat /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 BOOTPROTO=static HWADDR=00:0C:29:32:C3:9C IPADDR=192.168.0.90 NETMASK=255.255.255.0 ONBOOT=yes # cat /etc/hosts 127.0.0.1 localhost.localdomain localhost 192.168.0.90 ora11g.vnimos.org ora11g //必须至少包含以上两行、三列(IP 长名 短名),否则安装的时候将会出现”Oracle Net Configuration Assistant failed”的错误
1.3 oracle用户环境变量、系统参数的配置
# groupadd oinstall # groupadd dba # useradd -g oinstall -G dba,root oracle # echo "oracle" | passwd --stdin oracle # mkdir -p /u01/app/{oracle,oraInventory} # chown oracle:oinstall /u01/app/oracle # chown oracle:oinstall /u01/app/oraInventory # vi /home/oracle/.bash_profile export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1 export ORACLE_SID=orcl export LD_LIBRARY_PATH=$ORACLE_HOME/lib export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib:/usr/X11R6/lib export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/rdbms/lib export CLASS_PATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib export CLASS_PATH=$CLASS_PATH:$ORACLE_HOME/rdbms/jlib export CLASS_PATH=$CLASS_PATH:$ORACLE_HOME/network/jlib export TNS_ADMIN=$ORACLE_HOME/network/admin export NLS_LANG=american_america.AL32UTF8 export ORACLE_TERM=xterm export EDITOR=vi export PATH=$ORACLE_HOME/bin:$PATH export LANG=en_US # vi /etc/sysctl.conf kernel.shmmax = 1073741824 //物理内存的一半(字节) # sysctl -p
1.4 绑定裸设备(用于创建ASM磁盘组,美国服务器,更详细的内容请参考:)
# fdisk -l Disk /dev/sda: 32.2 GB, 32212254720 bytes 255 heads, 63 sectors/track, 3916 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 5 40131 83 Linux /dev/sda2 6 2172 17406427+ 8e Linux LVM /dev/sda3 2173 2237 522112+ 82 Linux swap / Solaris /dev/sda4 2238 3916 13486567+ 5 Extended /dev/sda5 2238 2542 2449881 83 Linux /dev/sda6 2543 2847 2449881 83 Linux /dev/sda7 2848 3152 2449881 83 Linux /dev/sda8 3153 3457 2449881 83 Linux /dev/sda9 3458 3916 3686886 83 Linux # vi /etc/sysconfig/rawdevices /dev/raw/raw5 /dev/sda5 /dev/raw/raw6 /dev/sda6 /dev/raw/raw7 /dev/sda7 /dev/raw/raw8 /dev/sda8 /dev/raw/raw9 /dev/sda9 # chmod +x /etc/rc.d/init.d/rawdevices # chkconfig --add rawdevices # chkconfig rawdevices on # service rawdevices start Assigning devices: /dev/raw/raw5 --> /dev/sda5 /dev/raw/raw5: bound to major 8, minor 5 /dev/raw/raw6 --> /dev/sda6 /dev/raw/raw6: bound to major 8, minor 6 /dev/raw/raw7 --> /dev/sda7 /dev/raw/raw7: bound to major 8, minor 7 /dev/raw/raw8 --> /dev/sda8 /dev/raw/raw8: bound to major 8, minor 8 /dev/raw/raw9 --> /dev/sda9 /dev/raw/raw9: bound to major 8, minor 9 done # raw -qa /dev/raw/raw5: bound to major 8, minor 5 /dev/raw/raw6: bound to major 8, minor 6 /dev/raw/raw7: bound to major 8, minor 7 /dev/raw/raw8: bound to major 8, minor 8 /dev/raw/raw9: bound to major 8, minor 9
# rpm -ivh pdksh-5.2.14-37.el5.x86_64.rpm //RHEL6光盘默认没有该软件包,可直接安装RHEL5的rpm软件包 # yum -y install binutils compat-libstdc++ elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel "compat*" //以上的软件必须包含32位的软件包,美国服务器,否则如果缺少,可能在安装大约到65%,开始编译的时候出现"Error in invoking target 'all_no_orcl' of makefile"的错误 # unzip -d /stage/ linux.x64_11gR2_grid.zip # chown -R oracle.oinstall /stage/grid # xhost + access control disabled, clients can connect from any host # su - oracle $ cd /stage/grid/ $ ./runInstaller2.2 创建FRA磁盘组(Fast Recovery Area)
$ . oraenv ORACLE_SID = [orcl] ? +ASM The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/grid is /u01/app/oracle $ env | grep SID ORACLE_SID=+ASM $ asmca
2.3 安装后的检查、配置