Step by step Install Oracle 11gR2(11.2.0.4.0) RAC+Active DataGuard on Oracle Enterprise Linux(OEL6.3X86_64)

1、概述和说明

1.1、概述

  本文档用于详细记录在OEL6.3X86_64位系统上安装配置Oracle 11gR2(11.2.0.4.0)RAC的步骤、RAC数据库的基本维护、为RAC创建单实例Active Physical DataGuard、验证Active DataGuard的功能、RAC主库同单实例物理备库的角色转换等内容。

  安装平台选择Oracle公司的Virtual Box虚拟机软件,通过在该虚拟机上配置两台OEL6.3 X86_64位Linux系统的机器,然后在这两台机器上配置Oracle11gR2RAC系统。其中

禁用selinux (将配置文件中SELINUX=enforcing修改为SELINUX=disabled) (注意:双节点都要执行)

[root@BJRAC ~]# more /etc/selinux/config 

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted 
禁用前
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
禁用后
RAC + DG 网络规划
Hostname Short Hostname Type IP Address Interface
BJRAC.localdomain BJRAC Public IP 192.168.1.150 eth0
BJRAC-VIP.localdomain BJRAC-VIP Virtual IP 192.168.1.152 eth0:0
BJRAC-PRIV.localdomain BJRAC-PRIV Private IP 192.168.56.150 eth1
CQRAC.localdomain CQRAC Public IP 192.168.1.160 eth0
CQRAC-VIP.localdomain CQRAC-VIP Virtual IP 192.168.1.162 eth0:0
CQRAC-PRIV.localdomain CQRAC-PRIV Private IP 192.168.56.160 eth1
SCAN-CLUSTER.localdomain SCAN-CLUSTER Scan IP 192.168.1.203 eth0
RACDG.localdomain RACDG Public IP 192.168.1.170 eth0

>关闭防火墙 (注意:双节点都要执行)

[root@CQRAC ~]# set NLS=C
[root@CQRAC ~]# setup

进行设置即可.在这个界面中同样可以设置关闭其他的服务比如说ip6tables、iptables、sendmail等服务

>>关闭iptable服务之前,查看其状态

[root@BJRAC ~]# service iptables status
Table: filter
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination         
1    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED 
2    ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0           
3    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           
4    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:22 
5    REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited 

Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination         
1    REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited 


Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination    

>>关闭iptable服务之后,可以查看状态

[root@CQRAC ~]# service iptables status                                                                                                      
iptables: Firewall is not running.

>取消图形界面(注意:双节点都要执行)

因为Oracle Enterprise Linux6.3 X86_64为操作系统在安装时默认设置为字符界面,所以这里不需要再设置。

# inittab is only used by upstart for the default runlevel.
#
# ADDING OTHER CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
#
# System initialization is started by /etc/init/rcS.conf
#
# Individual runlevels are started by /etc/init/rc.conf
#
# Ctrl-Alt-Delete is handled by /etc/init/control-alt-delete.conf
#
# Terminal gettys are handled by /etc/init/tty.conf and /etc/init/serial.conf,
# with configuration in /etc/sysconfig/init.
#
# For information on how to write upstart event handlers, or how
# upstart works, see init(5), init(8), and initctl(8).
#
# Default runlevel. The runlevels used are:
#   0 - halt (Do NOT set initdefault to this)
#   1 - Single user mode
#   2 - Multiuser, without NFS (The same as 3, if you do not have networking)
#   3 - Full multiuser mode
#   4 - unused
#   5 - X11
#   6 - reboot (Do NOT set initdefault to this)
#
id:3:initdefault:

>配置/etc/hosts文件(注意:双节点都要执行)

[root@BJRAC ~]# more /etc/hosts
127.0.0.1   localhost
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

#BJRAC
192.168.1.150           BJRAC.localdomain               BJRAC
192.168.1.152           BJRAC-VIP.localdomain           BJRAC-VIP
192.168.56.150          BJRAC-PRIV.localdomain          BJRAC-PRIV

#CQRAC
192.168.1.160           CQRAC.localdomain               CQRAC
192.68.1.162            CQRAC-VIP.localdomain           CQRAC-VIP
192.168.56.160          CQRAC-PRIV.localdomain          CQRAC-PRIV

#SCAN-IP
192.168.1.203           SCAN-CLUSTER.localdomain        SCAN-CLUSTER

#RACDG
192.168.1.170           RACDG.localdomain               RACDG

注意:要使两个节点中的/etc/hosts中的文件内容一致

2.3、配置DNS服务器,确认SCANIP可以被解析

参考文章

2.10、停止NTP,11gR2新增的检查项

BJRAC节点

