ITPub博客

首页 > 数据库 > Oracle > ORACLE ACFS创建

ORACLE ACFS创建

原创 Oracle 作者:bluesshadow 时间:2016-09-20 16:26:29 0 删除 编辑
sqlplus "/as sysasm"

创建磁盘组:
SQL> CREATE DISKGROUP ACFSDG01 external redundancy DISK '/dev/raw/raw8' ATTRIBUTE 'compatible.asm' = '11.2','compatible.rdbms' = '11.2','compatible.advm'='11.2';

Diskgroup created.

创建ACFS卷:

SQL> alter diskgroup ACFSDG01 add volume oravol1 size 5g;

Diskgroup altered.

创建ACFS卷成功后,在dev/asm下查看生成的设备文件:
[root@rheldb1 ~]# ls -al /dev/asm
total 0
drwxrwx---  2 root asmadmin         300 Nov  9 17:23 .
drwxr-xr-x 18 root root            4000 Nov  9 15:56 ..
brwxrwx---  1 root asmadmin 252,      0 Nov  9 15:56 .asm_ctl_spec
brwxrwx---  1 root asmadmin 252,     10 Nov  9 15:56 .asm_ctl_vbg0
brwxrwx---  1 root asmadmin 252,     11 Nov  9 15:56 .asm_ctl_vbg1
brwxrwx---  1 root asmadmin 252,     12 Nov  9 15:56 .asm_ctl_vbg2
brwxrwx---  1 root asmadmin 252,     13 Nov  9 15:56 .asm_ctl_vbg3
brwxrwx---  1 root asmadmin 252,     14 Nov  9 15:56 .asm_ctl_vbg4
brwxrwx---  1 root asmadmin 252,     15 Nov  9 15:56 .asm_ctl_vbg5
brwxrwx---  1 root asmadmin 252,     16 Nov  9 15:56 .asm_ctl_vbg6
brwxrwx---  1 root asmadmin 252,     17 Nov  9 15:56 .asm_ctl_vbg7
brwxrwx---  1 root asmadmin 252,     18 Nov  9 15:56 .asm_ctl_vbg8
brwxrwx---  1 root asmadmin 252,      1 Nov  9 15:56 .asm_ctl_vdbg
brwxrwx---  1 root asmadmin 252,      2 Nov  9 15:56 .asm_ctl_vmb
brwxrwx---  1 root asmadmin 252, 207361 Nov  9 17:23 oravol1-405

格式化ACFS卷:
[root@rheldb1 ~]# mkfs.acfs -f -b 8k /dev/asm/oravol1-405
mkfs.acfs: ACFS-01151: Ignoring invalid block size 8192, using 4096
mkfs.acfs: version                   = 11.2.0.4.0
mkfs.acfs: on-disk version           = 39.0
mkfs.acfs: volume                    = /dev/asm/oravol1-405
mkfs.acfs: volume size               = 5368709120
mkfs.acfs: Format complete.

注册ACFS卷:
[root@rheldb1 ~]# acfsutil registry -f -a /dev/asm/oravol1-405 /oradata01/
acfsutil registry: mount point /oradata01 successfully added to Oracle Registry
[root@rheldb1 ~]# df -h
Filesystem                  Size  Used Avail Use% Mounted on
/dev/mapper/sysvg-LogVol00   51G   29G   20G  59% /
tmpfs                       2.0G  122M  1.9G   7% /dev/shm
/dev/sda1                   504M   46M  434M  10% /boot

挂载ACFS卷:
[root@rheldb1 ~]# mount -t acfs /dev/asm/oravol1-405 /oradata01/


[root@rheldb4 ~]# df -h
Filesystem                  Size  Used Avail Use% Mounted on
/dev/mapper/sysvg-LogVol00   51G   22G   27G  45% /
tmpfs                       2.0G  122M  1.9G   7% /dev/shm
/dev/sda1                   504M   46M  434M  10% /boot
/dev/asm/oravol1-405        5.0G  163M  4.9G   4% /oradata01


动态调整acfs文件系统(一次至少256M)

