数据库模式描述了数据库表和它们之间的关系。您可以使用数据库模式来规划数据库的大小。
历史数据库模式中的信息可以帮您了解导入的业务度量模型和数据库表之间的映射。仪表板使用历史数据库进行多维分析并生成报告。
历史数据库最初是由日期/时间数据填充的,范围从 1995 年到 2009 年。 如果预计记录日期/时间(过程启动/终止时间或其他度量数据)会超出此日期范围,您应当使用以下 SQL 脚本将额外的日期添加到历史数据库中的 DIM_TIME 表:
insert into <your WBI schema name>.dim_time( surrogate_key, year, month, day)
with WBITIME (skey, ldate) as
(select surrogate_key+1 as skey,
COALESCE(
DATE(SUBSTR(DIGITS(YEAR),7,4) || '-' ||
SUBSTR(DIGITS(MONTH),4,2) || '-' ||
SUBSTR(DIGITS(DAY), 4,2)) + 1 DAYS,
DATE('YYYY-MM-DD of the first day you'd want to start from,
in case the DIM_TIME table is empty.')
)as ldate
from sysibm.sysdummy1, <your WBI schema name>.dim_time
where
DATE(
SUBSTR(DIGITS(YEAR) ,7,4) || '-' ||
SUBSTR(DIGITS(MONTH),4,2) || '-' ||
SUBSTR(DIGITS(DAY) ,4,2)
) =
(
SELECT
MAX(
DATE(SUBSTR(DIGITS(YEAR),7,4) || '-' ||
SUBSTR(DIGITS(MONTH),4,2) || '-' ||
SUBSTR(DIGITS(DAY), 4,2)))
FROM <your WBI schema name>.DIM_TIME
)
UNION ALL
SELECT parent.skey+1, ldate + 1 DAYS
from WBITIME parent
where YEAR(ldate + 1 days) < where YEAR(ldate + 1 days) <
<YYYY 4 Digit YEAR FOR WHICH YOU DON't WANT DATA to end in>
)
select a.skey, year(a.ldate), month(a.ldate), day(a.ldate)
from WBITIME a
WHERE
a.ldate >= DATE('YYYY-MM-DD: The start of the range that should be inserted.')
AND a.ldate <= DATE('YYYY-MM-DD: The end of range that
should be inserted.')