ITPub博客

首页 > 数据库 > Oracle > [20160303]显示bbed x命令格式.txt

[20160303]显示bbed x命令格式.txt

原创 Oracle 作者:lfree 时间:2016-03-04 09:22:21 0 删除 编辑

[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

--这样操作方便许多!

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/267265/viewspace-2035465/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
熟悉oracle相关技术,擅长sql优化,rman备份与恢复,熟悉linux shell编程。

注册时间:2008-01-03

  • 博文量
    2485
  • 访问量
    6292081