[20180510]sqlplus array 和 opifch2.txt
[20180510]sqlplus array 和 opifch2.txt
--//我以前透過10046跟蹤發現fetchsize的大小,一般在sqlplus下第1個總是1條,然後是arraysize大小.
--//也可以透過別的方式觀察,透過例子說明問題.
1.環境:
SCOTT@book> @ ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
SCOTT@book> @ &r/spid
SID SERIAL# PROCESS SERVER SPID PID P_SERIAL# C50
---------- ---------- ------------------------ --------- ------ ------- ---------- --------------------------------------------------
94 31 3282 DEDICATED 3283 31 15 alter system kill session '94,31' immediate;
SCOTT@book> set arraysize 3
SCOTT@book> select count(*) from emp;
COUNT(*)
----------
14
2./開啟另外終端回話,執行:
8]$ gdb -p 3283
GNU gdb (GDB) Red Hat Enterprise Linux (7.0.1-45.el5)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<>.
Attaching to process 3283
Reading symbols from /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle...(no debugging symbols found)...done.
Reading symbols from /u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libodm11.so...(no debugging symbols found)...done.
Loaded symbols for /u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libodm11.so
Reading symbols from /u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libcell11.so...(no debugging symbols found)...done.
Loaded symbols for /u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libcell11.so
Reading symbols from /u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libskgxp11.so...(no debugging symbols found)...done.
Loaded symbols for /u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libskgxp11.so
Reading symbols from /lib64/librt.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/librt.so.1
Reading symbols from /u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libnnz11.so...(no debugging symbols found)...done.
Loaded symbols for /u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libnnz11.so
Reading symbols from /u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libclsra11.so...(no debugging symbols found)...done.
Loaded symbols for /u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libclsra11.so
Reading symbols from /u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libdbcfg11.so...(no debugging symbols found)...done.
Loaded symbols for /u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libdbcfg11.so
Reading symbols from /u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libhasgen11.so...(no debugging symbols found)...done.
Loaded symbols for /u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libhasgen11.so
Reading symbols from /u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libskgxn2.so...(no debugging symbols found)...done.
Loaded symbols for /u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libskgxn2.so
Reading symbols from /u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libocr11.so...(no debugging symbols found)...done.
Loaded symbols for /u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libocr11.so
Reading symbols from /u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libocrb11.so...(no debugging symbols found)...done.
Loaded symbols for /u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libocrb11.so
Reading symbols from /u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libocrutl11.so...(no debugging symbols found)...done.
Loaded symbols for /u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libocrutl11.so
Reading symbols from /usr/lib64/libaio.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libaio.so.1
Reading symbols from /lib64/libdl.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libdl.so.2
Reading symbols from /lib64/libm.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libm.so.6
Reading symbols from /lib64/libpthread.so.0...(no debugging symbols found)...done.
[Thread debugging using libthread_db enabled]
Loaded symbols for /lib64/libpthread.so.0
Reading symbols from /lib64/libnsl.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/libnsl.so.1
Reading symbols from /lib64/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /usr/lib64/libnuma.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libnuma.so.1
Reading symbols from /lib64/libnss_files.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libnss_files.so.2
Reading symbols from /u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libnque11.so...(no debugging symbols found)...done.
Loaded symbols for /u01/app/oracle/product/11.2.0.4/dbhome_1/lib/libnque11.so
0x000000379a00da70 in __read_nocancel () from /lib64/libpthread.so.0
--//輸入如下:
(gdb) b opifch2
Breakpoint 1 at 0x95b4cac
(gdb) command 1
Type commands for when breakpoint 1 is hit, one per line.
End with a line saying just "end".
>p/d $rcx
>c
>end
(gdb) set pagination off
(gdb) c
Continuing.
2.測試:
SCOTT@book> select * from emp;
...
SCOTT@book> select * from emp;
SCOTT@book> select * from emp;
--//觀察gdb會話:(注從第3次觀察,因為前面的執行存在遞迴)
Breakpoint 1, 0x00000000095b4cac in opifch2 ()
$21 = 140735563509568
Breakpoint 1, 0x00000000095b4cac in opifch2 ()
$22 = 3
Breakpoint 1, 0x00000000095b4cac in opifch2 ()
$23 = 3
Breakpoint 1, 0x00000000095b4cac in opifch2 ()
$24 = 3
Breakpoint 1, 0x00000000095b4cac in opifch2 ()
$25 = 3
Breakpoint 1, 0x00000000095b4cac in opifch2 ()
$26 = 3
--//第一次總是140735563509568.後面都是3次.
SCOTT@book> set arraysize 5
SCOTT@book> select * from emp;
--//觀察gdb會話:
Breakpoint 1, 0x00000000095b4cac in opifch2 ()
$27 = 140735563509568
Breakpoint 1, 0x00000000095b4cac in opifch2 ()
$28 = 5
Breakpoint 1, 0x00000000095b4cac in opifch2 ()
$29 = 5
Breakpoint 1, 0x00000000095b4cac in opifch2 ()
$30 = 5
3.測試特殊情況:
set arraysize 1
--//我以前提到實際上最小2.看看測試的情況:
select * from emp;
--//觀察gdb會話:
Breakpoint 1, 0x00000000095b4cac in opifch2 ()
$31 = 140735563509568
Breakpoint 1, 0x00000000095b4cac in opifch2 ()
$32 = 2
Breakpoint 1, 0x00000000095b4cac in opifch2 ()
$33 = 2
Breakpoint 1, 0x00000000095b4cac in opifch2 ()
$34 = 2
Breakpoint 1, 0x00000000095b4cac in opifch2 ()
$35 = 2
Breakpoint 1, 0x00000000095b4cac in opifch2 ()
$36 = 2
Breakpoint 1, 0x00000000095b4cac in opifch2 ()
$37 = 2
Breakpoint 1, 0x00000000095b4cac in opifch2 ()
$38 = 2
--//可以發現即使設定最小1,實際上還是2.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2154311/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- JS Array.reduce 實現 Array.map 和 Array.filterJSFilter
- [20180510]20 Indexes.txtIndex
- [20170916]sqlplus set array最小2補充.txtSQL
- PHP array_search 和 in_array 函式效率問題PHP函式
- 【面試題】array_merge 和 array+ 的區別面試題
- 【Go】深入剖析slice和arrayGo
- 【Go】深入剖析 slice 和 arrayGo
- PHP原始碼閱讀:array_push 和 array_unshift 函式PHP原始碼函式
- array new 與 array deletedelete
- PHP array_flip() array_merge() array+array的使用總結PHP
- js--陣列的 Array.of() 和 Array.from() 方法的使用總結JS陣列
- JavaScript中有用的Array和Object方法JavaScriptObject
- 【譯】Rust中的array、vector和sliceRust
- sqlplus和sqlldr工具安裝SQL
- sqlplus中&&和&的區別SQL
- js的map遍歷和array遍歷JS
- 【C++學習筆記】vector和arrayC++筆記
- Array String物件的方法和屬性物件
- Array()與Array.of()方法區別
- PHP用foreach來表達array_walk/array_filter/array_map/array_reducePHPFilter
- array_filter ()、array_map ()、array_walk () 區別?容易記混淆!!!Filter
- 詳解go語言的array和slice 【一】Go
- ES6 Object和Array中常用的apiObjectAPI
- Array物件物件
- Array Repetition
- Unique Array
- sqlplus 中文?好和awr中文問號SQL
- waring:in_array()[function.in-array]:wrongdatatypeforsecondargumentFunction
- Go通關04:正確使用 array、slice 和 map!Go
- Python Numpy的陣列array和矩陣matrixPython陣列矩陣
- 使用call在sqlplus中呼叫procedure和funtion!SQL
- JavaScript Array物件JavaScript物件
- Sort Array By Parity
- javascript-ArrayJavaScript
- JavaScript Array 物件JavaScript物件
- Array陣列陣列
- JavaScript中ArrayJavaScript
- Array Division