首页 > 数据库 >[20240618]Oracle C functions annotations.txt

[20240618]Oracle C functions annotations.txt

时间:2024-07-13 21:07:49浏览次数:12  
标签:functions cache library oracle awk Oracle txt interface

[20240618]Oracle C functions annotations.txt

--//网站orafun.info可以查询oracle c functions.Created by Frits Hoogland with a little help from Kamil Stawiarski.
--//可以通过它了解oracle 内部C 函数.实际上可以直接下载相关文件,在本地使用.

https://gitlab.com/FritsHoogland/ora_functions/archive/master/ora_functions-master.tar.gz
https://gitlab.com/FritsHoogland/ora_functions

--//例子:
$ ./lookup.awk kgllkal
kgllkal : kernel generic library cache management library cache lock allocate

--//如果是windows系统,如果安装awk了.可以使用如下:

D:\tools\ora_functions-master>awk -f lookup.awk kgllkal
kgllkal : kernel generic library cache management library cache lock allocate

--//我开始以为我直接使用grep直接查询functions.csv文件,实际情况按照层次组织该文件.通过例子说明:

D:\tools\ora_functions-master>grep -i  kgllkal functions.csv
kgllkal|allocate

--//仅仅看到allocate.实际上看lookup.awk 代码,执行如下

D:\tools\ora_functions-master>grep -E "^k\||^kg\||^kgl\||^kgllk\||^kgllkal" functions.csv
k|kernel
kg|generic
kgl|library cache management
kgllk|library cache lock
kgllkal|allocate

--//拚接起来就是如下内容:

D:\tools\ora_functions-master>grep -E "^k\||^kg\||^kgl\||^kgllk\||^kgllkal" functions.csv| cut -f2 -d"|" | paste -sd" "
kernel generic library cache management library cache lock allocate

D:\tools\ora_functions-master>awk -f lookup.awk  -h
Usage: ./lookup.awk [-w] <function>
<function> = full function name, or part of a function name when used with -w.
-w = wildcard, lookup all functions start with <function>
--//可以使用-w参数,模糊查询,不过无法使用前缀模糊查询.这个由于函数的组织结构决定的.

D:\tools\ora_functions-master>awk -f lookup.awk -w kgllk
kgllk : kernel generic library cache management library cache lock
kgllkdl : kernel generic library cache management library cache lock delete
kgllkds : kernel generic library cache management library cache lock delete state object
kgllkal : kernel generic library cache management library cache lock allocate
(kgllk)a : kernel generic library cache management library cache lock ??
(kgllk)d : kernel generic library cache management library cache lock ??

--//最后两个为不完整的信息,注意结尾出现的??.
D:\tools\ora_functions-master>awk -f lookup.awk  kgllka
(kgllk)a : kernel generic library cache management library cache lock ??
--//提示括号内的内容可以查询到kgllk.
--//另外注意函数的大小写.

$ ./lookup.awk -w kglget
kglget : kernel generic library cache management get a lock on an object

$ ./lookup.awk -w kglGetMutex
kglGetMutex : kernel generic library cache management get mutex
--//前者没有找到kglGetMutex.

--//如果pstack的执行结果.例子:

SCOTT@book> select count(*) from emp,emp,dba_objects,dba_objects ;

$ pstack 54305
#0  0x0000000009726543 in qersoFetch ()
#1  0x000000000970b15d in qerjotFetch ()
#2  0x000000000256715f in qergsFetch ()
#3  0x00000000095b5776 in opifch2 ()
#4  0x0000000001ba5c5d in kpoal8 ()
#5  0x00000000095bbdad in opiodr ()
#6  0x00000000097a629f in ttcpip ()
#7  0x000000000186470e in opitsk ()
#8  0x0000000001869235 in opiino ()
#9  0x00000000095bbdad in opiodr ()
#10 0x00000000018607ac in opidrv ()
#11 0x0000000001e3a48f in sou2o ()
#12 0x0000000000a29265 in opimai_real ()
#13 0x0000000001e407ad in ssthrdmain ()
#14 0x0000000000a291d1 in main ()

