Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

2135

积分

502

好友

184

主题
1#
发表于 2012-3-5 20:46:59 | 查看: 8467| 回复: 0
今天想用KFED 的使用出现了以下错误:

[grid@vrh2 trace]$ kfed read /dev/asm-disk1
ERROR!!! could not initialize the diag context

查了一下metalink 说是$ORACLE_HOME/log/disg/asmtool 文件权限的问题:

  1.    
  2.        KFED - ERROR!!! could not initialize the diag context [ID 1335596.1]
  3. Applies to:  
  4. Oracle Server - Enterprise Edition - Version: 11.2.0.1.0 and later   [Release: 11.2 and later ]
  5. Information in this document applies to any platform.


  6. Symptoms
  7. kfed command shows the following error even though the running user has a proper permission on the target device.




  8.   $ kfed read /u02/oradata/asm_disk0
  9. ERROR!!! could not initialize the diag context



  10.   $ id
  11. uid=503(grid) gid=501(oinstall) groups=501(oinstall),504(asmadmin),505(asmoper),506(asmdba)



  12.   $ ls -l /u02/oradata/asm_disk0
  13. -rwxrwxrwx 1 grid oinstall 2097152000 Jul 5 22:14 /u02/oradata/asm_disk0

  14. Cause
  15. kfed executable will need create a directory for its own trace files
  16. under <GridHome>/log/diag/asmtool. If kfed firstly was used as
  17. root user, this directory - <GridHome>/log/diag/asmtool is created
  18. as root.
  19. The following kfed run by other than root user will not be able to create a directory under <GridHome>/log/diag/asmtool.



  20.   
  21. $ ls -l $ORACLE_HOME/log/diag

  22. drwxrwxrwx 2 grid oinstall 4096 Jul 5 15:29 asm
  23. drwxr-xr-x
  24. 3 root root 4096 Jul 6 11:17 asmtool << This directory is owned
  25. by root and there is no write permissin for other users.
  26. drwxr-xr-x 5 oracle asmadmin 4096 Jun 20 09:16 rdbms
  27. drwxrwxrwx 3 grid oinstall 4096 Jun 15 18:04 tnslsnr

  28. Solution
  29. Change the owner for <GridHome>/log/diag/asmtool directory as grid user.

  30. # chown grid:oinstall $ORACLE_HOME/log/disg/asmtool

  31. And as grid user, the following command will show the correct kfed output.


  32.   
  33. $kfed read /u02/oradata/asm_disk0 | more
  34. kfbh.endian: 1 ; 0x000: 0x01
  35. kfbh.hard: 130 ; 0x001: 0x82
  36. kfbh.type: 1 ; 0x002: KFBTYP_DISKHEAD
  37. kfbh.datfmt: 1 ; 0x003: 0x01
  38. kfbh.block.blk: 0 ; 0x004: T=0 NUMB=0x0
  39. kfbh.block.obj: 2147483648 ; 0x008: TYPE=0x8 NUMB=0x0
  40. kfbh.check: 1175212953 ; 0x00c: 0x460c5399
  41. kfbh.fcn.base: 0 ; 0x010: 0x00000000
  42. kfbh.fcn.wrap: 0 ; 0x014: 0x00000000
  43. kfbh.spare1: 0 ; 0x018: 0x00000000
  44. kfbh.spare2: 0 ; 0x01c: 0x00000000
  45. kfdhdb.driver.provstr: ORCLDISK ; 0x000: length=8
  46. ..
复制代码




查了以下 没有$ORACLE_HOME/log/disg/asmtool  这个目录


grid@vrh2 diag]$ ls -l $ORACLE_HOME/log/disg/asmtool
ls: /g01/11.2.0/grid/log/disg/asmtool: No such file or directory


之后对 kfed 做了 strace 才发现 文档写错了:

[grid@vrh2 diag]$ strace kfed

strace log:

stat("/g01/orabase/diag/asmtool", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/g01/orabase/diag/asmtool/user_grid", 0x7fffe3fe1250) = -1 ENOENT (No such file or directory)
mkdir("/g01/orabase/diag/asmtool/user_grid", 0775) = -1 EACCES (Permission denied)
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb6d1335000
write(1, "ERROR!!! could not initialize th"..., 48ERROR!!! could not initialize the diag context
) = 48
close(3)                                = 0
munmap(0x7fb6d10fd000, 143360)          = 0
exit_group(0)                           = ?


应当是 $ORACLE_BASE/diag/asmtool 这个目录才对

[grid@vrh2 ~]$ ls -l $ORACLE_BASE/diag/asmtool
total 4
drwxr-xr-x 3 root root 4096 Jan  4 18:33 user_root


要给予grid 用户合适的权限


[root@vrh2 ~]# chown grid:oinstall $ORACLE_BASE/diag/asmtool
[root@vrh2 ~]# chown grid:oinstall /g01/orabase/diag/asmtool/user_root

[grid@vrh2 ~]$ kfed
as/mlib         ASM Library [asmlib='lib']
aun/um          AU number to examine or update [AUNUM=number]
aus/z           Allocation Unit size in bytes [AUSZ=number]
blkn/um         Block number to examine or update [BLKNUM=number]
blks/z          Metadata block size in bytes [BLKSZ=number]
ch/ksum         Update checksum before each write [CHKSUM=YES/NO]
cn/t            Count of AUs to process [CNT=number]
de/v            ASM device to examine or update [DEV=string]
dm/pall         Don't suppress repeated lines when dumping corrupt blocks [DMPALL=YES/NO]
o/p             KFED operation type [OP=READ/WRITE/MERGE/REPAIR/NEW/FORM/FIND/STRUCT]
p/rovnm         Name for provisioning purposes [PROVNM=string]
s/eek           AU number to seek to [SEEK=number]
te/xt           File name for translated block text [TEXT=string]
ty/pe           ASM metadata block type number [TYPE=number]
下载专业ORACLE数据库恢复工具PRM-DUL  For Oracle http://www.parnassusdata.com/zh-hans/emergency-services

如果自己搞不定可以找诗檀软件专业ORACLE数据库修复团队成员帮您恢复!

诗檀软件专业数据库修复团队

服务热线 : 13764045638  QQ: 47079569   
您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-12-24 00:15 , Processed in 0.048251 second(s), 22 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569