[root@BJRAC /]# service ntpd status
ntpd is stopped
[root@BJRAC /]# chkconfig ntpd off
[root@BJRAC /]# mv /etc/ntp.conf /etc/ntp.conf.bak
[root@BJRAC /]# 

CQRAC节点

[root@CQRAC /]# service ntpd status
ntpd is stopped
[root@CQRAC /]# chkconfig ntpd off
[root@CQRAC /]# mv /etc/ntp.conf /etc/ntp.conf.bak

2.12、配置oracle、grid用户SSH对等性

参考文章

[root@CQRAC /]# su - grid
CQRAC-> mkdir ~/.ssh
CQRAC-> chmod 700 ~/.ssh/
CQRAC-> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/grid/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/grid/.ssh/id_rsa.
Your public key has been saved in /home/grid/.ssh/id_rsa.pub.
The key fingerprint is:
a9:c6:cb:11:cd:d5:f5:dc:77:04:51:79:ba:77:4b:37 grid@CQRAC.localdomain
The key's randomart image is:
+--[ RSA 2048]----+
|              +++|
|           . . =o|
|          . .  .B|
|       o o    . o|
|      . S      . |
|     . o      .E+|
|      =       ..=|
|     o o       . |
|      o          |
+-----------------+
CQRAC-> ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/grid/.ssh/id_dsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/grid/.ssh/id_dsa.
Your public key has been saved in /home/grid/.ssh/id_dsa.pub.
The key fingerprint is:
7c:c6:e3:d6:48:1b:57:a3:d0:b8:a3:10:e5:cd:b2:48 grid@CQRAC.localdomain
The key's randomart image is:
+--[ DSA 1024]----+
|        .        |
|       o o o     |
|      E o = . o  |
|     . + + o o . |
|      o S X o    |
|       . * O     |
|        . = .    |
|         .       |
|                 |
+-----------------+
CQRAC-> 
BJRAC-> cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
BJRAC-> cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
BJRAC-> ssh CQRAC cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys 
The authenticity of host 'cqrac (192.168.1.160)' can't be established.
RSA key fingerprint is f1:6f:7a:3a:73:40:5f:b6:57:8b:cb:9a:b0:50:7c:73.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'cqrac,192.168.1.160' (RSA) to the list of known hosts.
grid@cqrac's password: 
BJRAC-> ssh CQRAC cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys 
grid@cqrac's password: 
BJRAC-> scp ~/.ssh/authorized_keys CQRAC:~/.ssh/authorized_keys 
grid@cqrac's password: 
authorized_keys            
BJRAC-> ssh BJRAC date
Tue Feb 18 20:47:30 CST 2014
BJRAC-> ssh BJRAC-priv date
Tue Feb 18 20:47:34 CST 2014
BJRAC-> ssh BJRAC-priv.localdomain date
Tue Feb 18 20:47:41 CST 2014
BJRAC-> ssh CQRAC date
Mon Feb 17 23:23:25 CST 2014
BJRAC-> ssh CQRAC-priv date
Mon Feb 17 23:23:29 CST 2014
BJRAC-> ssh CQRAC-priv.localdomain date
Mon Feb 17 23:23:40 CST 2014
CQRAC-> ssh BJRAC date
Tue Feb 18 20:52:17 CST 2014
CQRAC-> ssh CQRAC date
Mon Feb 17 23:27:58 CST 2014
CQRAC-> ssh BJRAC-priv date
Tue Feb 18 20:52:29 CST 2014
CQRAC-> ssh BJRAC-priv.localdomain date
Tue Feb 18 20:52:38 CST 2014
CQRAC-> ssh CQRAC-priv.localdomain date
Mon Feb 17 23:28:28 CST 2014
CQRAC-> ssh CQRAC-priv date
Mon Feb 17 23:28:36 CST 2014

2.13、配置共享磁盘

2.14、配置asm磁盘

[root@BJRAC RACInstallPackages]# fdisk /dev/sdb 
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x69be0541.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): p

Disk /dev/sdb: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x69be0541

   Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
