oracle 11g rac集群 asm磁盤組增加硬盤


 

創建asm磁盤的幾種方式

復制代碼
創建asm磁盤方式很多主要有以下幾種
1、Faking方式
2、裸設備方式
3、udev方式(它下面有兩種方式)
  3.1 uuid方式
  3.2 raw方式(裸設備方式)
4、asmlib方式(oracleasm)

 

本次的操作需求

1、要增加磁盤的磁盤組為:DATA
2、增加磁盤 /dev/sdb1到磁盤組DATA
請參考 https://www.cnblogs.com/aozhejin/p/16006140.html

asm磁盤要求:

1、A disk or partition from a storage array    //一個磁盤或者是磁盤陣列的分區2、An entire disk or the partitions of a disk  //是一個完整的磁盤 或者是一個磁盤的分區
3、Logical volumes               //邏輯卷
4、Network-attached files (NAS)  //NAS(Network-attached storage,網絡連接存儲)

在第一個節點上的磁盤先分區:

[root@sh01 ~]# 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 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-391, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-391, default 391):
Using default value 391

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 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
//並不需要格式化

[root@sh01 ~]# ll /dev/oracleasm/disks  //列出當前的磁盤

total 0
brw-rw---- 1 oracle dba 8, 49 Jan 20 16:45 CRS
brw-rw---- 1 oracle dba 8, 17 Jan 20 16:45 DATA1
brw-rw---- 1 oracle dba 8, 33 Jan 20 16:45 DATA2

[root@sh02 disks]# oracleasm listdisks  //這個命令也可以
 

 格式化為oracleasm這種格式

[root@sh01 ~]# /etc/init.d/oracleasm createdisk DATA3 /dev/sdb1 
 Writing disk header: done
Instantiating disk: done

[root@sh01 ~]# ll /dev/oracleasm/disks  //已經多出來一個磁盤,被添加為了asm磁盤,已被識別

total 0
brw-rw---- 1 oracle dba 8, 49 Jan 20 16:47 CRS
brw-rw---- 1 oracle dba 8, 17 Jan 20 16:47 DATA1
brw-rw---- 1 oracle dba 8, 33 Jan 20 16:47 DATA2
brw-rw---- 1 oracle dba 8, 65 Jan 20 16:47 DATA3

在第二個節點操作

[root@sh02 ~]#  /etc/init.d/oracleasm scandisks   //掃描集群中的asm磁盤,讓其他節點識別
Scanning the system for Oracle ASMLib disks:               [  OK  ]
[root@sh02 ~]#  ll /dev/oracleasm/disks/
total 0
brw-rw---- 1 oracle dba 8, 49 Jan 20 16:54 CRS
brw-rw---- 1 oracle dba 8, 17 Jan 20 16:54 DATA1
brw-rw---- 1 oracle dba 8, 33 Jan 20 16:54 DATA2
brw-rw---- 1 oracle dba 8, 65 Jan 20 16:53 DATA3

 增加asm磁盤到磁盤組操作

[root@sh01 ~]# su - grid
[grid@sh01 ~]$ export ORACLE_SID=+ASM1  //asm實例

  [gird@sh02 ~]$ sqlplus / as sysdba
  SQL*Plus: Release 11.2.0.4.0 Production on Tue Mar 15 22:52:02 2022

  Copyright (c) 1982, 2013, Oracle. All rights reserved.

  Connected to:

  Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

  With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

  Data Mining and Real Application Testing options

SQL> set line 999
SQL> select name,path from v$asm_disk;  //查看原有ASM 磁盤

  NAME PATH
  ------------------------------ --------------------- 
  DATA_0000 /dev/oracleasm/disks/DATA1
  DATA_0001 /dev/oracleasm/disks/DATA2

  2 rows selected.

SQL> alter diskgroup DATA add disk '/dev/oracleasm/disks/DATA3' name DATA_0002;
Diskgroup altered.

  SQL> select name,path from v$asm_disk;  //查看添加的ASM磁盤

  NAME PATH
  ------------------------------ --------------------- 
  DATA_0000 /dev/oracleasm/disks/DATA1
  DATA_0001 /dev/oracleasm/disks/DATA2
  DATA_0002 /dev/oracleasm/disks/DATA3 

  3 rows selected.

//另外我們也可以使用asmca添加磁盤到磁盤組data

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM