查詢瀚高資料庫產生的歸檔量

2021-09-29 15:03:02 字數 2884 閱讀 2848

目錄

文件用途

詳細資訊

文件用途

查詢瀚高資料庫產生的歸檔量

詳細資訊

使用如下語句可查詢瀚高資料庫產生的歸檔數量。

with tmp_file as (

select t1.file,

t1.file_ls,

(pg_stat_file(t1.file)).modification as last_update_time,

round( ((pg_stat_file(t1.file)).size)/1024/1024*1.0,1) as log_size_mb

from (select dir||'\'||pg_ls_dir(t0.dir) as file,

pg_ls_dir(t0.dir) as file_ls

from ( select 'd:\highgo\database\4.3.2\data\pg_xlog'::text as dir   --需要修改這個物理路徑

) t0

) t1

where 1=1

order by (pg_stat_file(file)).modification desc

select to_char(date_trunc('day',tf0.last_update_time),'yyyymmdd') as day_id,

sum(case when date_part('hour',tf0.last_update_time) >=0 and date_part('hour',tf0.last_update_time) <24 then 1 else 0 end) as wal_num_all,

sum(case when date_part('hour',tf0.last_update_time) >=0 and date_part('hour',tf0.last_update_time) <1 then 1 else 0 end) as wal_num_00_01,

sum(case when date_part('hour',tf0.last_update_time) >=1 and date_part('hour',tf0.last_update_time) <2 then 1 else 0 end) as wal_num_01_02,

sum(case when date_part('hour',tf0.last_update_time) >=2 and date_part('hour',tf0.last_update_time) <3 then 1 else 0 end) as wal_num_02_03,

sum(case when date_part('hour',tf0.last_update_time) >=3 and date_part('hour',tf0.last_update_time) <4 then 1 else 0 end) as wal_num_03_04,

sum(case when date_part('hour',tf0.last_update_time) >=4 and date_part('hour',tf0.last_update_time) <5 then 1 else 0 end) as wal_num_04_05,

sum(case when date_part('hour',tf0.last_update_time) >=5 and date_part('hour',tf0.last_update_time) <6 then 1 else 0 end) as wal_num_05_06,

sum(case when date_part('hour',tf0.last_update_time) >=6 and date_part('hour',tf0.last_update_time) <7 then 1 else 0 end) as wal_num_06_07,

sum(case when date_part('hour',tf0.last_update_time) >=7 and date_part('hour',tf0.last_update_time) <8 then 1 else 0 end) as wal_num_07_08,

sum(case when date_part('hour',tf0.last_update_time) >=8 and date_part('hour',tf0.last_update_time) <9 then 1 else 0 end) as wal_num_08_09,

sum(case when date_part('hour',tf0.last_update_time) >=9 and date_part('hour',tf0.last_update_time) <10 then 1 else 0 end) as wal_num_09_10,

sum(case when date_part('hour',tf0.last_update_time) >=10 and date_part('hour',tf0.last_update_time) <11 then 1 else 0 end) as wal_num_10_11,

sum(case when date_part('hour',tf0.last_update_time) >=11 and date_part('hour',tf0.last_update_time) <12 then 1 else 0 end) as wal_num_11_12,

sum(case when date_part('hour',tf0.last_update_time) >=12 and date_part('hour',tf0.last_update_time) <13 then 1 else 0 end) as wal_num_12_13,

sum(case when date_part('hour',tf0.last_update_time) >=13 and date_part('hour',tf0.last_update_time) <

更多詳細資訊請登入【瀚高技術支援平台】 檢視

瀚高資料庫安全配置要求

目錄 文件用途 詳細資訊 文件用途 使用瀚高資料庫時建議遵循的相關要求。詳細資訊 i.應使用安全係數較高的資料庫使用者密碼且不可輕易洩露。安全係數可由數字 大小寫字母和特殊字元的組合實現,不以特殊字元作為開頭,建議長度為十位及以上。ii.應按照應用及使用者來合理分配賬號和許可權,避免不同使用者共享h...

go語言連線瀚高資料庫 APP

目錄 環境文件用途 詳細資訊 環境系統平台 microsoft windows 64 bit 10 版本 5.6.4 文件用途 詳細資訊 預設情況下.msi檔案會安裝在c go目錄下。你可以將c go bin目錄新增到path環境變數中。新增後你需要重啟命令視窗才能生效。建立工作目錄c go wor...

ARM 版本 瀚高 資料庫的啟動命令

1.在瀚高安裝目錄下面執行路徑 安裝目錄為 opt highgodb 4.3.4.3 bin下.pg ctl restart d data 本次的密碼是 highgo123 2.如果需要再次進行安裝的話 需要 先修改環境變數 vi bashrc export pghome opt highgodb ...