Focus On Oracle

Installing, Backup & Recovery, Performance Tuning,
Troubleshooting, Upgrading, Patching

Oracle Engineered System


当前位置: 首页 » 技术文章 » ASM

asmcmd之卷管理

ASMCMD Volume Management Commands(卷管理),通过ADVM Volume,我们可以建立ACFS文件系统,ACFS文件系统功能也能强大。卷管理涉及的命令有:volcreate, voldelete, voldisable, volenable, volinfo, volresize, volset, volstat
    
ACFS
Oracle Automatic Storage Management Cluster File System (Oracle ACFS) is a multi-platform, scalable file system, and storage management technology that extends Oracle Automatic Storage Management (Oracle ASM) functionality to support customer files maintained outside of Oracle Database. Oracle ACFS supports many database and application files, including executables, database trace files, database alert logs, application reports, BFILEs, and configuration files. Other supported files are video, audio, text, images, engineering drawings, and other general-purpose application file data.    
    
volcreate   创建Volume,volume是在Diskgroup上创建
Creates an Oracle ADVM volume in the specified disk group.
        volcreate -G diskgroup -s size [ --column number ] [ --width stripe_width ] [--redundancy {high|mirror|unprotected} ] [--primary {hot|cold}] [--secondary {hot|cold}] volume
        The options for the volcreate command are described below.

        -G diskgroup            - Name of the disk group containing the volume.
        -s size                 - Size of the volume to be created in units
                                  of K, M, G, or T. The unit designation must
                                  be appended to the number specified.
                                  No space is allowed. For example: 20G
        --column number         - Number of columns in a stripe set.
                                  Values range from 1 to 8. The default
                                  value is 4.
        --width stripe          - Stripe width of a volume. The value
                                  can range from 4 KB to 1 MB, at
                                  power-of-two intervals, with a default
                                  of 128 KB.
        --redundancy {high|mirror|unprotected}  - Redundancy of the
                                  Oracle ADVM volume which can be
                                  specified for normal redundancy disk
                                  groups. The range of values are as follows:
                                  unprotected for non-mirrored redundancy,
                                  mirror for double-mirrored redundancy, or
                                  high for triple-mirrored redundancy.
                                  If redundancy is not specified, the
                                  setting defaults to the redundancy level
                                  of the disk group.
        --primary {hot|cold}    - Intelligent Data Placement specification
                                  for primary extents, either hot or cold region.
        --secondary {hot|cold}  - Intelligent Data Placement specification
                                  for secondary extents, either hot or cold
                                  region.
        volume                  - Name of the volume to be created. Can be
                                  a maximum of 11 alphanumeric characters;
                                  dashes are not allowed. The first character
                                   must be alphabetic.
ASMCMD> volcreate -G ohsdba -s 1G ohs1
ORA-15032: not all alterations performed
ORA-15221: ASM operation requires compatible.asm of 11.2.0.0.0 or higher (DBD ERROR: OCIStmtExecute)
ASMCMD>
ASMCMD> lsattr -l -G ohsdba
Name  Value
ASMCMD>

ASMCMD> setattr -G ohsdba compatible.asm 11.2.0.0.0
ASMCMD> lsattr -l -G ohsdba
Name                     Value       
access_control.enabled   FALSE       
access_control.umask     066         
au_size                  1048576     
cell.smart_scan_capable  FALSE       
compatible.asm           11.2.0.0.0  
compatible.rdbms         10.1.0.0.0  
disk_repair_time         3.6h        
sector_size              512         
ASMCMD> setattr -G ohsdba compatible.rdbms 11.2.0.0.0

ASMCMD> lsattr -l -G ohsdba
Name                     Value       
access_control.enabled   FALSE       
access_control.umask     066         
au_size                  1048576     
cell.smart_scan_capable  FALSE       
compatible.asm           11.2.0.0.0  
compatible.rdbms         11.2.0.0.0  
disk_repair_time         3.6h        
sector_size              512         
ASMCMD>

ASMCMD> volcreate -G ohsdba -s 1G ohs1
ASMCMD> volinfo -G ohsdba ohs1
Diskgroup Name: OHSDBA
         Volume Name: OHS1
         Volume Device: /dev/asm/ohs1-109
         State: ENABLED
         Size (MB): 1024
         Resize Unit (MB): 32
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage:
         Mountpath:
ASMCMD> 

