1: PACKAGE BODY FND_LOG_UTIL AS
2: /* $Header: AFUTLBEB.pls 115.9 2004/04/05 23:06:31 rmohan noship $ */
3:
4: C_SUCCESS CONSTANT NUMBER := 0;
5: C_WARNING CONSTANT NUMBER := 1;
99: IS
100: BEGIN
101: fdebug('In:FND_BE_UTIL.METRIC_EVENT_PNDG_MTRCS');
102: IF (IS_TRANSACTION_COMPLETED(trId, trType, sessId, true)= TRUE) THEN
103: FND_LOG.WORK_METRICS_EVENT(trCtxId);
104: END IF;
105: fdebug('Out:FND_BE_UTIL.METRIC_EVENT_PNDG_MTRCS');
106: EXCEPTION
107: WHEN OTHERS THEN
135: select
136: distinct fltc.SESSION_ID, fltc.TRANSACTION_CONTEXT_ID, fltc.TRANSACTION_TYPE
137: , fltc.TRANSACTION_ID
138: from
139: FND_LOG_TRANSACTION_CONTEXT fltc,
140: FND_LOG_METRICS flm
141: where
142: fltc.TRANSACTION_CONTEXT_ID=flm.TRANSACTION_CONTEXT_ID
143: and flm.EVENT_KEY is null;
136: distinct fltc.SESSION_ID, fltc.TRANSACTION_CONTEXT_ID, fltc.TRANSACTION_TYPE
137: , fltc.TRANSACTION_ID
138: from
139: FND_LOG_TRANSACTION_CONTEXT fltc,
140: FND_LOG_METRICS flm
141: where
142: fltc.TRANSACTION_CONTEXT_ID=flm.TRANSACTION_CONTEXT_ID
143: and flm.EVENT_KEY is null;
144:
186: l_rows_start NUMBER;
187: l_rows_end NUMBER;
188: BEGIN
189: --Detelet Transaction Context infor if its relevent infor NA
190: delete from FND_LOG_TRANSACTION_CONTEXT where
191: TRANSACTION_TYPE = 'REQUEST' AND TRANSACTION_ID<>
192: ( SELECT REQUEST_ID from FND_CONCURRENT_REQUESTS where REQUEST_ID=TRANSACTION_ID);
193:
194: --Deletes data for which no transaction context info is available.
192: ( SELECT REQUEST_ID from FND_CONCURRENT_REQUESTS where REQUEST_ID=TRANSACTION_ID);
193:
194: --Deletes data for which no transaction context info is available.
195: ---dbms_output.put_line('IN:SYNC_EXP_DATA');
196: select count(*) into l_rows_start from FND_LOG_MESSAGES;
197: delete from FND_LOG_MESSAGES where
198: TRANSACTION_CONTEXT_ID not in
199: (select distinct TRANSACTION_CONTEXT_ID from
200: FND_LOG_TRANSACTION_CONTEXT)
193:
194: --Deletes data for which no transaction context info is available.
195: ---dbms_output.put_line('IN:SYNC_EXP_DATA');
196: select count(*) into l_rows_start from FND_LOG_MESSAGES;
197: delete from FND_LOG_MESSAGES where
198: TRANSACTION_CONTEXT_ID not in
199: (select distinct TRANSACTION_CONTEXT_ID from
200: FND_LOG_TRANSACTION_CONTEXT)
201: ;
196: select count(*) into l_rows_start from FND_LOG_MESSAGES;
197: delete from FND_LOG_MESSAGES where
198: TRANSACTION_CONTEXT_ID not in
199: (select distinct TRANSACTION_CONTEXT_ID from
200: FND_LOG_TRANSACTION_CONTEXT)
201: ;
202: select count(*) into l_rows_end from FND_LOG_MESSAGES;
203: ---dbms_output.put_line('FND_LOG_MESSAGES:dlt rows out of sync'||(l_rows_end-l_rows_start));
204: commit;
198: TRANSACTION_CONTEXT_ID not in
199: (select distinct TRANSACTION_CONTEXT_ID from
200: FND_LOG_TRANSACTION_CONTEXT)
201: ;
202: select count(*) into l_rows_end from FND_LOG_MESSAGES;
203: ---dbms_output.put_line('FND_LOG_MESSAGES:dlt rows out of sync'||(l_rows_end-l_rows_start));
204: commit;
205:
206: select count(*) into l_rows_start from FND_LOG_METRICS;
199: (select distinct TRANSACTION_CONTEXT_ID from
200: FND_LOG_TRANSACTION_CONTEXT)
201: ;
202: select count(*) into l_rows_end from FND_LOG_MESSAGES;
203: ---dbms_output.put_line('FND_LOG_MESSAGES:dlt rows out of sync'||(l_rows_end-l_rows_start));
204: commit;
205:
206: select count(*) into l_rows_start from FND_LOG_METRICS;
207: delete from FND_LOG_METRICS where
202: select count(*) into l_rows_end from FND_LOG_MESSAGES;
203: ---dbms_output.put_line('FND_LOG_MESSAGES:dlt rows out of sync'||(l_rows_end-l_rows_start));
204: commit;
205:
206: select count(*) into l_rows_start from FND_LOG_METRICS;
207: delete from FND_LOG_METRICS where
208: TRANSACTION_CONTEXT_ID not in
209: (select distinct TRANSACTION_CONTEXT_ID from
210: FND_LOG_TRANSACTION_CONTEXT)
203: ---dbms_output.put_line('FND_LOG_MESSAGES:dlt rows out of sync'||(l_rows_end-l_rows_start));
204: commit;
205:
206: select count(*) into l_rows_start from FND_LOG_METRICS;
207: delete from FND_LOG_METRICS where
208: TRANSACTION_CONTEXT_ID not in
209: (select distinct TRANSACTION_CONTEXT_ID from
210: FND_LOG_TRANSACTION_CONTEXT)
211: ;
206: select count(*) into l_rows_start from FND_LOG_METRICS;
207: delete from FND_LOG_METRICS where
208: TRANSACTION_CONTEXT_ID not in
209: (select distinct TRANSACTION_CONTEXT_ID from
210: FND_LOG_TRANSACTION_CONTEXT)
211: ;
212: select count(*) into l_rows_end from FND_LOG_METRICS;
213: ---dbms_output.put_line('FND_LOG_METRICS:dlt rows out of sync'||(l_rows_end-l_rows_start));
214: commit;
208: TRANSACTION_CONTEXT_ID not in
209: (select distinct TRANSACTION_CONTEXT_ID from
210: FND_LOG_TRANSACTION_CONTEXT)
211: ;
212: select count(*) into l_rows_end from FND_LOG_METRICS;
213: ---dbms_output.put_line('FND_LOG_METRICS:dlt rows out of sync'||(l_rows_end-l_rows_start));
214: commit;
215:
216: select count(*) into l_rows_start from FND_LOG_EXCEPTIONS;
209: (select distinct TRANSACTION_CONTEXT_ID from
210: FND_LOG_TRANSACTION_CONTEXT)
211: ;
212: select count(*) into l_rows_end from FND_LOG_METRICS;
213: ---dbms_output.put_line('FND_LOG_METRICS:dlt rows out of sync'||(l_rows_end-l_rows_start));
214: commit;
215:
216: select count(*) into l_rows_start from FND_LOG_EXCEPTIONS;
217: delete from FND_LOG_EXCEPTIONS where LOG_SEQUENCE not in
212: select count(*) into l_rows_end from FND_LOG_METRICS;
213: ---dbms_output.put_line('FND_LOG_METRICS:dlt rows out of sync'||(l_rows_end-l_rows_start));
214: commit;
215:
216: select count(*) into l_rows_start from FND_LOG_EXCEPTIONS;
217: delete from FND_LOG_EXCEPTIONS where LOG_SEQUENCE not in
218: (select distinct LOG_SEQUENCE from FND_LOG_MESSAGES );
219: select count(*) into l_rows_end from FND_LOG_EXCEPTIONS;
220: ---dbms_output.put_line('FND_LOG_EXCEPTIONS: dlt rows out of sync'||(l_rows_end-l_rows_start));
213: ---dbms_output.put_line('FND_LOG_METRICS:dlt rows out of sync'||(l_rows_end-l_rows_start));
214: commit;
215:
216: select count(*) into l_rows_start from FND_LOG_EXCEPTIONS;
217: delete from FND_LOG_EXCEPTIONS where LOG_SEQUENCE not in
218: (select distinct LOG_SEQUENCE from FND_LOG_MESSAGES );
219: select count(*) into l_rows_end from FND_LOG_EXCEPTIONS;
220: ---dbms_output.put_line('FND_LOG_EXCEPTIONS: dlt rows out of sync'||(l_rows_end-l_rows_start));
221: commit;
214: commit;
215:
216: select count(*) into l_rows_start from FND_LOG_EXCEPTIONS;
217: delete from FND_LOG_EXCEPTIONS where LOG_SEQUENCE not in
218: (select distinct LOG_SEQUENCE from FND_LOG_MESSAGES );
219: select count(*) into l_rows_end from FND_LOG_EXCEPTIONS;
220: ---dbms_output.put_line('FND_LOG_EXCEPTIONS: dlt rows out of sync'||(l_rows_end-l_rows_start));
221: commit;
222:
215:
216: select count(*) into l_rows_start from FND_LOG_EXCEPTIONS;
217: delete from FND_LOG_EXCEPTIONS where LOG_SEQUENCE not in
218: (select distinct LOG_SEQUENCE from FND_LOG_MESSAGES );
219: select count(*) into l_rows_end from FND_LOG_EXCEPTIONS;
220: ---dbms_output.put_line('FND_LOG_EXCEPTIONS: dlt rows out of sync'||(l_rows_end-l_rows_start));
221: commit;
222:
223:
216: select count(*) into l_rows_start from FND_LOG_EXCEPTIONS;
217: delete from FND_LOG_EXCEPTIONS where LOG_SEQUENCE not in
218: (select distinct LOG_SEQUENCE from FND_LOG_MESSAGES );
219: select count(*) into l_rows_end from FND_LOG_EXCEPTIONS;
220: ---dbms_output.put_line('FND_LOG_EXCEPTIONS: dlt rows out of sync'||(l_rows_end-l_rows_start));
221: commit;
222:
223:
224: select count(*) into l_rows_start from FND_LOG_UNIQUE_EXCEPTIONS;
220: ---dbms_output.put_line('FND_LOG_EXCEPTIONS: dlt rows out of sync'||(l_rows_end-l_rows_start));
221: commit;
222:
223:
224: select count(*) into l_rows_start from FND_LOG_UNIQUE_EXCEPTIONS;
225: delete from FND_LOG_UNIQUE_EXCEPTIONS where UNIQUE_EXCEPTION_ID not in
226: (select distinct UNIQUE_EXCEPTION_ID from FND_LOG_EXCEPTIONS );
227: select count(*) into l_rows_end from FND_LOG_UNIQUE_EXCEPTIONS;
228: ---dbms_output.put_line('FND_LOG_UNIQUE_EXCEPTIONS: dlt rows out of sync'||(l_rows_end-l_rows_start));
221: commit;
222:
223:
224: select count(*) into l_rows_start from FND_LOG_UNIQUE_EXCEPTIONS;
225: delete from FND_LOG_UNIQUE_EXCEPTIONS where UNIQUE_EXCEPTION_ID not in
226: (select distinct UNIQUE_EXCEPTION_ID from FND_LOG_EXCEPTIONS );
227: select count(*) into l_rows_end from FND_LOG_UNIQUE_EXCEPTIONS;
228: ---dbms_output.put_line('FND_LOG_UNIQUE_EXCEPTIONS: dlt rows out of sync'||(l_rows_end-l_rows_start));
229: commit;
222:
223:
224: select count(*) into l_rows_start from FND_LOG_UNIQUE_EXCEPTIONS;
225: delete from FND_LOG_UNIQUE_EXCEPTIONS where UNIQUE_EXCEPTION_ID not in
226: (select distinct UNIQUE_EXCEPTION_ID from FND_LOG_EXCEPTIONS );
227: select count(*) into l_rows_end from FND_LOG_UNIQUE_EXCEPTIONS;
228: ---dbms_output.put_line('FND_LOG_UNIQUE_EXCEPTIONS: dlt rows out of sync'||(l_rows_end-l_rows_start));
229: commit;
230:
223:
224: select count(*) into l_rows_start from FND_LOG_UNIQUE_EXCEPTIONS;
225: delete from FND_LOG_UNIQUE_EXCEPTIONS where UNIQUE_EXCEPTION_ID not in
226: (select distinct UNIQUE_EXCEPTION_ID from FND_LOG_EXCEPTIONS );
227: select count(*) into l_rows_end from FND_LOG_UNIQUE_EXCEPTIONS;
228: ---dbms_output.put_line('FND_LOG_UNIQUE_EXCEPTIONS: dlt rows out of sync'||(l_rows_end-l_rows_start));
229: commit;
230:
231:
224: select count(*) into l_rows_start from FND_LOG_UNIQUE_EXCEPTIONS;
225: delete from FND_LOG_UNIQUE_EXCEPTIONS where UNIQUE_EXCEPTION_ID not in
226: (select distinct UNIQUE_EXCEPTION_ID from FND_LOG_EXCEPTIONS );
227: select count(*) into l_rows_end from FND_LOG_UNIQUE_EXCEPTIONS;
228: ---dbms_output.put_line('FND_LOG_UNIQUE_EXCEPTIONS: dlt rows out of sync'||(l_rows_end-l_rows_start));
229: commit;
230:
231:
232: select count(*) into l_rows_start from FND_EXCEPTION_NOTES;
230:
231:
232: select count(*) into l_rows_start from FND_EXCEPTION_NOTES;
233: delete from FND_EXCEPTION_NOTES where UNIQUE_EXCEPTION_ID not in
234: (select distinct UNIQUE_EXCEPTION_ID from FND_LOG_UNIQUE_EXCEPTIONS );
235: select count(*) into l_rows_end from FND_EXCEPTION_NOTES;
236: ---dbms_output.put_line('FND_EXCEPTION_NOTES: dlt rows out of sync'||(l_rows_end-l_rows_start));
237: commit;
238:
238:
239:
240: select count(*) into l_rows_start from FND_OAM_BIZEX_SENT_NOTIF;
241: delete from FND_OAM_BIZEX_SENT_NOTIF where UNIQUE_EXCEPTION_ID not in
242: (select distinct UNIQUE_EXCEPTION_ID from FND_LOG_UNIQUE_EXCEPTIONS );
243: select count(*) into l_rows_end from FND_OAM_BIZEX_SENT_NOTIF;
244: ---dbms_output.put_line('FND_OAM_BIZEX_SENT_NOTIF: dlt rows out of sync'||(l_rows_end-l_rows_start));
245: commit;
246:
259:
260:
261:
262:
263: END FND_LOG_UTIL;