在VMware Server 2.0.2 上安裝 Oracle 10g RAC 手把手詳解

來源:互聯網
上載者:User

一步一步,完全不會報錯

IP 規劃

192.168.8.241

192.168.8.242
192.168.8.248
192.168.8.249

rac1->export LANG=en_US.UTF-8

vi /etc/sysconfig/network-scripts/ifcfg-eth0
vi /etc/sysconfig/network-scripts/ifcfg-eth1
[root@rac2 ~]# more /etc/sysconfig/network-scripts/ifcfg-eth0
# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE=eth0
BOOTPROTO=none
IPADDR=192.168.8.242
ONBOOT=yes
HWADDR=00:0c:29:98:38:5a
NETMASK=255.255.255.0
GATEWAY=192.168.8.1
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
You have new mail in /var/spool/mail/root

service network restart

[root@rac1 ~]# vi /etc/hosts
127.0.0.1       localhost
192.168.8.241   rac1.oracle.com         rac1
192.168.8.248   rac1-vip.oracle.com     rac1-vip
10.10.10.241    rac1-priv.oracle.com    rac1-priv
192.168.8.242   rac2.oracle.com         rac2
192.168.8.249   rac2-vip.oracle.com     rac2-vip
10.10.10.242    rac2-priv.oracle.com    rac2-priv

[root@rac2 ~]# vi /etc/hosts
127.0.0.1       localhost
192.168.8.241   rac1.oracle.com         rac1
192.168.8.248   rac1-vip.oracle.com     rac1-vip
10.10.10.241    rac1-priv.oracle.com    rac1-priv
192.168.8.242   rac2.oracle.com         rac2
192.168.8.249   rac2-vip.oracle.com     rac2-vip
10.10.10.242    rac2-priv.oracle.com    rac2-priv

rac1->mkdir ~/.ssh
rac1->chmod 700 ~/.ssh
rac1->ssh-keygen -t rsa
rac1->ssh-keygen -t dsa

rac2->mkdir ~/.ssh
rac2->chmod 700 ~/.ssh
rac2->ssh-keygen -t rsa
rac2->ssh-keygen -t dsa

rac2->cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
rac2->cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
rac2->ssh rac1 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys 
rac2->ssh rac1 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys 
rac2->scp ~/.ssh/authorized_keys rac1:~/.ssh/authorized_keys 
oracle@rac1's password: 
authorized_keys                               100% 2032     2.0KB/s  
 00:00

rac1->ssh rac2 date
rac1->ssh rac2-priv date
rac1->ssh rac2.oracle.com date
rac1->ssh rac2-priv.oracle.com date
rac1->ssh rac1.oracle.com
rac1->ssh rac1
rac1->ssh rac1-priv.oracle.com
rac1->ssh rac1-priv

rac2->ssh rac1.oracle.com date
rac2->ssh rac1-priv.oracle.com date
rac2->ssh rac1 date
rac2->ssh rac1-priv date
rac2->ssh rac2.oracle.com
rac2->ssh rac2
rac2->ssh rac2-priv.oracle.com
rac2->ssh rac2-priv

[root@rac1 ~]# rpm -qa|grep ocfs
ocfs2-2.6.18-128.el5xen-1.2.9-1.el5
ocfs2-2.6.18-128.el5-1.2.9-1.el5
ocfs2console-1.2.7-1.el5
ocfs2-2.6.18-128.el5debug-1.2.9-1.el5
ocfs2-tools-devel-1.2.7-1.el5
ocfs2-2.6.18-128.el5PAE-1.2.9-1.el5
ocfs2-tools-1.2.7-1.el5

[root@rac2 ~]# rpm -qa | grep ocfs
ocfs2-2.6.18-128.el5xen-1.2.9-1.el5
ocfs2-2.6.18-128.el5-1.2.9-1.el5
ocfs2console-1.2.7-1.el5
ocfs2-2.6.18-128.el5debug-1.2.9-1.el5
ocfs2-tools-devel-1.2.7-1.el5
ocfs2-2.6.18-128.el5PAE-1.2.9-1.el5
ocfs2-tools-1.2.7-1.el5

配置cluster file system

ocfs2console

rac1->more /etc/ocfs2/cluster.conf 
node:
        ip_port = 7777
        ip_address = 192.168.8.241
        number = 0
        name = rac1
        cluster = ocfs2