--//在http://orafun.info/stack/,copy and paste上面内容,显示如下:
Parsed stack:
Discovered stack type: gdb/pstack stack
Parsed gdb/pstack stack:
#0 0x0000000009726543 in qersoFetch ()             query execute rowsource sort fetch from from a sort row source
#1 0x000000000970b15d in qerjotFetch ()            query execute rowsource nested loop outer join tunneling fetch
#2 0x000000000256715f in qergsFetch ()             query execute rowsource group by sort fetch
#3 0x00000000095b5776 in opifch2 ()                oracle program interface oracle side of the fetch interface main routine
#4 0x0000000001ba5c5d in kpoal8 ()                 kernel programmatic interface oracle V8 bundled execution
#5 0x00000000095bbdad in opiodr ()                 oracle program interface oracle code request driver, route the current request
#6 0x00000000097a629f in ttcpip ()                 two task common pipe read/write
#7 0x000000000186470e in opitsk ()                 oracle program interface two task function dispatcher
#8 0x0000000001869235 in opiino ()                 oracle program interface initialize opi
#9 0x00000000095bbdad in opiodr ()                 oracle program interface oracle code request driver, route the current request
#10 0x00000000018607ac in opidrv ()                oracle program interface route current request driver, entry side into two task interface
#11 0x0000000001e3a48f in sou2o ()                 main oracle executable entry point
#12 0x0000000000a29265 in opimai_real ()           oracle program interface main real oracle start point
#13 0x0000000001e407ad in ssthrdmain ()            operating system dependent system main for every thread in a threaded oracle
#14 0x0000000000a291d1 in main ()                  (non oracle)general c starting function

--//如果本地操作可以执行如下:
D:\tools\ora_functions-master>awk "{print $4}" a.txt | tr -d "\r" | xargs -iQ awk -f lookup.awk Q"
qersoFetch : query execute rowsource sort fetch from from a sort row source
qerjotFetch : query execute rowsource nested loop outer join tunneling fetch
qergsFetch : query execute rowsource group by sort fetch
opifch2 : oracle program interface oracle side of the fetch interface main routine
kpoal8 : kernel programmatic interface oracle V8 bundled execution
opiodr : oracle program interface oracle code request driver, route the current request
ttcpip : two task common pipe read/write
opitsk : oracle program interface two task function dispatcher
opiino : oracle program interface initialize opi
opiodr : oracle program interface oracle code request driver, route the current request
opidrv : oracle program interface route current request driver, entry side into two task interface
sou2o : main oracle executable entry point. reads environment var ORACLE_SPAWNED_PROCESS.
opimai_real : oracle program interface main real oracle start point
ssthrdmain : operating system dependent system main for every thread in a threaded oracle
main : (non oracle)general c starting function

--//如果是跟踪文件里面记录的stack信息,可以执行如下:
kglLock()+1406<-kglget()+293<-qostobkglcrt1()+498<-qostobkglcrt()+248<-qostobkglcrt2()+412<-qospsis()+2511<-qospPostProcessIStats()+2765<-qerltFetch()+1544<-qerstFetch()+449<-insdlexe()+364<-insExecStmtExecIniEngine()+1810<-insexe()+2283<-atbugi_update_global_indexes()+1656<-atbFMdrop()+3088<-atbdrv()+7719

--//另外保存文件b.txt,执行如下:
D:\tools\ora_functions-master>cat b.txt | tr "<-" " \n"  | sed "s/().*$//"| tr -d "\r" | xargs -iQ awk -f lookup.awk Q
kglLock : kernel generic library cache management library cache lock
kglget : kernel generic library cache management get a lock on an object
(qos)tobkglcrt1 : query optimizer statistics ??
(qos)tobkglcrt : query optimizer statistics ??
(qos)tobkglcrt2 : query optimizer statistics ??
qospsis : query optimizer statistics DBMS_STATS.SET_INDEX_STATS_CALLOUT
(qos)pPostProcessIStats : query optimizer statistics ??
qerltFetch : query execute rowsource load table fetch
qerstFetch : query execute rowsource statistics row source fetch
insdlexe : insert direct load execute
(ins)ExecStmtExecIniEngine : insert ??
insexe : insert execute
(atb)ugi_update_global_indexes : alter table ??
(atb)FMdrop : alter table ??
atbdrv : alter table driver





