[20241016]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
$ ll
total 12828
-rwxrwxr-x. 1 oracle oinstall 1035 2021-01-29 22:06:05 annotate_flamegraph.awk
-rwxrwxr-x. 1 oracle oinstall 2439 2021-01-29 22:06:05 fold_debugtrace.awk
-rw-rw-r--. 1 oracle oinstall 348445 2021-01-29 22:06:05 functions.csv
-rw-r--r--. 1 oracle oinstall 418816 2024-10-16 09:50:45 functions.db
-rwxrwxr-x. 1 oracle oinstall 1630 2021-01-29 22:06:05 lookup.awk
-rwxr-xr-x. 1 oracle oinstall 1660 2024-10-16 09:58:54 lookupx.awk
-rw-rw-r--. 1 oracle oinstall 1679 2021-01-29 22:06:05 readme.md
-rwxrwxr-x. 1 oracle oinstall 3474 2021-01-29 22:06:05 sf.sh
-rw-rw-r--. 1 oracle oinstall 12231272 2021-01-29 22:06:05 symbol_archive_object_19.9.csv
-rw-rw-r--. 1 oracle oinstall 32650 2021-01-29 22:06:05 v_tables_x_tables_mapping.csv
-rw-rw-r--. 1 oracle oinstall 66350 2021-01-29 22:06:05 x_tables_descriptions.csv
--//實際上還有1個sf.sh指令碼,它需要本機安裝sqlite3。
$ grep ^sqlite3 sf.sh
sqlite3 functions.db "drop table if exists functions;"
sqlite3 functions.db "create table functions (function_name varchar(30), function_sum varchar(60));"
sqlite3 functions.db ".import functions.csv functions"
--//手工執行它後可以建立建立匯入表functions。functions.db就是執行指令碼sf.sh後建立的檔案。
--//注意:你執行完1次後,可以註解前面的這3行.
$ ./sf.sh kgllkal
kgllkal -- kernel generic library cache management library cache lock allocate
-------
--//不過顯示與lookup.awk不同。
$ ./lookup.awk -w kglpn
kglpn : kernel generic library cache management pin
kglpnal : kernel generic library cache management pin allocate
kglpnc : kernel generic library cache management pin pin heaps and load data pieces of a cursor object
kglpnck : kernel generic library cache management pin pin heaps and load data pieces of a cursor object check if latch is held
kglpndl : kernel generic library cache management pin delete data heaps
kglpnds : kernel generic library cache management pin delete state object
kglpnmi : kernel generic library cache management pin migration
kglpnp : kernel generic library cache management pin pin heaps and load data for stored procedures
$ ./sf.sh -w kglpn
kglpn pin
kglpnal allocate
kglpnc pin heaps and load data pieces of a cursor object
kglpnck check if latch is held
kglpndl delete data heaps
kglpnds delete state object
kglpnmi migration
kglpnp pin heaps and load data for stored procedures
--//還有2個檔案。
$ ll *table*
-rw-rw-r--. 1 oracle oinstall 32650 2021-01-29 22:06:05 v_tables_x_tables_mapping.csv
-rw-rw-r--. 1 oracle oinstall 66350 2021-01-29 22:06:05 x_tables_descriptions.csv
--//可以直接使用grep查詢:
$ grep -i kglob x_tables_descriptions.csv
X$KGLOB|kernel generic library cache object
X$KGLOBXML|kernel generic library cache object xml (version of x$kglob)
--//oracle 的X表都是大寫。加入-i或者直接大寫。
$ grep -i 'x$kglob' x_tables_descriptions.csv
X$KGLOB|kernel generic library cache object
X$KGLOBXML|kernel generic library cache object xml (version of x$kglob)
--//如果查詢帶有$字元,要加入單引號。
--//也可以修改lookup.awk檔案,修改檔名實現查詢。
$ diff -Nur lookup.awk lookupx.awk
--- lookup.awk 2021-01-29 22:06:05.000000000 +0800
+++ lookupx.awk 2024-10-16 09:58:54.461069120 +0800
@@ -33,14 +33,14 @@
exit 1
}
if ( ARGV[1] == "-w" ) {
- requested_function = ARGV[2];
+ requested_function = toupper(ARGV[2]);
} else {
- requested_function = ARGV[1];
+ requested_function = toupper(ARGV[1]);
}
# load functions from csv into array
PROCINFO["sorted_in"] = "@ind_str_asc";
FS="|";
- while ( ( getline < "functions.csv" ) > 0 ) function_array[$1]=$2;
+ while ( ( getline < "x_tables_descriptions.csv" ) > 0 ) function_array[$1]=$2;
# lookup function annotation starting with <function>
if ( ARGV[1] == "-w" ) {
for ( function_from_array in function_array )
$ ./lookupx.awk 'x$kglob'
X$KGLOB : kernel generic library cache object
--//這個的查詢特點一定要帶單引號,還是grep方便。
$ grep -i alert x_tables_descriptions.csv
X$DBGALERTEXT|debug alert extended information
X$DIAG_ALERT_EXT|diagnostics alert extended. database alert log details
X$KELRSGA|kernel event alert SGA
X$KELRTD|kernel event alert threshold type descriptions
X$KELTGSD|kernel event alert types generator descriptions
X$KELTOSD|kernel event alert types operations descriptions
X$KELTSD|kernel event alert types descriptions
X$KXDCM_OPEN_ALERTS|kernel execution exadata cell metrics open alerts
--//查詢v_tables_x_tables_mapping.csv可以知道一些對應關係,不過好像不全。
$ grep -i ir_failure v_tables_x_tables_mapping.csv
GV$IR_FAILURE|X$DBKFDG
GV$IR_FAILURE_SET|X$DBKFSET
$ grep -i '^GV$SESSION|' v_tables_x_tables_mapping.csv
GV$SESSION|X$KSUSE
--//僅僅看到1個X表,實際上關聯 x$ksuse , x$ksled , x$kslwt 。
[20241016]Oracle C functions annotations補充.txt
相關文章
- [20240618]Oracle C functions annotations.txtOracleFunction
- [20191217]Oracle C functions annotations.txtOracleFunction
- [20211025]12c sequence nocache測試補充.txt
- [20180928]ora-01426(補充).txt
- [20220603]測試quiz night(補充).txtUI
- [20211215]提示precompute_subquery補充.txt
- Analytic Functions in OracleFunctionOracle
- Oracle WMSYS FunctionsOracleFunction
- [20211116]plsql_code_type=native補充.txtSQL
- [20220811]奇怪的隱式轉換問題(12c補充測試).txt
- [20221014]TNS-12543 TNSdestination host unreachable(補充).txt
- [20210803]使用那個shared pool latch(補充).txt
- [20211013]測試遠端監聽補充.txt
- [20211221]提示precompute_subquery補充2.txt
- Oracle Pipelined Table Functions(轉)OracleFunction
- [20211022]ORA-00904 REF invalid identifier 19c dba_obj_audit_opts(補充).txtIDEOBJ
- [20211111]補充完善ash_wait_chains指令碼.txtAI指令碼
- [20220120]超長sql語句補充4.txtSQL
- [20220119]超長sql語句補充3.txtSQL
- [20180129]簡單探究cluster table(補充)4.txt
- [20181229]簡單探究cluster table(補充)3.txt
- [20181227]簡單探究cluster table(補充)2.txt
- 20241016
- C#基礎語法補充C#
- [20211021]windows新建文字檔案帶日期(補充).txtWindows
- [20220309]查詢x$ksmmem遇到的疑問補充.txt
- [20211221]記錄使用sqlplus的小問題補充.txtSQL
- [20200414]Linux下快速刪除大量檔案(補充).txtLinux
- [20201208]為什麼返回2行記錄補充.txt
- [20190214]11g Query Result Cache RC Latches補充.txt
- [20190211]簡單測試埠是否開啟(補充).txt
- 補充:C語言列舉型別C語言型別
- C#學習筆記(補充)——擴充套件方法、事件C#筆記套件事件
- [20211009]8K資料庫最大行號補充.txt資料庫
- [20201116]測試CURSOR_SPACE_FOR_TIME(10g)(補充).txt
- [20220317]補充完善TPT 顯示欄位列的指令碼.txt指令碼
- [20210708]find -mtime +0 0 -0時間問題補充.txt
- [20210626]find -mtime +N N -N時間問題補充.txt