您的位置:首页 > 数据库 > Oracle

Linux 5.4 + oracle 10g RAC +ASM 环境增加ASM磁盘

2013-04-11 16:34 501 查看
一、 检查从存储以多路径方式划分过来的磁盘
       ls /dev/mapper
       其中没有p1结尾的磁盘为未分区磁盘。

二、 对未分区磁盘进行格式化

# fdisk /dev/mapper/mpath9
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.

The number of cylinders for this disk is set to 13054.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 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-13054, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-13054, default 13054):
Using default value 13054

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

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 22: Invalid argument.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.

三、修改以下文件,在文件结尾添加如下信息(RAC环境两个节点都需要修改)

 vi /etc/sysconfig/rawdevices

# raw device bindings
# format:  <rawdev> <major> <minor>
#          <rawdev> <blockdev>
# example: /dev/raw/raw1 /dev/sda1
#          /dev/raw/raw2 8 5

#crs
/dev/raw/raw1  /dev/mapper/mpath2p1
/dev/raw/raw2  /dev/mapper/mpath3p1
#vote
/dev/raw/raw3  /dev/mapper/mpath4p1
/dev/raw/raw4  /dev/mapper/mpath5p1
/dev/raw/raw5  /dev/mapper/mpath6p1

#data
/dev/raw/raw6  /dev/mapper/mpath0p1
/dev/raw/raw7  /dev/mapper/mpath1p1
/dev/raw/raw8  /dev/mapper/mpath8p1
#new disk 20130411
/dev/raw/raw9  /dev/mapper/mpath9p1
/dev/raw/raw10 /dev/mapper/mpath10p1
/dev/raw/raw11 /dev/mapper/mpath11p1

四、修改以下文件,在文件结尾添加如下信息(RAC环境两个节点都需要修改)

# vi /etc/rc.local

#!/bin/sh

#

# This script will be executed *after* all the other init scripts.

# You can put your own initialization stuff in here if you don't

# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

chown root:oinstall /dev/raw/raw1

chown root:oinstall /dev/raw/raw2

chown oracle:oinstall /dev/raw/raw3

chown oracle:oinstall /dev/raw/raw4

chown oracle:oinstall /dev/raw/raw5

chown oracle:oinstall /dev/raw/raw6

chown oracle:oinstall /dev/raw/raw7

chown oracle:oinstall /dev/raw/raw8

#new raw 20130411

chown oracle:oinstall /dev/raw/raw9

chown oracle:oinstall /dev/raw/raw10

chown oracle:oinstall /dev/raw/raw11

五、将新增裸设备加入ASM磁盘组

          oracle用户下执行

$ export ORACLE_SID=+ASM1
$ sqlplus / as sysdba
SQL> select name from v$asm_disk;

NAME

--------------------------------------------------------------------------------

ORADATA_0002

ORADATA_0001

ORADATA_0000

SQL> alter diskgroup ORADATA add disk '/dev/raw/raw9';

Diskgroup altered.
SQL> alter diskgroup ORADATA add disk '/dev/raw/raw10';

Diskgroup altered.

SQL> alter diskgroup ORADATA add disk '/dev/raw/raw11';

Diskgroup altered.

SQL> select name from v$asm_disk;

NAME

--------------------------------------------------------------------------------

ORADATA_0005

ORADATA_0004

ORADATA_0003

ORADATA_0002

ORADATA_0001

ORADATA_0000

SQL> SELECT NAME,TOTAL_MB,FREE_MB FROM V$ASM_DISKGROUP;

NAME

--------------------------------------------------------------------------------

  TOTAL_MB    FREE_MB

---------- ----------

ORADATA

    614388     597610

如果环境为oracle 11g RAC的话,可以使用ASMCA进行磁盘组的修改和创建。

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: