[20131119]sqlplus顏色輸出.txt
[20131119]sqlplus顏色輸出.txt
昨天別人問一個sqlplus色彩輸出的問題,實際上以前我自己寫過一個指令碼,檢查rman備份的情況:
內容如下:
column status format a16
column input_type format a11
column elapsed_seconds format 99999 head "ELAPSED|SECONDS"
column compression_ratio format 99.99999 head "COMPRESSION|RATIO"
column inputb format a12 head "INPUT BYTES| DISPLAY"
column outputb format a12 head "OUTPUT BYTES| DISPLAY"
column input format a12 head "INPUT BYTES|PER_SEC DISPLAY"
column output format a12 head "OUTPUT BYTES|PER_SEC DISPLAY"
column time format a10
column ok format a14
set linesize 200
SELECT start_time, end_time, elapsed_seconds,TRIM (time_taken_display) TIME, status, input_type,
compression_ratio, TRIM (input_bytes_display) inputb,
TRIM (output_bytes_display) outputb,
TRIM (input_bytes_per_sec_display) input,
TRIM (output_bytes_per_sec_display) output,
DECODE (status,
'COMPLETED', CHR (27) || '[1;32m' || 'V',
CHR (27) || '[1;31m' || 'X'
)||CHR (27) || '[0m' ok
FROM v$rman_backup_job_details
WHERE start_time > TRUNC (SYSDATE) - 12
order by start_time desc ;
quit
輸出的例子:
ELAPSED COMPRESSION INPUT BYTES OUTPUT BYTES INPUT BYTES OUTPUT BYTES
START_TIME END_TIME SECONDS TIME STATUS INPUT_TYPE RATIO DISPLAY DISPLAY PER_SEC DISP PER_SEC DISP OK
------------------- ------------------- ------- ---------- ---------------- ----------- ----------- ------------ ------------ ------------ ------------ ----------
2013-11-19 00:20:18 2013-11-19 00:21:32 74 00:01:14 COMPLETED ARCHIVELOG 1.45321 749.02M 515.42M 10.12M 6.97M V
2013-11-18 00:20:23 2013-11-18 00:21:55 92 00:01:32 COMPLETED ARCHIVELOG 1.52757 839.37M 549.48M 9.12M 5.97M V
2013-11-17 00:20:09 2013-11-17 08:23:02 28973 08:02:53 FAILED DB FULL 3.56265 1.39T 400.65G 50.45M 14.16M X
2013-11-16 00:20:17 2013-11-16 00:21:45 88 00:01:28 COMPLETED ARCHIVELOG 1.41245 1.01G 731.91M 11.75M 8.32M V
2013-11-15 00:20:17 2013-11-15 01:01:11 2454 00:40:54 COMPLETED ARCHIVELOG 1.30648 46.58G 35.65G 19.44M 14.88M V
2013-11-14 00:20:33 2013-11-14 01:16:27 3354 00:55:54 COMPLETED ARCHIVELOG 1.30929 60.71G 46.37G 18.54M 14.16M V
2013-11-13 11:23:35 2013-11-13 11:24:37 62 00:01:02 COMPLETED SPFILE 1.00000 48.13M 48.28M 794.84K 797.42K V
2013-11-13 00:20:18 2013-11-13 00:26:53 395 00:06:35 COMPLETED ARCHIVELOG 1.30114 6.37G 4.90G 16.52M 12.70M V
2013-11-12 00:20:15 2013-11-12 00:21:26 71 00:01:11 COMPLETED ARCHIVELOG 1.57829 603.80M 382.57M 8.50M 5.39M V
2013-11-11 00:20:16 2013-11-11 00:21:18 62 00:01:02 COMPLETED ARCHIVELOG 1.54423 393.68M 254.94M 6.35M 4.11M V
2013-11-10 00:20:10 2013-11-10 06:55:54 23744 06:35:44 COMPLETED DB FULL 3.25490 1.18T 372.46G 52.28M 16.06M V
2013-11-09 00:20:18 2013-11-09 00:22:02 104 00:01:44 COMPLETED ARCHIVELOG 1.39767 912.69M 653.01M 8.78M 6.28M V
2013-11-08 00:20:16 2013-11-08 00:21:38 82 00:01:22 COMPLETED ARCHIVELOG 1.44176 753.84M 522.86M 9.19M 6.38M V
2013-11-07 00:20:16 2013-11-07 00:21:42 86 00:01:26 COMPLETED ARCHIVELOG 1.41592 1020.24M 720.55M 11.86M 8.38M V
14 rows selected.
--實際上這個指令碼僅僅在linux下使用,如果在windows依舊無法使用,當然解決方法很簡單,就是使用rlwrap呼叫sqlplus,這樣就可以了。
--rlwap的windows版本比較難找,我寫過一篇"如何提高命令列的工作效率增強版"的文章,連結如下,裡面有rlwrap的windows版本的下載。
http://www.itpub.net/forum.php?mod=viewthread&tid=1155109
昨天別人問一個sqlplus色彩輸出的問題,實際上以前我自己寫過一個指令碼,檢查rman備份的情況:
內容如下:
column status format a16
column input_type format a11
column elapsed_seconds format 99999 head "ELAPSED|SECONDS"
column compression_ratio format 99.99999 head "COMPRESSION|RATIO"
column inputb format a12 head "INPUT BYTES| DISPLAY"
column outputb format a12 head "OUTPUT BYTES| DISPLAY"
column input format a12 head "INPUT BYTES|PER_SEC DISPLAY"
column output format a12 head "OUTPUT BYTES|PER_SEC DISPLAY"
column time format a10
column ok format a14
set linesize 200
SELECT start_time, end_time, elapsed_seconds,TRIM (time_taken_display) TIME, status, input_type,
compression_ratio, TRIM (input_bytes_display) inputb,
TRIM (output_bytes_display) outputb,
TRIM (input_bytes_per_sec_display) input,
TRIM (output_bytes_per_sec_display) output,
DECODE (status,
'COMPLETED', CHR (27) || '[1;32m' || 'V',
CHR (27) || '[1;31m' || 'X'
)||CHR (27) || '[0m' ok
FROM v$rman_backup_job_details
WHERE start_time > TRUNC (SYSDATE) - 12
order by start_time desc ;
quit
輸出的例子:
ELAPSED COMPRESSION INPUT BYTES OUTPUT BYTES INPUT BYTES OUTPUT BYTES
START_TIME END_TIME SECONDS TIME STATUS INPUT_TYPE RATIO DISPLAY DISPLAY PER_SEC DISP PER_SEC DISP OK
------------------- ------------------- ------- ---------- ---------------- ----------- ----------- ------------ ------------ ------------ ------------ ----------
2013-11-19 00:20:18 2013-11-19 00:21:32 74 00:01:14 COMPLETED ARCHIVELOG 1.45321 749.02M 515.42M 10.12M 6.97M V
2013-11-18 00:20:23 2013-11-18 00:21:55 92 00:01:32 COMPLETED ARCHIVELOG 1.52757 839.37M 549.48M 9.12M 5.97M V
2013-11-17 00:20:09 2013-11-17 08:23:02 28973 08:02:53 FAILED DB FULL 3.56265 1.39T 400.65G 50.45M 14.16M X
2013-11-16 00:20:17 2013-11-16 00:21:45 88 00:01:28 COMPLETED ARCHIVELOG 1.41245 1.01G 731.91M 11.75M 8.32M V
2013-11-15 00:20:17 2013-11-15 01:01:11 2454 00:40:54 COMPLETED ARCHIVELOG 1.30648 46.58G 35.65G 19.44M 14.88M V
2013-11-14 00:20:33 2013-11-14 01:16:27 3354 00:55:54 COMPLETED ARCHIVELOG 1.30929 60.71G 46.37G 18.54M 14.16M V
2013-11-13 11:23:35 2013-11-13 11:24:37 62 00:01:02 COMPLETED SPFILE 1.00000 48.13M 48.28M 794.84K 797.42K V
2013-11-13 00:20:18 2013-11-13 00:26:53 395 00:06:35 COMPLETED ARCHIVELOG 1.30114 6.37G 4.90G 16.52M 12.70M V
2013-11-12 00:20:15 2013-11-12 00:21:26 71 00:01:11 COMPLETED ARCHIVELOG 1.57829 603.80M 382.57M 8.50M 5.39M V
2013-11-11 00:20:16 2013-11-11 00:21:18 62 00:01:02 COMPLETED ARCHIVELOG 1.54423 393.68M 254.94M 6.35M 4.11M V
2013-11-10 00:20:10 2013-11-10 06:55:54 23744 06:35:44 COMPLETED DB FULL 3.25490 1.18T 372.46G 52.28M 16.06M V
2013-11-09 00:20:18 2013-11-09 00:22:02 104 00:01:44 COMPLETED ARCHIVELOG 1.39767 912.69M 653.01M 8.78M 6.28M V
2013-11-08 00:20:16 2013-11-08 00:21:38 82 00:01:22 COMPLETED ARCHIVELOG 1.44176 753.84M 522.86M 9.19M 6.38M V
2013-11-07 00:20:16 2013-11-07 00:21:42 86 00:01:26 COMPLETED ARCHIVELOG 1.41592 1020.24M 720.55M 11.86M 8.38M V
14 rows selected.
--實際上這個指令碼僅僅在linux下使用,如果在windows依舊無法使用,當然解決方法很簡單,就是使用rlwrap呼叫sqlplus,這樣就可以了。
--rlwap的windows版本比較難找,我寫過一篇"如何提高命令列的工作效率增強版"的文章,連結如下,裡面有rlwrap的windows版本的下載。
http://www.itpub.net/forum.php?mod=viewthread&tid=1155109
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-776903/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- python 輸出顏色Python
- python帶顏色輸出Python
- linux shell輸出帶顏色文字Linux
- linux改變shell的輸出顏色Linux
- Linux 輸出不同檔案預設顏色Linux
- [20190524]sqlplus 與輸出&.txtSQL
- [20120817]sqlplus 輸出html格式.txtSQLHTML
- 夢想是怎樣的顏色?.txt
- Python輸出帶顏色的字型,附詳細引數Python
- [20190720]sqlplus 與輸出& 2.txtSQL
- 在linux中如何使用echo 輸出帶有字型顏色呢Linux
- SQLPLUS執行輸出SQL
- [20241112]無法理解sqlplus的輸出.txtSQL
- 自定義chrome的輸入框背景顏色Chrome
- win10 如何設定txt背景綠色 win10如何在txt文件修改背景顏色Win10
- Shader從入門到跑路:顏色自定義輸出、紋理取樣
- [SVG]修改固定顏色為填充顏色SVG
- js設定輸入的文字不同顏色效果JS
- 純css改變輸入框游標顏色CSS
- HTML 顏色色號HTML
- [20131104]通過pipe儲存sqlplus的輸出.txtSQL
- 修改pyqtgraph匯出檢視背景顏色QT
- css顏色CSS
- HTML 顏色HTML
- 塗顏色(數論,大資料輸入處理)大資料
- 設定toast的字型顏色和背景顏色AST
- shell-定義一個顏色輸出字串函式字串函式
- SQLPLUS命令列儲存輸出資訊SQL命令列
- 顏色轉換
- CSS顏色表示CSS
- HSV顏色模型模型
- VC 對話方塊背景顏色、控制元件顏色控制元件
- excel填充顏色快捷鍵 表格快速填充顏色快捷鍵Excel
- CSS樣式中顏色與顏色值的應用CSS
- android顏色對應的xml配置值,顏色表AndroidXML
- 遊戲中用的256色顏色表遊戲
- sqlplus與空行.txtSQL
- iOS 修改狀態列StatusBar的顏色及文字顏色iOS