volresize 调整ADVM volume的大小
Resizes an Oracle ADVM volume.
        volresize -G diskgroup -s size [ -f ] volume

        The options for the volresize command are described below.
        -G diskgroup    - Name of the disk group containing the volume.
        -f              - Force the shrinking of a volume that is not an Oracle                           ACFS volume to suppress the warning message.
        volume          - Name of the volume to be operated on.
        -s size         - New size of the volume in units of M, G, or T.
Resize volume ohs1到1.5G
ASMCMD> volresize -G ohsdba -s 1.5G ohs1
ASMCMD> volinfo -G ohsdba ohs1
Diskgroup Name: OHSDBA
         Volume Name: OHS1
         Volume Device: /dev/asm/ohs1-109
         State: ENABLED
         Size (MB): 1536
         Resize Unit (MB): 32
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage:
         Mountpath:
ASMCMD>
[orgrid@ohs1 ~]$ ls -l /dev/asm/ohs1-109
brwxrwx--- 1 root oinstall 252, 55809 May 10 00:23 /dev/asm/ohs1-109
[orgrid@ohs1 ~]$

也通过acfsutil resize
[oracle@ohs1 ~]$ /sbin/acfsutil size 2G /acfs
acfsutil size: new file system size: 2147483648 (2048MB)
[oracle@ohs1 ~]$ asmcmd volinfo -a
Diskgroup Name: OHSDBA
         Volume Name: OHS1
         Volume Device: /dev/asm/ohs1-109
         State: ENABLED
         Size (MB): 2048
         Resize Unit (MB): 32
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage: ACFS
         Mountpath: /acfs
[oracle@ohs1 ~]$

volinfo 显示ADVM Volume的信息
Displays information about Oracle ADVM volumes.
        volinfo { -a | -G diskgroup -a | -G diskgroup volume }
        volinfo {--show_diskgroup |--show_volume} volumedevice

        The options for the volinfo command are described below.
        -a                      - When used without a disk group name, specifies
                                  all volumes within all disk groups.
                                  When used with a disk group name
                                  (-G diskgroup -a), specifies all volumes
                                  within that disk group.
        -G diskgroup            - Name of the disk group containing the volume.
        volume                  - Name of the volume.
        --show_diskgroup        - Returns only the disk group name.
                                  A volume device name is required.
        --show_volume           - Returns only the volume name.
                                  A volume device name is required.
        volumedevice            - Name of the volume device. 
[oracle@ohs1 ~]$ asmcmd volinfo -a
Diskgroup Name: OHSDBA
         Volume Name: OHS1
         Volume Device: /dev/asm/ohs1-109
         State: ENABLED
         Size (MB): 1536
         Resize Unit (MB): 32
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage: ACFS
         Mountpath: /acfs
 
volstat 显示ADVM volume的I/O信息
        Reports I/O statistics for Oracle ADVM volumes
        volstat [-G diskgroup][volume]

        The options for the volstat command are described below

        -G diskgroup    - Name of the mounted disk group containing the volume
        volume          - Name of the volume to be operated on.
ASMCMD> volstat

DISKGROUP NUMBER / NAME:  3 / OHSDBA
---------------------------------------
  VOLUME_NAME
     READS           BYTES_READ      READ_TIME       READ_ERRS       
     WRITES          BYTES_WRITTEN   WRITE_TIME      WRITE_ERRS      
  -------------------------------------------------------------
  OHS1
     0               0               0               0               
     0               0               0               0  

volenable 启用ADVM volume
Enables Oracle ADVM volumes in mounted disk groups.
        volenable { -a | -G diskgroup -a | -G diskgroup volume }
        The options for the volenable command are described below.
        -a              - When used without a disk group name, specifies all
                          volumes within all disk groups.

                          When used with a disk group name (-G diskgroup -a),
                          specifies all volumes within that disk group.
        -G diskgroup    - Name of the disk group containing the volume.
        volume          - Name of the volume to be operated on.        
ASMCMD> volenable -G ohsdba ohs1
ASMCMD> volinfo -G ohsdba -a
Diskgroup Name: OHSDBA

         Volume Name: OHS1
         Volume Device: /dev/asm/ohs1-109
         State: ENABLED
         Size (MB): 2048
         Resize Unit (MB): 32
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage: ACFS
         Mountpath: /acfs
ASMCMD>  
     
