Oracle asm命令使用说明
程序员文章站
2022-04-14 08:55:39
1、运行环境 linux:centos 6.5oracle:11.2.0.4.0
2、oracle asm命令使用说明
[root@strong ~]# oracleasm
usage: or...
1、运行环境 linux:centos 6.5oracle:11.2.0.4.0
2、oracle asm命令使用说明
[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"