ASM 擴容

chenoracle發表於2015-07-22

ASM 擴容

 

檢視 ASM 空間使用情況

SQL> select group_number,name,total_mb from v$asm_diskgroup;

     GROUP_NUMBER   NAME       TOTAL_MB

         1                   DATADG   1039

         2                   SYSTEDG  4096

 

停止資料庫

[oracle@ogg1 ~]$ lsnrctl stop

 

[oracle@ogg1 ~]$ sqlplus / as sysdba

SQL> shutdown immediate

 

[grid@ogg1 ~]$ sqlplus / as sysasm

SQL> shutdown immediate

 

停止伺服器,新增磁碟

[root@ogg1 ~]# init 0

虛擬機器-- 設定-- 儲存-- 建立新的虛擬盤--1G-- 啟動虛擬機器

 

啟動伺服器

[grid@ogg1 ~]$ sqlplus / as sysasm

SQL> startup

[oracle@ogg1 ~]$ sqlplus / as sysdba

SQL> startup

[oracle@ogg1 ~]$ lsnrctl start

 

為新磁碟新增磁碟機代號

[root@ogg1 ~]# fdisk -l

......

Disk /dev/sdi: 1073 MB, 1073741824 bytes

255 heads, 63 sectors/track, 130 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

 

[root@ogg1 ~]# cd /dev/

[root@ogg1 dev]# ls -l sd*

brw-rw---- 1 root disk 8,   0 Jul 21 13:51 sda

brw-rw---- 1 root disk 8,   1 Jul 21 13:51 sda1

brw-rw---- 1 root disk 8,   2 Jul 21 13:51 sda2

brw-rw---- 1 root disk 8,   3 Jul 21 13:51 sda3

brw-rw---- 1 root disk 8,  16 Jul 21 13:56 sdb

brw-rw---- 1 root disk 8,  32 Jul 21 13:56 sdc

brw-rw---- 1 root disk 8,  48 Jul 21 13:56 sdd

brw-rw---- 1 root disk 8,  64 Jul 21 13:56 sde

brw-rw---- 1 root disk 8,  80 Jul 21 13:56 sdf

brw-rw---- 1 root disk 8,  96 Jul 21 13:56 sdg

brw-rw---- 1 root disk 8, 112 Jul 21 13:56 sdh

brw-rw---- 1 root disk 8, 128 Jul 21 13:51 sdi

 

[root@ogg1 dev]# for i in i;

> do

> echo "KERNEL==\"sd*\", BUS==\"scsi\", PROGRAM==\"/sbin/scsi_id --whitelisted  --replace-whitespace --device=/dev/\$name\", RESULT==\"`/sbin/scsi_id  --whitelisted --replace-whitespace --device=/dev/sd$i`\", NAME=\"asm-disk$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\"" >> /etc/udev/rules.d/99-oracle-asmdevices.rules

> done

 

[root@ogg1 dev]# /sbin/start_udev

Starting udev:                                             [  OK  ]

 

[root@ogg1 dev]# ls -l asm*

brw-rw---- 1 grid asmadmin 8,  16 Jul 21 14:02 asm-diskb

brw-rw---- 1 grid asmadmin 8,  32 Jul 21 14:02 asm-diskc

brw-rw---- 1 grid asmadmin 8,  48 Jul 21 14:02 asm-diskd

brw-rw---- 1 grid asmadmin 8,  64 Jul 21 14:02 asm-diske

brw-rw---- 1 grid asmadmin 8,  80 Jul 21 14:02 asm-diskf

brw-rw---- 1 grid asmadmin 8,  96 Jul 21 14:02 asm-diskg

brw-rw---- 1 grid asmadmin 8, 112 Jul 21 14:02 asm-diskh

brw-rw---- 1 grid asmadmin 8, 128 Jul 21 14:02 asm-diski

 

將新磁碟加入到 ASM 磁碟組

[grid@ogg1 ~]$ sqlplus / as sysasm

SQL> col name for a20

SQL> select group_number,name,total_mb from v$asm_diskgroup;

GROUP_NUMBER NAME              TOTAL_MB

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

           1 DATADG            1039

           2 SYSTEDG           4096

 

SQL> alter diskgroup SYSTEDG add disk '/dev/asm-diski';

 

檢視 ASM 空間使用情況

SQL> select group_number,name,total_mb from v$asm_diskgroup;

 

GROUP_NUMBER NAME         TOTAL_MB

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

           1 DATADG           1039

           2 SYSTEDG          5120

 

SQL> select group_number,name,path,os_mb,free_mb from v$asm_disk order by 1 desc;

     GROUP_NUMBER NAME         PATH                OS_MB       FREE_MB

         2       SYSTEDG_0000         /dev/asm-diskg        2048         594

         2       SYSTEDG_0001         /dev/asm-diskh        2048         590

         2       SYSTEDG_0002         /dev/asm-diski          1024         131

         1       DATADG_0000              /dev/asm-diskb        208          172

         1       DATADG_0003              /dev/asm-diske        210          172

         1       DATADG_0001              /dev/asm-diskc         210          175

         1       DATADG_0002       /dev/asm-diskd        211          173

         1       DATADG_0004        /dev/asm-diskf         200          164

 

[grid@ogg1 ~]$ asmcmd

ASMCMD> lsdg

State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name

MOUNTED  NORMAL  N         512   4096  1048576      1039      856              211             322              0             N  DATADG/

MOUNTED  NORMAL  N         512   4096  1048576      5120     1295             2048            -376              0             N  SYSTEDG/

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29785807/viewspace-1744758/,如需轉載,請註明出處,否則將追究法律責任。

相關文章