Linux下搭建Oracle11g RAC(5)----配置ASM磁盘
将共享磁盘格式化、然后用asmlib将其配置为ASM磁盘,用于将来存放OCR、Voting Disk和数据库用。
注意:只需在其中1个节点上格式化就可以,接下来我们选择在node1节点上格式化。
这里我们以asmlib软件来创建ASM磁盘,而不使用raw disk,而且从11gR2开始,OUI的图形界面已经不再支持raw disk。
格式化共享磁盘
① 以root用户分别在两个节点上执行fdisk命令,查看现有硬盘分区信息:
node1:
[root@node1 ~]# 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 2163 17374266 83 Linux /dev/sda2 2164 2609 3582495 82 Linux swap / Solaris Disk /dev/sdb: 524 MB, 524288000 bytes 64 heads, 32 sectors/track, 500 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Disk /dev/sdb doesn't contain a valid partition table Disk /dev/sdc: 524 MB, 524288000 bytes 64 heads, 32 sectors/track, 500 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Disk /dev/sdc doesn't contain a valid partition table Disk /dev/sdd: 3221 MB, 3221225472 bytes 255 heads, 63 sectors/track, 391 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdd doesn't contain a valid partition table Disk /dev/sde: 3221 MB, 3221225472 bytes 255 heads, 63 sectors/track, 391 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sde doesn't contain a valid partition table [root@node1 ~]# |
node2:
[root@node2 ~]# 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 2163 17374266 83 Linux /dev/sda2 2164 2609 3582495 82 Linux swap / Solaris Disk /dev/sdb: 524 MB, 524288000 bytes 64 heads, 32 sectors/track, 500 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Disk /dev/sdb doesn't contain a valid partition table Disk /dev/sdc: 524 MB, 524288000 bytes 64 heads, 32 sectors/track, 500 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Disk /dev/sdc doesn't contain a valid partition table Disk /dev/sdd: 3221 MB, 3221225472 bytes 255 heads, 63 sectors/track, 391 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdd doesn't contain a valid partition table Disk /dev/sde: 3221 MB, 3221225472 bytes 255 heads, 63 sectors/track, 391 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sde doesn't contain a valid partition table [root@node2 ~]# |
从上,我们可以看到目前两个节点上的分区信息一致:其中/dev/sda是用于存放操作系统的,/dev/sdb、/dev/sdc、/dev/sdd、/dev/sde这4块盘都没有分区信息
② root用户在node1上格式化/dev/sdb、/dev/sdc、/dev/sdd、/dev/sde这4块盘
[root@node1 ~]# fdisk /dev/sdb Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. 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 0×0000 of partition table 4 will be corrected by w(rite) Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-500, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-500, default 500): Using default value 500 Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. [root@node1 ~]# |
说明:fdisk /dev/sdb表示要对/dev/sdb磁盘进行格式化,其中,输入的命令分别表示:
n表示新建1个分区;
p表示分区类型选择为primary partition 主分区;
1表示分区编号从1开始;
起始、终止柱面选择默认值,即1和500;
w表示将新建的分区信息写入硬盘分区表。
③ 重复上述步骤②,以root用户在node1上分别格式化其余3块磁盘:
④ 格式化完毕之后,在node1,node2节点上分别看到下述信息:
node1:
[root@node1 ~]# 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 2163 17374266 83 Linux /dev/sda2 2164 2609 3582495 82 Linux swap / Solaris Disk /dev/sdb: 524 MB, 524288000 bytes 64 heads, 32 sectors/track, 500 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Device Boot Start End Blocks Id System /dev/sdb1 1 500 511984 83 Linux Disk /dev/sdc: 524 MB, 524288000 bytes 64 heads, 32 sectors/track, 500 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Device Boot Start End Blocks Id System /dev/sdc1 1 500 511984 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: 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/sde1 1 391 3140676 83 Linux [root@node1 ~]# |
node2:
[root@node2 ~]# 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 2163 17374266 83 Linux /dev/sda2 2164 2609 3582495 82 Linux swap / Solaris Disk /dev/sdb: 524 MB, 524288000 bytes 64 heads, 32 sectors/track, 500 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Device Boot Start End Blocks Id System /dev/sdb1 1 500 511984 83 Linux Disk /dev/sdc: 524 MB, 524288000 bytes 64 heads, 32 sectors/track, 500 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Device Boot Start End Blocks Id System /dev/sdc1 1 500 511984 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: 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/sde1 1 391 3140676 83 Linux # |
至此,格式化共享磁盘完毕。
在两个节点上安装ASM RPM软件包
在安装ASM软件包时,要注意选择的软件包要与操作系统平台、内核版本选择一致。ASM软件包可以到Oracle官网下载。
node1安装:
[root@node1 ~]# rpm -qa|grep asm 用上述命令,并未发现节点1上安装任何asm软件包。 [root@node1 ~]# cd asm_rpm/ [root@node1 asm_rpm]# ll total 136 -rw-r–r– 1 root root 25977 Apr 26 11:19 oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm -rw-r–r– 1 root root 14176 Apr 26 11:19 oracleasmlib-2.0.4-1.el5.x86_64.rpm -rw-r–r– 1 root root 89027 Apr 26 11:19 oracleasm-support-2.1.3-1.el5.x86_64.rpm [root@node1 asm_rpm]# rpm -ivh oracleasm-support-2.1.3-1.el5.x86_64.rpm warning: oracleasm-support-2.1.3-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159 Preparing… ########################################### [100%] 1:oracleasm-support ########################################### [100%] [root@node1 asm_rpm]# rpm -ivh oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm warning: oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159 Preparing… ########################################### [100%] 1:oracleasm-2.6.18-194.el########################################### [100%] [root@node1 asm_rpm]# rpm -ivh oracleasmlib-2.0.4-1.el5.x86_64.rpm warning: oracleasmlib-2.0.4-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159 Preparing… ########################################### [100%] 1:oracleasmlib ########################################### [100%] [root@node1 asm_rpm]# rpm -qa|grep asm oracleasm-2.6.18-194.el5-2.0.5-1.el5 oracleasm-support-2.1.3-1.el5 oracleasmlib-2.0.4-1.el5 [root@node1 asm_rpm]# |
node2 安装:
[root@node2 asm_rpm]# ll total 136 -rw-r–r– 1 root root 25977 Apr 26 11:20 oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm -rw-r–r– 1 root root 14176 Apr 26 11:20 oracleasmlib-2.0.4-1.el5.x86_64.rpm -rw-r–r– 1 root root 89027 Apr 26 11:20 oracleasm-support-2.1.3-1.el5.x86_64.rpm [root@node2 asm_rpm]# rpm -qa|grep asm [root@node2 asm_rpm]# rpm -ivh oracleasm-support-2.1.3-1.el5.x86_64.rpm warning: oracleasm-support-2.1.3-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159 Preparing… ########################################### [100%] 1:oracleasm-support ########################################### [100%] [root@node2 asm_rpm]# rpm -ivh oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm warning: oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159 Preparing… ########################################### [100%] 1:oracleasm-2.6.18-194.el########################################### [100%] [root@node2 asm_rpm]# rpm -ivh oracleasmlib-2.0.4-1.el5.x86_64.rpm warning: oracleasmlib-2.0.4-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159 Preparing… ########################################### [100%] 1:oracleasmlib ########################################### [100%] [root@node2 asm_rpm]# rpm -qa|grep asm oracleasmlib-2.0.4-1.el5 oracleasm-support-2.1.3-1.el5 oracleasm-2.6.18-194.el5-2.0.5-1.el5 [root@node2 asm_rpm]# |
说明:安装上述3个ASM RPM软件包时要先安装oracleasm-support-2.1.3-1.el5软件包,其次安装oracleasm-2.6.18-194.el5-2.0.5-1.el5软件包,最后安装oracleasmlib-2.0.4-1.el5软件包。
安装完毕后,执行 rpm -qa|grep asm确认是否安装成功。
配置ASM driver服务
在node1上以root用户进行配置。在安装完3个ASM RPM软件包之后,可以通过执行/usr/sbin/oracleasm命令来进行配置,也可以通过执行/etc/init.d/oracleasm命令来进行配置,后者命令是Oracle 10g中进行ASM配置的命令,Oracle推荐执行前者命令,不过后者命令保留使用。
① 查看ASM服务状态:
[root@node1 ~]# /usr/sbin/oracleasm status
Checking if ASM is loaded: no
Checking if /dev/oracleasm is mounted: no
[root@node1 ~]#
看到,默认情况下ASM服务并未开启。具体命令和相关参数可以直接执行下述命令来获取:
[root@node1 ~]# /usr/sbin/oracleasm -h Usage: oracleasm [--exec-path=<exec_path>] <command> [ <args> ] oracleasm –exec-path oracleasm -h oracleasm -V The basic oracleasm commands are: configure Configure the Oracle Linux ASMLib driver init Load and initialize the ASMLib driver exit Stop the ASMLib driver scandisks Scan the system for Oracle ASMLib disks status Display the status of the Oracle ASMLib driver listdisks List known Oracle ASMLib disks querydisk Determine if a disk belongs to Oracle ASMlib createdisk Allocate a device for Oracle ASMLib use deletedisk Return a device to the operating system renamedisk Change the label of an Oracle ASMlib disk update-driver Download the latest ASMLib driver [root@node1 ~]# |
② 配置ASM服务:
[root@node1 ~]# /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@node1 ~]# /usr/sbin/oracleasm status Checking if ASM is loaded: no Checking if /dev/oracleasm is mounted: no [root@node1 ~]# /usr/sbin/oracleasm init Loading module "oracleasm": oracleasm Mounting ASMlib driver filesystem: /dev/oracleasm [root@node1 ~]# /usr/sbin/oracleasm configure ORACLEASM_ENABLED=true ORACLEASM_UID=grid ORACLEASM_GID=asmadmin ORACLEASM_SCANBOOT=true ORACLEASM_SCANORDER="" ORACLEASM_SCANEXCLUDE="" [root@node1 ~]# |
说明:/usr/sbin/oracleasm configure -i命令进行配置时,用户配置为grid,组为asmadmin,启动ASM library driver驱动服务,并且将其配置为随着操作系统的启动而自动启动。
配置完成后,记得执行 /usr/sbin/oracleasm init命令来加载oracleasm内核模块。
③ 在node2上执行上述步骤②,完成ASM服务配置。
配置ASM磁盘
我们安装ASM RPM软件包,配置ASM 驱动服务的最终目的是要创建ASM磁盘,为将来安装grid软件、创建Oracle数据库提供存储。
说明:只需在一个节点上创建ASM磁盘即可!创建完之后,在其它节点上执行/usr/sbin/oracleasm scandisks之后,就可看到ASM磁盘。
接下来,开始创建ASM磁盘:
① 执行/usr/sbin/oracleasm createdisk来创建ASM磁盘
[root@node1 ~]# /usr/sbin/oracleasm listdisks [root@node1 ~]# /usr/sbin/oracleasm createdisk -h Usage: oracleasm-createdisk [-l <manager>] [-v] <label> <device> [root@node1 ~]# /usr/sbin/oracleasm createdisk VOL1 /dev/sdb1 Writing disk header: done Instantiating disk: done [root@node1 ~]# /usr/sbin/oracleasm createdisk VOL2 /dev/sdc1 Writing disk header: done Instantiating disk: done [root@node1 ~]# /usr/sbin/oracleasm createdisk VOL3 /dev/sdd1 Writing disk header: done Instantiating disk: done [root@node1 ~]# /usr/sbin/oracleasm createdisk VOL4 /dev/sde1 Writing disk header: done Instantiating disk: done [root@node1 ~]# /usr/sbin/oracleasm listdisks VOL1 VOL2 VOL3 VOL4 [root@node1 ~]# |
从上看到,创建出来4块ASM磁盘。此时,node2上还看不到刚创建的ASM磁盘。
② node2 执行/usr/sbin/oracleasm scandisks扫描磁盘
[root@node2 ~]# /usr/sbin/oracleasm listdisks [root@node2 ~]# /usr/sbin/oracleasm scandisks Reloading disk partitions: done Cleaning any stale ASM disks… Scanning system for ASM disks… Instantiating disk "VOL1" Instantiating disk "VOL2" Instantiating disk "VOL3" Instantiating disk "VOL4" [root@node2 ~]# /usr/sbin/oracleasm listdisks VOL1 VOL2 VOL3 VOL4 [root@node2 ~]# |
③ 如何确定ASM磁盘同物理磁盘之间的对应关系?
[root@node1 ~]# /usr/sbin/oracleasm querydisk /dev/sd* Device "/dev/sda" is not marked as an ASM disk Device "/dev/sda1" is not marked as an ASM disk Device "/dev/sda2" is not marked as an ASM disk Device "/dev/sdb" is not marked as an ASM disk Device "/dev/sdb1" is marked an ASM disk with the label "VOL1" Device "/dev/sdc" is not marked as an ASM disk Device "/dev/sdc1" is marked an ASM disk with the label "VOL2" Device "/dev/sdd" is not marked as an ASM disk Device "/dev/sdd1" is marked an ASM disk with the label "VOL3" Device "/dev/sde" is not marked as an ASM disk Device "/dev/sde1" is marked an ASM disk with the label "VOL4" [root@node1 ~]# |
至此,ASM磁盘准备工作已经完成!
Linux下搭建Oracle11g RAC(5)----配置ASM磁盘的更多相关文章
- Linux下搭建Oracle11g RAC(8)----创建ASM磁盘组
以grid用户创建ASM磁盘组,创建的ASM磁盘组为下一步创建数据库提供存储. ① grid用户登录图形界面,执行asmca命令来创建磁盘组: ② 进入ASMCA配置界面后,单击Create,创建新的 ...
- Linux下搭建Oracle11g RAC(2)----配置DNS服务器,确认SCAN IP可以被解析
从Oracle 11gR2开始,引入SCAN(Single Client Access Name) IP的概念,相当于在客户端和数据库之间增加一层虚拟的网络服务层,即是SCAN IP和SCAP IP ...
- Linux下搭建Oracle11g RAC(4)----配置oracle,grid用户SSH对等性
虽然在安装软件的过程中,oracle会自动配置SSH对等性,建议在安装软件之前手工配置. 配置oracle用户对等性: node1: [root@node1 ~]# su - oracle node1 ...
- Linux下搭建Oracle11g RAC(6)----安装Grid Infrastructure
从此步骤开始,我们正式安装Grid软件: ① 以grid用户登录图形界面,执行/home/grid/grid/runInstaller,进入OUI的图形安装界面: ② 进入OUI安装界面后,选择第3项 ...
- Linux下搭建Oracle11g RAC(3)----创建用户及配置相关文件
配置11gR2 RAC需要安装Oracle Grid Infrastructure软件.Oracle数据库软件,其中Grid软件等同于Oracle 10g的Clusterware集群件.Oracle建 ...
- Linux下搭建Oracle11g RAC(1)----IP分配与配置IP
首先需要说明的,我的RAC搭建不是在虚拟机上完成的,而是在实际部署中,二者之间有些许差异,本人水平有限,请见谅. 其中,每台机器至少需要配置3个IP地址,在安装操作系统的过程中,我们需要配置公网IP和 ...
- Linux下搭建Oracle11g RAC(9)----创建RAC数据库
接下来,使用DBCA来创建RAC数据库. ① 以oracle用户登录图形界面,执行dbca,进入DBCA的图形界面,选择第1项,创建RAC数据库: ② 选择创建数据库选项,Next: ③ 选择创建通用 ...
- Linux下搭建Oracle11g RAC(7)----安装Oracle 软件
从此步骤开始,我们正式安装oracle软件: ① 以oracle用户登录图形界面,执行/home/oracle/database/runInstaller,进入OUI的图形安装界面: ② 进入OUI安 ...
- linux下一个Oracle11g RAC建立(五岁以下儿童)
linux下一个Oracle11g RAC建立(五岁以下儿童) 四.建立主机之间的信任关系(node1.node2) 建立节点之间oracle .grid 用户之间的信任(通过ssh 建立公钥和私钥) ...
随机推荐
- uva 12206 - Stammering Aliens
基于hash的LCP算法: #include<cstdio> #include<cstring> #include<algorithm> #define maxn ...
- warning: push.default is unset;
git push warning questions This warning was introduced in Git 1.7.11 along with the simple style of ...
- 查看本机上的端口使用情况netstat -an
1.查找本机上的端口使用情况 netstat -an 2.查找指定端口的使用情况 C:\Windows\System32>netstat -ano | find "8002" ...
- FusionCharts 3.2.1 flash 图表展示、数据钻取
StackedColumn3DLineDY.swf 效果展示: 一.页面代码 <div id="chart2div" align="center" sty ...
- Delphi的BPL介绍和使用 转
了解BPL和DLL的关系将有助于我们更好地理解DELPHI在构件制作.运用和动态.静态编译的工作方式.对初学DELPHI但仍对DELPHI开发不甚清晰的朋友有一定帮助.BPL vs. DLL(原文ht ...
- Oracle去掉特殊字符
/*LYXXB(陵园信息表) lymc(甲方),dz(通信地址),dh(联系电话) */ SELECT lymc,dz,dh FROM lyxxb /*去掉回车(\b)*/ ),'') /*去掉换行( ...
- Unity3d Fast Indirect illumination Using Two Virtual Spherical Gaussian Lights-Square Enix论文
博主实现(in Unity3d 5) used one spotlight 史克威尔效果展示(夜光引擎?) 博主近期渲染:最近用unity5弄的一些渲染 ---- by wolf96 http:// ...
- [App]Xamarin学习资料收集
在博客园其实有很多朋友都在介绍Xamarin的使用方法,下面是比较活跃的一些: http://www.cnblogs.com/yaozhenfa/
- slua 中使用 lua5.3
因为我们服务器极有可能要迁移到 skynet 上,它基于 lua5.3,而服务器和客户端会公用很多lua代码,所以在考虑在客户端 slua 中使用 lua5.3. 经过编译后,发现 slua 对 lu ...
- JavaScript---网络编程(4)-Date、Math、Global和自定义对象
本节博客进行Date对象.Math对象.Global对象和自定义对象的用法演示. 首先是一个out.js文件内容(输出到网页中的自定义输出方法): function println(parma){ d ...