asm常用命令

[grid@lxtrac05 ~]$ export DBI_TRACE=1
[grid@lxtrac05 ~]$ asmcmd

[grid@lxtrac03 ~]$ kfed REPAIR /dev/sdd5 aus=4194304 <<<<<磁盘头修复
[grid@lxtrac03 ~]$ 

例如:
[root@lxtrac03 grid]# dd if=/dev/zero of=/dev/sdd5 bs=4194304 count=1 <<<<<使用dd将第一个AU清理掉。au大小为4M
1+0 records in
1+0 records out
4194304 bytes (4.2 MB) copied, 0.00566068 s, 741 MB/s
[root@lxtrac03 grid]# kfed read /dev/sdd5 清理掉之后,使用kfed read 发现type为invalid
kfbh.endian: 0 ; 0x000: 0x00
kfbh.hard: 0 ; 0x001: 0x00
kfbh.type: 0 ; 0x002: KFBTYP_INVALID
kfbh.datfmt: 0 ; 0x003: 0x00
kfbh.block.blk: 0 ; 0x004: blk=0
kfbh.block.obj: 0 ; 0x008: file=0
kfbh.check: 0 ; 0x00c: 0x00000000
kfbh.fcn.base: 0 ; 0x010: 0x00000000
kfbh.fcn.wrap: 0 ; 0x014: 0x00000000
kfbh.spare1: 0 ; 0x018: 0x00000000
kfbh.spare2: 0 ; 0x01c: 0x00000000
000000000 00000000 00000000 00000000 00000000 [................]
Repeat 255 times
KFED-00322: invalid content encountered during block traversal: [kfbtTraverseBlock][Invalid OSM block type][][0]

[root@lxtrac03 grid]# kfed repair /dev/sdd5 aus=4194304 <<<<<<使用repair修复
[root@lxtrac03 grid]# kfed read /dev/sdd5 |more <<<<<<能正常读到磁盘头
kfbh.endian: 1 ; 0x000: 0x01
kfbh.hard: 130 ; 0x001: 0x82
kfbh.type: 1 ; 0x002: KFBTYP_DISKHEAD
kfbh.datfmt: 1 ; 0x003: 0x01
kfbh.block.blk: 0 ; 0x004: blk=0
kfbh.block.obj: 2147483648 ; 0x008: disk=0
kfbh.check: 1793886199 ; 0x00c: 0x6aec87f7
kfbh.fcn.base: 0 ; 0x010: 0x00000000
kfbh.fcn.wrap: 0 ; 0x014: 0x00000000
kfbh.spare1: 0 ; 0x018: 0x00000000
kfbh.spare2: 0 ; 0x01c: 0x00000000

[root@lxtrac03 grid]# kfed read /dev/sdd5 blkn=2 aus=4194304|more <<<<<<读0号AU,2号block的AT表,却是invalid
kfbh.endian: 0 ; 0x000: 0x00
kfbh.hard: 0 ; 0x001: 0x00
kfbh.type: 0 ; 0x002: KFBTYP_INVALID
kfbh.datfmt: 0 ; 0x003: 0x00
kfbh.block.blk: 0 ; 0x004: blk=0
kfbh.block.obj: 0 ; 0x008: file=0
kfbh.check: 0 ; 0x00c: 0x00000000
kfbh.fcn.base: 0 ; 0x010: 0x00000000
kfbh.fcn.wrap: 0 ; 0x014: 0x00000000
kfbh.spare1: 0 ; 0x018: 0x00000000
kfbh.spare2: 0 ; 0x01c: 0x00000000
000002000 00000000 00000000 00000000 00000000 [................]
Repeat 255 times
KFED-00322: invalid content encountered during block traversal: [kfbtTraverseBlock][Invalid OSM block type][][0]

[root@lxtrac03 grid]#
[grid@lxtrac03 tmp]$ sqlplus / as sysasm
SQL> alter diskgroup DATA check all repair; <<<使用check命令对repair的盘,进行check。或等待下一次重启crs,自动生效
Diskgroup altered.
SQL> alter diskgroup data mount;


