[20180628]顯示bbed x命令格式.txt
[20180628]顯示bbed x命令格式.txt
--//測試經常使用bbed x命令顯示資料,裡面的格式每次輸入必須顯示錶結構才方便輸入.
--//如果欄位很多非常麻煩,寫一個指令碼完成這個工作.
--//這個是我以前寫的,12c已經淘汰wmsys.wm_concat,要使用listagg代替.
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);
---//改寫如下,做一個記錄:
prompt
PROMPT DISPLAY BBED EXAMINE(X) FORMAT
prompt
SELECT REPLACE (LISTAGG (c1, ',') WITHIN GROUP (ORDER BY column_id), ',') c80
FROM ( SELECT data_type
,column_id
,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')
AND hidden_column = 'NO'
ORDER BY column_id);
SCOTT@test01p> @ bbedcol12 '' emp
DISPLAY BBED EXAMINE(X) FORMAT
C80
----------
nccntnnn
SCOTT@test01p> @ ver1
PORT_STRING VERSION BANNER CON_ID
------------------------------ -------------- -------------------------------------------------------------------------------- ----------
IBMPC/WIN_NT64-9.1.0 12.1.0.1.0 Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production 0
SCOTT@test01p> select rowid,emp.* from emp where rownum=1;
ROWID EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
------------------ ---------- ---------- --------- ---------- ------------------- ---------- ---------- ----------
AAAWh/AAJAAAACVAAA 7369 SMITH CLERK 7902 1980-12-17 00:00:01 800 20
SCOTT@test01p> @ rowid AAAWh/AAJAAAACVAAA
OBJECT FILE BLOCK ROW ROWID_DBA DBA TEXT
---------- ---------- ---------- ---------- -------------------- -------------------- ----------------------------------------
92287 9 149 0 0x2400095 9,149 alter system dump datafile 9 block 149 ;
D:\tools\bbed>echo x /rnccntnnn dba 9,150 *kdbr[0] | bbed1
echo x /rnccntnnn dba 9,150 *kdbr[0] | bbed1
BBED: Release 2.0.0.0.0 - Limited Production on Thu Jun 28 20:56:28 2018
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
************* !!! For Oracle Internal Use only !!! ***************
BBED> set count 8192
COUNT 8192
BBED> set width 160
WIDTH 160
BBED> rowdata[570] @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:01
col 5[2] @8181: 800
col 6[0] @8184: *NULL*
col 7[2] @8185: 20
--//測試經常使用bbed x命令顯示資料,裡面的格式每次輸入必須顯示錶結構才方便輸入.
--//如果欄位很多非常麻煩,寫一個指令碼完成這個工作.
--//這個是我以前寫的,12c已經淘汰wmsys.wm_concat,要使用listagg代替.
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);
---//改寫如下,做一個記錄:
prompt
PROMPT DISPLAY BBED EXAMINE(X) FORMAT
prompt
SELECT REPLACE (LISTAGG (c1, ',') WITHIN GROUP (ORDER BY column_id), ',') c80
FROM ( SELECT data_type
,column_id
,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')
AND hidden_column = 'NO'
ORDER BY column_id);
SCOTT@test01p> @ bbedcol12 '' emp
DISPLAY BBED EXAMINE(X) FORMAT
C80
----------
nccntnnn
SCOTT@test01p> @ ver1
PORT_STRING VERSION BANNER CON_ID
------------------------------ -------------- -------------------------------------------------------------------------------- ----------
IBMPC/WIN_NT64-9.1.0 12.1.0.1.0 Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production 0
SCOTT@test01p> select rowid,emp.* from emp where rownum=1;
ROWID EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
------------------ ---------- ---------- --------- ---------- ------------------- ---------- ---------- ----------
AAAWh/AAJAAAACVAAA 7369 SMITH CLERK 7902 1980-12-17 00:00:01 800 20
SCOTT@test01p> @ rowid AAAWh/AAJAAAACVAAA
OBJECT FILE BLOCK ROW ROWID_DBA DBA TEXT
---------- ---------- ---------- ---------- -------------------- -------------------- ----------------------------------------
92287 9 149 0 0x2400095 9,149 alter system dump datafile 9 block 149 ;
D:\tools\bbed>echo x /rnccntnnn dba 9,150 *kdbr[0] | bbed1
echo x /rnccntnnn dba 9,150 *kdbr[0] | bbed1
BBED: Release 2.0.0.0.0 - Limited Production on Thu Jun 28 20:56:28 2018
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
************* !!! For Oracle Internal Use only !!! ***************
BBED> set count 8192
COUNT 8192
BBED> set width 160
WIDTH 160
BBED> rowdata[570] @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:01
col 5[2] @8181: 800
col 6[0] @8184: *NULL*
col 7[2] @8185: 20
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2157009/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20210920]bbed的assign命令.txt
- [20210304]bbed的assign命令.txt
- [20180628]expdp與rows=n.txt
- [20180627]測試bbed是否支援管道命令.txt
- [20231109]bbed p命令dba引數問題.txt
- Layui表格日期格式顯示UI
- [20181204]bbed修改問題.txt
- [20180619]bbed verify問題.txt
- [20231008]bbed探究lob段.txt
- [20220223]bbed ktbbh.ktbbhict.txt
- [20190321]smem的顯示缺陷.txt
- [20180811]windows 7 顯示桌面.txtWindows
- [20211020]奇怪lsnrctl status顯示.txt
- 【BBED】Oracle bbed常用命令參考Oracle
- $1,890.55格式的顯示
- django 設定日期顯示格式Django
- [20210906]bbed讀取資料塊(bbed-wrap.sh).txt
- [20190412]bash顯示日期相減.txt
- [20210301]延遲顯示輸出.txt
- [20190104]bbed手工插入資料.txt
- [20181227]bbed的使用問題.txt
- [20210901]cygwin下使用bbed.txt
- [20230224]bbed設定偏移技巧.txt
- [20210303]bbed使用小問題.txt
- [20210223]bbed itl ktbitflg 2.txt
- PHP列印格式化顯示利器PHP
- SAP SD 以PDF格式顯示BILLING的輸出格式
- [20181207]sqlplus下顯示資料精度.txtSQL
- [20180312]iostat顯示輸出問題.txtiOS
- [20231207]ls -f的顯示問題.txt
- [20190104]bbed手動修改資料.txt
- [20210318]bbed讀取資料塊.txt
- [20210311]如何建立bbed安裝包.txt
- 時間格式化,顯示昨天、今天
- [20200217]bash顯示path環境變數.txt變數
- [20201103]lsof顯示link=0的檔案.txt
- [20201121]顯示時間戳高精度版本.txt時間戳
- [20230405]奇怪的顯示輸出寬度.txt