【ASM】Oracleasm命令

1、运行环境
  • Linux:Centos 6.5
  • Oracle:11.2.0.4.0
2、Oracleasm命令使用说明
[root@strong ~]# oracleasm
Usage: oracleasm [--exec-path=]  [  ]
       oracleasm --exec-path
       oracleasm -h
       oracleasm -V

The basic oracleasm commands are:
    configure        Configure the Oracle Linux ASMLib driver
    init             Load and initialize the ASMLib driver
    exit             Stop the ASMLib driver
    scandisks        Scan the system for Oracle ASMLib disks
    status           Display the status of the Oracle ASMLib driver
    listdisks        List known Oracle ASMLib disks
    querydisk        Determine if a disk belongs to Oracle ASMlib
    createdisk       Allocate a device for Oracle ASMLib use
    deletedisk       Return a device to the operating system
    renamedisk       Change the label of an Oracle ASMlib disk
    update-driver    Download the latest ASMLib driver
[root@strong ~]# which oracleasm
/usr/sbin/oracleasm
[root@strong ~]# cd /etc/init.d/
[root@strong init.d]# ./oracleasm 
Usage: ./oracleasm {start|stop|restart|enable|disable|configure|createdisk|deletedisk|querydisk|listdisks|scandisks|status}
[root@strong init.d]# 
3、查看文件系统
[root@strong init.d]# fdisk -l |grep /dev/sd
Disk /dev/sdb: 10.7 GB, 10737418240 bytes
/dev/sdb1               1        1305    10482381   83  Linux
Disk /dev/sdc: 10.7 GB, 10737418240 bytes
/dev/sdc1               1        1305    10482381   83  Linux
Disk /dev/sdd: 10.7 GB, 10737418240 bytes
/dev/sdd1               1        1305    10482381   83  Linux
Disk /dev/sde: 10.7 GB, 10737418240 bytes
/dev/sde1               1        1305    10482381   83  Linux
Disk /dev/sdf: 10.7 GB, 10737418240 bytes
/dev/sdf1               1        1305    10482381   83  Linux
Disk /dev/sdg: 10.7 GB, 10737418240 bytes
/dev/sdg1               1        1305    10482381   83  Linux
Disk /dev/sdh: 10.7 GB, 10737418240 bytes
/dev/sdh1               1        1305    10482381   83  Linux
Disk /dev/sdi: 10.7 GB, 10737418240 bytes
/dev/sdi1               1        1305    10482381   83  Linux
Disk /dev/sdj: 10.7 GB, 10737418240 bytes
/dev/sdj1               1        1305    10482381   83  Linux
Disk /dev/sdk: 10.7 GB, 10737418240 bytes
/dev/sdk1               1        1305    10482381   83  Linux
Disk /dev/sda: 75.2 GB, 75161927680 bytes
/dev/sda1               1        5222    41943040   83  Linux
/dev/sda2            5222        5744     4194304   82  Linux swap / Solaris
/dev/sda3   *        5744        9138    27261952   83  Linux
[root@strong init.d]# 
[root@strong init.d]# ll /dev/oracleasm/disks/
total 0
brw-rw----. 1 grid asmadmin 8, 17 Dec 20 14:46 DATADISK1
brw-rw----. 1 grid asmadmin 8, 33 Dec 20 14:46 DATADISK2
brw-rw----. 1 grid asmadmin 8, 49 Dec 20 14:46 FRADISK3
brw-rw----. 1 grid asmadmin 8, 65 Dec 20 14:46 FRADISK4
4、查看asm的状态及磁盘信息
[root@strong init.d]# oracleasm status
Checking if ASM is loaded: yes
Checking if /dev/oracleasm is mounted: yes
[root@strong init.d]# oracleasm listdisks
DATADISK1
DATADISK2
FRADISK3
FRADISK4
[root@strong init.d]# 
5、查看ASM磁盘对应的物理磁盘
[root@strong init.d]# oracleasm querydisk datadisk1
Disk "DATADISK1" is a valid ASM disk
[root@strong init.d]# oracleasm querydisk -d datadisk1
Disk "DATADISK1" is a valid ASM disk on device [8,17]
[root@strong init.d]# ll -t /dev/sd*
brw-rw----. 1 root disk 8, 145 Dec 20 16:45 /dev/sdj1
brw-rw----. 1 root disk 8,  81 Dec 20 16:45 /dev/sdf1
brw-rw----. 1 root disk 8, 113 Dec 20 16:45 /dev/sdh1
brw-rw----. 1 root disk 8,  97 Dec 20 16:45 /dev/sdg1
brw-rw----. 1 root disk 8, 129 Dec 20 16:45 /dev/sdi1
brw-rw----. 1 root disk 8, 161 Dec 20 16:45 /dev/sdk1
brw-rw----. 1 root disk 8,  96 Dec 20 16:45 /dev/sdg
brw-rw----. 1 root disk 8, 144 Dec 20 16:45 /dev/sdj
brw-rw----. 1 root disk 8, 128 Dec 20 16:45 /dev/sdi
brw-rw----. 1 root disk 8,  80 Dec 20 16:45 /dev/sdf
brw-rw----. 1 root disk 8, 160 Dec 20 16:45 /dev/sdk
brw-rw----. 1 root disk 8, 112 Dec 20 16:45 /dev/sdh
brw-rw----. 1 root disk 8,  33 Dec 20 14:46 /dev/sdc1
brw-rw----. 1 root disk 8,  17 Dec 20 14:46 /dev/sdb1
brw-rw----. 1 root disk 8,  49 Dec 20 14:46 /dev/sdd1
brw-rw----. 1 root disk 8,  32 Dec 20 14:46 /dev/sdc
brw-rw----. 1 root disk 8,  65 Dec 20 14:46 /dev/sde1
brw-rw----. 1 root disk 8,  16 Dec 20 14:46 /dev/sdb
brw-rw----. 1 root disk 8,  48 Dec 20 14:46 /dev/sdd
brw-rw----. 1 root disk 8,  64 Dec 20 14:46 /dev/sde
brw-rw----. 1 root disk 8,   1 Dec 20 14:46 /dev/sda1
brw-rw----. 1 root disk 8,   2 Dec 20 14:46 /dev/sda2
brw-rw----. 1 root disk 8,   3 Dec 20 14:46 /dev/sda3
brw-rw----. 1 root disk 8,   0 Dec 20 14:46 /dev/sda
[root@strong init.d]# oracleasm querydisk -d /dev/sdb1
Device "/dev/sdb1" is marked an ASM disk with the label "DATADISK1"
[root@strong init.d]# 
或者:
[root@strong init.d]# oracleasm querydisk -p datadisk1
Disk "DATADISK1" is a valid ASM disk
/dev/sdb1: LABEL="DATADISK1" TYPE="oracleasm"


你可能感兴趣的:(Oracle系列)