标签:functions,cache,library,oracle,awk,Oracle,txt,interface
From: https://www.cnblogs.com/lfree/p/18300722

相关文章

  • 使用 pip 和 requirements.txt 安装 Python 包
    1.构建当前项目需要的软件包pip3installpipreqspip3installpip-toolspipreqs--savepath=requirements.in&&pip-compile1.根据配置文件批量安装软件包。requirements.txt在某些环境中,可使用pip3而不是pippipinstall-rrequirements.txt2.检查当前环境......
  • 8、Oracle中的创建和管理表
    最近项目要用到Oracle,奈何之前没有使用过,所以在B站上面找了一个学习视频,用于记录学习过程以及自己的思考。视频链接:【尚硅谷】Oracle数据库全套教程,oracle从安装到实战应用如果有侵权,请联系删除,谢谢。学习目标:描述主要的数据库对象创建表描述各种数据类型修改表的定义......
  • Oracle Record Variables 记录变量
    OracleRecordVariables(Oracle记录变量)是Oracle数据库编程中PL/SQL语言的一个关键特性,它允许开发者将多个相关的、分离的、基本数据类型的变量组合成一个复合数据类型,类似于C语言中的结构体(STRUCTURE)。这种复合数据类型被称为RECORD(记录)。在PL/SQL中,记录变量提供了一种非常......
  • Oracle数据文件扩容
    1、增加数据文件扩容ALTERTABLESPACEapp_dataADDDATAFILE'D:\ORACLE\PRODUCT\10.2.0\ORADATA\EDWTEST\APP04.DBF'SIZE30GAUTOEXTENDONNEXT1GMAXSIZEUNLIMITED;ALTERdatabasedatafile'/ora/oradata/radius/undo.dbf'resize32G;altertab......
  • Oracle、达梦:拼接数组数据为一行
    一、普通拼接1、需求oracle查询的数据是:value1123怎么获取:1/2/32、实现value1:是要拼接的字段value2:是表中的任意字段-可用于排序的字段,也可以是value1--使用LISTAGG函数将多行数据连接成一个字符串,以'/'作为连接符SELECTLISTAGG(value1,'/')......
  • 【Oracle】SQL 将一组已经排序的数据进行分组,按照每组50行进行分组
    【Oracle】SQL将一组已经排序的数据进行分组,按照每组50行进行分组简单来说,使用ceil函数SELECTyour_column,--ROW_NUMBER()OVER(ORDERBYyour_column)为排序的开窗函数,用那种都可以CEIL(ROW_NUMBER()OVER(ORDERBYyour_column)/51)ASgroup_numberFR......
  • CMakeLists.txt编写思路
      近期在linux编写CMakeLists.txt文件,整理了一些思路。一、编写CMakeLists.txt的基本步骤和思路:初始化CMake:使用cmake_minimum_required指令指定CMake的最小版本要求,以确保兼容性。使用project指令定义项目名称和可选的语言。设置变量:使用set指令设置项目相关的变量,......
  • 成为MySQL DBA后,再看ORACLE数据库(十三、物理备份)
    前面总结了ORACLE的逻辑备份,本文来总结以下ORACLE的物理备份。数据库的备份一般分为冷备份和热备份,其中冷备份是指将数据库彻底关闭后进行的一致性备份,由于需要关停数据库所以在实际应用中很少用到冷备份。而热备份是指在数据库运行的同时对数据库进行备份,本文主要总结的是ORACLE......
  • Oracle 11g dg switchover切换操作流程
    主库切换为物理备库查看主库的状态--获取/确认主库的状态信息以及保护模式SQL> set linesize 720SQL> col name for a10SQL> col open_mode for a10SQL> col database_role for a14SQL> col switchover_status for a16SQL> col force_logging for a8SQ......
  • Oracle 使用append对insert大批量数据进行优化
    append介绍/+append/1、概念:append属于directinsert,归档模式下appendtablenologging会大量减少日志,非归档模式append会大量减少日志,append方式插入只会产生很少的undo。2、优势:使用append,一是减少对空间的搜索;二是有可能减少redolog的产生。所以append方式会快很多,一......