2019年(65)
分类:
2019-07-23 16:36:02
Oracle RAC on Veritas DBE/AC(Step by Step) |
||
一、 安装Solaris 9 8/03版本,由于该版本是Solaris操作系统的最新版,所以不需要在安装补丁程序。 二、 使用Sun公司发布的补丁盘,安装SUNWsan软件包和补丁包 三、 为要安装Oracle RAC的Sun V880设置好网络 主机A: 机器名:rac1 网卡 eri0:192.0.0.101/255.255.255.0 用于做心跳网卡2 网卡 ge0:192.0.1.101/255.255.255.0 用于做心跳网卡1 网卡 ce0:172.39.199.101/255.255.255.0 用于做对外服务网卡 主机A具体配置文件如下: l /etc/hosts文件的内容: # # Internet host table # 127.0.0.1 localhost 192.168.0.101 rac1 loghost a.b 192.168.0.102 rac2 192.168.1.101 rac1-ge0 172.39.199.101 rac1-ce0 l /etc/netmasks文件的内容 # # The netmasks file associates Internet Protocol (IP) address # masks with IP network numbers. # # network-number netmask # # The term network-number refers to a number obtained from the Internet Network # Information Center. Currently this number is restricted to being a class # A, B, or C network number. In the future we should be able to support # arbitrary network numbers per the Classless Internet Domain Routing # guidelines. # # Both the network-number and the netmasks are specified in # "decimal dot" notation, e.g: # # 128.32.0.0 255.255.255.0 # 192.168.0.0 255.255.255.0 172.39.199.0 255.255.255.0 l /etc/hostname.eri0文件的内容: rac1 l /etc/hostname.ge0文件的内容: rac1-ge0 l /etc/hostname.ce0文件的内容: rac1-ce0 l /etc/hosts.equiv文件的内容: + l /etc/notrouter文件是一个空文件 l /etc/defaultrouter文件的内容 172.16.199。254 l /.rhosts文件的内容 rac1 rac2 主机B: 机器名:rac2 网卡 eri0:192.0.0.102/255.255.255.0 用于做心跳网卡2 网卡 ge0:192.0.1.102/255.255.255.0 用于做心跳网卡1 网卡 ce0:172.39.199.102/255.255.255.0 用于做对外服务网卡 具体配置文件如下: l /etc/hosts文件的内容: # # Internet host table # 127.0.0.1 localhost 192.168.0.102 rac2 loghost a.b 192.168.0.101 rac1 192.168.1.102 rac2-ge0 172.39.199.102 rac2-ce0 l /etc/netmasks文件的内容 # # The netmasks file associates Internet Protocol (IP) address # masks with IP network numbers. # # network-number netmask # # The term network-number refers to a number obtained from the Internet Network # Information Center. Currently this number is restricted to being a class # A, B, or C network number. In the future we should be able to support # arbitrary network numbers per the Classless Internet Domain Routing # guidelines. # # Both the network-number and the netmasks are specified in # "decimal dot" notation, e.g: # # 128.32.0.0 255.255.255.0 # 192.168.0.0 255.255.255.0 172.39.199.0 255.255.255.0 l /etc/hostname.eri0文件的内容: rac2 l /etc/hostname.ge0文件的内容: rac2-ge0 l /etc/hostname.ce0文件的内容: rac2-ce0 l /etc/hosts.equiv文件的内容: + l /etc/notrouter文件是一个空文件 l /etc/defaultrouter文件的内容 172.16.199.254 l /.rhosts文件的内容 rac1 rac2 四、 为两台主机的超级用户加上如下环境变量 l 在文件/。Profile中加上以下内容 PATH=/sbin:/usr/sbin:/usr/bin:/usr/lib/vxvm/bin:/usr/lib/fs/vxfs:/opt/VRTSvxfs/sbin:\ /opt/VRTSvcs/bin:/opt/VRTSvcs/rac/bin:/opt/VRTSob/bin:$PATH export PATH MANPATH=/usr/share/man:/opt/VRTS/man export MANPATH 五、 使用超级用户的身份登录到系统RAC1上,将VERITAS DBE/AC for Oracle9i RAC software介质放入RAC1的CDROM中,等待一会后,运行Veritas安装脚本。 以下黑体字部分是安装时需要输入的信息,采用C语言的注释方法进行中文说明。 # cd /cdrom/database_ac_for_oracle9i # ./installDBAC /* 运行DBAC的安装脚本 */ Enter the names of the systems on which VCS is to be installed separated by spaces (example: system1 system2): rac1 rac2 /* 以上是输入集群的所有主机名,主机名之间用空格分开 */ Analyzing . . . /*系统开始检查和分析:1、是否有足够的磁盘空间来安装软件包2、SUNWsan软件包和其补丁是否已经安装3、用户是否具有超级用户的权限4、系统是否已经安装了VRTSvlic软件包,如果没有的话,就将该软件包安装在系统上*/ You do not have a Database Edition for Advanced Cluster license installed on rac1. Do you want to add a license key for this product on rac1 ?[Y/N](Y) y Enter your license key : XXXX-XXXX-XXXX-XXXX-XXXX-XXX Registering license for rac1. You do not have a Database Edition for Advanced Cluster license installed on rac2. Do you want to add a license key for this product on rac2 ?[Y/N](Y) y Enter your license key : XXXX-XXXX-XXXX-XXXX-XXXX-XXX Registering license for rac2. /* 以上是输入Veritas for Oracle RAC的license */ You can skip VERITAS Cluster server installation, if you need to install only VERITAS Volume manager and VERITAS Filesystem Would you like to continue VCS installation. [Y/N](Y)? Y Starting VCS installation. /* 以上是提示继续安装Veritas for Oracle RAC 软件包 */ Checking for ssh on rac1 ............................ not found Verifying communication with rac2 ............. ping successful Attempting rsh with rac2 ....................... rsh successful Checking OS version on rac1. ........................ SunOS 5.8 Creating /tmp subdirectory on rac1... /tmp subdirectory created Checking OS version on rac2 ......................... SunOS 5.8 Using /usr/bin/rsh and /usr/bin/rcp to communicate with rac1 Communication check completed successfully VCS licensing verification: Checking rac1 .............found DBED/AC Node Locked key Do you want to enter a new key for rac1 (N) n Using the existing DBED/AC Node Locked key located on rac2. Checking rac2 .............found DBED/AC Node Locked key Using the existing DBED/AC Node Locked key located on rac2. DBED/AC licensing completed successfully /* 以上部分进行License的校验 */ Are you ready to start the Cluster installation now? (Y) Y /* 以上询问是否开始安装VeritasforOracle RAC集群软件 */ To configure VCS the following is required: A unique Cluster name A unique Cluster ID number between 0-255 Two NIC cards on each system used for private network heartbeat links Are you ready to configure DBED/AC on these systems? (Y) Y /* 以上询问是否开始配置VeritasforOracle RAC集群软件 */ Enter the unique Cluster Name: testrac Enter the unique Cluster ID number between 0-255: 10 /* 集群的名字是testrac,集群的ID是10 */ Discovering NICs on galaxy: ..... discovered eri0 ge0 ce0 Enter the NIC for the first private network heartbeat link on Rac1: (eri0 ge0 ce0) ge0 Enter the NIC for the second private network heartbeat link on Rac1: (hme0 qfe1 qfe2 qfe3) eri0 Are you using the same NICs for private heartbeat links on all systems? (Y) Y /* 以上配置集群的心跳网络,ge0是主心跳网络,eri0是次心跳网络,集群中的所有节点的心跳网络配置参数都是相同的 */ Cluster information verification: Cluster Name: testrac Cluster ID Number: 10 Private Network Heartbeat Links for rac1: link1=ge0 link2=eri0 Private Network Heartbeat Links for rac2: link1=ge0 link2=eri0 Is this information correct? (Y) Y /* 以上对配置的集群心跳网络进行确认 */ The following information is required to configure the Cluster Manager: A public NIC used by each system in the cluster A Virtual IP address and netmask for the Cluster Manager Do you want to configure the Cluster Manager (Web Console) (Y) Y Active NIC devices discovered on rac1: ce0 Enter the NIC for the Cluster Manager (Web Console) to use on rac1: (ce0) ce0 Is ce0 the public NIC used for all systems (Y) Y Enter the Virtual IP address for the Cluster Manager: 172.39.199.103 Enter the netmask for IP 172.39.199.103: (255.255.255.0) 255.255.255.0 /* 以上配置集群管理工具,集群中的所有节点的管理工具配置参数都是相同的 */ Cluster Manager (Web Console) verification: NIC: ce0 IP: 172.39.199.102 Netmask: 255.255.255.0 Is this information correct? (Y) Y /* 以上是对集群管理工具的配置参数进行确认 */ The following information is required to configure SMTP notification: The domain based address of the SMTP server The email address of each SMTP recipient A minimum severity level of messages to send to each recipient Do you want to configure SMTP notification? (Y) n /* 不使用SMTP */ The following information is required to configure SNMP notification: System names of SNMP console(s) to receive DBED/AC trap messages SNMP trap daemon port numbers for each console A minimum severity level of messages to send to each console Do you want to configure SNMP notification? (Y) n /* 不使用SNMP */ Installing VCS on rac1: Installing VRTSvlic package ........................... Done Installing VRTSperl package ........................... Done Installing VRTSllt package ............................ Done Installing VRTSgab package ............................ Done Installing VRTSvcs package ............................ Done Installing VRTSvcsmg package .......................... Done Installing VRTSvcsag package .......................... Done Installing VRTSweb package ............................ Done Installing VRTSvcsw package ........................... Done Installing VRTSvcsdc package .......................... Done Installing VRTSvcsmn package .......................... Done Installing VRTSvcsor package .......................... Done Installing VRTSdbac package ........................... Done Installing VCS on nebula: Copying VRTSvlic binaries ............................. Done Installing VRTSvlic package ........................... Done Copying VRTSperl binaries ............................. Done Installing VRTSperl package ........................... Done . . . Package installation completed successfully /* 以上安装VCS软件包 */ Configuring DBED/AC .................................. Done Copying DBED/AC configuration files to rac1 .......... Done Copying DBED/AC configuration files to rac2 .......... Done Configuration files copied successfully /* 以上配置DBE/AC软件包 */ Do you want to start the cluster components now? (Y) . . . Starting DBED/AC on rac1 Starting LLT ...................................... Started Starting GAB ...................................... Started Starting DBED/AC .................................. Started Starting DBED/AC drivers........................... Started Starting DBED/AC on rac2 Starting LLT ...................................... Started Starting GAB ...................................... Started Starting DBED/AC .................................. Started Starting DBED/AC drivers........................... Started /* 以上启动集群组件 */ DBED/AC installation completed successfully Successful installation of VCS /* 以上表示已经成功安装Veritas集群软件VCS */ Starting installation of VERITAS Database Edition for Advanced Cluster on rac1 Kernel Config parameters are set. The following packages need to be installed for VERITAS Database Edition for Advanced Cluster. VRTSvxvm is required VRTSvxfs is required VRTSglm is required VRTSgms is required VRTSodm is required VRTScavf is required VRTSvmman is Optional VRTSvmdoc is Optional VRTSfsdoc is Optional VRTSob is Optional VRTSvmpro is Optional VRTSfspro is Optional VRTSobgui is Optional Continue? [y,n,?,q] y /* 开始安装DBAC软件包*/ Checking existing package installation ... Installing VRTSvxvm. Installation of VRTSvxvm................................Done Installing VRTSvxfs. . . . Installing VRTSvmman. system VRTSvmman VERITAS Volume Manager, Manual Pages This package is optional. Install? [y,n,?,q] y Installation of VRTSvmman................................Done . . . Completed Installation of VERITAS database Edition for Advanced Cluster. The following packages were installed: VRTSobgui VRTSfspro VRTSvmpro VRTSob VRTSfsdoc VRTSvmdoc VRTSvmman VRTScavf VRTSodm VRTSgms VRTSglm VRTSvxfs VRTSvxvm Successfully Installed Foundation products on galaxy /* 以上是在rac1上安装DBAC软件包,注意,我们将安装所有的选项软件包,因此,对所有的提示都回答y */ Installing on rac2 machine. Starting installation of VERITAS Database Edition for Advanced Cluster on rac2. Kernel Config parameters are set. The following packages need to be installed for VERITAS Database Edition for Advanced Cluster. VRTSvxvm is required VRTSvxfs is required VRTSglm is required VRTSgms is required VRTSodm is required VRTScavf is required VRTSvmman is Optional VRTSvmdoc is Optional VRTSfsdoc is Optional VRTSob is Optional VRTSvmpro is Optional VRTSfspro is Optional VRTSobgui is Optional Continue? [y,n,?,q] y Checking existing package installation ... Copying VRTSvxvm binaries ... Installing VRTSvxvm. Installation of VRTSvxvm...............................Done Copying VRTSvxfs binaries ... . . Completed Installation of VERITAS Database Edition for Advanced Cluster. The following packages were installed: VRTSobgui VRTSfspro VRTSvmpro VRTSob VRTSfsdoc VRTSvmdoc VRTSvmman VRTScavf VRTSodm VRTSgms VRTSglm VRTSvxfs VRTSvxvm Successfully installed Foundation products on rac2 /* 以上是在rac2上安装DBAC软件包,注意,我们将安装所有的选项软件包,因此,对所有的提示都回答y */ Would you like to configure Cluster Volume Manager and Cluster File System [Y/N](Y) y The cluster configuration information as read from cluster configuration file is as follows. Cluster : testrac Nodes : rac1 rac2 You will now be prompted to enter the information pertaining to the cluster and the individual nodes. Enter the timeout value in seconds. This timeout will be used by CVM in the protocol executed during cluster reconfiguration. Choose the default value, if you do not wish to enter any specific value. Timeout: [ ------- Following is the summary of the information: ------ Cluster : testrac Nodes : rac1 rc2 Transport : gab ----------------------------------------------------------- Hit RETURN to continue./* 敲回车键 */ Is this correct [y,n,q,?] (default: y) y You will now be prompted to enter whether you want to start cvm on the systems in the cluster. If you choose to do so, then attempt will be made to start the cvm on all the systems in the cluster. It will not be started on the systems which do not have cluster manager running. Do you want to start cvm ? [y,n] n ======================================================== Cluster File System Configuration is in progress... cfscluster: CFS Cluster Configured Successfully /* 以上是配置CFS 和CVM */ You must reboot all the system in the cluster. /* 提示需要重起机器,注意此时不能重起机器*/ 六、 配置Veritas Volume Manage # vxinstall /* 这条命令应该在rac1和rac2上分别执行,需要对根盘进行封装,创建rootdg 。*/ 七、 重新启动计算机rac1和rac2 在rac2上 # halt OK 在rac1上 # reboot 等rac1启动可以登录后,再启动rac2 OK boot 八、 安装Emulex FC卡驱动程序 root@rac1 # ls EmlxApps100a08.tar lpfc.1 solaris-5.01e-1.tar lpfc-5.01e-sparc.tar readme.first.txt /* solaris-5.01e-1.tar是Emulex FC卡的驱动程序包,使用如下命令可以将该包解开: * # tar xvf solaris-5.01e-1.tar * # tar xvf lpfc-5.01e-sparc.tar * 包解完以后,驱动程序位于目录lpfc.1中 */ root@rac1 # pkgadd -d . The following packages are available: 1 lpfc.1 Emulex LightPulse FC SCSI/IP Host Bus Adapter driver (sun4u) Release 5.01e Select package(s) you wish to process (or 'all' to process all packages). (default: all) [?,??,q]: /* 需要在rac1和rac2上分别安装Emulex FC卡的驱动程序 */ 九、 修改文件/kernel/drv/lpfc.conf,将下面的行 # topology: link topology for initializing the Fibre Channel connection. # 0 = attempt loop mode, if it fails attempt point-to-point mode # 2 = attempt point-to-point mode only # 4 = attempt loop mode only # 6 = attempt point-to-point mode, if it fails attempt loop mode # Set point-to-point mode if you want to run as an N_Port. # Set loop mode if you want to run as an NL_Port. topology=0; /* 原来Emulex FC卡工作方式为:如果交换模式失败尝试loop方式 */ 修改为 topology=2; /* 使 Emulex FC卡仅工作在交换模式 */ 在文件/kernel/drv/sd.conf的最后,增加如下: name="sd" class="scsi" target=0 lun=0; name="sd" class="scsi" target=0 lun=1; name="sd" class="scsi" target=0 lun=2; name="sd" class="scsi" target=0 lun=3; name="sd" class="scsi" target=0 lun=4; name="sd" class="scsi" target=1 lun=0; name="sd" class="scsi" target=1 lun=1; name="sd" class="scsi" target=1 lun=2; name="sd" class="scsi" target=1 lun=3; name="sd" class="scsi" target=1 lun=4; name="sd" class="scsi" target=2 lun=0; name="sd" class="scsi" target=2 lun=1; name="sd" class="scsi" target=2 lun=2; name="sd" class="scsi" target=2 lun=3; name="sd" class="scsi" target=2 lun=4; name="sd" class="scsi" target=3 lun=0; name="sd" class="scsi" target=3 lun=1; name="sd" class="scsi" target=3 lun=2; name="sd" class="scsi" target=3 lun=3; name="sd" class="scsi" target=3 lun=4; /* 需要在rac1和rac2上分别进行以上这些修改 */ 十、 重新启动计算机rac1和rac2 在rac2上 # halt OK 在rac1上 # reboot 等rac1启动可以登录后,再启动rac2 OK boot 十一、 安装Veritas Volume Manager vxvm mp2 root@rac1 # ls -l total 343920 -rwxr-xr-x 1 root root 30657 Aug 6 12:10 READ_THIS_FIRST.pdf drwxrwxr-x 3 root root 512 Mar 12 2003 support -rw-r--r-- 1 root other 175953408 Aug 3 15:48 vm.3.5MP2.sol.CD_261905. tar drwxrwxr-x 4 root root 512 Aug 19 07:58 volume_manager /* vm.3.5MP2.sol.CD_261905.是VXVM MP2补丁包,使用如下命令可以将该包解开: * # tar xvf vm.3.5MP2.sol.CD_261905 * 包解完以后,补丁程序位于volume_manager目录中 */ root@rac1 # cd volume_manager root@rac1 # ls copyright patches veritas_enabled root@rac1 # cd patches root@rac1 # ls 112392-06 113211-03 README.113208-03 README.113596-03 113203-03 113595-04 README.113209-03 113208-03 113596-03 README.113210-03 113209-03 README.112392-06 README.113211-03 113210-03 README.113203-03 README.113595-04 创建文件a,其内容是: patchadd 112392-06 patchadd 113203-03 patchadd 113208-03 patchadd 113209-03 patchadd 113210-03 patchadd 113211-03 patchadd 113595-04 patchadd 113596-03 运行文件a,安装补丁程序 # sh a 以下步骤安装Veritas IBM FastT900阵列支持库: root@rac1 # ls READ_THIS_FIRST.pdf vm.3.5MP2.sol.CD_261905.tar support volume_manager root@rac1 # cd volume_manager root@rac1 # ls copyright patches veritas_enabled root@rac1 # cd veritas_enabled root@rac1 # ls 3PARData EMC.README IBM.README STK.README 3PARData.README Fujitsu LSI SUN ADTX Fujitsu.README LSI.README SUN.README ADTX.README HP MTI Toshiba ASL_README.pdf HP.README MTI.README Toshiba.README Chaparral Hitachi Netapp Chaparral.README Hitachi.README Netapp.README EMC IBM STK root@rac1 # cd IBM root@rac1 # ls SMibmasl-SOL-08.40.05.03.pkg # pkgadd –d ./ SMibmasl-SOL-08.40.05.03.pkg # vxdctl enable /* 以上这些步骤需要在rac1和rac2上执行 */ 十二、 重新启动计算机rac1和rac2 在rac2上 # halt OK 在rac1上 # reboot -- -r 等rac1启动可以登录后,再启动rac2 OK boot -r 十三、 运行vxdiskadm,初始化磁盘,将阵列置于VXVM控制之下 # vxdiskadm Volume Manager Support Operations Menu: VolumeManager/Disk 1 Add or initialize one or more disks 2 Encapsulate one or more disks 3 Remove a disk 4 Remove a disk for replacement 5 Replace a failed or removed disk 6 Mirror volumes on a disk 7 Move volumes from a disk 8 Enable access to (import) a disk group 9 Remove access to (deport) a disk group 10 Enable (online) a disk device 11 Disable (offline) a disk device 12 Mark a disk as a spare for a disk group 13 Turn off the spare flag on a disk 14 Unrelocate subdisks back to a disk 15 Exclude a disk from hot-relocation use 16 Make a disk available for hot-relocation use 17 Prevent multipathing/Suppress devices from VxVM's view 18 Allow multipathing/Unsuppress devices from VxVM's view 19 List currently suppressed/non-multipathed devices 20 Change the disk naming scheme 21 Get the newly connected/zoned disks in VxVM view list List disk information ? Display help about menu ?? Display help about the menuing system q Exit from menus Select an operation to perform: 1 Add or initialize disks Menu: VolumeManager/Disk/AddDisks Use this operation to add one or more disks to a disk group. You can add the selected disks to an existing disk group or to a new disk group that will be created as a part of the operation. The selected disks may also be added to a disk group as spares. Or they may be added as nohotuses to be excluded from hot-relocation use. The selected disks may also be initialized without adding them to a disk group leaving the disks available for use as replacement disks. More than one disk or pattern may be entered at the prompt. Here are some disk selection examples: all: all disks c3 c4t2: all disks on both controller 3 and controller 4, target 2 c3t4d2: a single disk (in the c#t#d# naming scheme) xyz_0 : a single disk (in the enclosure based naming scheme) xyz_ : all disks on the enclosure whose name is xyz Select disk devices to add: [ /* 需要在rac1和rac2上进行初始化 */ 十四、 进行SCSI-3 PR(I/O Fencing)测试 确定不同计算机上的两块硬盘是不是同一块硬盘的方法: root@rac1 # vxfenadm -i /dev/rdsk/c2t0d0s2 Vendor id : IBM Product id : 1742-900 Revision : 0520 Serial Number : }? ?? root@rac1 # rlogin rac2 Last login: Mon Nov 17 10:03:57 from 172.39.199.112 Sun Microsystems Inc. SunOS 5.9 Generic May 2002 You have new mail. Sourcing //.profile-EIS..... root@rac2 # vxfenadm -i /dev/rdsk/c2t0d0s2 Vendor id : IBM Product id : 1742-900 Revision : 0520 Serial Number : }? ?? /* 通过查看Serial Number是否一样来看是否是同一块硬盘 * IBM FastT900阵列的系列号是怪字符,但只要一样就可以了!!! */ 使用应用程序vxfentsthdw来测试磁盘阵列是否支持SCSI-3 PR(I/O Fencing): # cd /opt/VRTSvcs/rac/bin # ./vxfentsthdw ******** WARNING!!!!!!!! ******** THIS UTILITY WILL DESTROY THE DATA ON THE DISK!! Do you still want to contnue : [y/n] (default: n) y Enter the first node of the cluster: rac1 Enter the second node of the cluster: rac2 Enter the disk name to be checked for SCSI-3 PGR on node rac1 in the format: /dev/rdsk/cxtxdxsx /dev/rdsk/c2t0d0s2 Enter the disk name to be checked for SCSI-3 PGR on node rac2 in the format: /dev/rdsk/cxtxdxsx Make sure it's the same disk as seen by nodes rac1 and rac2 /dev/rdsk/c2t0d0s2 Keys registered for disk /dev/rdsk/c2t8d0s2 on node rac1 Verifying registrations of keys for disk /dev/rdsk/c2t8d0s2 on node rac1: passed Reads from disk /dev/rdsk/c4t8d0s2 successful on node rac1 Reads from disk /dev/rdsk/c4t8d0s2 successful on node rac2 Writes from disk /dev/rdsk/c4t8d0s2 successful on node rac1 Writes from disk /dev/rdsk/c4t8d0s3 successful on node rac2 . . . /* 出现如下信息表示SCSI-3 PR(I/O Fencing)测试成功 */ The disk /dev/rdsk/c4t8d0s2 is ready to be configured for I/O Fencing on node rac1 The disk /dev/rdsk/c4t8d0s2 is ready to be configured for I/O Fencing on node rac2 /* 注意:需要对每一个共享磁盘阵列进行这种测试,只有通过这种测试,才能用于安装Oracle RAC */ 十五、 配置veritas I/O Fensing 在rac1上,执行如下命令: rac1# vxdg init vxfencoorddg c2t0d1 c2t0d2 c2t0d3 /* 创建有三个协作盘的卷 */ rac1# vxdg deport vxfencoorddg /* 卸载卷vxfencoorddg */ rac1# vxdg –t import vxfencoorddg /* 安装卷vxfencoorddg,但重起时不在安装该卷 */ rac1# vxdg deport vxfencoorddg /* 卸载卷vxfencoorddg */ 在rac2上执行如下命令: rac2# vxdg –t import vxfencoorddg /* 安装卷vxfencoorddg,但重起时不在安装该卷 */ rac2# vxdg deport vxfencoorddg /* 卸载卷vxfencoorddg */ /* 以上步骤是创建协作卷组 */ 在rac1上,执行如下的步骤,配置和启动I/O Fensing: rac1# echo "vxfencoorddg" > /etc/vxfendg rac1# /etc/init.d/vxfen start 执行完这两条命令后生成如下文件: l 文件 /etc/vxfendg,其内容为: vxfencoorddg l 文件/etc/vxfentab,其内容为: /dev/rdsk/c2t0d1s2 /dev/rdsk/c2t0d2s2 /dev/rdsk/c2t0d3s2 在rac2上,执行如下的步骤,配置和启动I/O Fensing: rac2# echo "vxfencoorddg" > /etc/vxfendg rac2# /etc/init.d/vxfen start 同样,这两条命令也生成文件/etc/vxfendg和/vxfentab 下面的命令,验证I/O Fensing的功能是否启动: # /sbin/gabconfig -a GAB Port Memberships =============================================================== Port a gen 4a1c0001 membership 01 Port b gen g8ty0002 membership 01 Port d gen 40100001 membership 01 Port f gen f1990002 membership 01 Port h gen d8850002 membership 01 Port o gen f1100002 membership 01 Port q gen 28d10002 membership 01 Port v gen 1fc60002 membership 01 Port w gen 15ba0002 membership 01 如果有Port b gen g8ty0002 membership 01这一行信息显示,则表示I/O Fensing的功能已经启动。 十六、 为SRVM创建共享卷组和卷,以下的命令,在rac1上执行就可以了: vxdg -s init orasrv_dg c2t0d4 vxassist -g orasrv_dg make srvm_vol 300M vxedit set diskdetpolicy=local orasrv_dg vxdg -g orasrv_dg set activation=sw rsh -l root rac2 vxdg -g orasrv_dg set activation=sw 十七、 在rac1和rac2上创建dba组和oracle用户:oracle用户的主组是dba;主目录是/opt/oracle;shell是Bourne Shell,其环境文件如下 stty istrip PATH=/usr/bin:/usr/ucb:/etc:. export PATH ORACLE_BASE=/opt/oracle export ORACLE_BASE ORACLE_OWNER=oracle export ORACLE_OWNER ORACLE_HOME=/opt/oracle/VRT export ORACLE_HOME ORACLE_TERM=xsun5 export ORACLE_TERM ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data export ORA_NLS33 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME/jdbc/lib:usr/bin: /lib:/usr/lib:/usr/openwin/lib export LD_LIBRARY_PATH PATH=$PATH:/usr/bin:/usr/ucb:/etc:$ORACLE_HOME/bin:/opt/bin:/usr/ccs/bin: export PATH ORACLE_DOC=$ORACLE_HOME/DOC export ORACLE_DOC DBCA_RAW_CONFIG=/opt/oracle/dbfile export DBCA_RAW_CONFIG 在主目录下创建目录/opt/oracle/VRT # mkdir /opt/oracle/VRT 在主目录下创建文件/opt/oracle/.rhosts,其内容为: rac1 rac2 十八、 在rac1和rac2上修改文件/etc/system,加入如下内容: set shmsys:shminfo_shmmax=4294967296 set shmsys:shminfo_shmmin=1 set shmsys:shminfo_shmmni=100 set shmsys:shminfo_shmseg=10 set semsys:seminfo_semmni=100 set semsys:seminfo_semmns=1024 set semsys:seminfo_semmsl=256 set semsys:seminfo_semopm=100 set semsys:seminfo_semvmx=32767 十九、 重新启动计算机rac1和rac2 在rac2上 # halt OK 在rac1上 # reboot 等rac1启动可以登录后,再启动rac2 OK boot 二十、 在rac1和rac2上执行如下步骤: # cd /opt/ORCLcluster/lib/9iR2 # cp libskgxn2_64.so ../libskgxn2.so /* 64位数据库版本,如果是64位数据库版本执行cp libskgxn2_32.so ../libskgxn2.so */ 二十一、 运行oracle 9iR2的runInstaller程序,开始安装Oracle RAC,需要注意以下几点: 1、 需要选择所有的集群节点 2、 根据提示输入SRVM共享卷/dev/vx/rdsk/orasrv_dg/srvm_vol 3、 安装时需要选择Software Only(只安装oracle软件) 二十二、 以oracle用户的身份在rac1和rac2上运行如下命令: $ cp /opt/ORCLcluster/lib/9iR2/libskgxp92_64.so $ORACLE_HOME/lib/libskgxp9.so $ cd $ORACLE_HOME/lib $ mv libodm9.so libodm9.so.old $ ln -s /usr/lib/sparcv9/libodm.so libodm9.so 二十三、 在目录/opt/oracle下创建文件dbfile,内容为 system=/dev/vx/rdsk/oradata_dg/system1_vol spfile=/dev/vx/rdsk/oradata_dg/spfile1_vol users=/dev/vx/rdsk/oradata_dg/user1_vol temp=/dev/vx/rdsk/oradata_dg/temp1_vol undotbs1=/dev/vx/rdsk/oradata_dg/undotbs1_vol undotbs2=/dev/vx/rdsk/oradata_dg/undotbs2_vol example=/dev/vx/rdsk/oradata_dg/example1_vol cwmlite=/dev/vx/rdsk/oradata_dg/cwmlite1_vol indx=/dev/vx/rdsk/oradata_dg/indx1_vol tools=/dev/vx/rdsk/oradata_dg/tools1_vol drsys=/dev/vx/rdsk/oradata_dg/drsys1_vol control1=/dev/vx/rdsk/oradata_dg/control1_vol control2=/dev/vx/rdsk/oradata_dg/control2_vol redo1_1=/dev/vx/rdsk/oradata_dg/redo1_1_vol redo1_2=/dev/vx/rdsk/oradata_dg/redo1_2_vol redo2_1=/dev/vx/rdsk/oradata_dg/redo2_1_vol redo2_2=/dev/vx/rdsk/oradata_dg/redo2_2_vol odm01=/dev/vx/rdsk/oradata_dg/odm1_vol xml01=/dev/vx/rdsk/oradata_dg/xml1_vol 二十四、 在/opt/oracle/.profile文件中加入如下两行,配置环境变量 DBCA_RAW_CONFIG=/opt/oracle/dbfile export DBCA_RAW_CONFIG 二十五、 用oracle的身份登录,运行dbca图形工具创建数据库 $ dbca 这一步需要注意的是: 1、 选中创建集群数据库; 2、 注意选择oracle数据库的字符集 二十六、 修改/opt/oracle/VRT/network/admin/tnsnames.ora文件,修改后的文件内容为: # TNSNAMES.ORA Network Configuration File: /opt/oracle/VRT/network/admin/tnsname s.ora # Generated by Oracle configuration tools. LISTENERS_ORADB = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = rac1)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = rac2)(PORT = 1521)) ) INST1_HTTP = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = rac1)(PORT = 1521)) ) (CONNECT_DATA = (SERVER = SHARED) (SERVICE_NAME = MODOSE) (PRESENTATION = ) ) ) LISTENER_ORADB2 = (ADDRESS = (PROTOCOL = TCP)(HOST = rac2)(PORT = 1521)) ORADB2 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = rac2)(PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = oradb) (INSTANCE_NAME = oradb2) ) ) LISTENER_ORADB1 = (ADDRESS = (PROTOCOL = TCP)(HOST = rac1)(PORT = 1521)) ORADB1 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = rac1)(PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = oradb) (INSTANCE_NAME = oradb1) ) ) ORADB = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = rac1)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = rac2)(PORT = 1521)) (LOAD_BALANCE = yes) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = oradb) (FAILOVER_MODE= (TYPE=select) (METHOD=basic) ) ) ) 二十七、 在rac1上的文件/opt/oracle/.profile文件加入如下: ORACLE_SID=oradb1 export ORACLE_SID 二十八、 在rac1上的文件/opt/oracle/.profile文件加入如下: ORACLE_SID=oradb2 export ORACLE_SID |