在Exadata上,为什么 DUL 和 ODU不能读取ASM数据库的数据,但是Kfed却可以?

联系:QQ(5163721)

标题:在Exadata上,为什么 DUL 和 ODU不能读取ASM数据库的数据,但是Kfed却可以?

作者:Lunar©版权所有[文章允许转载,但必须以链接方式注明源地址,否则追究法律责任.]

普通的dul在exadata上是不能读取 cell 节点的数据的:

。。。。。。。。。。。
7132       0.000119 read(4, "disk o/192.168.56.11/data_CD_dis"..., 4096) = 46
7132       0.004402 read(4, "", 4096)   = 0
7132       0.156246 open("o/192.168.56.11/data_CD_disk01_dm01cel01", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
7132       0.000211 write(1, "\n", 1)   = 1
7132       0.000186 write(1, "DUL: Error: ", 12) = 12
7132       0.000163 write(1, "open( 'o/192.168.56.11/data_CD_d"..., 60) = 60
7132       0.000170 write(1, "\n", 1)   = 1
7132       0.000170 write(1, "OS error 2: No such file or dire"..., 38) = 38
7132       0.000196 write(3, "DUL version 10.2.0.5.28 with 64-"..., 1377) = 1377
7132       0.063801 write(1, "DUL: Error: ", 12) = 12
7132       0.000426 write(1, "Could not read disk header block"..., 82) = 82
7132       0.000166 write(1, "\n", 1)   = 1
7132       0.000366 close(4)            = 0
7132       0.000000 munmap(0xe8610000, 4096) = 0
7132       0.000188 brk(0xa93d000)      = 0xa93d000
7132       0.000151 write(1, "DUL> ", 5) = 5
7132       0.000294 write(3, "DUL: Error: Could not read disk "..., 101) = 101
7132       0.000751 fstat64(0, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
7132       0.000242 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xffffffffe8610000
7132       0.000237 read(0, 

这里很清晰看到DUL报错了“OS error 2: No such file or dire”和“DUL: Error: “, 12″,由于篇幅关系,这里我就不贴前台DUL的报错界面了,这个trace已经很清晰了。

.

那么,我猜ODU也是同样的采用传统的read和write的方式读取数据的,跟踪一下,主要内容如下:

。。。。。。。。。。。
7940       0.000739 write(1, "loading default asm disk file .."..., 37) = 37
7940       0.000132 write(1, "\n", 1)   = 1
7940       0.000178 open("asmdisk.txt", O_RDONLY|O_LARGEFILE) = 4
7940       0.000101 fstat64(4, {st_mode=S_IFREG|0755, st_size=90, ...}) = 0
7940       0.000113 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xfffffffff7f88000
7940       0.000455 read(4, "# disk_no  disk_path       group"..., 4096) = 90
7940       0.000141 read(4, "", 4096)   = 0
7940       0.000086 close(4)            = 0
7940       0.000084 munmap(0xf7f88000, 4096) = 0
7940       0.000114 write(1, "\n", 1)   = 1
7940       0.000139 write(1, "grp# dsk# bsize ausize disksize "..., 69) = 69
7940       0.000157 write(1, "---- ---- ----- ------ -------- "..., 109) = 109
7940       0.000102 write(1, "\n", 1)   = 1
7940       0.000089 write(1, "load asm disk file 'asmdisk.txt'"..., 44) = 44
7940       0.000102 write(1, "loading default control file ..."..., 36) = 36
7940       0.000102 write(1, "\n", 1)   = 1
7940       0.000252 open("oductl.dat", O_RDONLY) = -1 ENOENT (No such file or directory)
7940       0.000133 open("control.txt", O_RDONLY|O_LARGEFILE) = 4
7940       0.000106 fstat64(4, {st_mode=S_IFREG|0755, st_size=118, ...}) = 0
7940       0.000116 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xfffffffff7f88000
7940       0.000088 read(4, "#ts fno   rfno     filename     "..., 4096) = 118
7940       0.000105 read(4, "", 4096)   = 0
7940       0.002253 close(4)            = 0
7940       0.000086 munmap(0xf7f88000, 4096) = 0
7940       0.000114 write(1, "\n", 1)   = 1
7940       0.000134 write(1, " ts#   fn  rfn bsize   blocks bf"..., 49) = 49
7940       0.000274 write(1, "---- ---- ---- ----- -------- --"..., 85) = 85
7940       0.000096 write(1, "load control file 'control.txt' "..., 43) = 43
7940       0.000000 open("user.odu", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
7940       0.000085 open("obj.odu", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
7940       0.000111 open("col.odu", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
7940       0.000097 open("tab.odu", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
7940       0.000109 open("ind.odu", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
7940       0.000105 open("lob.odu", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
7940       0.000101 open("lobfrag.odu", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
7940       0.000115 write(1, "loading dictionary data......don"..., 34) = 34
7940       0.000140 write(1, "\n", 1)   = 1
7940       0.001075 open("ext.odu", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
7940       0.000112 open("lobind.odu", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
7940       0.001063 open("lobpage.odu", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
7940       0.000235 write(1, "loading scanned data......done\n", 31) = 31
7940       0.000122 write(1, "\n", 1)   = 1
7940       0.000115 fstat64(0, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
7940       0.000140 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xfffffffff7f88000
7940       0.000093 write(1, "ODU> ", 5) = 5
7940       0.000114 read(0, 

我们看到,ODU读取了配置文件:“write(1, “load asm disk file ‘asmdisk.txt’”…, 44) = 44”
然后根据配置文件中的信息直接读取磁盘内容。
很明显,这种情况下ODU还是直接根据文件路径读取信息,那么在Exadata上,自然是搜索不到的。
因为,Exadata上,数据是放在cell上的,db节点调用 libcell11.a 并通过 socket 的方式通信。

.

但是kfed可以读取cell的数据,具体方法参见
Exadata上验证ASM磁盘头备份的位置

我跟踪了一下kfed读取cell上数据块的过程,大致如下:

kfed打开socket,并读取/etc/nsswitch.conf来进行域名解析:


。。。。。。。。。。。
9624       0.000204 socket(PF_FILE, SOCK_STREAM, 0) = 3
9624       0.000103 fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
9624       0.000082 connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"...}, 110) = -1 ENOENT (No such file or directory)
9624       0.000132 close(3)            = 0
9624       0.000084 socket(PF_FILE, SOCK_STREAM, 0) = 3
9624       0.000165 fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
9624       0.000085 connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"...}, 110) = -1 ENOENT (No such file or directory)
9624       0.000157 close(3)            = 0
9624       0.000128 open("/etc/nsswitch.conf", O_RDONLY) = 3
9624       0.000146 fstat(3, {st_mode=S_IFREG|0644, st_size=1696, ...}) = 0
9624       0.000127 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b6cccf0f000
9624       0.000087 read(3, "#\n# /etc/nsswitch.conf\n#\n# An ex"..., 4096) = 1696
9624       0.000132 read(3, "", 4096)   = 0
9624       0.000098 close(3)            = 0

。。。。。。。。。。。

kfed 读取自己的fd(/proc/self/fd/),fd是linux系统上进程的文件描述符:


。。。。。。。。。。。
9624       0.000108 open("/proc/self/fd/", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
9624       0.000139 fcntl(4, F_SETFD, FD_CLOEXEC) = 0
9624       0.000081 brk(0xe6e5000)      = 0xe6e5000

。。。。。。。。。。。。。

kfed 读取 ADR 的配置信息(怀疑Oracle的进程都会有类似过程,因为他们要讲log或者trace写入ADR):


。。。。。。。。。。。。。

9624       0.000154 fcntl(5, F_GETFL)   = 0x8002 (flags O_RDWR|O_LARGEFILE)
9624       0.000087 fcntl(5, F_SETLK, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}) = 0
9624       0.000277 times({tms_utime=0, tms_stime=2, tms_cutime=0, tms_cstime=0}) = 1718557960
9624       0.000105 times({tms_utime=0, tms_stime=2, tms_cutime=0, tms_cstime=0}) = 1718557960
9624       0.000144 lstat("/u01/app/oracle/diag/asmtool/user_oracle/host_3488797338_80/metadata/ADR_CONTROL.ams", 0x7fff2d998640) = -1 ENOENT (No such file or directory)
9624       0.000120 stat("/u01/app/oracle/diag/asmtool/user_oracle/host_3488797338_80/metadata/ADR_CONTROL.ams", 0x7fff2d9986f0) = -1 ENOENT (No such file or directory)
9624       0.000181 stat("/u01/app/oracle/diag/asmtool/user_oracle/host_3488797338_80/metadata/ADR_CONTROL.ams", 0x7fff2d9983b8) = -1 ENOENT (No such file or directory)
9624       0.000127 open("/u01/app/oracle/diag/asmtool/user_oracle/host_3488797338_80/metadata/ADR_CONTROL.ams", O_RDWR|O_CREAT|O_EXCL|O_SYNC, 0660) = 6
9624       0.005864 fstat(6, {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
9624       0.000149 fstatfs(6, {f_type="EXT2_SUPER_MAGIC", f_bsize=4096, f_blocks=14807532, f_bfree=11368131, f_bavail=10603818, f_files=15287712, f_ffree=15007712, f_fsid={0, 0}, f_namelen=255, f_frsize=4096}) = 0
9624       0.000129 close(6)            = 0
9624       0.000085 open("/u01/app/oracle/diag/asmtool/user_oracle/host_3488797338_80/metadata/ADR_CONTROL.ams", O_RDWR|O_SYNC|O_DIRECT) = 6
9624       0.000131 ftruncate(6, 65536) = 0
9624       0.000089 close(6)            = 0
9624       0.000127 stat("/u01/app/oracle/diag/asmtool/user_oracle/host_3488797338_80/metadata/ADR_CONTROL.ams", {st_mode=S_IFREG|0640, st_size=65536, ...}) = 0
9624       0.000196 stat("/u01/app/oracle/diag/asmtool/user_oracle/host_3488797338_80/metadata/ADR_CONTROL.ams", {st_mode=S_IFREG|0640, st_size=65536, ...}) = 0
9624       0.000148 open("/u01/app/oracle/diag/asmtool/user_oracle/host_3488797338_80/metadata/ADR_CONTROL.ams", O_RDONLY) = 6
9624       0.000114 ioctl(6, BLKSSZGET, 0x7fff2d990078) = -1 ENOTTY (Inappropriate ioctl for device)
9624       0.000254 close(6)            = 0
9624       0.000108 statfs("/u01/app/oracle/diag/asmtool/user_oracle/host_3488797338_80/metadata/ADR_CONTROL.ams", {f_type="EXT2_SUPER_MAGIC", f_bsize=4096, f_blocks=14807532, f_bfree=11368130, f_bavail=10603817, f_files=15287712, f_ffree=15007712, f_fsid={0, 0}, f_namelen=255, f_frsize=4096}) = 0
9624       0.000153 open("/u01/app/oracle/diag/asmtool/user_oracle/host_3488797338_80/metadata/ADR_CONTROL.ams", O_RDONLY|O_DIRECT) = 6
9624       0.000108 fstatfs(6, {f_type="EXT2_SUPER_MAGIC", f_bsize=4096, f_blocks=14807532, f_bfree=11368130, f_bavail=10603817, f_files=15287712, f_ffree=15007712, f_fsid={0, 0}, f_namelen=255, f_frsize=4096}) = 0
9624       0.000133 close(6)            = 0
9624       0.000081 statfs("/u01/app/oracle/diag/asmtool/user_oracle/host_3488797338_80/metadata/ADR_CONTROL.ams", {f_type="EXT2_SUPER_MAGIC", f_bsize=4096, f_blocks=14807532, f_bfree=11368130, f_bavail=10603817, f_files=15287712, f_ffree=15007712, f_fsid={0, 0}, f_namelen=255, f_frsize=4096}) = 0
9624       0.000171 statfs("/u01/app/oracle/diag/asmtool/user_oracle/host_3488797338_80/metadata/ADR_CONTROL.ams", {f_type="EXT2_SUPER_MAGIC", f_bsize=4096, f_blocks=14807532, f_bfree=11368130, f_bavail=10603817, f_files=15287712, f_ffree=15007712, f_fsid={0, 0}, f_namelen=255, f_frsize=4096}) = 0
9624       0.000151 open("/u01/app/oracle/diag/asmtool/user_oracle/host_3488797338_80/metadata/ADR_CONTROL.ams", O_RDWR|O_SYNC|O_DIRECT) = 6
9624       0.000126 getrlimit(RLIMIT_NOFILE, {rlim_cur=128*1024, rlim_max=128*1024}) = 0
9624       0.000086 fcntl(6, F_DUPFD, 256) = 256
9624       0.000083 close(6)  

。。。。。。。。。。。。。

ADR_CONTROL.ams 是一个二进制文件,主要保存了ADR的配置等的相关信息,其大致内容如下:

[oracle@dm01db01 lck]$ ll /u01/app/oracle/diag/asmtool/user_oracle/host_3488797338_80/metadata/ADR_CONTROL.ams
-rw-r----- 1 oracle oinstall 65536 Feb 22 00:30 /u01/app/oracle/diag/asmtool/user_oracle/host_3488797338_80/metadata/ADR_CONTROL.ams
[oracle@dm01db01 lck]$ strings /u01/app/oracle/diag/asmtool/user_oracle/host_3488797338_80/metadata/ADR_CONTROL.ams
TADR_CONTROL
ADRID
SHORTP_POLICY
LONGP_POLICY
LAST_MOD_TIME
LAST_AUTOPRG_TIME
LAST_MANUPRG_TIME
ADRDIR_VERSION
ADRSCHM_VERSION
ADRSCHMV_SUMMARY
ADRALERT_VERSION
CREATE_TIME
[oracle@dm01db01 lck]$ 

接下来,我们看到,kfed读取”/etc/oracle/cell/network-config/cellinit.ora”文件和”/etc/oracle/cell/network-config/cellip.ora”


。。。。。。。。。。。。。

9624       0.000116 open("/etc/oracle/cell/network-config/cellinit.ora", O_RDONLY) = 10
9624       0.000103 stat("/etc/oracle/cell/network-config/cellinit.ora", {st_mode=S_IFREG|0644, st_size=142, ...}) = 0
9624       0.000317 fstat(10, {st_mode=S_IFREG|0644, st_size=142, ...}) = 0
9624       0.000179 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b6ccd37b000
9624       0.000056 read(10, "ipaddress1=192.168.56.31/24\n_cel"..., 4096) = 142
9624       0.000279 close(10)           = 0
9624       0.000182 munmap(0x2b6ccd37b000, 4096) = 0
9624       0.000388 close(9)            = 0
9624       0.003771 gettimeofday({1393000211, 706856}, NULL) = 0
9624       0.000904 gettimeofday({1393000211, 707752}, NULL) = 0
9624       0.000185 open("/u01/app/oracle/product/11.2.0.3/dbhome_1/oracore/mesg/lrmus.msb", O_RDONLY) = 9
9624       0.000120 fcntl(9, F_SETFD, FD_CLOEXEC) = 0
9624       0.000085 lseek(9, 0, SEEK_SET) = 0
9624       0.000081 read(9, "\25\23\"\1\23\3\t\t\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 256) = 256
9624       0.000159 open("/etc/oracle/cell/network-config/cellip.ora", O_RDONLY) = 10
9624       0.000171 stat("/etc/oracle/cell/network-config/cellip.ora", {st_mode=S_IFREG|0644, st_size=42, ...}) = 0
9624       0.000192 fstat(10, {st_mode=S_IFREG|0644, st_size=42, ...}) = 0
9624       0.000137 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b6ccd37b000
9624       0.000096 read(10, "cell=\"192.168.56.11\"\ncell=\"192.1"..., 4096) = 42
9624       0.000198 close(10)           = 0
9624       0.000104 munmap(0x2b6ccd37b000, 4096) = 0
9624       0.000123 close(9)            = 0
9624       0.000128 open("/u01/app/oracle/product/11.2.0.3/dbhome_1/oracore/mesg/lrmus.msb", O_RDONLY) = 9
9624       0.000113 fcntl(9, F_SETFD, FD_CLOEXEC) = 0
9624       0.000095 lseek(9, 0, SEEK_SET) = 0
9624       0.000084 read(9, "\25\23\"\1\23\3\t\t\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 256) = 256
9624       0.000260 open("/etc/oracle/cell/network-config/cellip.ora", O_RDONLY) = 10
9624       0.000110 stat("/etc/oracle/cell/network-config/cellip.ora", {st_mode=S_IFREG|0644, st_size=42, ...}) = 0
9624       0.000240 fstat(10, {st_mode=S_IFREG|0644, st_size=42, ...}) = 0
9624       0.000129 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b6ccd37b000
9624       0.000085 read(10, "cell=\"192.168.56.11\"\ncell=\"192.1"..., 4096) = 42
9624       0.000171 close(10)           = 0
9624       0.000082 munmap(0x2b6ccd37b000, 4096) = 0
9624       0.000127 close(9)  

。。。。。。。。。。。。

在Exadata上,db节点会配置/etc/oracle/cell/network-config/cellinit.ora,大致内容如下:

[root@dm01db01 odu]# cat /etc/oracle/cell/network-config/cellinit.ora
ipaddress1=192.168.56.31/24
_cell_print_all_params=true
_skgxp_gen_ant_off_rpc_timeout_in_sec=60
_skgxp_udp_interface_detection_time_secs=15 ----------我的是Exadata的VM,自然只能用UDP协议了,O(∩_∩)O哈哈~
[root@dm01db01 odu]# 

我们看到,这里面主要是配置了db节点跟cell节点通信时必要的网络环境:
比如第一行 ipaddress1=192.168.56.31/24 ,这表示当前db节点的IP是192.168.56.31,子网掩码是255.255.255.0

.

24的意思就是说子网掩码中表示网络的二进制位数是24位,即: 11111111.11111111.11111111.00000000,数一下刚好24个1,变成十进制就是:255.255.255.0

.

后面两个_skgxp开头的参数,熟悉RAC的可能一下就想的了大名鼎鼎的$ORACLE_HOME/lib/libskgxpN.so。
N代表版本号,从9~11,12c没确定,还以依旧……

skgxp 是oracle开放的一个应用接口(System Kernel Generic Interface Inter-Process Communications),GCS和GES通信和传输数据会之用这个API
缺省的,libskgxp文件定义的传输协议是UDP/IP,但是如果条件具备(有Infiniband连接),你可以enable RDS协议,以提高实例间通信的效率。

例如,在AIX上缺省使用UDP:
$ uname -a
AIX server1 3 5 00C8E8124C00
$ $ORACLE_HOME/bin/skgxpinfo -v
Oracle UDP/IP (generic)
$ 

例如,在Exadata,上缺省使用RDS协议:

[grid@dm01db01 ~]$ $ORACLE_HOME/bin/skgxpinfo -v
Oracle RDS/IP (generic)
[grid@dm01db01 ~]$ 

我这里是11.2.0.3,那么自然是libskgxp11.so:

[root@dm01db01 network-config]# ls -lrt $ORACLE_HOME/lib/libskgxp*
-rw-r--r-- 1 grid oinstall 1010327 Sep 17  2011 /u01/app/11.2.0.3/grid/lib/libskgxpr.so
-rw-r--r-- 1 grid oinstall   20494 Sep 17  2011 /u01/app/11.2.0.3/grid/lib/libskgxpd.so
-rw-r--r-- 1 grid oinstall   20494 Sep 17  2011 /u01/app/11.2.0.3/grid/lib/libskgxpcompat.so
-rw-r--r-- 1 grid oinstall 1010297 Sep 17  2011 /u01/app/11.2.0.3/grid/lib/libskgxpg.so
-rw-r--r-- 1 root oinstall 1010297 Jun 13  2013 /u01/app/11.2.0.3/grid/lib/libskgxp11.so
[root@dm01db01 network-config]# 
[root@dm01db01 network-config]# nm -D /u01/app/11.2.0.3/grid/lib/libskgxp11.so|grep msg
                 U __cmsg_nxthdr
00000000000b3f60 T lwipc_rcvmsg
00000000000b4f66 T lwipc_rcvmsg_e
00000000000b402c T lwipc_sendmsg
                 U recvmsg
                 U sendmsg
[root@dm01db01 network-config]# 

这里可以看到,Exadata上,db节点跟cell节点通信(完成IO请求)就采用了recvmsg和sendmsg。而传统数据库是采用read/pread和write/pwrite等来完成IO操作的。

.

例如 libskgxp9.so,这个函数最早在9i就已经有了,当时这个是有第三方厂商提供的集群功能。

.

还有一个cellip.ora 文件,该文件的内容是具体的cell的地址,我这里配置了两个cell服务器的IP地址:

[root@dm01db01 network-config]#  cat /etc/oracle/cell/network-config/cellip.ora 
cell="192.168.56.11"
cell="192.168.56.12"
[root@dm01db01 network-config]# 
.

到这里,我们知道了kfed会读取cell的配置信息,并通过预先配置的协议进行节点间的通信。

.

接下来,我们看到kfed通过socket的方式跟cell节点进行通信,发出请求并接受返回的信息:


。。。。。。。。。。。。

9624       0.000125 futex(0x3946354a08, FUTEX_WAKE_PRIVATE, 2147483647) = 0
9624       0.000147 socket(PF_NETLINK, SOCK_RAW, 0) = 9
9624       0.000101 bind(9, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 0
9624       0.000094 getsockname(9, {sa_family=AF_NETLINK, pid=9624, groups=00000000}, [5049059786767728652]) = 0
9624       0.000123 time(NULL)          = 1393000211
9624       0.000088 sendto(9, "\24\0\0\0\26\0\1\3\23\177\7S\0\0\0\0\0\0\0\0", 20, 0, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 20
9624       0.000122 recvmsg(9, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"<\0\0\0\24\0\2\0\23\177\7S\230%\0\0\2\10\200\376\1\0\0\0\10\0\1\0\177\0\0\1"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 400
9624       0.000131 recvmsg(9, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"\24\0\0\0\3\0\2\0\23\177\7S\230%\0\0\0\0\0\0\1\0\0\0\10\0\1\0\177\0\0\1"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 20
9624       0.000121 close(9)            = 0
9624       0.000340 socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 9
9624       0.000173 fcntl(9, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
9624       0.000130 connect(9, {sa_family=AF_INET, sin_port=htons(5042), sin_addr=inet_addr("192.168.56.11")}, 16) = -1 EINPROGRESS (Operation now in progress)
9624       0.000385 poll([{fd=9, events=POLLOUT}], 1, 2000) = 1 ([{fd=9, revents=POLLOUT}])
9624       0.000560 getsockopt(9, SOL_SOCKET, SO_ERROR, [17179869184], [4]) = 0
9624       0.000108 fcntl(9, F_GETFL)   = 0x802 (flags O_RDWR|O_NONBLOCK)
9624       0.000113 fcntl(9, F_SETFL, O_RDWR) = 0
9624       0.000453 uname({sys="Linux", node="dm01db01", ...}) = 0
9624       0.000220 times({tms_utime=10, tms_stime=90, tms_cutime=0, tms_cstime=0}) = 1718558361
9624       0.000131 uname({sys="Linux", node="dm01db01", ...}) = 0
9624       0.000224 sendto(9, "\4\3\2\1\0\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\6\0\0\0\1\0\0\0\3\0\0\0"..., 776, 0, NULL, 0) = 776
9624       0.000197 times({tms_utime=10, tms_stime=90, tms_cutime=0, tms_cstime=0}) = 1718558361
9624       0.000122 poll([{fd=9, events=POLLIN}], 1, 2000) = 1 ([{fd=9, revents=POLLIN}])
9624       0.000898 recvfrom(9, "\0\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\6\0\0\0\0\0\0\0\0\0\0\0"..., 776, 0, NULL, NULL) = 776
9624       0.000188 fcntl(9, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
9624       0.000121 poll([{fd=9, events=POLLOUT}], 1, 2000) = 1 ([{fd=9, revents=POLLOUT}])
9624       0.000163 sendto(9, "\4\3\2\1\0\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\6\0\0\0\1\0\0\0\3\0\0\0"..., 776, 0, NULL, 0) = 776
9624       0.000188 fcntl(9, F_GETFL)   = 0x802 (flags O_RDWR|O_NONBLOCK)
9624       0.000111 fcntl(9, F_SETFL, O_RDWR) = 0
9624       0.000105 times({tms_utime=10, tms_stime=90, tms_cutime=0, tms_cstime=0}) = 1718558361
9624       0.000100 poll([{fd=9, events=POLLIN}], 1, 2000) = 1 ([{fd=9, revents=POLLIN}])
9624       0.016341 recvfrom(9, "\0\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\6\0\0\0\0\0\0\0\0\0\0\0"..., 776, 0, NULL, NULL) = 776
9624       0.000115 close(9)            = 0

。。。。。。。。。。。。。。

9624       0.000127 gettimeofday({1393000211, 754633}, NULL) = 0
9624       0.000108 sendmsg(7, {msg_name(16)={sa_family=AF_INET, sin_port=htons(45901), sin_addr=inet_addr("192.168.56.11")}, msg_iov(4)=[{"\4\3\2\1\340\2\0\0\0\0\0\0MRON\0\3\0\0\0\0\0\0\352\254\17\20\0\0\0\0"..., 76}, {"\1\0\1\0\0\0\0\0\20\1\0\0004\1\0\0\0\0\0\0\0\0\377\377\1\0\0\0", 28}, {"\4\3\2\1\34\0\0\0b\365\2403\0\0\0\0\0\0\0\0\1\2\0\0\216S\232\17\34\353Xw"..., 272}, {"\0\0\0\0\352\254\17\20\0\0$\0\20\0\20\0\4\3\2\1\1\1\0\0\316\302\213\353\31\0\0\0"..., 36}], msg_controllen=0, msg_flags=0}, 0) = 412
9624       0.000288 gettimeofday({1393000211, 755062}, NULL) = 0
9624       0.000166 gettimeofday({1393000211, 755195}, NULL) = 0
9624       0.000086 gettimeofday({1393000211, 755279}, NULL) = 0
9624       0.000090 poll([{fd=8, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}, {fd=7, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}], 2, 913) = 1 ([{fd=7, revents=POLLIN|POLLRDNORM}])
9624       0.000325 gettimeofday({1393000211, 755696}, NULL) = 0
9624       0.000120 recvmsg(7, {msg_name(16)={sa_family=AF_INET, sin_port=htons(45901), sin_addr=inet_addr("192.168.56.11")}, msg_iov(3)=[{"\4\3\2\1\232rN\0\0\0\0\0MRON\4\3\0\0\0\0\0\0b\365\2403\0\0\0\0"..., 76}, {"\1\0\0\0\0\0\0\0\240\0\0\0\0\0\0\0\0\16QT\0\0\0\0\0\0\0\0", 28}, {"\4\3\2\1\36\0\0\0\352\254\17\20\0\0\0\0\0\0\0\0\1\2\0\0\0\0\0\0\0\0\0\0"..., 576}], msg_controllen=0, msg_flags=0}, 0) = 264
9624       0.000293 recvmsg(7, 0x7fff2d997d30, 0) = -1 EAGAIN (Resource temporarily unavailable)
9624       0.000106 gettimeofday({1393000211, 756213}, NULL) = 0

。。。。。。。。。。。。。。
.

最后,kfed获取信息的工作结束后,关闭了相关的文件描述符,释放资源(close(10),close(9),close(7),close(8)):


。。。。。。。。。。。。。。


9624       0.000352 times({tms_utime=10, tms_stime=108, tms_cutime=0, tms_cstime=0}) = 1718558421
9624       0.000092 gettimeofday({1393000212, 342023}, NULL) = 0
9624       0.000089 gettimeofday({1393000212, 342112}, NULL) = 0
9624       0.000194 socket(PF_NETLINK, SOCK_RAW, 0) = 10
9624       0.000136 bind(10, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 0
9624       0.000130 getsockname(10, {sa_family=AF_NETLINK, pid=9624, groups=00000000}, [1038475675733852172]) = 0
9624       0.000173 time(NULL)          = 1393000212
9624       0.000249 sendto(10, "\24\0\0\0\26\0\1\3\24\177\7S\0\0\0\0\0\0\0\0", 20, 0, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 20
9624       0.000303 recvmsg(10, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"<\0\0\0\24\0\2\0\24\177\7S\230%\0\0\2\10\200\376\1\0\0\0\10\0\1\0\177\0\0\1"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 400
9624       0.000187 recvmsg(10, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"\24\0\0\0\3\0\2\0\24\177\7S\230%\0\0\0\0\0\0\1\0\0\0\10\0\1\0\177\0\0\1"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 20
9624       0.000186 close(10)           = 0
9624       0.000154 socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 10
9624       0.000146 fcntl(10, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
9624       0.000201 connect(10, {sa_family=AF_INET, sin_port=htons(5042), sin_addr=inet_addr("192.168.56.11")}, 16) = -1 EINPROGRESS (Operation now in progress)
9624       0.000229 poll([{fd=10, events=POLLOUT}], 1, 2000) = 1 ([{fd=10, revents=POLLOUT}])
9624       0.000572 getsockopt(10, SOL_SOCKET, SO_ERROR, [17179869184], [4]) = 0
9624       0.000174 fcntl(10, F_GETFL)  = 0x802 (flags O_RDWR|O_NONBLOCK)
9624       0.000082 fcntl(10, F_SETFL, O_RDWR) = 0
9624       0.000113 uname({sys="Linux", node="dm01db01", ...}) = 0
9624       0.000143 fcntl(10, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
9624       0.000075 poll([{fd=10, events=POLLOUT}], 1, 2000) = 1 ([{fd=10, revents=POLLOUT}])
9624       0.000092 sendto(10, "\4\3\2\1\0\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\6\0\0\0\1\0\0\0\3\0\0\0"..., 776, 0, NULL, 0) = 776
9624       0.000233 fcntl(10, F_GETFL)  = 0x802 (flags O_RDWR|O_NONBLOCK)
9624       0.000307 fcntl(10, F_SETFL, O_RDWR) = 0
9624       0.000150 times({tms_utime=10, tms_stime=109, tms_cutime=0, tms_cstime=0}) = 1718558422
9624       0.000132 poll([{fd=10, events=POLLIN}], 1, 2000) = 1 ([{fd=10, revents=POLLIN}])
9624       0.000509 recvfrom(10, "\0\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\6\0\0\0\0\0\0\0\0\0\0\0"..., 776, 0, NULL, NULL) = 776
9624       0.000097 close(10)           = 0
9624       0.000192 close(9)            = 0
9624       0.000247 close(7)            = 0
9624       0.000234 close(8)            = 0
9624       0.000136 gettimeofday({1393000212, 347899}, NULL) = 0
9624       0.000177 munmap(0x2b6ccd153000, 143360) = 0
9624       0.000780 munmap(0x2b6cccf1c000, 143360) = 0
9624       0.007067 exit_group(0)       = ?

那么如果需要使用DUL和ODU抽取数据怎么办呢?
我想,首先是跟kfed一样,加入必要的动态库,然后采用socket的方式读取数据,O(∩_∩)O哈哈~

此条目发表在 内部机制 分类目录,贴了 , , , , 标签。将固定链接加入收藏夹。

在Exadata上,为什么 DUL 和 ODU不能读取ASM数据库的数据,但是Kfed却可以?》有 1 条评论

  1. Pingback 引用通告: Exadata读取数据和传统数据库环境中读取数据的方式有什么关键区别? – 世间所有相遇都是久别重逢 - Lunar的oracle实验室

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>