當前為10.0版本文檔,更多實例內容將在最新幫助文檔中展現,點選跳轉至 最新版幫助文檔

報表日志 LogDB 數據庫

1. 概述

1.1 版本

報表服務器版本  
10.0

1.2 應用場景

爲了加強對報表工程的管理,随時監控其運行狀态,可以在平台中開啓日志記錄,如下圖所示:

3.png

注:平台日志的設置僅影響系統日志的輸出,不影響操作日志。

1.3 功能簡介

LogDB 數據庫是 FineReport 日志監控開啓之後,用於保存日志的内置數據庫.

本文将簡單介紹 LogDB 中各個數據表的含義以及字段的含義。

2. 連接 LogDB 數據庫

2.1 新建數據連接

設計器菜單欄點擊服務器>定義數據連接,新增一個 JDBC 數據連接,将其重命名爲 LogDB,設置信息如下表所示:

選項内容備注
數據庫Others-
驅動器com.fr.swift.jdbc.Driver手動輸入驅動器名稱
URL

jdbc:swift:emb://default

Mac、Windows、Linux 通用
用戶名和密碼-

設計器數據連接頁面如下圖所示:

2.png

2.2 查看數據表

測試鏈接成功之後,新建一個 數據庫查詢 方式的數據集,選擇上面創建的數據連接,即可看到日志數據庫下面的所有數據表,如下圖所示:

6.png

注:如果是服務器添加了 LogDB 這個數據連接務必控制這個 數據連接的權限 ,否則存在被越權訪問并修改配置數據庫的風險。

2.3 LogDB 數據表和字段

 Logdb 數據庫中各個數據表和表字段的含義,請參見:LogDB 表結構

3. 查詢語法

3.1 明細查詢

SQL 語句示例:

1)select * from fine_record_execute

2)select tname, displayName, consume from fine_record_execute

3.2 group by 查詢

GROUP BY 查詢,有 SUM,COUNT,MAX,MIN,AVERAVG 這五種聚合方式,如果什麽都不寫,會默認 COUNT

SQL 語句示例:

1)select sum(consume) from fine_record_execute group by tname, displayName

2)select consume from fine_record_execute group by tname, displayName

3)select min(consume), max(consume) from fine_record_execute group by tname, displayName

3.3 where 過濾條件

簡單的 WHERE 過濾條件,支持 AND,OR,=,<>,>,>=,<,<=,in,isnull 

SQL 語句示例:

1)select * from fine_record_execute where consume > 10

2)select sum(consume) from fine_record_execute where consume > 10 and consume < 100 group by tname, displayName

3)select consume from fine_record_execute where tname = `doc/Advanced/Chart/GraphSwitching/多圖表實現統一切換.frm`

4)select sum(consume) from fine_record_execute where tname in (`doc/Advanced/Chart/GraphSwitching/多圖表實現統一切換.frm`, `doc/Advanced/Chart/Combination/柱形-面積組合圖.cpt`) group by tname, displayName

3.4 todate() 将時間戳轉換爲普通的日期類型

todate() 結果的日期格式爲:2018-12-18 10:15:26

SQL 語句示例:

1)  select todate(time) from fine_record_execute

2) select * from fine_record_execute where todate(time)<'2018-12-18 10:15:26' and todate(time)>'2018-12-17 10:15:26'

注: 需要更新 2019-05-20 以後的 JAR。

3.5 like 模糊查詢

只支持前後‘%’的用法

注1:支持使用 like 進行模糊查詢,不支持 not like 用法 。

注2:目前只支持 '%',暫不支持通配符 ‘_’,需要更新 2019-05-20 以後的 JAR。

SQL 語句示例:

1)select * from fine_record_execute where tname like '%demo%'

附件列表


主題: 原簡體文檔
  • 有幫助
  • 沒幫助
  • 只是瀏覽

文 檔回 饋

滑鼠選中內容,快速回饋問題

滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

不再提示

9s后關閉

反饋已提交

網絡繁忙