[20160303]显示bbed x命令格式.txt
--使用bbed显示数据信息时要选对类型,随手写一个脚本
prompt
PROMPT DISPLAY BBED EXAMINE(X) FORMAT
prompt
SELECT REPLACE (wmsys.wm_concat (c1), ',') c80
FROM ( SELECT data_type
,column_name
,DECODE
(
data_type
,'NUMBER', 'n'
,'CHAR', 'c'
,'VARCHAR', 'c'
,'VARCHAR2', 'c'
,'DATE', 't'
,' '
)
c1
FROM dba_tab_cols
WHERE owner = UPPER(nvl('&1',user)) AND TABLE_NAME = UPPER( '&2')
ORDER BY column_id);
SCOTT@book> select rowid,emp.* from emp where rownum=1;
ROWID EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
------------------ ---------- ---------- --------- ---------- ------------------- ---------- ---------- ----------
AAAVREAAEAAAACXAAA 7369 SMITH CLERK 7902 1980-12-17 00:00:00 800 20
SCOTT@book> @ &r/rowid AAAVREAAEAAAACXAAA
OBJECT FILE BLOCK ROW DBA TEXT
---------- ---------- ---------- ---------- -------------------- ----------------------------------------
87108 4 151 0 4,151 alter system dump datafile 4 block 151 ;
SCOTT@book> @ &r/bbedcol scott emp
DISPLAY BBED EXAMINE(X) FORMAT
old 16: WHERE owner = UPPER(nvl('&1',user)) AND TABLE_NAME = UPPER( '&2')
new 16: WHERE owner = UPPER(nvl('scott',user)) AND TABLE_NAME = UPPER( 'emp')
C80
--------------------------------------------
nccntnnn
BBED> set dba 4,151
DBA 0x01000097 (16777367 4,151)
BBED> p *kdbr[0]
rowdata[529]
------------
ub1 rowdata[529] @8150 0x2c
BBED> x /rnccntnnn
rowdata[529] @8150
------------
flag@8150: 0x2c (KDRHFL, KDRHFF, KDRHFH)
lock@8151: 0x01
cols@8152: 8
col 0[3] @8153: 7369
col 1[5] @8157: SMITH
col 2[5] @8163: CLERK
col 3[3] @8169: 7902
col 4[7] @8173: 1980-12-17 00:00:00
col 5[2] @8181: 800
col 6[0] @8184: *NULL*
col 7[2] @8185: 20
--这样操作方便许多!