The following lines contain the word 'select', 'insert', 'update' or 'delete':
select PHASE_CODE into l_phase_code
from FND_CONCURRENT_REQUESTS
where REQUEST_ID=trId;
select count(*) into l_audsid_count
from GV$SESSION
where AUDSID=trId;
select PROCESS_STATUS_CODE into l_process_status_code
from FND_CONCURRENT_PROCESSES
where CONCURRENT_PROCESS_ID=trId;
select LAST_CONNECT into l_last_connect
from ICX_TRANSACTIONS
where TRANSACTION_ID=sessId;
select max(LAST_CONNECT) into l_last_connect
from ICX_TRANSACTIONS
where SESSION_ID=sessId;
select
distinct fltc.SESSION_ID, fltc.TRANSACTION_CONTEXT_ID, fltc.TRANSACTION_TYPE
, fltc.TRANSACTION_ID
from
FND_LOG_TRANSACTION_CONTEXT fltc,
FND_LOG_METRICS flm
where
fltc.TRANSACTION_CONTEXT_ID=flm.TRANSACTION_CONTEXT_ID
and flm.EVENT_KEY is null;
delete from FND_LOG_TRANSACTION_CONTEXT where
TRANSACTION_TYPE = 'REQUEST' AND TRANSACTION_ID<>
( SELECT REQUEST_ID from FND_CONCURRENT_REQUESTS where REQUEST_ID=TRANSACTION_ID);
select count(*) into l_rows_start from FND_LOG_MESSAGES;
delete from FND_LOG_MESSAGES where
TRANSACTION_CONTEXT_ID not in
(select distinct TRANSACTION_CONTEXT_ID from
FND_LOG_TRANSACTION_CONTEXT)
;
select count(*) into l_rows_end from FND_LOG_MESSAGES;
select count(*) into l_rows_start from FND_LOG_METRICS;
delete from FND_LOG_METRICS where
TRANSACTION_CONTEXT_ID not in
(select distinct TRANSACTION_CONTEXT_ID from
FND_LOG_TRANSACTION_CONTEXT)
;
select count(*) into l_rows_end from FND_LOG_METRICS;
select count(*) into l_rows_start from FND_LOG_EXCEPTIONS;
delete from FND_LOG_EXCEPTIONS where LOG_SEQUENCE not in
(select distinct LOG_SEQUENCE from FND_LOG_MESSAGES );
select count(*) into l_rows_end from FND_LOG_EXCEPTIONS;
select count(*) into l_rows_start from FND_LOG_UNIQUE_EXCEPTIONS;
delete from FND_LOG_UNIQUE_EXCEPTIONS where UNIQUE_EXCEPTION_ID not in
(select distinct UNIQUE_EXCEPTION_ID from FND_LOG_EXCEPTIONS );
select count(*) into l_rows_end from FND_LOG_UNIQUE_EXCEPTIONS;
select count(*) into l_rows_start from FND_EXCEPTION_NOTES;
delete from FND_EXCEPTION_NOTES where UNIQUE_EXCEPTION_ID not in
(select distinct UNIQUE_EXCEPTION_ID from FND_LOG_UNIQUE_EXCEPTIONS );
select count(*) into l_rows_end from FND_EXCEPTION_NOTES;
select count(*) into l_rows_start from FND_OAM_BIZEX_SENT_NOTIF;
delete from FND_OAM_BIZEX_SENT_NOTIF where UNIQUE_EXCEPTION_ID not in
(select distinct UNIQUE_EXCEPTION_ID from FND_LOG_UNIQUE_EXCEPTIONS );
select count(*) into l_rows_end from FND_OAM_BIZEX_SENT_NOTIF;