alter diskgroup DATA check all repair; alert_+asm中会报出如下警告
Errors in file /u01/app/grid/diag/asm/+asm/+ASM2/trace/+ASM2_ora_26901.trc:
ORA-15196: invalid ASM block header [kfc.c:29757] [endian_kfbh] [2147483648] [59] [0 != 1]
ORA-15196: invalid ASM block header [kfc.c:29757] [endian_kfbh] [2147483648] [59] [0 != 1]
NOTE: a corrupted block from group DATA was dumped to /u01/app/grid/diag/asm/+asm/+ASM2/trace/+ASM2_ora_26901.trc
NOTE: cache repaired a corrupt block: group=1(DATA) dsk=0 blk=59 on disk 0 from disk=0 (DATA01) incarn=2043227377 au=11 blk=59 count=1
SUCCESS: check of diskgroup DATA found no errors
2018-02-28T11:22:49.478046+08:00
SUCCESS: alter diskgroup DATA check all repair

[grid@lxtrac03 ~]$ dd if=/dev/sdd5 of=/tmp/asm.dd bs=1024k count=4     <<<<保存磁盘头信息
4+0 records in
4+0 records out
4194304 bytes (4.2 MB) copied, 0.00799118 s, 525 MB/s
[grid@lxtrac03 ~]$

[grid@lxtrac03 ~]$ asmcmd find --type ASMPARAMETERFILE +OCR '*';
+OCR/ora12c-cluster/ASMPARAMETERFILE/REGISTRY.253.944241683
[grid@lxtrac03 ~]$

acfs的简单使用
1.acfs加载
# acfsload start <<<<单实例需要手工加载(rac环境下是自动load,不需要手工干预)
2.创建asm磁盘组
$ sqlplus / as sysasm <<<<<创建asm磁盘组,可以使用asmca图形界面创建
SQL> create diskgroup ACFS
disk 'ORCL:ASMDISK5', 'ORCL:ASMDISK6'
attribute 'COMPATIBLE.ASM' = '11.2', 'COMPATIBLE.ADVM' = '11.2';
Diskgroup created.
SQL>
3.在acfs磁盘组创建一些卷
$ asmcmd volcreate -G ACFS -s 4G VOL1
4.获取卷的信息
[grid@lxtrac05 ~]$ asmcmd volinfo -a
Diskgroup Name: DATA

Volume Name: ACFS
Volume Device: /dev/asm/acfs-257
State: ENABLED
Size (MB): 6144
Resize Unit (MB): 32
Redundancy: UNPROT
Stripe Columns: 4
Stripe Width (K): 128
Usage: ACFS
Mountpath: /tt

[grid@lxtrac05 ~]$
5.基于卷来创建文件来创建acfs文件系统
# mkdir /acfs1
# chmod 777 /acfs1
# /sbin/mkfs -t acfs /dev/asm/vol1-142
# mount -t acfs /dev/asm/vol1-142 /acfs1

[root@lxtrac03 ~]# /sbin/mkfs -t acfs /dev/asm/vol-136

mkfs.acfs: version = 12.2.0.1.0
mkfs.acfs: on-disk version = 46.0
mkfs.acfs: volume = /dev/asm/vol-136
mkfs.acfs: volume size = 6442450944 ( 6.00 GB )
mkfs.acfs: Format complete.
[root@lxtrac03 ~]#

http://community.oracle.com/thread/4122374

Hi

I'm just experimenting with Grid 12.2 using Oracle Cloud Filesystem.
I set it up, it is running fine, failover works...

Howeve,r a question about the NFS Server:
On my system I have to edit /etc/exports file and add the exported filesystems manually.
Is this normal behaivor or did I miss something when setting up the Cloud Filesystems?
As far as I got it, the manuals just give the information that nfs Server must be running, which is the case.
Therefore I expected that the installation would do the changes of /export/exports automaticly.

as root created the FS
mkfs -t acfs /dev/asm/acfs_volum2-483

created the mount points on all nodes
mkdir /acfs2


build the cluster resource
srvctl add filesystem -d /dev/asm/acfs_volum2-483 -m /acfs2

starting the cluster resource
srvctl start filesystem -d /dev/asm/acfs_volum2-483


create HAVIP
srvctl add havip -id havip_acfs_vol2 -address ACFS-VOL2

create and start exportfs
srvctl add exportfs -id havip_acfs_vol2 -path /acfs2 -name export_acfs_volume2 -options rw -clients *.darkwing.net
srvctl start exportfs -name export_acfs_volume2


Thx
Christian

猜你喜欢

转载自www.cnblogs.com/erwadba/p/8474029.html