422: SELECT max(day) AS day
423: FROM JTF_PF_PAGE_SUMM
424: UNION ALL
425: SELECT max(day) AS day
426: FROM JTF_PF_SESSION_SUMM
427: UNION ALL
428: SELECT max(day) AS day
429: FROM JTF_PF_USER_SUMM) x;
430: END IF;
440:
441: DELETE FROM JTF_PF_PAGE_SUMM
442: WHERE day >= last_migrate_day;
443:
444: DELETE FROM JTF_PF_SESSION_SUMM
445: WHERE (sessionid IS NULL and day >= last_migrate_day)
446: OR (sessionid IS NOT NULL
447: and sessionid IN
448: (select distinct sessionid
480: ucnt_users, ucnt_apps, ucnt_resps, ucnt_langs, sum_exect, sum_thinkt,
481: cnt_thinkt, startt, endt, cnt_fail, cnt_forward
482: FROM JTF_PF_PAGE_SUMMARY_VL);
483:
484: INSERT INTO JTF_PF_SESSION_SUMM (day, seqid, sessionid, user_name, userid,
485: sum_exect_jtf, sum_exect_oaf, sum_exect_form, sum_thinkt_jtf,
486: sum_thinkt_oaf, sum_thinkt_form, cnt_pages_jtf, cnt_pages_oaf,
487: cnt_pages_form, cnt_pages_all, ucnt_pages, ucnt_flows, ucnt_users,
488: ucnt_apps, ucnt_resps, ucnt_langs, startt, endt, cnt_fail)
490: sum_exect_oaf, sum_exect_form, sum_thinkt_jtf, sum_thinkt_oaf,
491: sum_thinkt_form, cnt_pages_jtf, cnt_pages_oaf, cnt_pages_form,
492: cnt_pages_jtf+cnt_pages_oaf+cnt_pages_form, ucnt_pages, ucnt_flows,
493: ucnt_users, ucnt_apps, ucnt_resps, ucnt_langs, startt, endt, cnt_fail
494: FROM JTF_PF_SESSION_SUMMARY_VL
495: WHERE (sessionid IS NULL )
496: or (sessionid IS NOT NULL
497: and sessionid IN
498: (select distinct sessionid
538: cnt_thinkt, startt, endt, cnt_fail, cnt_forward
539: FROM JTF_PF_PAGE_SUMMARY_VL
540: WHERE day >= last_migrate_day);
541:
542: INSERT INTO JTF_PF_SESSION_SUMM (day, seqid, sessionid, user_name, userid,
543: sum_exect_jtf, sum_exect_oaf, sum_exect_form, sum_thinkt_jtf,
544: sum_thinkt_oaf, sum_thinkt_form, cnt_pages_jtf, cnt_pages_oaf,
545: cnt_pages_form, cnt_pages_all, ucnt_pages, ucnt_flows, ucnt_users,
546: ucnt_apps, ucnt_resps, ucnt_langs, startt, endt, cnt_fail)
548: sum_exect_oaf, sum_exect_form, sum_thinkt_jtf, sum_thinkt_oaf,
549: sum_thinkt_form, cnt_pages_jtf, cnt_pages_oaf, cnt_pages_form,
550: cnt_pages_jtf+cnt_pages_oaf+cnt_pages_form, ucnt_pages, ucnt_flows,
551: ucnt_users, ucnt_apps, ucnt_resps, ucnt_langs, startt, endt, cnt_fail
552: FROM JTF_PF_SESSION_SUMMARY_VL
553: WHERE (sessionid IS NULL and day >= last_migrate_day)
554: or (sessionid IS NOT NULL
555: and sessionid IN
556: (select distinct sessionid
1020: DELETE FROM JTF_PF_ANON_ACTIVITY WHERE DAY <= START_DATE;
1021: DELETE FROM JTF_PF_APP_SUMM WHERE DAY <= START_DATE;
1022: DELETE FROM JTF_PF_HOST_SUMM WHERE DAY <= START_DATE;
1023: DELETE FROM JTF_PF_PAGE_SUMM WHERE DAY <= START_DATE;
1024: DELETE FROM JTF_PF_SESSION_SUMM WHERE DAY <= START_DATE;
1025: DELETE FROM JTF_PF_USER_SUMM WHERE DAY <= START_DATE;
1026: COMMIT;
1027: END;
1028: /*===========================================================================