node:
        ip_port = 7777
        ip_address = 192.168.8.242
        number = 1
        name = rac2
        cluster = ocfs2

ocfs2console 傳輸設定檔
[root@rac2 ~]# more /etc/ocfs2/cluster.conf 
node:
        ip_port = 7777
        ip_address = 192.168.8.241
        number = 0
        name = rac1
        cluster = ocfs2

node:
        ip_port = 7777
        ip_address = 192.168.8.242
        number = 1
        name = rac2
        cluster = ocfs2

cluster:
        node_count = 2
        name = ocfs2

cluster:
        node_count = 2
        name = ocfs2

[root@rac1 ~]# /etc/init.d/o2cb unload
[root@rac2 ~]# /etc/init.d/o2cb unload

配置心跳
[root@rac1 ~]# /etc/init.d/o2cb configure
[root@rac2 ~]# /etc/init.d/o2cb configure
[root@rac1 ~]# /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
  Heartbeat dead threshold: 1200
  Network idle timeout: 30000
  Network keepalive delay: 2000
  Network reconnect delay: 2000
Checking O2CB heartbeat: Not active
[root@rac2 ~]#  /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
  Heartbeat dead threshold: 1200
  Network idle timeout: 30000
  Network keepalive delay: 2000
  Network reconnect delay: 2000
Checking O2CB heartbeat: Not active

[root@rac1 ~]# fdisk -l
Disk /dev/sdb: 536 MB, 536870912 bytes
64 heads, 32 sectors/track, 512 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

ocfs2console 格式化 /dev/sdb

掛載
[root@rac1 ~]# mount -t ocfs2 -o datavolume,nointr /dev/sdb1 /ocfs
[root@rac2 ~]# mount -t ocfs2 -o datavolume,nointr /dev/sdb1 /ocfs

[root@rac1 ~]# vi /etc/fstab
[root@rac2 ~]# vi /etc/fstab 
/dev/sdb1               /ocfs           ocfs2   _netdev,datavolume,nointr 0 0

[root@rac1 ~]# df -h
[root@rac2 ~]# df -h
[root@rac1 ~]# cd /ocfs
[root@rac1 ocfs]# ll
total 1
drwxr-xr-x 2 root root 1024 Aug 12 00:51 lost+found

[root@rac1 ocfs]# mkdir cluster
[root@rac1 ocfs]# chown -R oracle:dba /ocfs
[root@rac2 soft]# cd /ocfs
[root@rac2 ocfs]# ll
total 2
drwxr-xr-x 2 oracle dba 1024 Aug 12 01:00 cluster
drwxr-xr-x 2 oracle dba 1024 Aug 12 00:51 lost+found

rac1->cd /soft
rac1->ll
total 12
drwxrwxrwx 9 oracle oinstall 4096 Jun  3 12:14 clusterware
drwxrwxrwx 6 oracle oinstall 4096 Jul  3  2005 database
drwxr-xr-x 3 root   root     4096 Nov 22  2009 rac

rac1->more ~/.bash_profile
rac2->more ~/.bash_profile

PATH=$PATH:$HOME/bin

export PS1="`/bin/hostname -s`->"
export EDITOR=vim
export ORACLE_SID=devdb1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORA_CRS_HOME=$ORACLE_BASE/product/10.2.0/crs_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib

export PATH=$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/
usr/X11R6/bin
umask 022
export LANG=en_US.UTF-8

rac1->export LANG=en
rac1->cd /soft
rac1->cd clusterware/
rac1->pwd
/soft/clusterware
rac1->ll
total 36
drwxrwxrwx 2 oracle oinstall 4096 Jun  3 12:10 cluvfy
drwxrwxrwx 6 oracle oinstall 4096 Jun  3 12:10 doc
drwxrwxrwx 4 oracle oinstall 4096 Jun  3 12:10 install
drwxrwxrwx 2 oracle oinstall 4096 Jun  3 12:10 response
drwxrwxrwx 2 oracle oinstall 4096 Jun  3 12:10 rpm
-rwxrwxrwx 1 oracle oinstall 1328 Jun  3 12:10 runInstaller
drwxrwxrwx 9 oracle oinstall 4096 Jun  3 12:14 stage
drwxrwxrwx 2 oracle oinstall 4096 Jun  3 12:14 upgrade
-rwxrwxrwx 1 oracle oinstall 3445 Jun  3 12:14 welcome.html