[root@rheldb1 ~]# mount -t acfs /dev/asm/oravol1-405 /oradata01/
[root@rheldb1 ~]# df -h
Filesystem                  Size  Used Avail Use% Mounted on
/dev/mapper/sysvg-LogVol00   51G   24G   25G  49% /
tmpfs                       2.0G  758M  1.2G  39% /dev/shm
/dev/sda1                   504M   46M  434M  10% /boot
/dev/asm/oravol1-405        5.0G  2.3G  2.8G  46% /oradata01
[root@rheldb1 ~]# acfsutil size +512M /oradata01/
acfsutil size: new file system size: 5905580032 (5632MB)
[root@rheldb1 ~]# df -h
Filesystem                  Size  Used Avail Use% Mounted on
/dev/mapper/sysvg-LogVol00   51G   24G   25G  49% /
tmpfs                       2.0G  758M  1.2G  39% /dev/shm
/dev/sda1                   504M   46M  434M  10% /boot
/dev/asm/oravol1-405        5.5G  2.3G  3.3G  42% /oradata01
[root@rheldb1 ~]# acfsutil size +13G /oradata01/
acfsutil size: new file system size: 19864223744 (18944MB)
[root@rheldb1 ~]# df -h
Filesystem                  Size  Used Avail Use% Mounted on
/dev/mapper/sysvg-LogVol00   51G   24G   25G  49% /
tmpfs                       2.0G  758M  1.2G  39% /dev/shm
/dev/sda1                   504M   46M  434M  10% /boot
/dev/asm/oravol1-405         19G  2.4G   17G  13% /oradata01

查看卷信息:
ASMCMD> ls -al
WARNING:option 'a' is deprecated for 'ls'
please use 'absolutepath'

State    Type    Rebal  Name
MOUNTED  EXTERN  N      ACFSDG01/
MOUNTED  EXTERN  N      CRSDATA/
MOUNTED  EXTERN  N      DBDATA01/
ASMCMD> volinfo -G acfsdg01 -a
Diskgroup Name: ACFSDG01

         Volume Name: ORAVOL1
         Volume Device: /dev/asm/oravol1-405
         State: ENABLED
         Size (MB): 18944
         Resize Unit (MB): 32
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage: ACFS
         Mountpath: /oradata01/

ASMCMD> exit
[grid@rheldb1 ~]$ asmcmd volinfo -G acfsdg01 -a
Diskgroup Name: ACFSDG01

         Volume Name: ORAVOL1
         Volume Device: /dev/asm/oravol1-405
         State: ENABLED
         Size (MB): 18944
         Resize Unit (MB): 32
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage: ACFS
         Mountpath: /oradata01/
         
停止卷:

SQL> alter diskgroup acfsdg01 disable volume 'oravol1';
alter diskgroup acfsdg01 disable volume 'oravol1'
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15468: volume 'ORAVOL1' in diskgroup 'ACFSDG01' is currently being accessed

[root@rheldb1 asm]# umount /oradata01/

SQL> alter diskgroup acfsdg01 disable volume 'oravol1';

Diskgroup altered.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
[grid@rheldb1 ~]$ asmcmd volinfo -G acfsdg01 -a
Diskgroup Name: ACFSDG01

         Volume Name: ORAVOL1
         Volume Device: /dev/asm/oravol1-405
         State: DISABLED
         Size (MB): 18944
         Resize Unit (MB): 32
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage: ACFS
         Mountpath: /oradata01/
         
激活卷:         
         
SQL> alter diskgroup acfsdg01 enable volume 'oravol1';

Diskgroup altered.

挂载卷:
[root@rheldb1 asm]# mount -t acfs /dev/asm/oravol1-405 /oradata01/
[root@rheldb1 asm]# df -h
Filesystem                  Size  Used Avail Use% Mounted on
/dev/mapper/sysvg-LogVol00   51G   24G   25G  49% /
tmpfs                       2.0G  759M  1.2G  39% /dev/shm
/dev/sda1                   504M   46M  434M  10% /boot
/dev/asm/oravol1-405         19G  2.4G   17G  13% /oradata01

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24668589/viewspace-2125221/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 左连接和右连接
下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2010-09-27

  • 博文量
    34
  • 访问量
    140347