voldisable 禁用ADVM Volume,禁用之前先umount acfs文件系统
        Disables Oracle ADVM volumes in mounted disk groups and removes the
        volume device on the local node.
        voldisable { -a | -G diskgroup -a | -G diskgroup volume }
        The options for the voldisable command are described below.
        -a              - When used without a disk group name, specifies all
                          volumes within all disk groups.
                          When used with a disk group name (-G diskgroup -a),
                          specifies all volumes within that disk group.
        -G diskgroup    - Name of the disk group containing the volume.
        volume          - Name of the volume to be operated on. Can be
                          maximum of 30 alphanumeric characters. The first
                          character must be alphabetic. 
ASMCMD> voldisable -G ohsdba ohs1
ASMCMD> volinfo -G ohsdba -a
Diskgroup Name: OHSDBA

         Volume Name: OHS1
         Volume Device: /dev/asm/ohs1-109
         State: DISABLED
         Size (MB): 2048
         Resize Unit (MB): 32
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage: ACFS
         Mountpath: /acfs

ASMCMD>                                

volset 设置ADVM Volume的属性
Sets attributes of an Oracle ADVM volume in mounted disk groups.
        volset -G diskgroup [ --usagestring string] [--mountpath mount_path ] [--primary {hot|cold}] [--secondary {hot|cold}] volume
        The options for the volset command are described below.
        -G diskgroup            - Name of the disk group containing the volume.
        --usagestring string    - Optional usage string to tag a volume which
                                  can be up to 30 characters. This string is
                                  set to ACFS when the volume is attached to
                                  a file system and should not be changed.
        --mountpath mount_path  - Optional string to tag a volume with its
                                  mount path string which can be up to 1024
                                  characters. This string is for user
                                  information only.
        --primary {hot|cold}    - Intelligent Data Placement specification for
                                  primary extents, either hot or cold region.
        --secondary {hot|cold}  - Intelligent Data Placement specification for
                                  secondary extents, either hot or cold region.
        volume                    Name of the volume to be operated on.
ASMCMD> volinfo -G ohsdba -a
Diskgroup Name: OHSDBA
         Volume Name: OHS1
         Volume Device: /dev/asm/ohs1-109
         State: ENABLED
         Size (MB): 2048
         Resize Unit (MB): 32
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage: ACFS
         Mountpath: /acfs

ASMCMD> volset -G ohsdba --usagestring 'acfs file system' --mountpath /mnt ohs1
ASMCMD> volinfo -G ohsdba -a
Diskgroup Name: OHSDBA
         Volume Name: OHS1
         Volume Device: /dev/asm/ohs1-109
         State: ENABLED
         Size (MB): 2048
         Resize Unit (MB): 32
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage: acfs file system
         Mountpath: /mnt

ASMCMD>   

voldelete 删除ADVM Volume     
Deletes an Oracle ADVM volume.
        voldelete -G diskgroup volume
        The options for the voldelete command are described below.
        -G diskgroup    - Name of the disk group containing the volume.
        volume          - Name of the volume to be operated on.
ASMCMD> voldelete -G ohsdba ohs1
ASMCMD> volinfo -G ohsdba -a
diskgroup ohsdba has no volumes or is not mounted
ASMCMD> 


Reference
http://docs.oracle.com/cd/B14117_01/server.101/b10739/storeman.htm
http://docs.oracle.com/cd/B19306_01/server.102/b14231/storeman.htm#i1021337
http://docs.oracle.com/cd/B19306_01/server.102/b14215/asm_util.htm
http://docs.oracle.com/cd/E11882_01/server.112/e18951/asmcon.htm
http://docs.oracle.com/cd/E11882_01/server.112/e18951/asm_util001.htm
http://docs.oracle.com/database/121/OSTMG/GUID-34A732CD-CC55-4A25-982A-209FDF6134BE.htm
http://docs.oracle.com/database/121/OSTMG/GUID-1E5C4FAD-087F-4598-B959-E66670804C4F.htm

http://docs.oracle.com/database/121/OSTMG/GUID-995198B7-9235-4FCF-988E-A48B3B62B405.htm


关键词:asm 

相关文章

Oracle ASM from 10g to 18c
在18c中通过ASM Flex DiskGroup克隆PDB
Exadata and ASM
Oracle ASM Storage Limits
12c 如何将Standard ASM转化为Flex ASM
How to use amdu(ASM Metadata Dump Utility)
How to use kfed(Kernel Files metadata Editor)
How to use kfod(Kernel Files OSM Disk)
如何计算ASM磁盘头自动备份的位置
What is disk_repair_time?
Find block in ASM
12c新特性ASMFD
Top