ocr disk:/ocfs/cluster/ocr
vote disk:/ocfs/cluster/votingdisk

[root@rac1 ~]# /u01/app/oracle/oraInventory/orainstRoot.sh
[root@rac2 ~]# /u01/app/oracle/oraInventory/orainstRoot.sh

[root@rac1 ~]# cd /u01/app/oracle/product/10.2.0/crs_1/bin
[root@rac1 bin]# ls -l vipca
-rwxr-xr-x 1 oracle oinstall 5014 Aug 12 02:01 vipca
[root@rac1 bin]# vi vipca
unset LD_ASSUME_KERNEL

[root@rac1 bin]# vim srvctl
unset LD_ASSUME_KERNEL

[root@rac2 bin]# vi vipca
unset LD_ASSUME_KERNEL

[root@rac2 bin]# vim srvctl
unset LD_ASSUME_KERNEL

[root@rac1 bin]# /u01/app/oracle/product/10.2.0/crs_1/root.sh
[root@rac2 bin]# /u01/app/oracle/product/10.2.0/crs_1/root.sh
dding daemons to inittab
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
        rac1
        rac2
CSS is active on all nodes.
Waiting for the Oracle CRSD and EVMD to start
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])]

vipca

alias

[root@rac1 ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.8.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth1
10.0.0.0        0.0.0.0         255.0.0.0       U     0      0        0 eth1
[root@rac1 ~]# route add default gw 192.168.8.1
[root@rac1 ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.8.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth1
10.0.0.0        0.0.0.0         255.0.0.0       U     0      0        0 eth1
0.0.0.0         192.168.8.1     0.0.0.0         UG    0      0        0 eth0

[root@rac2 ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.8.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth1
10.0.0.0        0.0.0.0         255.0.0.0       U     0      0        0 eth
[root@rac2 ~]# route add default gw 192.168.8.1
[root@rac2 ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.8.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth1
10.0.0.0        0.0.0.0         255.0.0.0       U     0      0        0 eth1
0.0.0.0         192.168.8.1     0.0.0.0         UG    0      0        0 eth0

[root@rac2 bin]# ./oifcfg setif -global eth0/192.168.8.0:public
[root@rac2 bin]# ./oifcfg setif -global eth1/10.10.10.0:cluster_interconnect
[root@rac2 bin]# ./oifcfg iflist
eth0  192.168.8.0
eth1  10.0.0.0
[root@rac1 bin]# ./oifcfg getif
eth0  192.168.8.0  global  public
eth1  10.10.10.0  global  cluster_interconnect

rac1->rpm -qa | grep oracleasm
rac2->rpm -qa | grep oracleasm

[root@rac1 rac1]# /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 <ENTER> 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
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [  OK  ]
Scanning the system for Oracle ASMLib disks: [  OK  ]

[root@rac2 ~]# /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 <ENTER> 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
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [  OK  ]
Scanning the system for Oracle ASMLib disks: [  OK  ]

[root@rac1 rac1]# /etc/init.d/oracleasm createdisk VOL1 /dev/sdc1
Marking disk "VOL1" as an ASM disk: [  OK  ]
[root@rac1 rac1]# /etc/init.d/oracleasm createdisk VOL1 /dev/sdc1
Marking disk "VOL1" as an ASM disk: [  OK  ]
[root@rac1 rac1]# /etc/init.d/oracleasm createdisk VOL2 /dev/sdd1
Marking disk "VOL2" as an ASM disk: [  OK  ]
[root@rac1 rac1]# /etc/init.d/oracleasm createdisk VOL3 /dev/sde1
Marking disk "VOL3" as an ASM disk: [  OK  ]
[root@rac1 rac1]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3

[root@rac2 ~]# /etc/init.d/oracleasm listdisks
[root@rac2 ~]# /etc/init.d/oracleasm
Usage: /etc/init.d/oracleasm {start|stop|restart|enable|disable|configure|createdisk|deletedisk|querydisk|listdisks|scandisks|status}
[root@rac2 ~]# /etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks: [  OK  ]
[root@rac2 ~]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3

[root@rac1 ~]# /u01/app/oracle/product/10.2.0/db_1/root.sh

[root@rac2 ~]# /u01/app/oracle/product/10.2.0/db_1/root.sh

如需轉載,請註明出處及原文連結

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.