Obsidian/Recognition/Work Related/프로젝트/D-MHFH/유지보수/TSS Test SQL.md

2.6 KiB

데이터 확인용


-- 패킷 건수
SELECT SLOT_NO , REPORT_DT , MODEM 
FROM TB_LC_FSHOPRRPT_202205
WHERE to_char(INSERT_DT , 'yyyymmdd') LIKE '20220609'
GROUP BY SLOT_NO , REPORT_DT , MODEM 

SELECT SLOT_NO
FROM TB_LC_FSHOPRRPT_202205
WHERE to_char(INSERT_DT , 'yyyymmdd') LIKE '20220609'
GROUP BY SLOT_NO
 
SELECT SLOT_NO , REPORT_DT, MODEM1 AS modem
FROM TB_TRACK_05
WHERE to_char(INSERT_DT , 'yyyymmdd') LIKE '20220609'
AND MODEM1 IS NOT NULL
GROUP BY SLOT_NO , REPORT_DT, modem1
UNION ALL
SELECT SLOT_NO , REPORT_DT, MODEM2 AS modem
FROM TB_TRACK_05
WHERE to_char(INSERT_DT , 'yyyymmdd') LIKE '20220609'
AND MODEM2 IS NOT NULL
GROUP BY SLOT_NO , REPORT_DT, modem2
UNION ALL 
SELECT SLOT_NO , REPORT_DT, MODEM3 AS modem
FROM TB_TRACK_05
WHERE to_char(INSERT_DT , 'yyyymmdd') LIKE '20220609'
AND MODEM3 IS NOT NULL
GROUP BY SLOT_NO , REPORT_DT, modem3


------------------------------------------------------------------------
-- TB_LAST_LC 정상업데이트 확인
SELECT *
FROM (
	SELECT SLOT_NO , max(REPORT_DT) AS max_REPORT_DT
	FROM TB_LC_FSHOPRRPT_202205
	WHERE to_char(INSERT_DT , 'yyyymmdd') LIKE '20220609'
	GROUP BY SLOT_NO ) a
WHERE EXISTS (
 SELECT 'x'
 FROM TB_LAST_LC 
 WHERE SLOT_NO  = a.SLOT_NO
 AND report_dt >= a.max_REPORT_DT)
 
------------------------------------------------------------------------

 -- 기타
 
SELECT *
FROM TB_LAST_LC
WHERE SLOT_NO = 788

SELECT *
FROM TB_LC_FSHOPRRPT_202205
WHERE to_char(INSERT_DT , 'yyyymmdd') LIKE '20220609'

SELECT *
FROM TB_PASSIVLC_RSPNS
WHERE to_char(INSERT_DT , 'yyyymmdd') LIKE '20220609'

------------------------------------------------------------------------
 
 
-- 패킷검색용
SELECT to_char(REPORT_DT, 'yyyymmddhh24miss') AS reporrt_txt, a.*
FROM TB_LC_FSHOPRRPT_202205 a
WHERE to_char(INSERT_DT , 'yyyymmdd') LIKE '20220609'
ORDER BY rowid

SELECT to_char(REPORT_DT, 'yyyymmddhh24miss') AS reporrt_txt, a.*
FROM TB_TRACK_05 a
WHERE to_char(INSERT_DT , 'yyyymmdd') LIKE '20220609'
--AND to_char(REPORT_DT, 'yyyymmddhh24miss') = '20220529223000'
--AND SLOT_NO = 1024
ORDER BY INSERT_DT DESC, rowid DESC



테스트 데이터 삭제

DELETE 
FROM TB_LC_FSHOPRRPT_202205
WHERE to_char(INSERT_DT , 'yyyymmdd') LIKE '20220609'

DELETE
FROM TB_TRACK_05
WHERE to_char(INSERT_DT , 'yyyymmdd') LIKE '20220609'


DELETE
FROM TB_PASSIVLC_RSPNS
WHERE to_char(INSERT_DT , 'yyyymmdd') LIKE '20220609'



-- 처리안된 패킷 확인
SELECT *
FROM tmp_29packet a
WHERE 1=1
AND NOT EXISTS (
 SELECT 'x' 
 FROM TB_TRACK_05
 WHERE to_char(INSERT_DT , 'yyyymmdd') LIKE '20220608' 
 AND instr(a.PACKET , nvl(modem1, nvl(modem2, modem3))||'|1,'||to_char(REPORT_DT, 'yyyymmddhh24miss') ) > 1 )