1
Invalid partition number for type `1'
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-3916, default 1): 
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-3916, default 3916): +2g
Unsupported suffix: 'g'.
Supported: 10^N: KB (KiloByte), MB (MegaByte), GB (GigaByte)
            2^N: K  (KibiByte), M  (MebiByte), G  (GibiByte)
Last cylinder, +cylinders or +size{K,M,G} (1-3916, default 3916): +2G

Command (m for help): p

Disk /dev/sdb: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x69be0541

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         262     2104483+  83  Linux

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (263-3916, default 263): 
Using default value 263
Last cylinder, +cylinders or +size{K,M,G} (263-3916, default 3916): +2G

Command (m for help): p

Disk /dev/sdb: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x69be0541

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         262     2104483+  83  Linux
/dev/sdb2             263         524     2104515   83  Linux

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (525-3916, default 525): 
Using default value 525
Last cylinder, +cylinders or +size{K,M,G} (525-3916, default 3916): +2G   

Command (m for help): p

Disk /dev/sdb: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x69be0541

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         262     2104483+  83  Linux
/dev/sdb2             263         524     2104515   83  Linux
/dev/sdb3             525         786     2104515   83  Linux

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
e
Selected partition 4
First cylinder (787-3916, default 787): 
Using default value 787
Last cylinder, +cylinders or +size{K,M,G} (787-3916, default 3916): 
Using default value 3916

Command (m for help): p

Disk /dev/sdb: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x69be0541

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         262     2104483+  83  Linux
/dev/sdb2             263         524     2104515   83  Linux
/dev/sdb3             525         786     2104515   83  Linux
/dev/sdb4             787        3916    25141725    5  Extended

Command (m for help): n
First cylinder (787-3916, default 787): 
Using default value 787
Last cylinder, +cylinders or +size{K,M,G} (787-3916, default 3916): +4G

Command (m for help): p

Disk /dev/sdb: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x69be0541

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         262     2104483+  83  Linux
/dev/sdb2             263         524     2104515   83  Linux
/dev/sdb3             525         786     2104515   83  Linux
/dev/sdb4             787        3916    25141725    5  Extended
/dev/sdb5             787        1309     4200966   83  Linux

Command (m for help): n
First cylinder (1310-3916, default 1310): 
Using default value 1310
Last cylinder, +cylinders or +size{K,M,G} (1310-3916, default 3916): +4G

Command (m for help): p

Disk /dev/sdb: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x69be0541

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         262     2104483+  83  Linux
/dev/sdb2             263         524     2104515   83  Linux
/dev/sdb3             525         786     2104515   83  Linux
/dev/sdb4             787        3916    25141725    5  Extended
/dev/sdb5             787        1309     4200966   83  Linux
/dev/sdb6            1310        1832     4200966   83  Linux

Command (m for help): n
First cylinder (1833-3916, default 1833): 
Using default value 1833
Last cylinder, +cylinders or +size{K,M,G} (1833-3916, default 3916): +4G

Command (m for help): p

Disk /dev/sdb: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x69be0541

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         262     2104483+  83  Linux
/dev/sdb2             263         524     2104515   83  Linux
/dev/sdb3             525         786     2104515   83  Linux
/dev/sdb4             787        3916    25141725    5  Extended
/dev/sdb5             787        1309     4200966   83  Linux
/dev/sdb6            1310        1832     4200966   83  Linux
/dev/sdb7            1833        2355     4200966   83  Linux

Command (m for help): n
First cylinder (2356-3916, default 2356): 
Using default value 2356
Last cylinder, +cylinders or +size{K,M,G} (2356-3916, default 3916): +4G

Command (m for help): p

Disk /dev/sdb: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x69be0541

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         262     2104483+  83  Linux
/dev/sdb2             263         524     2104515   83  Linux
/dev/sdb3             525         786     2104515   83  Linux
/dev/sdb4             787        3916    25141725    5  Extended
/dev/sdb5             787        1309     4200966   83  Linux
/dev/sdb6            1310        1832     4200966   83  Linux
/dev/sdb7            1833        2355     4200966   83  Linux
/dev/sdb8            2356        2878     4200966   83  Linux

Command (m for help): n
First cylinder (2879-3916, default 2879): 
Using default value 2879
Last cylinder, +cylinders or +size{K,M,G} (2879-3916, default 3916): +4G

Command (m for help): p

Disk /dev/sdb: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x69be0541

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         262     2104483+  83  Linux
/dev/sdb2             263         524     2104515   83  Linux
/dev/sdb3             525         786     2104515   83  Linux
/dev/sdb4             787        3916    25141725    5  Extended
/dev/sdb5             787        1309     4200966   83  Linux
/dev/sdb6            1310        1832     4200966   83  Linux
/dev/sdb7            1833        2355     4200966   83  Linux
/dev/sdb8            2356        2878     4200966   83  Linux
/dev/sdb9            2879        3401     4200966   83  Linux

Command (m for help): n
First cylinder (3402-3916, default 3402): 
Using default value 3402
Last cylinder, +cylinders or +size{K,M,G} (3402-3916, default 3916): +4G
Value out of range.
Last cylinder, +cylinders or +size{K,M,G} (3402-3916, default 3916): +4G
Value out of range.
Last cylinder, +cylinders or +size{K,M,G} (3402-3916, default 3916): +3G

Command (m for help): p

Disk /dev/sdb: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x69be0541

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         262     2104483+  83  Linux
/dev/sdb2             263         524     2104515   83  Linux
/dev/sdb3             525         786     2104515   83  Linux
/dev/sdb4             787        3916    25141725    5  Extended
/dev/sdb5             787        1309     4200966   83  Linux
/dev/sdb6            1310        1832     4200966   83  Linux
/dev/sdb7            1833        2355     4200966   83  Linux
/dev/sdb8            2356        2878     4200966   83  Linux
/dev/sdb9            2879        3401     4200966   83  Linux
/dev/sdb10           3402        3794     3156741   83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@BJRAC RACInstallPackages]# 
[root@BJRAC RACInstallPackages]# fdisk -l

Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0004f386

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         523     4194304   82  Linux swap / Solaris
Partition 1 does not end on cylinder boundary.
/dev/sda2   *         523        3917    27261952   83  Linux

Disk /dev/sdb: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x69be0541

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         262     2104483+  83  Linux
/dev/sdb2             263         524     2104515   83  Linux
/dev/sdb3             525         786     2104515   83  Linux
/dev/sdb4             787        3916    25141725    5  Extended
/dev/sdb5             787        1309     4200966   83  Linux
/dev/sdb6            1310        1832     4200966   83  Linux
/dev/sdb7            1833        2355     4200966   83  Linux
/dev/sdb8            2356        2878     4200966   83  Linux
/dev/sdb9            2879        3401     4200966   83  Linux
/dev/sdb10           3402        3794     3156741   83  Linux

2.14.3、配置ASM Driver 服务(注意:双节点都要执行)

[root@BJRAC ~]# which oracleasm
/usr/sbin/oracleasm
[root@BJRAC ~]# /usr/sbin/oracleasm status
Checking if ASM is loaded: no
Checking if /dev/oracleasm is mounted: no
[root@BJRAC ~]# /usr/sbin/oracleasm configure -i
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 []: grid
Default group to own the driver interface []: asmadmin
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
[root@BJRAC ~]# /usr/sbin/oracleasm status
Checking if ASM is loaded: no
Checking if /dev/oracleasm is mounted: no
[root@BJRAC ~]# /usr/sbin/oracleasm init
Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module "oracleasm": oracleasm
Mounting ASMlib driver filesystem: /dev/oracleasm
[root@BJRAC ~]# /usr/sbin/oracleasm configure
ORACLEASM_ENABLED=true
ORACLEASM_UID=grid
ORACLEASM_GID=asmadmin
ORACLEASM_SCANBOOT=true
ORACLEASM_SCANORDER=""
ORACLEASM_SCANEXCLUDE=""
[root@BJRAC ~]# 

2.14.4、配置ASM磁盘

在节点BJRAC上创建ASM磁盘

[root@BJRAC ~]# /usr/sbin/oracleasm listdisks
[root@BJRAC ~]# /usr/sbin/oracleasm createdisk VOL1 /dev/sdb1
Writing disk header: done
Instantiating disk: done
[root@BJRAC ~]# /usr/sbin/oracleasm createdisk VOL2 /dev/sdb2
Writing disk header: done
Instantiating disk: done
[root@BJRAC ~]# /usr/sbin/oracleasm createdisk VOL3 /dev/sdb3
Writing disk header: done
Instantiating disk: done
[root@BJRAC ~]# /usr/sbin/oracleasm createdisk VOL5 /dev/sdb5
Writing disk header: done
Instantiating disk: done
[root@BJRAC ~]# /usr/sbin/oracleasm createdisk VOL6 /dev/sdb6
Writing disk header: done
Instantiating disk: done
[root@BJRAC ~]# /usr/sbin/oracleasm createdisk VOL7 /dev/sdb7
Writing disk header: done
Instantiating disk: done
[root@BJRAC ~]# /usr/sbin/oracleasm createdisk VOL8 /dev/sdb8
Writing disk header: done
Instantiating disk: done
[root@BJRAC ~]# /usr/sbin/oracleasm createdisk VOL9 /dev/sdb9
Writing disk header: done
Instantiating disk: done
[root@BJRAC ~]# /usr/sbin/oracleasm createdisk VOL10 /dev/sdb10
Writing disk header: done
Instantiating disk: done
[root@BJRAC ~]# /usr/sbin/oracleasm listdisks
VOL1
VOL10
VOL2
VOL3
VOL5
VOL6
VOL7
VOL8
VOL9

在节点CQRAC上扫描磁盘

[root@CQRAC ~]# /usr/sbin/oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
[root@CQRAC ~]# /usr/sbin/oracleasm listdisks
VOL1
VOL10
VOL2
VOL3
VOL5
VOL6
VOL7
VOL8
VOL9
[root@CQRAC ~]# 
原文地址:https://www.cnblogs.com/arcer/p/3552188.html