Wednesday, December 12, 2018

Tuning Advisor on sql from backend



below are the steps to run Tuning Advisor on sql_id

DECLARE
  my_task_name VARCHAR2(30);
begin
my_task_name := DBMS_SQLTUNE.CREATE_TUNING_TASK(sql_id => '&sql_id',scope => 'COMPREHENSIVE',time_limit =>7200,task_name => 'STA:1t05z5qh0u707',description => 'description_ax');
end;

EXEC DBMS_SQLTUNE.execute_tuning_task(task_name => 'STA:1t05z5qh0u707');

SET LONG 10000
SET PAGESIZE 1000
SET LINESIZE 200
SELECT DBMS_SQLTUNE.REPORT_TUNING_TASK('STA:1t05z5qh0u707') from dual;

Index on Table

Index on Table

select
b.uniqueness, a.index_name, a.table_name, a.column_name
from all_ind_columns a, all_indexes b
where a.index_name=b.index_name
and a.table_name = upper('&table_name')
order by a.table_name, a.index_name, a.column_position;

Monday, December 10, 2018

Close WF_notifications as part of clone process


Close WF_notifications as part of clone process

use the below commands to close open notification so that emails are not sent out of the non-prod environments

create table wf_notifications_bkp as select * from wf_notifications;
update applsys.wf_notifications set status ='CLOSED';
update applsys.wf_notifications set mail_status ='SENT' where mail_status ='MAIL';
commit;