打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
redhat AS+oracle 10g RAC

redhat AS+oracle 10g RAC

ORACLE等数据库 2010-06-27 19:20:16 阅读77 评论0   字号: 订阅

在网上看到很多文章都是说在vmware server 2.0+rhel 4下实现的oracle 10g RAC,都不推荐使用vmware workstation,原因是共享磁盘有问题,以下是我在vmware workstation 7下成功实现oracle 10g RAC的一些记录。
我的操作系统:win7 (32bit)
2G内存,每个虚拟机配置700M内存。
准备条件:vmware workstation 7
RedHat AS4.6
oracle 10g
ocfs2-2.6.9-67.ELsmp-1.2.9-1.el4.i686.rpm
ocfs2console-1.2.7-1.el4.i386.rpm
ocfs2-tools-1.2.7-1.el4.i386.rpm
oracleasm-2.6.9-67.ELsmp-2.0.3-1.i686.rpm
oracleasmlib-2.0.4-1.el4.i386.rpm
oracleasm-support-2.1.3-1.el4.i386.rpm


1、安装vmware workstation 7
2、安装第一台虚拟机
2.1、安装vmware tools
2.2、修改虚拟机配置文件
这里是设置其他参数以启用两个虚拟 RAC 节点之间的磁盘共享。打开配置文件 F:Virtual MachineRAC1Red Hat Enterprise Linux 4.vmxethernet0.generatedAddressOffset = "0"
vmci0.id = "-1549901261"
isolation.tools.hgfs.disable = "FALSE"
ethernet1.present = "TRUE"
ethernet1.connectionType = "hostonly"
ethernet1.wakeOnPcktRcv = "FALSE"
ethernet1.addressType = "generated"
disk.locking = "FALSE"
diskLib.dataCacheMaxSize = "0"
scsi1.sharedBus = "virtual"
diskLib.dataCacheMaxReadAheadSize=0
diskLib.dataCacheMinReadAheadSize=0
diskLib.dataCachePageSize=4096
diskLib.maxUnsyncedWrites = "0"
scsi1.present = "TRUE"
scsi1.virtualDev = "lsilogic"
scsi1:0.present = "TRUE"
scsi1:0.fileName = "F:Virtual MachineASMocfs2disk.vmdk"
scsi1:0.mode = "independent-persistent"
scsi1:0.deviceType = "disk"
scsi1:1.present = "TRUE"
scsi1:1.fileName = "F:Virtual MachineASMasm1disk.vmdk"
scsi1:1.mode = "independent-persistent"
scsi1:1.deviceType = "disk"
scsi1:2.present = "TRUE"
scsi1:2.fileName = "F:Virtual MachineASMasm2disk.vmdk"
scsi1:2.mode = "independent-persistent"
scsi1:2.deviceType = "disk"
scsi1:3.present = "TRUE"
scsi1:3.fileName = "F:Virtual MachineASMasm3disk.vmdk"
scsi1:3.mode = "independent-persistent"
scsi1:3.deviceType = "disk"
ethernet1.generatedAddress = "00:0c:29:9e:62:3c"
2.3、给虚拟机添加共享磁盘
F:Virtual MachineASMocfs2disk.vmdk /dev/sdb SCSI 1:0 512M OCFS2 磁盘
F:Virtual MachineASMasmdisk1.vmdk /dev/sdc SCSI 1:1 3072M ASM 磁盘组 1
F:Virtual MachineASMasmdisk2.vmdk /dev/sdd SCSI 1:2 3072M ASM 磁盘组 1
F:Virtual MachineASMasmdisk3.vmdk /dev/sde SCSI 1:3 2048M ASM 闪回恢复区
2.4、添加一块网卡
网卡的网络连接方式为host-only
IP地址为:10.10.10.31
netmask:255.255.255.0
2.5、安装 oracleasmlib 程序包
oracleasmlib程序包请根据操作系统的内核版本来安装。
查看内核版本:uname -r
2.6、安装oracle集群文件系统(OCFS2)
oracleasmlib程序包请根据操作系统的内核版本来安装。
查看内核版本:uname -r
2.7、创建oracle安装组和用户
# groupadd oinstall
# groupadd dba
# mkdir -p /u01/app/oracle /ocfs
# useradd -g oinstall -G dba oracle
# chown -R oracle:dba /u01
# passwd oracle
New Password:
Re-enter new Password:
passwd: password successfully changed for oracle
2.8、配置oracle安装用户环境变量
ORACLE_SID=db1
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
ORA_CRS_HOME=$ORACLE_BASE/product/10.2.0/crs_1
LD_LIBRARY_PATH=$ORACLE_HOME/lib
PATH=$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin
export ORACLE_SID ORACLE_BASE ORACLE_HOME
export ORA_CRS_HOME LD_LIBRARY_PATH PATH
2.9、配置/etc/hosts
2.10、创建文件系统目录结构
rac1-> mkdir -p $ORACLE_BASE/admin
rac1-> mkdir -p $ORACLE_HOME
rac1-> mkdir -p $ORA_CRS_HOME
rac1-> mkdir -p /u01/oradata/db
2.11、提高 Oracle 用户的 shell 限制
/etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
/etc/pam.d/login
session required /lib/security/pam_limits.so
2.12、配置内核参数
# more /etc/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 = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
2.13、修改 /etc/hosts 文件
# more /etc/hosts
127.0.0.1 localhost
192.168.2.131 rac1.oracle.com rac1
192.168.2.31 rac1-vip.oracle.com rac1-vip
10.10.10.31 rac1-priv.oralce.com rac1-priv
192.168.2.132 rac2.oracle.com rac2
192.168.2.32 rac2-vip.oracle.com rac2-vip
10.10.10.32 rac2-priv.oracle.com rac2-priv
2.14、配置 hangcheck timer 内核模块
在 /etc/modprobe.conf 中添加以下行,以设置 hangcheck 内核模块参数。
#vi /etc/modprobe.conf
options hangcheck-timer hangcheck_tick=30 hangcheck_margin=180
2.15、为 OCFS2 和 Oracle ASM 创建磁盘分区
# fdisk /dev/sdb
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.
# fdisk /dev/sdc
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-391, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-391, default 391):
Using default value 391
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
# fdisk /dev/sdd
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-391, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-391, default 391):
Using default value 391
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
# fdisk /dev/sde
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-261, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-261, default 261):
Using default value 261
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
# fdisk -l
Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 910 7309543+ 83 Linux
/dev/sda2 911 1170 2088450 82 Linux swap
/dev/sda3 1171 2610 11566800 83 Linux
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: 3221 MB, 3221225472 bytes
255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 391 3140676 83 Linux
Disk /dev/sdd: 3221 MB, 3221225472 bytes
255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdd1 1 391 3140676 83 Linux
Disk /dev/sde: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sde1 1 261 2096451 83 Linux
2.16、为 ASM 磁盘映射原始设备
将以下行添加到 /etc/sysconfig/rawdevices 中。
#vi /etc/sysconfig/rawdevices
/dev/raw/raw1 /dev/sdc1
/dev/raw/raw2 /dev/sdd1
/dev/raw/raw3 /dev/sde1
要使映射立即生效,以 root 用户身份执行以下命令:
# /sbin/service rawdevices restart
Assigning devices:
/dev/raw/raw1 --> /dev/sdc1
/dev/raw/raw1: bound to major 8, minor 33
/dev/raw/raw2 --> /dev/sdd1
/dev/raw/raw2: bound to major 8, minor 49
/dev/raw/raw3 --> /dev/sde1
/dev/raw/raw3: bound to major 8, minor 65
done
# chown oracle:dba /dev/raw/raw[1-3]
# chmod 660 /dev/raw/raw[1-3]
# ls -lat /dev/raw/raw*
crw-rw---- 1 oracle dba 162, 3 Nov 4 07:04 /dev/raw/raw3
crw-rw---- 1 oracle dba 162, 2 Nov 4 07:04 /dev/raw/raw2
crw-rw---- 1 oracle dba 162, 1 Nov 4 07:04 /dev/raw/raw1
以 oracle 用户身份执行
rac1-> ln -sf /dev/raw/raw1 /u01/oradata/devdb/asmdisk1
rac1-> ln -sf /dev/raw/raw2 /u01/oradata/devdb/asmdisk2
rac1-> ln -sf /dev/raw/raw3 /u01/oradata/devdb/asmdisk3
2.17、修改 /etc/udev/permissions.d/50-udev.permissions
在 /etc/udev/permissions.d/50-udev.permissions 中为原始行“raw/*:root:disk:0660”添加注释,然后添加一个新行“raw/*:oracle:dba:0660”。
#vi /etc/udev/permissions.d/50-udev.permissions
# raw devices
ram*:root:disk:0660
#raw/*:root:disk:0660
raw/*:oracle:dba:0660
3、创建第二台虚拟机
3.1、关闭第一台虚拟机,并将F:Virtual MachineRAC1复制到F:Virtual MachineRAC2
3.2、在vmware workstation打开第二台虚拟机F:Virtual MachineRAC2Red Hat Enterprise Linux 4.vmx
3.3、将虚拟机名称从 rac1 重命名为 rac2。右键单击您刚才打开的新 rac1 选项卡,然后选择 Settings---选择 Options 选项卡---虚拟机名称:输入“rac2”
3.4、单击 Start this virtual machine 启动 rac2,保留 rac1 为电源关闭状态。
3.5、vmware workstation会提示该虚拟机是"i move it"和"i copy it",选择"i copy it"
3.6、在系统启动的时候,会检查到新的硬件(主要是网卡),在此处可以对新硬件进行配置,也可以在系统启动之后进行配置。
3.7、修改系统的主机名
vi /etc/sysconfig/network
将hostname更改为rac2
修改oracle用户的环境变量,将ORACLE_SID=db1更改为ORACLE_SID=db2
重启机器:reboot
注:此步骤一定要做,否则会在RAC2上执行/etc/init.d/o2cb configure的时候,报这个错:o2cb_ctl: Internal logic failure failed while adding RAC1,在RAC1上正常,这是RAC2上的具体信息:
Load O2CB driver on boot (y/n) [y]: y
Cluster to start on boot (Enter "none" to clear) [ocfs2]:
Specify heartbeat dead threshold (>=7) [61]: 61
Specify network idle timeout in ms (>=5000) [30000]: 30000
Specify network keepalive delay in ms (>=1000) [2000]: 2000
Specify network reconnect delay in ms (>=2000) [2000]: 2000
Writing O2CB configuration: OK
Starting O2CB cluster ocfs2: Failed
Cluster ocfs2 created
o2cb_ctl: Internal logic failure while adding node rac1
Stopping O2CB cluster ocfs2: OK
4、建立用户等效性
在集群就绪服务 (CRS) 和 RAC 安装过程中,Oracle Universal Installer (OUI) 必须能够以 oracle 的身份将软件复制到所有 RAC 节点,而不提示输入口令。在 Oracle 10g 中,可以使用 ssh 代替 rsh 完成此操作。
要建立用户等效性,请在两个节点上以 oracle 用户身份生成用户的公钥和私钥。打开 rac1 的电源,在这两个节点上执行以下任务。
在 rac1 上执行。
rac1-> mkdir ~/.ssh
rac1-> chmod 700 ~/.ssh
rac1-> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/export/home/oracle/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /export/home/oracle/.ssh/id_rsa.
Your public key has been saved in /export/home/oracle/.ssh/id_rsa.pub.
The key fingerprint is:
87:54:4f:92:ba:ed:7b:51:5d:1d:59:5b:f9:44:da:b6 oracle@rac1.mycorpdomain.com
rac1-> ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/export/home/oracle/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /export/home/oracle/.ssh/id_dsa.
Your public key has been saved in /export/home/oracle/.ssh/id_dsa.pub.
The key fingerprint is:
31:76:96:e6:fc:b7:25:04:fd:70:42:04:1f:fc:9a:26 oracle@rac1.mycorpdomain.com
在 rac2 上执行
rac2-> mkdir ~/.ssh
rac2-> chmod 700 ~/.ssh
rac2-> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/export/home/oracle/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /export/home/oracle/.ssh/id_rsa.
Your public key has been saved in /export/home/oracle/.ssh/id_rsa.pub.
The key fingerprint is:
29:5a:35:ac:0a:03:2c:38:22:3c:95:5d:68:aa:56:66 oracle@rac2.mycorpdomain.com
rac2-> ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/export/home/oracle/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /export/home/oracle/.ssh/id_dsa.
Your public key has been saved in /export/home/oracle/.ssh/id_dsa.pub.
The key fingerprint is:
4c:b2:5a:8d:56:0f:dc:7b:bc:e0:cd:3b:8e:b9:5c:7c oracle@rac2.mycorpdomain.com
在 rac1 上执行
rac1-> cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
rac1-> cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
rac1-> ssh rac2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
The authenticity of host 'rac2 (192.168.2.132)' can't be established.
RSA key fingerprint is 63:d3:52:d4:4d:e2:cb:ac:8d:4a:66:9f:f1:ab:28:1f.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'rac2,192.168.2.132' (RSA) to the list of known hosts.
oracle@rac2's password:
rac1-> ssh rac2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
oracle@rac2's password:
rac1-> scp ~/.ssh/authorized_keys rac2:~/.ssh/authorized_keys
oracle@rac2's password:
authorized_keys 100% 1716 1.7KB/s 00:00
在每个节点上测试连接。验证当您再次运行以下命令时,系统是否不提示您输入口令。
ssh rac1 date
ssh rac2 date
ssh rac1-priv date
ssh rac2-priv date
ssh rac1.oracle.com date
ssh rac2.oracle.com date
ssh rac1-priv.oracle.com date
ssh rac2-priv.oracle.com date
5. 配置 Oracle 自动存储管理 (ASM)
Oracle ASM 与 Oracle 数据库紧密集成在一起,并与 Oracle 的数据管理工具套件配合工作。它可以简化数据库存储管理,并提供原始磁盘 I/O 的性能。
配置 ASMLib。以 root 用户身份在两个节点上配置 ASMLib。
# /etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets ('[]'). Hitting without typing an
answer will keep that current value. Ctrl-C will abort.
Default user to own the driver interface []: oracle
Default group to own the driver interface []: dba
Start Oracle ASM library driver on boot (y/n) [n]: y
Fix permissions of Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: [ OK ]
Loading module "oracleasm": [ OK ]
Mounting ASMlib driver filesystem: [ OK ]
Scanning system for ASM disks: [ OK ]
创建 ASM 磁盘。以 root 用户身份在任何一个节点上创建 ASM 磁盘。
# /etc/init.d/oracleasm createdisk VOL1 /dev/sdc1
Marking disk "/dev/sdc1" as an ASM disk: [ OK ]
# /etc/init.d/oracleasm createdisk VOL2 /dev/sdd1
Marking disk "/dev/sdd1" as an ASM disk: [ OK ]
# /etc/init.d/oracleasm createdisk VOL3 /dev/sde1
Marking disk "/dev/sde1" as an ASM disk: [ OK ]
Verify that the ASM disks are visible from every node.
# /etc/init.d/oracleasm scandisks
Scanning system for ASM disks: [ OK ]
# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
6、配置 Oracle 集群文件系统 (OCFS2)
6.1、创建 OCFS2 配置文件。 在 rac1 上,以 root 用户身份执行
# ocfs2console
1. OCFS2 控制台:选择 Cluster,然后选择 Configure Nodes。
2. “集群堆栈已经启动”:单击 Close。
3. 节点配置:单击 Add。
4. 新增节点:添加以下节点,然后单击 Apply。
* 名称:rac1
* IP 地址: 192.168.2.131
* IP 端口: 7777
* 名称:rac2
* IP 地址: 192.168.2.132
* IP 端口: 7777
5. 验证生成的配置文件。
# more /etc/ocfs2/cluster.conf
node:
ip_port = 7777
ip_address = 192.168.2.131
number = 0
name = rac1
cluster = ocfs2
node:
ip_port = 7777
ip_address = 192.168.2.132
number = 1
name = rac2
cluster = ocfs2
cluster:
node_count = 2
name = ocfs2
6. 将配置文件传播到 rac2。您可以在 rac2 上重新运行上述步骤以生成配置文件,或者在 rac1 的 OCFS2 控制台上选择 Cluster 和 Propagate Configuration 以将配置文件传播到 rac2。
6.2、配置 O2CB 驱动程序
在两个节点上执行下面的过程,将 O2CB 配置为在引导时启动。
以 root 用户身份执行
# /etc/init.d/o2cb unload
Stopping O2CB cluster ocfs2: OK
Unmounting ocfs2_dlmfs filesystem: OK
Unloading module "ocfs2_dlmfs": OK
Unmounting configfs filesystem: OK
Unloading module "configfs": OK
# /etc/init.d/o2cb configure
Configuring the O2CB driver.
This will configure the on-boot properties of the O2CB driver.
The following questions will determine whether the driver is loaded on
boot. The current values will be shown in brackets ('[]'). Hitting
without typing an answer will keep that current value. Ctrl-C
will abort.
Load O2CB driver on boot (y/n) [y]: y
Cluster to start on boot (Enter "none" to clear) [ocfs2]:
Specify heartbeat dead threshold (>=7) [7]: 61
Writing O2CB configuration: OK
Loading module "configfs": OK
Mounting configfs filesystem at /config: OK
Loading module "ocfs2_nodemanager": OK
Loading module "ocfs2_dlm": OK
Loading module "ocfs2_dlmfs": OK
Mounting ocfs2_dlmfs filesystem at /dlm: OK
Starting O2CB cluster ocfs2: OK
6.3、格式化文件系统。在格式化和挂载文件系统之前,应验证 O2CB 在两个节点上均联机;O2CB 心跳当前没有活动,因为文件系统未挂载。
# /etc/init.d/o2cb status
Module "configfs": Loaded
Filesystem "configfs": Mounted
Module "ocfs2_nodemanager": Loaded
Module "ocfs2_dlm": Loaded
Module "ocfs2_dlmfs": Loaded
Filesystem "ocfs2_dlmfs": Mounted
Checking O2CB cluster ocfs2: Online
Checking O2CB heartbeat: Not active
您只需在一个节点上格式化文件系统。在 rac1 上,以 root 用户身份执行
# ocfs2console
1. OCFS2 控制台:选择 Tasks、Format。
2. 格式:
* 可用设备:/dev/sdb1
* 卷标:oracle
* 集群大小:Auto
* 节点插槽数量: 4
* 块大小:Auto
3. OCFS2 控制台:按 CTRL-Q 退出。
6.4、挂载文件系统。要挂载文件系统,在两个节点上执行以下命令。
# mount -t ocfs2 -o datavolume,nointr /dev/sdb1 /ocfs
要在引导时挂载文件系统,在两个节点的 /etc/fstab 中添加以下行。
/etc/fstab
/dev/sdb1 /ocfs ocfs2 _netdev,datavolume,nointr 0 0
6.5、创建 Oracle 集群件目录。在 OCR 和表决磁盘将驻留的 OCFS2 文件系统中创建目录。
在 rac1 上执行
# mkdir /ocfs/clusterware
# chown -R oracle:dba /ocfs
现在,您已经完成了 OCFS2 的设置。验证您可以在两个节点的共享集群文件系统上读写文件。
7、安装 Oracle 集群件
下载后,在 rac1 上以 oracle 用户身份执行
rac1-> /u01/staging/clusterware/runInstaller
1. 欢迎页面:单击 Next。
2. 指定 Inventory 目录和证书:
* 输入 inventory 目录的完整路径:/u01/app/oracle/oraInventory。
* 指定操作系统组名:oinstall。
3. 指定 Home 详细内容:
* 名称:OraCrs10g_home
* /u01/app/oracle/product/10.2.0/crs_1
4. 特定于产品的必要条件检查:
* 忽略有关物理内存要求的警告。
5. 指定集群配置:单击 Add。
* 公共节点名称:rac2.oracle.com
* 专用节点名称:rac2-priv.oracle.com
* 虚拟主机名称:rac2-vip.oracle.com
6. 指定网络接口用法:
* 接口名称:eth0
* 子网: 192.168.1.0
* 接口类型:Public
* 接口名称:eth1
* 子网: 172.16.1.0
* 接口类型:Private
7. 指定 Oracle 集群注册表 (OCR) 位置:选择 External Redundancy。
为了简单起见,这里将不镜像 OCR。在生产环境中,您可能会考虑复用 OCR 以实现更高的冗余。
* 指定 OCR 位置:/ocfs/clusterware/ocr
8. 指定表决磁盘位置:选择 External Redundancy。
同样,为了简单起见,我们选择不镜像表决磁盘。
* 表决磁盘位置:/ocfs/clusterware/votingdisk
9. 摘要:单击 Install。
10. 执行配置脚本:以 root 用户身份按顺序执行以下脚本(一次执行一个)。在当前脚本完成后,再继续执行下一个脚本。
* 在 rac1 上执行 /u01/app/oracle/oraInventory/orainstRoot.sh。
* 在 rac2 上执行 /u01/app/oracle/oraInventory/orainstRoot.sh。
* 在 rac1 上执行 /u01/app/oracle/product/10.2.0/crs_1/root.sh。
* 在 rac2 上执行 /u01/app/oracle/product/10.2.0/crs_1/root.sh。
rac2 上的 root.sh 脚本会自动调用 VIPCA,但会因为“The given interface(s), "eth0" is not public.Public interfaces should be used to configure virtual IPs.”错误而失败。如果您的公共接口使用不可路由的 IP 地址 (192.168.x.x),则 Oracle 集群验证实用程序 (CVU) 将无法找到合适的公共接口。一种解决方法是手动运行 VIPCA。
11. 以 root 用户身份在第二个节点上手动调用 VIPCA。
# /u01/app/oracle/product/10.2.0/crs_1/bin/vipca
12. 欢迎页面:单击 Next。
13. 网络接口:选择 eth0。
14. 集群节点的虚拟 IP:
* 节点名称:rac1
* IP 别名:rac1-vip
* IP 地址: 192.168.2.31
* 子网掩码: 255.255.255.0
* 节点名称:rac2
* IP 别名:rac2-vip
* IP 地址: 192.168.2.32
* 子网掩码: 255.255.255.0
15.摘要:单击 Finish。
16.配置助手进度对话框:配置完成后,单击 OK。
17.配置结果:单击 Exit。
18.返回到 rac1 的执行配置脚本屏幕,然后单击 OK。
8、安装 Oracle 数据库 10g 第 2 版
下载后,在 rac1 上以 oracle 用户身份执行
rac1-> /u01/staging/database/runInstaller
1. 欢迎页面:单击 Next。
2. 选择安装类型:
* 选择 Enterprise Edition。
3. 指定 Home 详细内容:
* 名称:OraDb10g_home1
* 路径:/u01/app/oracle/product/10.2.0/db_1
4. 指定硬件集群安装模式:
* 选择 Cluster Installation。
* 单击 Select All。
5. 特定于产品的必要条件检查:
* 忽略有关物理内存要求的警告。
6. 选择配置选项:
* 创建数据库。
7. 选择数据库配置:
* 选择 Advanced。
8. 摘要:单击 Install。
9. 数据库模板:
* 选择 General Purpose。
10. 数据库标识:
* 全局数据库名称:db
* SID 前缀:db
11. 管理选项:
* 选择 Configure the Database with Enterprise Manager。
12. 数据库证书:
* 针对所有帐户使用相同的口令。
13. 存储选项:
* 选择 Automatic Storage Management (ASM)。
14. 创建 ASM 实例:
* SYS 口令:<输入 SYS 口令>。
* 选择 Create initialization parameter file (IFILE)。
15. ASM 磁盘组:
* 单击 Create New。
16. 创建磁盘组:
创建两个磁盘组 — DG1 和 RECOVERYDEST。
* 磁盘组名称:DG1
* 选择 Normal 冗余。
* 选择磁盘路径 ORCL:VOL1 和 ORCL:VOL2。如果您已经使用标准 Linux I/O 配置了 ASM 磁盘,则请选择 /u01/oradata/devdb/asmdisk1 和 /u01/oradata/devdb/asmdisk2。
* 单击 OK。
* 磁盘组名称:RECOVERYDEST。
* 选择 External 冗余。
* 选择磁盘路径 ORCL:VOL3。如果您已经使用标准 Linux I/O 配置了 ASM 磁盘,则请选择 /u01/oradata/devdb/asmdisk3。
* 单击 OK。
17. ASM 磁盘组:单击 Next。
18. 数据库文件位置:
* 选择 Use Oracle-Managed Files。
o 数据库区域:+DG1
19. 恢复配置:
* 选择 Specify Flash Recovery Area。
o 闪回恢复区:+RECOVERYDEST
o 闪回恢复区大小:1500M
* 选择 Enable Archiving。
20. 数据库内容:
* 选择或取消选择示例模式。
21. 数据库服务:
* 单击 Next。稍后,您可以使用 DBCA 或 srvctl 创建或修改其他服务。
22. 初始化参数:
* 选择 Custom。
o 共享内存管理:Automatic
o SGA 大小:176MB
o PGA 大小:58MB
* b. 根据需要修改其余参数。
23. 数据库存储:单击 Next。
24. 创建选项:
* 选择 Create Database。
* 单击 Finish。
25. 摘要:单击 OK。
26. 数据库配置助手:单击 Exit。
27. 执行配置脚本:以 root 用户身份执行下面的脚本。
* 在 rac1 上执行 /u01/app/oracle/product/10.2.0/db_1/root.sh。
* 在 rac2 上执行 /u01/app/oracle/product/10.2.0/db_1/root.sh。
28. 返回到 rac1 的执行配置脚本屏幕,然后单击 OK。
29. 安装结束:单击 Exit。
恭喜,你已经在 RedHat Linux AS4 上成功安装了 Oracle RAC 数据库 10g!
9、检查 RAC 数据库环境
现在,您已经成功安装了虚拟双节点 RAC 数据库,下面来检查应用程序资源的状态。
rac1-> crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.devdb.db application ONLINE ONLINE rac1
ora....b1.inst application ONLINE ONLINE rac1
ora....b2.inst application ONLINE ONLINE rac2
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
linux平台oracle10g rac搭建
使用 VMware Server 在 Oracle Enterprise Linux 上安...
OCFS2+ASM 的RAC安装文档
Vmware server1.0 Linux As4 Oracle 10g RAC
详细解析Oracle RAC在Linux下的安装
【安装篇】- 基于 VMWARE Oracle Linux7.9 安装 Oracle19c RAC 详细配置方案
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服