1>. 编译产生kfed
cd $oracle_home/rdbms/lib
make -f ins_rdbms.mk ikfed
linking kfed utility (kfed)
rm -f /oracle/app/oracle/product/10.2.0/db_1/rdbms/lib/kfed
gcc -o /oracle/app/oracle/product/10.2.0/db_1/rdbms/lib/kfed -l/oracle/app/oracle/product/10.2.0/db_1/rdbms/lib/ -l/oracle/app/oracle/product/10.2.0/db_1/lib/ -l/oracle/app/oracle/product/10.2.0/db_1/lib/stubs/ -l/usr/lib -lirc /oracle/app/oracle/product/10.2.0/db_1/lib/s0main.o /oracle/app/oracle/product/10.2.0/db_1/rdbms/lib/sskfeded.o /oracle/app/oracle/product/10.2.0/db_1/rdbms/lib/skfedpt.o /oracle/app/oracle/product/10.2.0/db_1/rdbms/lib/defopt.o -ldbtools10 -lclntsh `cat /oracle/app/oracle/product/10.2.0/db_1/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /oracle/app/oracle/product/10.2.0/db_1/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10 -lvsn10 -lcommon10 -lgeneric10 -lmm -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 `cat /oracle/app/oracle/product/10.2.0/db_1/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /oracle/app/oracle/product/10.2.0/db_1/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10 -lvsn10 -lcommon10 -lgeneric10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 -lclient10 -lnnetd10 -lvsn10 -lcommon10 -lgeneric10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 `cat /oracle/app/oracle/product/10.2.0/db_1/lib/sysliblist` -wl,-rpath,/oracle/app/oracle/product/10.2.0/db_1/lib -lm `cat /oracle/app/oracle/product/10.2.0/db_1/lib/sysliblist` -ldl -lm -l/oracle/app/oracle/product/10.2.0/db_1/lib
mv -f /oracle/app/oracle/product/10.2.0/db_1/bin/kfed /oracle/app/oracle/product/10.2.0/db_1/bin/kfedo
mv: cannot stat `/oracle/app/oracle/product/10.2.0/db_1/bin/kfed': no such file or directory
make: [ikfed] error 1 (ignored)
mv /oracle/app/oracle/product/10.2.0/db_1/rdbms/lib/kfed /oracle/app/oracle/product/10.2.0/db_1/bin/kfed
chmod 751 /oracle/app/oracle/product/10.2.0/db_1/bin/kfed
2>. 查看磁盘组信息
select name,path,total_mb,free_mb,failgroup from v$asm_disk order by name
alter diskgroup dskgrp2 add disk '/oracle/oradata/asmdisk04';
set lines 200 pages 80
col name for a20
col path for a40
select name,path,state,total_mb,free_mb,failgroup from v$asm_disk order by name;
name path total_mb free_mb failgroup
-------------------- ---------------------------- --------- ---------- ----------------
archgroup_0000 /oracle/oradata/asmdisk09 1024 927 archgroup_0000
archgroup_0001 /oracle/oradata/asmdisk10 1024 927 archgroup_0001
dskgrp1_0000 /oracle/oradata/asmdisk01 1024 566 controller1
dskgrp1_0001 /oracle/oradata/asmdisk02 1024 568 controller1
dskgrp1_0002 /oracle/oradata/asmdisk05 1024 567 controller2
dskgrp1_0003 /oracle/oradata/asmdisk06 1024 567 controller2
dskgrp2_0000 /oracle/oradata/asmdisk03 1024 998 dskgrp2_0000
dskgrp2_0001 /oracle/oradata/asmdisk07 1024 999 dskgrp2_0001
dskgrp2_0002 /oracle/oradata/asmdisk04 1024 1020 dskgrp2_0002
/oracle/oradata/asmdisk08 1024 0
select name,state from v$asm_diskgroup;
name state
------------------------------------------------------------ ----------------------
archgroup mounted
dskgrp1 mounted
dskgrp2 mounted
3>. 备份相关信息
关闭所有数据库及实例
dd if='/oracle/oradata/asmdisk04' of='/tmp/asmdisk04.head' bs=4096 count=1
kfed read /oracle/oradata/asmdisk03 > asmdisk03.old.txt
kfed read /oracle/oradata/asmdisk07 > asmdisk07.old.txt
kfed read /oracle/oradata/asmdisk04 > asmdisk04.old.txt
4>. 破坏asmdisk04
dd if=/dev/zero of=/oracle/oradata/asmdisk04 bs=4096 count=1
启动asm
sql> alter diskgroup all mount;
alter diskgroup all mount
*
error at line 1:
ora-15032: not all alterations performed
ora-15040: diskgroup is incomplete
ora-15042: asm disk "2" is missing
同时检查asm警告日志
note: cache dismounting group 3/0x9492cd17 (dskgrp2)
note: dbwr not being msg'd to dismount
error: diskgroup dskgrp2 was not mounted
select name,state from v$asm_diskgroup;
name state
------------------------------------------------------------ ----------------------
archgroup mounted
dskgrp1 mounted
dskgrp2 dismounted
5>. 修复磁盘组
查找那块盘上有file directory信息
kfdhdb.f1b1locn
kf3.h /* file directory blk 1 au num */
beginging for file directory
kfed read /oracle/oradata/asmdisk03 | grep f1b1
kfdhdb.f1b1locn: 2 ; 0x0d4: 0x00000002
kfed read /oracle/oradata/asmdisk07 | grep f1b1
kfdhdb.f1b1locn: 0 ; 0x0d4: 0x00000000
kfed read /oracle/oradata/asmdisk04 | grep f1b1
kfdhdb.f1b1locn不为0表示该块记录有file direcotry信息
kfed read /oracle/oradata/asmdisk03 aunum=2 | grep kfbh.type
kfbh.type: 5 ; 0x002: kfbtyp_listhead
kfed read /oracle/oradata/asmdisk07 aunum=2 blknum=0 > asmdisk07_crestmp.txt
find :
kfddde[2].crestmp.hi: 32920276 ; 0x3f8: hour=0x14 days=0x16 mnth=0x4 year=0x7d9
kfddde[2].crestmp.lo: 2349526016 ; 0x3fc: usec=0x0 msec=0x2bb secs=0x0 mins=0x23
kfed read /oracle/oradata/asmdisk07 > asmdisk04.new.txt
modify
kfdhdb.dsknum: 1 ; 0x024: 0x0001
kfdhdb.dskname: dskgrp2_0001 ; 0x028: length=12
kfdhdb.fgname: dskgrp2_0001 ; 0x068: length=12
to
kfdhdb.dsknum: 2 ; 0x024: 0x0001
kfdhdb.dskname: dskgrp2_0002 ; 0x028: length=12
kfdhdb.fgname: dskgrp2_0002 ; 0x068: length=12
modify
kfbh.block.obj: 2147483649 ; 0x008: type=0x8 numb=0x1
to
kfbh.block.obj: 2147483650 ; 0x008: type=0x8 numb=0x1
modify
kfdhdb.crestmp.hi: 32920270 ; 0x0a8: hour=0xe days=0x16 mnth=0x4 year=0x7d9
kfdhdb.crestmp.lo: 3624518656 ; 0x0ac: usec=0x0 msec=0x271 secs=0x0 mins=0x36
to
kfdhdb.crestmp.hi: 32920276 ; 0x3f8: hour=0x14 days=0x16 mnth=0x4 year=0x7d9
kfdhdb.crestmp.lo: 2349526016 ; 0x3fc: usec=0x0 msec=0x2bb secs=0x0 mins=0x23
kfed merge /oracle/oradata/asmdisk04 text=asmdisk04.new.txt
sql> alter diskgroup dskgrp2 mount;
diskgroup altered.
ref:
阅读(2237) | 评论(0) | 转发(0) |