給ASM例項增加diskgroup
測試虛擬機器作業系統版本是 Redhat 6.4 64位,資料庫版本是 oracle 11.2.0.4.0 64bit, GI版本 oracle 11.2.0.4 64bit,下文記錄了
使用udev給ASM例項新增一個磁碟組 diskgroup FRA,一共兩個硬碟 sdf, sdg,各20G空間.
step1:確認新硬碟並建立分割槽
[root@rhel ~]# ls -lt /dev/sd*
brw-rw----. 1 root disk 8, 1 Jun 16 03:42 /dev/sda1
brw-rw----. 1 root disk 8, 2 Jun 16 03:42 /dev/sda2
brw-rw----. 1 root disk 8, 16 Jun 16 03: /dev/sdb
brw-rw----. 1 root disk 8, 32 Jun 16 03:42 /dev/sdc
brw-rw----. 1 root disk 8, 64 Jun 16 03:42 /dev/sde
brw-rw----. 1 root disk 8, 0 Jun 16 03:42 /dev/sda
brw-rw----. 1 root disk 8, 80 Jun 16 03:42 /dev/sdf
brw-rw----. 1 root disk 8, 48 Jun 16 03:42 /dev/sdd
brw-rw----. 1 root disk 8, 96 Jun 16 03:42 /dev/sdg
fdisk /dev/sdf
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x5cf28aa4.
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): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-2610, default 1): 1
Last cylinder, +cylinders or +size{K,M,G} (1-2610, default 2610):
Using default value 2610
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
partprobe /dev/sdf1
partprobe /dev/sdf
partprobe /dev/sdg1
partprobe /dev/sdg
step2:修改udev 的rules規則檔案
先備份原來使用的,然後在編輯。
vi 99-oracle-asmdevices.rules
KERNEL=="sdb1", NAME="asmdisk1_udev1", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sdc1", NAME="asmdisk2_udev2", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sdd1", NAME="asmdisk3_udev3", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sde1", NAME="asmdisk4_udev4", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sdf1", NAME="asmdisk4_udev5", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sdg1", NAME="asmdisk4_udev6", OWNER="grid", GROUP="asmadmin", MODE="0660"
儲存後退出。
step3:重新載入規則檔案和啟動udev
[root@rhel rules.d]#udevadm control --reload-rules
[root@rhel rules.d]# start_udev
Starting udev:
檢視結果
[root@rhel rules.d]# ls -lt /dev/asm*
brw-rw----. 1 grid asmadmin 8, 17 Jun 16 03:53 /dev/asmdisk1_udev1
brw-rw----. 1 grid asmadmin 8, 33 Jun 16 03:53 /dev/asmdisk2_udev2
brw-rw----. 1 grid asmadmin 8, 49 Jun 16 03:53 /dev/asmdisk3_udev3
brw-rw----. 1 grid asmadmin 8, 97 Jun 16 03:53 /dev/asmdisk4_udev6
brw-rw----. 1 grid asmadmin 8, 81 Jun 16 03:53 /dev/asmdisk4_udev5
brw-rw----. 1 grid asmadmin 8, 65 Jun 16 03:53 /dev/asmdisk4_udev4
step4:建立新的diskgroup
[grid@rhel ~]$ sqlplus / as sysasm
SQL*Plus: Release 11.2.0.4.0 Production on Mon Jun 16 03:54:36 2014
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 Automatic Storage Management option
SQL> select name,state,path from v$asm_disk;
NAME STATE PATH
------------------------------ -------- ----------------------------------------------------------------------
NORMAL /dev/asmdisk4_udev6
NORMAL /dev/asmdisk4_udev5
DATA_0001 NORMAL /dev/asmdisk2_udev2
DATA_0000 NORMAL /dev/asmdisk1_udev1
DATA_0002 NORMAL /dev/asmdisk3_udev3
DATA_0003 NORMAL /dev/asmdisk4_udev4
6 rows selected.
SQL> select GROUP_NUMBER,NAME,STATE,SECTOR_SIZE from v$asm_diskgroup;
GROUP_NUMBER NAME STATE SECTOR_SIZE
------------ ------------------------------ ----------- -----------
1 DATA MOUNTED 512
SQL> create diskgroup FRA normal redundancy
failgroup fg1 disk '/dev/asmdisk4_udev5'
failgroup fg2 disk '/dev/asmdisk4_udev6'; 2 3
Diskgroup created.
SQL> select name,path from v$asm_disk;
NAME PATH
------------------------------ ----------------------------------------------------------------------
DATA_0001 /dev/asmdisk2_udev2
DATA_0000 /dev/asmdisk1_udev1
DATA_0002 /dev/asmdisk3_udev3
DATA_0003 /dev/asmdisk4_udev4
FRA_0001 /dev/asmdisk4_udev6
FRA_0000 /dev/asmdisk4_udev5
6 rows selected.
SQL> select name,state from v$asm_diskgroup;
NAME STATE
------------------------------ -----------
DATA MOUNTED
FRA MOUNTED
之後就可以在RDBMS端建立tablespace 存放資料到新建立的磁碟組。
參考文件
How To Setup Partitioned Linux Block Devices Using UDEV (Non-ASMLIB) And Assign Them To ASM? (Doc ID 1528148.1)
使用udev給ASM例項新增一個磁碟組 diskgroup FRA,一共兩個硬碟 sdf, sdg,各20G空間.
step1:確認新硬碟並建立分割槽
[root@rhel ~]# ls -lt /dev/sd*
brw-rw----. 1 root disk 8, 1 Jun 16 03:42 /dev/sda1
brw-rw----. 1 root disk 8, 2 Jun 16 03:42 /dev/sda2
brw-rw----. 1 root disk 8, 16 Jun 16 03: /dev/sdb
brw-rw----. 1 root disk 8, 32 Jun 16 03:42 /dev/sdc
brw-rw----. 1 root disk 8, 64 Jun 16 03:42 /dev/sde
brw-rw----. 1 root disk 8, 0 Jun 16 03:42 /dev/sda
brw-rw----. 1 root disk 8, 80 Jun 16 03:42 /dev/sdf
brw-rw----. 1 root disk 8, 48 Jun 16 03:42 /dev/sdd
brw-rw----. 1 root disk 8, 96 Jun 16 03:42 /dev/sdg
fdisk /dev/sdf
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x5cf28aa4.
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): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-2610, default 1): 1
Last cylinder, +cylinders or +size{K,M,G} (1-2610, default 2610):
Using default value 2610
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
partprobe /dev/sdf1
partprobe /dev/sdf
partprobe /dev/sdg1
partprobe /dev/sdg
step2:修改udev 的rules規則檔案
先備份原來使用的,然後在編輯。
vi 99-oracle-asmdevices.rules
KERNEL=="sdb1", NAME="asmdisk1_udev1", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sdc1", NAME="asmdisk2_udev2", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sdd1", NAME="asmdisk3_udev3", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sde1", NAME="asmdisk4_udev4", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sdf1", NAME="asmdisk4_udev5", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sdg1", NAME="asmdisk4_udev6", OWNER="grid", GROUP="asmadmin", MODE="0660"
儲存後退出。
step3:重新載入規則檔案和啟動udev
[root@rhel rules.d]#udevadm control --reload-rules
[root@rhel rules.d]# start_udev
Starting udev:
檢視結果
[root@rhel rules.d]# ls -lt /dev/asm*
brw-rw----. 1 grid asmadmin 8, 17 Jun 16 03:53 /dev/asmdisk1_udev1
brw-rw----. 1 grid asmadmin 8, 33 Jun 16 03:53 /dev/asmdisk2_udev2
brw-rw----. 1 grid asmadmin 8, 49 Jun 16 03:53 /dev/asmdisk3_udev3
brw-rw----. 1 grid asmadmin 8, 97 Jun 16 03:53 /dev/asmdisk4_udev6
brw-rw----. 1 grid asmadmin 8, 81 Jun 16 03:53 /dev/asmdisk4_udev5
brw-rw----. 1 grid asmadmin 8, 65 Jun 16 03:53 /dev/asmdisk4_udev4
step4:建立新的diskgroup
[grid@rhel ~]$ sqlplus / as sysasm
SQL*Plus: Release 11.2.0.4.0 Production on Mon Jun 16 03:54:36 2014
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 Automatic Storage Management option
SQL> select name,state,path from v$asm_disk;
NAME STATE PATH
------------------------------ -------- ----------------------------------------------------------------------
NORMAL /dev/asmdisk4_udev6
NORMAL /dev/asmdisk4_udev5
DATA_0001 NORMAL /dev/asmdisk2_udev2
DATA_0000 NORMAL /dev/asmdisk1_udev1
DATA_0002 NORMAL /dev/asmdisk3_udev3
DATA_0003 NORMAL /dev/asmdisk4_udev4
6 rows selected.
SQL> select GROUP_NUMBER,NAME,STATE,SECTOR_SIZE from v$asm_diskgroup;
GROUP_NUMBER NAME STATE SECTOR_SIZE
------------ ------------------------------ ----------- -----------
1 DATA MOUNTED 512
SQL> create diskgroup FRA normal redundancy
failgroup fg1 disk '/dev/asmdisk4_udev5'
failgroup fg2 disk '/dev/asmdisk4_udev6'; 2 3
Diskgroup created.
SQL> select name,path from v$asm_disk;
NAME PATH
------------------------------ ----------------------------------------------------------------------
DATA_0001 /dev/asmdisk2_udev2
DATA_0000 /dev/asmdisk1_udev1
DATA_0002 /dev/asmdisk3_udev3
DATA_0003 /dev/asmdisk4_udev4
FRA_0001 /dev/asmdisk4_udev6
FRA_0000 /dev/asmdisk4_udev5
6 rows selected.
SQL> select name,state from v$asm_diskgroup;
NAME STATE
------------------------------ -----------
DATA MOUNTED
FRA MOUNTED
之後就可以在RDBMS端建立tablespace 存放資料到新建立的磁碟組。
參考文件
How To Setup Partitioned Linux Block Devices Using UDEV (Non-ASMLIB) And Assign Them To ASM? (Doc ID 1528148.1)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/21754115/viewspace-1184191/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle 11g RAC 建立例項DBCA無法發現ASM DiskgroupOracleASM
- 11g ASM例項記憶體大小與diskgroup大小的關係ASM記憶體
- ASM之建立ASM例項ASM
- 單例項刪除ASM例項單例ASM
- 管理 ASM 例項ASM
- 停止ASM例項ASM
- Asm diskgroup 的修復ASM
- script of check repair ASM DISKGROUPAIASM
- 刪除ASM例項ASM
- ASM之建立ASM例項及ASM資料庫ASM資料庫
- 【例項】增加控制檔案
- 建立ASM例項及ASM資料庫ASM資料庫
- asm例項刪除方法ASM
- oracle 收集asm例項資訊OracleASM
- ASM管理 - 如何重新命名diskgroupASM
- Using FTP Transferring Non-ASM Datafiles to ASM diskgroupFTPASM
- RAC+DG(asm單例項)ASM單例
- Oracle 11.2.0.3 管理ASM例項OracleASM
- 單例項的duplicate(non ASM)單例ASM
- 啟動ASM 例項報錯ASM
- Oracle 11.2.0.3管理ASM例項OracleASM
- ASM之建立ASM例項時的常見故障ASM
- Flex ASM自動重定位ASM例項測試FlexASM
- oracle asm diskgroup add datafile error problemOracleASMError
- 學習ASM技術(三)--diskgroup管理ASM
- 學習ASM技術(二)--diskgroup管理ASM
- 新建或修改ASM diskgroup 的問題ASM
- ASM 增加磁碟ASM
- 【Oracle】ASM例項安裝入門OracleASM
- ASM例項配置監聽和TNSASM
- 單機環境配置ASM例項ASM
- 單節點執行ASM例項ASM
- RAC asm恢復到單例項ASM單例
- 使用普通檔案建立ASM例項ASM
- 建立ASM例項和資料庫ASM資料庫
- 【ASM學習】在windows 環境下建立ASM例項ASMWindows
- 【Oracle ASM】關於asm例項與db例項中的磁碟狀態_詳細分析過程OracleASM
- How to move ASM database files from one diskgroup to anotherASMDatabase