ORACLE 10g RAC安装


美河学习在线 www.eimhe.com 1 10grac 安装 ----------by phoenix 一、安装前准备 1.1.系统预览 服务器 RAC1 RAC2 Public 192.168.1.31 192.168.1.32 Private 10.0.0.10 10.0.0.11 Vip 192.168.1.33 192.168.1.34 Getway 192.168.1.1 192.168.1.1 ocr(集群注册表) /dev/sda1 voting(仲裁盘) /dev/sdb1 ASM 盘 /dev/sdc1,/dev/sdd1 1.2.系统配置 1.2.1.配置系统参数 [root@db1 ~]# chkconfig sendmail off [root@db1 ~]# chkconfig cups off [root@db1 ~]# chkconfig smartd off [root@db1 ~]# chkconfig iptables off [root@db1 ~]# vi /etc/hosts --2 个节点都要添加 #######public######## 192.168.1.31 db1 192.168.1.32 db2 ####### vip ######## 192.168.1.33 db1-vip 192.168.1.34 db2-vip #######private######## 10.0.0.10 db1-priv 10.0.0.11 db2-priv 美河学习在线 www.eimhe.com 2 [root@db1 etc]# vi sysctl.conf kernel.shmall = 2097152 kernel.shmmax = 2147483648 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 fs.file-max = 65536 net.ipv4.ip_local_port_range = 1024 65000 net.core.rmem_default = 262144 net.core.rmem_max = 262144 net.core.wmem_default = 262144 net.core.wmem_max = 262144 [root@db1 etc]# vi /etc/security/limits.conf oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 oracle soft memlock 5242880 oracle hard memlock 524280 [root@db1 etc]# vi /etc/pam.d/login session required /lib/security/pam_limits.so [root@db1 /]#vi /etc/profile if [ $USER = "oracle" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi fi [root@db1 /]# vi /etc/csh.login if ( $USER == "oracle" ) then limit maxproc 16384 limit descriptors 65536 endif 美河学习在线 www.eimhe.com 3 1.2.2.配置用户和坏境变量 --2 个节点都要执行以下命令 [root@db1 /]# groupadd oinstall [root@db1 /]# groupadd dba [root@db1 /]# groupadd oper [root@db1 /]# useradd -g oinstall -G dba,oper oracle [root@db1 /]# passwd oracle [root@db1 /]su - oracle [root@db1 /]vi .bash_profile umask 022 export ORACLE_BASE=/oracle export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1 export CRS_HOME=$ORACLE_BASE/product/10.2.0/crs_1 export ORA_CRS_HOME=$CRS_HOME export ORACLE_SID=orcl1 export PATH=$ORA_CRS_HOME/bin:$ORACLE_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X1 1R6/bin export ORACLE_TERM=xterm export TNS_ADMIN=$ORACLE_HOME/network/admin export ORA_NLS10=$ORACLE_HOME/nls/data export LD_LIBRARY_PATH=$ORACLE_HOME/lib export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib export CLASSPATH=$ORACLE_HOME/JRE export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib export THREADS_FLAG=native export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK --节点 2 [root@db2 /]su - oracle [root@db2 /]vi .bash_profile umask 022 export ORACLE_BASE=/oracle 美河学习在线 www.eimhe.com 4 export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1 export CRS_HOME=$ORACLE_BASE/product/10.2.0/crs_1 export ORA_CRS_HOME=$CRS_HOME export ORACLE_SID=orcl2 export PATH=$ORA_CRS_HOME/bin:$ORACLE_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X1 1R6/bin export ORACLE_TERM=xterm export TNS_ADMIN=$ORACLE_HOME/network/admin export ORA_NLS10=$ORACLE_HOME/nls/data export LD_LIBRARY_PATH=$ORACLE_HOME/lib export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib export CLASSPATH=$ORACLE_HOME/JRE export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib export THREADS_FLAG=native export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK 1.2.3.配置 rpm 包 --2 个节点都要检查 [root@db1/]rpm -q binutils compat-db compat-libstdc++-296 control-center gcc gcc-c++ glibc glibc-common libstdc++ libstdc++-devel make sysstat setarch glibc-devel libaio ksh glibc-headers libgnome libgcc libgnomeui libgomp openmotif libXp --queryformat "%{N}-%{VERSION}.%{RELEASE} (%{ARCH})\n" --配置本地 YUM 源: [root@db1/]cd /etc/yum.repos.d [root@db1 yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.bak [root@db1 yum.repos.d]# vi CentOS-Media.repo [c5-media] name=CentOS-$releasever - Media baseurl=file:///media/CentOS_5.4_Final gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 --安装 rpm 包 [root@db1 yum.repos.d]# yum -y install compat-db [root@db1 yum.repos.d]# yum -y install openmotif 美河学习在线 www.eimhe.com 5 1.2.4.配置 hangcheck-timer 模块 2 个节点都要执行 Hangcheck-timer 是Linux 提供的一个内核级的IO-Fencing 模块, 这个模块会监控Linux 内 核运行状态, 如果长时间挂起, 这个模块会自动重启系统。这个模块在 Linux 内核空间运 行, 不会受系统负载的影响。 这个模块会使用 CPU 的 Time Stamp Counter(TSC) 寄存器, 这个寄存器的值会在每个时钟周期自动增加, 因此使用的是硬件时间,所以精度更高。 配置这个模块需要 2 个参数: hangcheck_tick 和 hangcheck_margin。 hangcheck_tick 用于定义多长时间检查一次,缺省值是 30 秒。 有可能内核本身很忙, 导致 这个检查被推迟, 该模块还允许定义一个延迟上限,就是 hangcheck_margin, 它的缺省值 是 180 秒。 Hangcheck-timer 模块会根据 hangcheck_tick 的设置,定时检查内核。只要 2 次检查的时 间间隔小于 hangcheck_tick + hangchec_margin, 都会认为内核运行正常,否则就意味着运行 异常,这个模块会自动重启系统。 CRS 本身还有一个 MissCount 参数,可以通过 crsctl get css miscount 命令查看。 当 RAC 结点间的心跳信息丢失时, Clusterware 必须确保在进行重构时,故障结点确实是 Dead 状态,否则结点仅是临时负载过高导致心跳丢失,然后其他结点开始重构,但是结点 没有重启,这样会损坏数据库。 因此 MissCount 必须大于 hangcheck_tick+hangcheck_margin 的和。 1) 查看模块位置 [root@db1 pam.d]# find /lib/modules -name "hangcheck-timer.ko" /lib/modules/2.6.18-164.el5/kernel/drivers/char/hangcheck-timer.ko 2) 配置系统启动时自动加载模块,在/etc/rc.d/rc.local 中添加如下内容 [root@db1 pam.d]# modprobe hangcheck-timer [root@db1 pam.d]# vi /etc/rc.d/rc.local modprobe hangcheck-timer 3) 配置 hangcheck-timer 参数, 在/etc/modprobe.conf 中添加如下内容: [root@db1 pam.d]# vi /etc/modprobe.conf options hangcheck-timer hangcheck_tick=30 hangcheck_margin=180 4) 确认模块加载成功: [root@db1 pam.d]# grep Hangcheck /var/log/messages | tail -2 Feb 12 00:59:00 db1 kernel: Hangcheck: starting hangcheck timer 0.9.0 (tick is 180 seconds, margin is 60 seconds). Feb 12 00:59:00 db1 kernel: Hangcheck: Using monotonic_clock(). 美河学习在线 www.eimhe.com 6 1.2.5.配置 ntp 服务 --1 节点上执行: [root@db1 yum.repos.d]# service ntpd status ntpd is stopped [root@db1 /]vi /etc/ntp.conf --取消掉下面的注释 # Hosts on local network are less restricted. restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap [root@db1 etc]# vi /etc/sysconfig/ntpd SYNC_HWCLOCK=yes [root@db1 etc]# service ntpd restart Starting ntpd: [ OK ] [root@db1 etc]# service ntpd status ntpd (pid 2884) is running... --节点 2 上执行: [root@db2 ~]# vi /etc/ntp.conf --加入以下行 # Use public servers from the pool.ntp.org project. # Please consider joining the pool (http://www.pool.ntp.org/join.html). server 192.168.1.31 prefer [root@db2 ~]# ntpdate 192.168.1.31 12 Feb 10:06:53 ntpdate[3875]: adjust time server 192.168.1.31 offset 0.001672 sec [root@db2 ~]# crontab -e * * * * * /usr/sbin/ntpdate 192.168.1.31 >>/opt/ntp/ntp.log --节点 1 执行以下命令 [root@db1 raw]# chkconfig ntpd on [root@db1 raw]# chkconfig --list ntpd ntpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off 美河学习在线 www.eimhe.com 7 1.2.6.配置共享磁盘 --查看共享磁盘 [root@db1 etc]# fdisk -l --分区 [root@db1 etc]# fdisk /dev/sda Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-512, default 1): --默认 Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-512, default 512): --默认 Using default value 512 Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. [root@db1 etc]# fdisk -l --节点 2 查看分区情况 [root@db2 ~]# fdisk -l Disk /dev/hda: 42.9 GB, 42949672960 bytes 255 heads, 63 sectors/track, 5221 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/hda1 * 1 13 104391 83 Linux /dev/hda2 14 5221 41833260 8e Linux LVM Disk /dev/sda: 537 MB, 537290240 bytes 64 heads, 32 sectors/track, 512 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Device Boot Start End Blocks Id System /dev/sda1 1 512 524272 83 Linux 美河学习在线 www.eimhe.com 8 Disk /dev/sdb: 536 MB, 536870912 bytes 64 heads, 32 sectors/track, 512 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Device Boot Start End Blocks Id System /dev/sdb1 1 512 524272 83 Linux Disk /dev/sdc: 8589 MB, 8589934592 bytes 255 heads, 63 sectors/track, 1044 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdc1 1 1044 8385898+ 83 Linux Disk /dev/sdd: 8589 MB, 8589934592 bytes 255 heads, 63 sectors/track, 1044 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdd1 1 1044 8385898+ 83 Linux 1.2.7.配置裸设备 --2 个节点都要配置 [root@db1 rules.d]#vi /etc/udev/rules.d/60-raw.rules ACTION=="add", KERNEL=="sda1", RUN+="/bin/raw /dev/raw/raw1 %N" ACTION=="add", KERNEL=="sdb1", RUN+="/bin/raw /dev/raw/raw2 %N" ACTION=="add", KERNEL=="sdc1", RUN+="/bin/raw /dev/raw/raw3 %N" ACTION=="add", KERNEL=="sdd1", RUN+="/bin/raw /dev/raw/raw4 %N" ACTION=="add", KERNEL=="raw[1-4]",OWNER="oracle", GROUP="oinstall", MODE="660" [root@db2 rules.d]#vi /etc/udev/rules.d/60-raw.rules ACTION=="add", KERNEL=="sda1", RUN+="/bin/raw /dev/raw/raw1 %N" ACTION=="add", KERNEL=="sdb1", RUN+="/bin/raw /dev/raw/raw2 %N" ACTION=="add", KERNEL=="sdc1", RUN+="/bin/raw /dev/raw/raw3 %N" ACTION=="add", KERNEL=="sdd1", RUN+="/bin/raw /dev/raw/raw4 %N" ACTION=="add", KERNEL=="raw[1-4]",OWNER="oracle", GROUP="oinstall", MODE="660" [root@db1 rules.d]# start_udev Starting udev: [ OK ] 美河学习在线 www.eimhe.com 9 [root@db2 rules.d]# start_udev Starting udev: [ OK ] [root@db1 rules.d]# ls -lrt /dev/raw total 0 crw-rw---- 1 oracle oinstall 162, 4 Feb 12 10:52 raw4 crw-rw---- 1 oracle oinstall 162, 3 Feb 12 10:52 raw3 crw-rw---- 1 oracle oinstall 162, 2 Feb 12 10:52 raw2 crw-rw---- 1 oracle oinstall 162, 1 Feb 12 10:52 raw1 [root@db2 rules.d]# ls -l /dev/raw total 0 crw-rw---- 1 oracle oinstall 162, 1 Feb 12 11:14 raw1 crw-rw---- 1 oracle oinstall 162, 2 Feb 12 11:14 raw2 crw-rw---- 1 oracle oinstall 162, 3 Feb 12 11:14 raw3 crw-rw---- 1 oracle oinstall 162, 4 Feb 12 11:14 raw4 1.2.8.配置 ssh --节点 1: [root@db1 ~]# su - oracle [oracle@db1 ~]$ mkdir ~/.ssh [oracle@db1 ~]$ chmod 700 ~/.ssh [oracle@db1 ~]$ ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/oracle/.ssh/id_rsa): --回车 Enter passphrase (empty for no passphrase): --回车 Enter same passphrase again: --回车 Your identification has been saved in /home/oracle/.ssh/id_rsa. Your public key has been saved in /home/oracle/.ssh/id_rsa.pub. The key fingerprint is: c7:66:11:28:e2:67:66:16:4f:5f:1b:aa:df:7d:35:9b oracle@db1.com.cn [oracle@db1 ~]$ ssh-keygen -t dsa Generating public/private dsa key pair. Enter file in which to save the key (/home/oracle/.ssh/id_dsa): --回车 Enter passphrase (empty for no passphrase): --回车 Enter same passphrase again: --回车 Your identification has been saved in /home/oracle/.ssh/id_dsa. Your public key has been saved in /home/oracle/.ssh/id_dsa.pub. The key fingerprint is: d9:aa:92:37:e7:6a:e1:07:94:0c:77:9d:c2:ee:39:6e oracle@db1.com.cn 美河学习在线 www.eimhe.com 10 --节点 2 [oracle@db2 ~]$ mkdir ~/.ssh [oracle@db2 ~]$ chmod 700 ~/.ssh [oracle@db2 ~]$ ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/oracle/.ssh/id_rsa): --回车 Enter passphrase (empty for no passphrase): --回车 Enter same passphrase again: --回车 Your identification has been saved in /home/oracle/.ssh/id_rsa. Your public key has been saved in /home/oracle/.ssh/id_rsa.pub. The key fingerprint is: ba:82:c3:18:d1:50:75:f1:04:4f:37:ea:90:6f:ea:c2 oracle@db2.com.cn [oracle@db2 ~]$ ssh-keygen -t dsa Generating public/private dsa key pair. Enter file in which to save the key (/home/oracle/.ssh/id_dsa): --回车 Enter passphrase (empty for no passphrase): --回车 Enter same passphrase again: --回车 Your identification has been saved in /home/oracle/.ssh/id_dsa. Your public key has been saved in /home/oracle/.ssh/id_dsa.pub. The key fingerprint is: 7f:fe:a2:fc:9b:ce:09:d5:72:41:f8:5d:f9:87:c0:2a oracle@db2.com.cn --节点 1 [oracle@db1 ~]$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys [oracle@db1 ~]$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys [oracle@db1 ~]$ scp ~/.ssh/authorized_keys db2.com.cn:~/.ssh/authorized_keys The authenticity of host 'db2.com.cn (192.168.1.32)' can't be established. RSA key fingerprint is 13:d7:e2:48:fd:c9:3a:91:50:d3:35:e8:e4:b2:18:a6. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'db2.com.cn,192.168.1.32' (RSA) to the list of known hosts. oracle@db2.com.cn's password: --输入 oracle 用户密码 oracle@db2.com.cn's password: authorized_keys 100% 1006 1.0KB/s 00:00 --节点 2: [oracle@db2 ~]$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys [oracle@db2 ~]$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys [oracle@db2 ~]$ scp ~/.ssh/authorized_keys db1.com.cn:~/.ssh/authorized_keys The authenticity of host 'db1.com.cn (192.168.1.31)' can't be established. RSA key fingerprint is 13:d7:e2:48:fd:c9:3a:91:50:d3:35:e8:e4:b2:18:a6. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'db1.com.cn,192.168.1.31' (RSA) to the list of known hosts. oracle@db1.com.cn's password: 美河学习在线 www.eimhe.com 11 authorized_keys 100% 2012 2.0KB/s 00:00 --节点 1 测试 ssh 是否建立成功 [oracle@db1 ~]$ ssh db1.com.cn date Wed Feb 12 13:22:14 CST 2014 [oracle@db1 ~]$ ssh db2.com.cn date Wed Feb 12 13:22:17 CST 2014 --节点 2 测试 ssh 是否建立成功 [oracle@db2 ~]$ ssh db2.com.cn date Wed Feb 12 13:23:10 CST 2014 [oracle@db2 ~]$ ssh db1.com.cn date Wed Feb 12 13:23:14 CST 2014 以上表示 ssh 建立成功 1.2.9.配置安装目录 --节点 1: [root@db1 ~]# mkdir -p /oracle [root@db1 ~]# chown -R oracle:oinstall /oracle [root@db1 ~]# chmod -R 775 /oracle --节点 2: [root@db2 ~]# mkdir -p /oracle [root@db2 ~]# mkdir -p /oracle [root@db2 ~]# chown -R oracle:oinstall /oracle [root@db2 ~]# chmod -R 775 /oracle 1.2.10.上传解压软件 [oracle@db1 oracle]$ ls 10201_clusterware_linux_x86_64.cpio.gz 10201_database_linux_x86_64.cpio.gz [oracle@db1 oracle]$ gunzip 10201_clusterware_linux_x86_64.cpio.gz [oracle@db1 oracle]$cpio -idmv < 10201_clusterware_linux_x86_64.cpio 1.2.11.配置 vnc [oracle@db1 ~]$ vncserver 美河学习在线 www.eimhe.com 12 You will require a password to access your desktops. Password: Verify: xauth: creating new authority file /home/oracle/.Xauthority New 'db1.com.cn:1 (oracle)' desktop is db1.com.cn:1 Creating default startup script /home/oracle/.vnc/xstartup --记住该路径 Starting applications specified in /home/oracle/.vnc/xstartup Log file is /home/oracle/.vnc/db1.com.cn:1.log [oracle@db1 ~]$ vi /home/oracle/.vnc/xstartup --修改如下 #!/bin/sh # Uncomment the following two lines for normal desktop: # unset SESSION_MANAGER # exec /etc/X11/xinit/xinitrc [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot -solid grey vncconfig -iconic & #xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & #twm & gnome-session & ~ [oracle@db1 ~]$ ps -ef|grep vnc oracle 9743 1 0 13:44 pts/1 00:00:00 Xvnc :1 -desktop db1.com.cn:1 (oracle) -httpd /usr/share/vnc/classes -auth /home/oracle/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 30000 -rfbauth /home/oracle/.vnc/passwd -rfbport 5901 -pn oracle 9750 1 0 13:44 pts/1 00:00:00 vncconfig -iconic oracle 9816 9706 0 13:47 pts/1 00:00:00 grep vnc [oracle@db1 ~]$ kill -9 9743 [oracle@db1 ~]$ vncserver Warning: db1.com.cn:1 is taken because of /tmp/.X1-lock Remove this file if there is no X server db1.com.cn:1 New 'db1.com.cn:2 (oracle)' desktop is db1.com.cn:2 Starting applications specified in /home/oracle/.vnc/xstartup 美河学习在线 www.eimhe.com 13 Log file is /home/oracle/.vnc/db1.com.cn:2.log [oracle@db1 ~]$ ps -ef|grep vnc oracle 9828 1 1 13:47 pts/1 00:00:00 Xvnc :2 -desktop db1.com.cn:2 (oracle) -httpd /usr/share/vnc/classes -auth /home/oracle/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 30000 -rfbauth /home/oracle/.vnc/passwd -rfbport 5902 -pn 美河学习在线 www.eimhe.com 14 二、软件安装配置 2.1.安装 cluster 2.1.1.软件安装 [root@db1 ~]# cd /oracle/clusterware/rpm/ [root@db1 rpm]# ls cvuqdisk-1.0.1-1.rpm [root@db1 rpm]# rpm -ivh cvuqdisk-1.0.1-1.rpm Preparing... ########################################### [100%] 1:cvuqdisk ########################################### [100%] [root@db1 rpm]# scp cvuqdisk-1.0.1-1.rpm db2.com.cn:/oracle root@db2.com.cn's password: cvuqdisk-1.0.1-1.rpm 100% 5339 5.2KB/s 00:00 节点 2: [root@db2 oracle]# rpm -ivh cvuqdisk-1.0.1-1.rpm 美河学习在线 www.eimhe.com 15 Preparing... ########################################### [100%] 1:cvuqdisk ########################################### [100%] 回车,出现 oracle 安装界面 美河学习在线 www.eimhe.com 16 图 2 点击“Next”,进入 美河学习在线 www.eimhe.com 17 图 3 保持默认不做修改,点击“Next” 美河学习在线 www.eimhe.com 18 图 4 保持默认不做修改,点击“Next” 图 5 所有选项均通过以后,点击“Next”,进入到下一步骤: 美河学习在线 www.eimhe.com 19 图 6 Cluster Name:集群名称,可以保持默认,可以自定义 点击“Add”按钮添加第二节点信息 美河学习在线 www.eimhe.com 20 图 7 填完以后点击“ok”按钮返回界面 美河学习在线 www.eimhe.com 21 图 8 点击“Next”,进入下一步操作: 美河学习在线 www.eimhe.com 22 图 9 点击“Edit”,修改“eth0”网卡的接口类型: 图 11 美河学习在线 www.eimhe.com 23 图 12 点击“Next”按钮,进入 ocr 磁盘指定: 美河学习在线 www.eimhe.com 24 图 13 如果你是正常冗余那么需要 2 块 OCR 磁盘,这里选择“External Redundancy”外部冗余模式 美河学习在线 www.eimhe.com 25 图 14 点击“Next” 美河学习在线 www.eimhe.com 26 图 15 点击“Next” 美河学习在线 www.eimhe.com 27 美河学习在线 www.eimhe.com 28 2.1.2.执行脚本 节点 1:root 用户执行 [root@db1 sysconfig]# /oracle/oraInventory/orainstRoot.sh Changing permissions of /oracle/oraInventory to 770. Changing groupname of /oracle/oraInventory to oinstall. The execution of the script is complete --节点 2:root 用户执行 [root@db2 sysconfig]# /oracle/oraInventory/orainstRoot.sh Changing permissions of /oracle/oraInventory to 770. Changing groupname of /oracle/oraInventory to oinstall. The execution of the script is complete --节点 1:root 用户执行 [root@db1 sysconfig]# /oracle/product/10.2.0/root.sh WARNING: directory '/oracle/product' is not owned by root WARNING: directory '/oracle' is not owned by root Checking to see if Oracle CRS stack is already configured /etc/oracle does not exist. Creating it now. 美河学习在线 www.eimhe.com 29 Setting the permissions on OCR backup directory Setting up NS directories Oracle Cluster Registry configuration upgraded successfully WARNING: directory '/oracle/product' is not owned by root WARNING: directory '/oracle' is not owned by root Successfully accumulated necessary OCR keys. Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897. node : node 1: db1 db1-priv db1 node 2: db2 db2-priv db2 Creating OCR keys for user 'root', privgrp 'root'.. Operation successful. Now formatting voting device: /dev/raw/raw2 Format of 1 voting devices complete. Startup will be queued to init within 90 seconds. Adding daemons to inittab Expecting the CRS daemons to be up within 600 seconds. CSS is active on these nodes. db1 CSS is inactive on these nodes. db2 Local node checking complete. Run root.sh on remaining nodes to start CRS daemons. [root@db1 sysconfig]# 2.1.3.解决错误 --节点 2:root 用户执行 首先修改 vipca,否则会报错,2 个节点都要修改 [root@db2 bin]#vi /oracle/product/10.2.0/bin/vipca Linux) LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/srvm/lib:$LD_LIBRARY_PATH export LD_LIBRARY_PATH #Remove this workaround when the bug 3937317 is fixed arch=`uname -m` if [ "$arch" = "i686" -o "$arch" = "ia64" -o "$arch" = "x86_64" ] then # LD_ASSUME_KERNEL=2.4.19 # export LD_ASSUME_KERNEL unset LD_ASSUME_KERNEL fi 美河学习在线 www.eimhe.com 30 #End workaround [root@db2 bin]#vi /oracle/product/10.2.0/bin/srvctl #Remove this workaround when the bug 3937317 is fixed LD_ASSUME_KERNEL=2.4.19 export LD_ASSUME_KERNEL unset LD_ASSUME_KERNEL [root@db2 bin]# /oracle/product/10.2.0/root.sh WARNING: directory '/oracle/product' is not owned by root WARNING: directory '/oracle' is not owned by root Checking to see if Oracle CRS stack is already configured /etc/oracle does not exist. Creating it now. Setting the permissions on OCR backup directory Setting up NS directories Oracle Cluster Registry configuration upgraded successfully WARNING: directory '/oracle/product' is not owned by root WARNING: directory '/oracle' is not owned by root clscfg: EXISTING configuration version 3 detected. clscfg: version 3 is 10G Release 2. Successfully accumulated necessary OCR keys. Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897. node : node 1: db1 db1-priv db1 node 2: db2 db2-priv db2 clscfg: Arguments check out successfully. NO KEYS WERE WRITTEN. Supply -force parameter to override. -force is destructive and will destroy any previous cluster configuration. Oracle Cluster Registry for cluster has already been initialized Startup will be queued to init within 90 seconds. Adding daemons to inittab Expecting the CRS daemons to be up within 600 seconds. CSS is active on these nodes. db1 db2 CSS is active on all nodes. Waiting for the Oracle CRSD and EVMD to start Waiting for the Oracle CRSD and EVMD to start Oracle CRS stack installed and running under init(1M) Running vipca(silent) for configuring nodeapps Error 0(Native: listNetInterfaces:[3]) [Error 0(Native: listNetInterfaces:[3])] 美河学习在线 www.eimhe.com 31 解决办法:节点 2 执行以下命令 [root@db2 bin]# ./oifcfg setif -global eth0/192.168.1.0:public [root@db2 bin]# ./oifcfg setif -global eth0/10.0.0.0:cluster_interconnect [root@db2 bin]# ./oifcfg getif eth0 192.168.1.0 global public eth0 10.0.0.0 global cluster_interconnect --节点 1: 美河学习在线 www.eimhe.com 32 美河学习在线 www.eimhe.com 33 美河学习在线 www.eimhe.com 34 美河学习在线 www.eimhe.com 35 美河学习在线 www.eimhe.com 36 点击“Exit”,返回脚本执行窗口 美河学习在线 www.eimhe.com 37 点击“OK”按钮 美河学习在线 www.eimhe.com 38 点击“Exit”结束安装 美河学习在线 www.eimhe.com 39 2.2.4.验证安装 [oracle@db1 bin]$ crs_stat -t Name Type Target State Host ------------------------------------------------------------ ora.db1.gsd application ONLINE ONLINE db1 ora.db1.ons application ONLINE ONLINE db1 ora.db1.vip application ONLINE ONLINE db1 ora.db2.gsd application ONLINE ONLINE db2 ora.db2.ons application ONLINE ONLINE db2 ora.db2.vip application ONLINE ONLINE db2 [oracle@db1 bin]$ 节点 2: [oracle@db2 ~]$ crs_stat -t Name Type Target State Host ------------------------------------------------------------ ora.db1.gsd application ONLINE ONLINE db1 ora.db1.ons application ONLINE ONLINE db1 ora.db1.vip application ONLINE ONLINE db1 ora.db2.gsd application ONLINE ONLINE db2 ora.db2.ons application ONLINE ONLINE db2 ora.db2.vip application ONLINE ONLINE db2 ---表明 CRS 安装完成,已经启动 卸载 clusterware rm -f /etc/init.d/init.cssd rm -f /etc/init.d/init.crs rm -f /etc/init.d/init.crsd rm -f /etc/init.d/init.evmd rm -f /etc/rc2.d/K96init.crs rm -f /etc/rc2.d/S96init.crs rm -f /etc/rc3.d/K96init.crs rm -f /etc/rc3.d/S96init.crs rm -f /etc/rc5.d/K96init.crs rm -f /etc/rc5.d/S96init.crs rm -rf /etc/oracle/scls_scr rm -f /etc/inittab.crs rm -rf /u01/oraInventory rm -rf /u01/app/crs 美河学习在线 www.eimhe.com 40 rm -rf /etc/ora* rm -rf /etc/init.d/init.* rm -f /usr/local/bin/* rm -rf /opt/ORCLfmap rm -rf /opt/oracle/admin [root@db1 10.2.0]# cp /etc/inittab.orig /etc/inittab [root@db1 10.2.0]# ps -ef|grep crs root 2387 1 0 00:36 ? 00:00:03 /oracle/product/10.2.0/bin/crsd.bin reboot root 9512 2736 0 00:47 pts/1 00:00:00 grep crs [root@db1 10.2.0]# kill -9 2387 [root@db1 10.2.0]# ps -ef|grep crs [root@db1 oracle]# rm -rf /oracle/oraInventory product [root@db1 oracle]# rm -rf /var/tmp/.oracle [root@db1 oracle]# rm -rf /tmp/.oracle [root@db1 oracle]# rm -f /etc/oracle/orc.loc [root@db1 raw]# dd if=/dev/zero of=/dev/raw1 bs=8192 count=2560 2560+0 records in 2560+0 records out 20971520 bytes (21 MB) copied, 0.038242 seconds, 548 MB/s [root@db1 raw]# dd if=/dev/zero of=/dev/raw2 bs=8192 count=2560 2560+0 records in 2560+0 records out 20971520 bytes (21 MB) copied, 0.049138 seconds, 427 MB/s [root@db2 oracle]# dd if=/dev/zero of=/dev/raw1 bs=8192 count=2560 2560+0 records in 2560+0 records out 20971520 bytes (21 MB) copied, 0.073873 seconds, 284 MB/s [root@db2 oracle]# dd if=/dev/zero of=/dev/raw2 bs=8192 count=2560 2560+0 records in 2560+0 records out 20971520 bytes (21 MB) copied, 0.045982 seconds, 456 MB/s 2).解决 Startup will be queued to init within 90 seconds.挂起 美河学习在线 www.eimhe.com 41 [root@db1 raw]# cd /oracle/product/10.2.0/crs_1/install [root@db1 install]# ./rootdeinstall.sh Removing contents from OCR device 2560+0 records in 2560+0 records out 10485760 bytes (10 MB) copied, 6.3727 seconds, 1.6 MB/s --重新运行 root.sh [root@db1 install]# /oracle/product/10.2.0/crs_1/root.sh 3). ocr 和 votedisk 磁盘损坏或者其他原因需要重新执行 root.sh $CRS_HOME/install/rootdelete.sh $CRS_HOME/install/rootdeinstall.sh $CRS_HOME/root.sh 2.2.安装数据库软件 2.2.1.软件安装 节点 1:oracle 用户执行 美河学习在线 www.eimhe.com 42 美河学习在线 www.eimhe.com 43 美河学习在线 www.eimhe.com 44 美河学习在线 www.eimhe.com 45 美河学习在线 www.eimhe.com 46 美河学习在线 www.eimhe.com 47 2.2.2.执行脚本 节点 1: [root@db1 install]# /oracle/product/10.2.0/db_1/root.sh Running Oracle10 root.sh script... The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /oracle/product/10.2.0/db_1 Enter the full pathname of the local bin directory: [/usr/local/bin]: Copying dbhome to /usr/local/bin ... Copying oraenv to /usr/local/bin ... Copying coraenv to /usr/local/bin ... Creating /etc/oratab file... Entries will be added to the /etc/oratab file as needed by Database Configuration Assistant when a database is created Finished running generic part of root.sh script. Now product-specific root actions will be performed. 节点 2: [root@db2 network-scripts]# /oracle/product/10.2.0/db_1/root.sh Running Oracle10 root.sh script... The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /oracle/product/10.2.0/db_1 Enter the full pathname of the local bin directory: [/usr/local/bin]: Copying dbhome to /usr/local/bin ... Copying oraenv to /usr/local/bin ... Copying coraenv to /usr/local/bin ... Creating /etc/oratab file... Entries will be added to the /etc/oratab file as needed by Database Configuration Assistant when a database is created Finished running generic part of root.sh script. Now product-specific root actions will be performed. 美河学习在线 www.eimhe.com 48 2.3.cluster 软件升级 由于 DBCA 创建数据库时提示升级,所以对进行软件升级操作: 节点 1:上传 10.2.0.5 补丁软件 p8202632_10205_Linux-x86-64.zip 2.3.1.解压软件 [oracle@db1 oracle]$ unzip p8202632_10205_Linux-x86-64.zip [oracle@db1 oracle]$ ls Disk1 oraInventory product README.htm software 2.3.2.开启 vnc 服务 [oracle@db1 oracle]$ vncserver New 'db1:1 (oracle)' desktop is db1:1 美河学习在线 www.eimhe.com 49 Starting applications specified in /home/oracle/.vnc/xstartup Log file is /home/oracle/.vnc/db1:1.log 2.3.3.升级 clusterware 打开终端窗口,进入补丁所在目录,输入“./runInstaller” 图 1 美河学习在线 www.eimhe.com 50 图 2 点击“Next”进入下一步操作 美河学习在线 www.eimhe.com 51 图 3 首先升级的是 clusterware,所以这里 Path 路径修改为/oracle/product/10.2.0/crs_1 集群软件 所在的目录 美河学习在线 www.eimhe.com 52 图 4 点击“Next”进入下一步 美河学习在线 www.eimhe.com 53 图 5 默认选择所有节点,点击“Next” 美河学习在线 www.eimhe.com 54 图 6 出现警告,有 2 中处理方法 1):忽略警告,后期升级可能会出现问题 2):按照提示修改,修改完成后点击“Retry” [root@db1 ~]#vi /etc/sysctl.conf #fs.file-max = 65536 fs.file-max = 101365 #net.ipv4.ip_local_port_range = 1024 65000 net.ipv4.ip_local_port_range = 9000 65500 #net.core.rmem_max = 262144 net.core.rmem_max = 1048576 net.core.wmem_default = 262144 net.core.wmem_max = 262144 "/etc/sysctl.conf" 47L, 1291C written [root@db1 ~]# sysctl -p 2 个节点都要修改 美河学习在线 www.eimhe.com 55 图 7 点击“Next” 美河学习在线 www.eimhe.com 56 图 8 点击“Install”安装更新 美河学习在线 www.eimhe.com 57 图 9 美河学习在线 www.eimhe.com 58 图 10 根据提示,在节点 1 和节点 2 执行提示的脚本 2.3.4.执行脚本 节点 1: [root@db1 etc]# /oracle/product/10.2.0/crs_1/bin/crsctl stop crs Stopping resources. Successfully stopped CRS resources Stopping CSSD. Shutting down CSS daemon. Shutdown request successfully issued. [root@db1 etc]# /oracle/product/10.2.0/crs_1/install/root102.sh Creating pre-patch directory for saving pre-patch clusterware files Completed patching clusterware files to /oracle/product/10.2.0/crs_1 Relinking some shared libraries. Relinking of patched files is complete. WARNING: directory '/oracle/product/10.2.0' is not owned by root WARNING: directory '/oracle/product' is not owned by root WARNING: directory '/oracle' is not owned by root Preparing to recopy patched init and RC scripts. Recopying init and RC scripts. Startup will be queued to init within 30 seconds. Starting up the CRS daemons. Waiting for the patched CRS daemons to start. This may take a while on some systems. . . 10205 patch successfully applied. clscfg: EXISTING configuration version 3 detected. clscfg: version 3 is 10G Release 2. Successfully deleted 1 values from OCR. Successfully deleted 1 keys from OCR. Successfully accumulated necessary OCR keys. Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897. node : node 1: db1 db1-priv db1 Creating OCR keys for user 'root', privgrp 'root'.. Operation successful. clscfg -upgrade completed successfully 美河学习在线 www.eimhe.com 59 Creating '/oracle/product/10.2.0/crs_1/install/paramfile.crs' with data used for CRS configuration Setting CRS configuration values in /oracle/product/10.2.0/crs_1/install/paramfile.crs --节点 2 执行 [root@db2 ~]# /oracle/product/10.2.0/crs_1/install/root102.sh 2.3.5.验证补丁 --节点 1 [oracle@db1 ~]$ crsctl query crs softwareversion db1 CRS software version on node [db1] is [10.2.0.5.0] [oracle@db1 ~]$ crsctl query crs activeversion CRS active version on the cluster is [10.2.0.5.0] --节点 2 [oracle@db2 ~]$ crsctl query crs softwareversion db1 CRS software version on node [db1] is [10.2.0.5.0] [oracle@db2 ~]$ crsctl query crs activeversion CRS active version on the cluster is [10.2.0.5.0] 查看集群状态: [oracle@db1 ~]$ crs_stat -t Name Type Target State Host ------------------------------------------------------------ ora.db1.gsd application ONLINE ONLINE db1 ora.db1.ons application ONLINE ONLINE db1 ora.db1.vip application ONLINE ONLINE db1 ora.db2.gsd application ONLINE ONLINE db2 ora.db2.ons application ONLINE ONLINE db2 ora.db2.vip application ONLINE ONLINE db2 2.4.oracle 软件升级 2.4.1.开启 vnc 服务 [oracle@db1 ~]$ vncserver New 'db1:1 (oracle)' desktop is db1:1 Starting applications specified in /home/oracle/.vnc/xstartup 美河学习在线 www.eimhe.com 60 Log file is /home/oracle/.vnc/db1:1.log [oracle@db1 ~]$ ps -ef|grep vnc oracle 17593 1 0 01:57 pts/1 00:00:00 Xvnc :1 -desktop db1:1 (oracle) -httpd /usr/share/vnc/classes -auth /home/oracle/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 30000 -rfbauth /home/oracle/.vnc/passwd -rfbport 5901 -pn 2.4.2.升级 oracle 软件 新开终端窗口,进入补丁文件所在目录,键入“./runInstaller”,打开软件升级窗口 美河学习在线 www.eimhe.com 61 点击“Next” 美河学习在线 www.eimhe.com 62 指定要升级的 oracle 软件所在目录,一般保持默认,点击“Next”按钮,进入下一步 美河学习在线 www.eimhe.com 63 这里取消掉“I wish to receive......”按钮,点击“Next”按钮时会弹出提示,点击“Yes”按 钮,进入下一步 美河学习在线 www.eimhe.com 64 美河学习在线 www.eimhe.com 65 默认是 2 个节点都选中,直接点击“Next,进入下一步 美河学习在线 www.eimhe.com 66 产品预案装检查,pass 以后点击“Next”按钮,进入下一步 美河学习在线 www.eimhe.com 67 点击“Install”按钮,升级 oracle 软件 美河学习在线 www.eimhe.com 68 美河学习在线 www.eimhe.com 69 2.4.3.执行脚本 --节点 1 切换到 root 用户,执行以下脚本 [root@db1 ~]# /oracle/product/10.2.0/db_1/root.sh Running Oracle 10g root.sh script... The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /oracle/product/10.2.0/db_1 Enter the full pathname of the local bin directory: [/usr/local/bin]: The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: y Copying dbhome to /usr/local/bin ... The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: y Copying oraenv to /usr/local/bin ... The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: y Copying coraenv to /usr/local/bin ... Entries will be added to the /etc/oratab file as needed by Database Configuration Assistant when a database is created Finished running generic part of root.sh script. Now product-specific root actions will be performed. 节点 2 切换到 root,执行以下脚本 [root@db2 ~]# /oracle/product/10.2.0/db_1/root.sh Running Oracle 10g root.sh script... The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /oracle/product/10.2.0/db_1 Enter the full pathname of the local bin directory: [/usr/local/bin]: The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: y Copying dbhome to /usr/local/bin ... The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: y 美河学习在线 www.eimhe.com 70 Copying oraenv to /usr/local/bin ... The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: y Copying coraenv to /usr/local/bin ... Entries will be added to the /etc/oratab file as needed by Database Configuration Assistant when a database is created Finished running generic part of root.sh script. Now product-specific root actions will be performed. 脚本完成后返回升级界面点击“OK”按钮,结束升级 2.4.4.验证升级 --节点 1 [root@db1 ~]# su - oracle [oracle@db1 ~]$ sqlplus -v SQL*Plus: Release 10.2.0.5.0 - Production [oracle@db1 ~]$ sqlplus / as sysdba 美河学习在线 www.eimhe.com 71 SQL*Plus: Release 10.2.0.5.0 - Production on Fri Feb 14 03:01:53 2014 Copyright (c) 1982, 2010, Oracle. All Rights Reserved. --节点 2 [oracle@db2 ~]$ sqlplus -v SQL*Plus: Release 10.2.0.5.0 - Production [oracle@db2 ~]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.5.0 - Production on Fri Feb 14 03:01:39 2014 Copyright (c) 1982, 2010, Oracle. All Rights Reserved. 到此软件升级完成。 三、创建数据库 3.1.启动 DBCA 图 1 美河学习在线 www.eimhe.com 72 保持默认选项“Oracle Real Application Clusters database”,创建 rac 数据库,点击“Next”按 钮 图 2 在“Select the operation that you want to perform”界面选择“Configure Automatic Storage Management”配置自动存储管理选项,创建 ASM 实例和 ASM 磁盘组,点击“Next”按钮 美河学习在线 www.eimhe.com 73 图 3 点击“Select All”按钮选中所有节点,向导将在两个节点创建数据库,点击“Next” 图 4 在创建 ASM 实例界面输入 sys 密码,该密码是 ASM 实例的密码,选择“Create initialization parameter file (IFILE)”点击“Next”界面 美河学习在线 www.eimhe.com 74 图 5 在弹出的界面,点击“OK”按钮 图 6 美河学习在线 www.eimhe.com 75 图 7 选择“Yes”将自动创建监听,否则请手动创建监听 步骤:1,新开终端窗口 步骤:2,再终端窗口输入 netca 命令即可 这里我选择“Yes”自动创建监听 美河学习在线 www.eimhe.com 76 图 8 图 9 图 10 --监听已经自动配置并启动 美河学习在线 www.eimhe.com 77 --节点 1 执行以下命令: [oracle@db1 ~]$ lsnrctl status LSNRCTL for Linux: Version 10.2.0.5.0 - Production on 14-FEB-2014 03:21:33 Copyright (c) 1991, 2010, Oracle. All rights reserved. Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)) STATUS of the LISTENER ------------------------ Alias LISTENER_DB1 Version TNSLSNR for Linux: Version 10.2.0.5.0 - Production Start Date 14-FEB-2014 03:19:56 Uptime 0 days 0 hr. 1 min. 36 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /oracle/product/10.2.0/db_1/network/admin/listener.ora Listener Log File /oracle/product/10.2.0/db_1/network/log/listener_db1.log Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.33)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.31)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC))) Services Summary... Service "+ASM" has 1 instance(s). Instance "+ASM1", status BLOCKED, has 1 handler(s) for this service... Service "+ASM_XPT" has 1 instance(s). Instance "+ASM1", status BLOCKED, has 1 handler(s) for this service... The command completed successfully 节点 2: [oracle@db2 ~]$ lsnrctl status LSNRCTL for Linux: Version 10.2.0.5.0 - Production on 14-FEB-2014 03:22:40 Copyright (c) 1991, 2010, Oracle. All rights reserved. Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)) STATUS of the LISTENER ------------------------ Alias LISTENER_DB2 Version TNSLSNR for Linux: Version 10.2.0.5.0 - Production Start Date 14-FEB-2014 03:19:59 Uptime 0 days 0 hr. 2 min. 40 sec 美河学习在线 www.eimhe.com 78 Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /oracle/product/10.2.0/db_1/network/admin/listener.ora Listener Log File /oracle/product/10.2.0/db_1/network/log/listener_db2.log Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.34)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.32)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC))) Services Summary... Service "+ASM" has 1 instance(s). Instance "+ASM2", status BLOCKED, has 1 handler(s) for this service... Service "+ASM_XPT" has 1 instance(s). Instance "+ASM2", status BLOCKED, has 1 handler(s) for this service... The command completed successfully 点击“Create New”按钮,创建存放数据文件的 ASM 磁盘组 图 11 美河学习在线 www.eimhe.com 79 图 12 填入磁盘组名称,选择冗余模式,勾选要建成磁盘组的磁盘 图 13 美河学习在线 www.eimhe.com 80 点击“OK”按钮,创建 ASM 磁盘 图 14 ASM 磁盘组创建完成后会自动 mount 美河学习在线 www.eimhe.com 81 图 15 点击“Finish”弹出“你是否想要执行另外的操作”提示,点击“Yes”按钮 图 16 美河学习在线 www.eimhe.com 82 选择“Create Database”创建数据库 图 17 点击“Select All”按钮选择要安装数据库的节点,点击“Next” 图 18 美河学习在线 www.eimhe.com 83 选择“Custom Database”自定义数据库,点击“Next” 图 19 输入数据库全局名称,这的全局名称是环境变量中 ORACLE_SID=orcl1 去掉 1 图 20 美河学习在线 www.eimhe.com 84 这里我取消“Configure the Database with Enterprise Manager”选项,你可以保留该选项,点 击“Next” 图 21 图 21 默认选择“Use the Same Password for ALL Accounts”,所有帐号使用同一个密码 美河学习在线 www.eimhe.com 85 图 22 选择“Automatic Storage Management(ASM)”选项 图 23 保持默认选项 美河学习在线 www.eimhe.com 86 图 24 保持默认选项 图 25 保持默认选项,你也可以指定快速恢复区,我只是为了写文档,所以不指定 美河学习在线 www.eimhe.com 87 图 26 这里取消掉了所有的选项,你也可以保留这些选项,不取消 图 27 点击“Add”按钮添加服务名 美河学习在线 www.eimhe.com 88 图 28 输入服务名点击“OK”按钮 图 29 点击“Next” 图 30 美河学习在线 www.eimhe.com 89 这里为了写文档只是修改了“Character Sets” 图 31 选择“ZHS16GBK”语言字符集 图 32 美河学习在线 www.eimhe.com 90 点击“Next” 图 33 点击“Finish” 图 34 美河学习在线 www.eimhe.com 91 检查无误后点击“OK”按钮,开始创建数据库 图 35 开始创建数据库 美河学习在线 www.eimhe.com 92 图 36 点击“Exit”退出 图 37 美河学习在线 www.eimhe.com 93 3.2.验证 [oracle@db1 orcl]$ crs_stat -t Name Type Target State Host ------------------------------------------------------------ ora....SM1.asm application ONLINE ONLINE db1 ora....B1.lsnr application ONLINE ONLINE db1 ora.db1.gsd application ONLINE ONLINE db1 ora.db1.ons application ONLINE ONLINE db1 ora.db1.vip application ONLINE ONLINE db1 ora....SM2.asm application ONLINE ONLINE db2 ora....B2.lsnr application ONLINE ONLINE db2 ora.db2.gsd application ONLINE ONLINE db2 ora.db2.ons application ONLINE ONLINE db2 ora.db2.vip application ONLINE ONLINE db2 ora.orcl.db application OFFLINE OFFLINE ora....l1.inst application OFFLINE OFFLINE ora....l2.inst application OFFLINE OFFLINE ora....ltaf.cs application OFFLINE OFFLINE ora....cl1.srv application OFFLINE OFFLINE ora....cl2.srv application OFFLINE OFFLINE --数据库未能启动,手动启动数据库 节点 1 执行:该命令是 2 个节点同时启动数据库 [oracle@db1 orcl]$ srvctl start database -d orcl --新开终端窗口执行以下命令 [oracle@db1 orcl]$tail -f $ORACLE_BASE/admin/orcl/bdump/alert_orcl1.log 查看日志是否有报错 [oracle@db1 orcl]$ sqlplus / as sysdba SQL> select inst_id,open_mode from gv$database; INST_ID OPEN_MODE ---------- ---------- 2 READ WRITE 1 READ WRITE 数据库已经正常启动 启动未能启动的服务 [oracle@db1 orcl]$ crs_start ora.orcl.orcltaf.orcl2.srv Attempting to start `ora.orcl.orcltaf.orcl2.srv` on member `db2` Start of `ora.orcl.orcltaf.orcl2.srv` on member `db2` succeeded. [oracle@db1 orcl]$ crs_start ora.orcl.orcltaf.orcl1.srv 美河学习在线 www.eimhe.com 94 Attempting to start `ora.orcl.orcltaf.orcl1.srv` on member `db1` Start of `ora.orcl.orcltaf.orcl1.srv` on member `db1` succeeded. --验证所有服务是否已经正常启动 [oracle@db1 orcl]$ crs_stat -t Name Type Target State Host ------------------------------------------------------------ ora....SM1.asm application ONLINE ONLINE db1 ora....B1.lsnr application ONLINE ONLINE db1 ora.db1.gsd application ONLINE ONLINE db1 ora.db1.ons application ONLINE ONLINE db1 ora.db1.vip application ONLINE ONLINE db1 ora....SM2.asm application ONLINE ONLINE db2 ora....B2.lsnr application ONLINE ONLINE db2 ora.db2.gsd application ONLINE ONLINE db2 ora.db2.ons application ONLINE ONLINE db2 ora.db2.vip application ONLINE ONLINE db2 ora.orcl.db application ONLINE ONLINE db1 ora....l1.inst application ONLINE ONLINE db1 ora....l2.inst application ONLINE ONLINE db2 ora....ltaf.cs application ONLINE ONLINE db2 ora....cl1.srv application ONLINE ONLINE db1 ora....cl2.srv application ONLINE ONLINE db2 --检查 tnsnames.ora 文件是否已经自动创建 [oracle@db1 bdump]$ cd $ORACLE_HOME/network/admin [oracle@db1 admin]$ ls listener.ora samples shrept.lst tnsnames.ora --节点 2 [oracle@db1 orcl]$ cd $ORACLE_HOME/network/admin [oracle@db1 admin]$ ls listener.ora samples shrept.lst tnsnames.ora --验证网络服务是否能正常连接 [oracle@db1 admin]$ sqlplus system/oracle@orcl2 SQL*Plus: Release 10.2.0.5.0 - Production on Fri Feb 14 07:25:01 2014 Copyright (c) 1982, 2010, Oracle. All Rights Reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production 美河学习在线 www.eimhe.com 95 With the Partitioning, Real Application Clusters, OLAP, Data Mining and Real Application Testing options SQL> exit Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production With the Partitioning, Real Application Clusters, OLAP, Data Mining and Real Application Testing options --节点 2: [oracle@db2 admin]$ sqlplus system/oracle@orcl1 SQL*Plus: Release 10.2.0.5.0 - Production on Fri Feb 14 07:25:55 2014 Copyright (c) 1982, 2010, Oracle. All Rights Reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production With the Partitioning, Real Application Clusters, OLAP, Data Mining and Real Application Testing options
还剩94页未读

继续阅读

下载pdf到电脑,查找使用更方便

pdf的实际排版效果,会与网站的显示效果略有不同!!

需要 8 金币 [ 分享pdf获得金币 ] 0 人已下载

下载pdf