Linux 5.4 + oracle 10g RAC +ASM 環境增加ASM磁盤

一、 檢查從存儲以多路徑方式劃分過來的磁盤
       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進行磁盤組的修改和創建。

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章