From c17e1d7375ee2323caab90bc288933ce13720ab0 Mon Sep 17 00:00:00 2001 From: Yacine31 Date: Mon, 6 Nov 2023 19:22:18 +0100 Subject: [PATCH] purge des scripts --- Daily/sql/11_temp_tbs_details.sql | 10 ---- Daily/sql/14_redolog_freq_switch.sql | 71 -------------------------- Daily/sql/16_redolog_size_per_days.sql | 13 ----- Daily/sql/22_check_pga_use.sql | 13 ----- Daily/sql/23_check_sort_area.sql | 6 --- Daily/sql/24_disable_auto_tasks.sql | 62 +--------------------- 6 files changed, 2 insertions(+), 173 deletions(-) delete mode 100644 Daily/sql/11_temp_tbs_details.sql delete mode 100644 Daily/sql/14_redolog_freq_switch.sql delete mode 100644 Daily/sql/16_redolog_size_per_days.sql delete mode 100644 Daily/sql/22_check_pga_use.sql delete mode 100644 Daily/sql/23_check_sort_area.sql diff --git a/Daily/sql/11_temp_tbs_details.sql b/Daily/sql/11_temp_tbs_details.sql deleted file mode 100644 index c34e624..0000000 --- a/Daily/sql/11_temp_tbs_details.sql +++ /dev/null @@ -1,10 +0,0 @@ -SELECT A.tablespace_name tablespace, D.mb_total,SUM (A.used_blocks * D.block_size) / 1024 / 1024 mb_used, -D.mb_total - SUM (A.used_blocks * D.block_size) / 1024 / 1024 mb_free -FROM v$sort_segment A, -( -SELECT B.name, C.block_size, SUM (C.bytes) / 1024 / 1024 mb_total -FROM v$tablespace B, v$tempfile C -WHERE B.ts#= C.ts# GROUP BY B.name, C.block_size -) D -WHERE A.tablespace_name = D.name GROUP by A.tablespace_name, D.mb_total; -exit diff --git a/Daily/sql/14_redolog_freq_switch.sql b/Daily/sql/14_redolog_freq_switch.sql deleted file mode 100644 index c77080b..0000000 --- a/Daily/sql/14_redolog_freq_switch.sql +++ /dev/null @@ -1,71 +0,0 @@ --- --- affichage de la rotation des redelog par jour et par heure --- - -set head off -select max('Taille des fichiers redolog (Mo) : ' || bytes/1024/1024) from v$log; - -set head on -set pages 999 lines 200 -col Date for a12 -col Total for 9999 -col 00 for 999 -col 01 for 999 -col 02 for 999 -col 03 for 999 -col 04 for 999 -col 05 for 999 -col 06 for 999 -col 07 for 999 -col 08 for 999 -col 09 for 999 -col 10 for 999 -col 11 for 999 -col 12 for 999 -col 13 for 999 -col 14 for 999 -col 15 for 999 -col 16 for 999 -col 17 for 999 -col 18 for 999 -col 19 for 999 -col 20 for 999 -col 21 for 999 -col 22 for 999 -col 23 for 999 -col 24 for 999 - - -select to_char(first_time, 'YYYY/MM/dd') "Date", -count(1) "Total", -sum(decode(to_char(first_time, 'hh24'),'00',1,0)) "00", -sum(decode(to_char(first_time, 'hh24'),'01',1,0)) "01", -sum(decode(to_char(first_time, 'hh24'),'02',1,0)) "02", -sum(decode(to_char(first_time, 'hh24'),'03',1,0)) "03", -sum(decode(to_char(first_time, 'hh24'),'04',1,0)) "04", -sum(decode(to_char(first_time, 'hh24'),'05',1,0)) "05", -sum(decode(to_char(first_time, 'hh24'),'06',1,0)) "06", -sum(decode(to_char(first_time, 'hh24'),'07',1,0)) "07", -sum(decode(to_char(first_time, 'hh24'),'08',1,0)) "08", -sum(decode(to_char(first_time, 'hh24'),'09',1,0)) "09", -sum(decode(to_char(first_time, 'hh24'),'10',1,0)) "10", -sum(decode(to_char(first_time, 'hh24'),'11',1,0)) "11", -sum(decode(to_char(first_time, 'hh24'),'12',1,0)) "12", -sum(decode(to_char(first_time, 'hh24'),'13',1,0)) "13", -sum(decode(to_char(first_time, 'hh24'),'14',1,0)) "14", -sum(decode(to_char(first_time, 'hh24'),'15',1,0)) "15", -sum(decode(to_char(first_time, 'hh24'),'16',1,0)) "16", -sum(decode(to_char(first_time, 'hh24'),'17',1,0)) "17", -sum(decode(to_char(first_time, 'hh24'),'18',1,0)) "18", -sum(decode(to_char(first_time, 'hh24'),'19',1,0)) "19", -sum(decode(to_char(first_time, 'hh24'),'20',1,0)) "20", -sum(decode(to_char(first_time, 'hh24'),'21',1,0)) "21", -sum(decode(to_char(first_time, 'hh24'),'22',1,0)) "22", -sum(decode(to_char(first_time, 'hh24'),'23',1,0)) "23", -sum(decode(to_char(first_time, 'hh24'),'24',1,0)) "24" -from v$log_history -group by to_char(first_time, 'YYYY/MM/dd') -order by to_char(first_time, 'YYYY/MM/dd') -; - -exit diff --git a/Daily/sql/16_redolog_size_per_days.sql b/Daily/sql/16_redolog_size_per_days.sql deleted file mode 100644 index 7b73e36..0000000 --- a/Daily/sql/16_redolog_size_per_days.sql +++ /dev/null @@ -1,13 +0,0 @@ -REM -REM Tailes des redoslog par jour -REM - -select - to_char(first_time, 'YYYY/MM/dd') "Jour", - count(*) "Nbr de fichiers", - ROUND(sum(BLOCKS*BLOCK_SIZE)/1024/1024, 0) "Taille_Mo" -from v$archived_log -group by to_char(first_time, 'YYYY/MM/dd') -order by to_char(first_time, 'YYYY/MM/dd') -; -exit \ No newline at end of file diff --git a/Daily/sql/22_check_pga_use.sql b/Daily/sql/22_check_pga_use.sql deleted file mode 100644 index 2662ecf..0000000 --- a/Daily/sql/22_check_pga_use.sql +++ /dev/null @@ -1,13 +0,0 @@ -col osuser format a15 -col pid format 9999 -col program format a20 -col sid format 99999 -col spid format a6 -col username format a12 - -SELECT p.spid,p.pid,s.sid,s.serial#,s.status,p.pga_alloc_mem,p.PGA_USED_MEM,s.username,s.osuser,s.program -FROM v$process p,v$session s -WHERE s.paddr ( + ) = p.addr --- AND p.background IS NULL -- comment if need to monitor background processes -ORDER BY p.pga_alloc_mem DESC; -exit diff --git a/Daily/sql/23_check_sort_area.sql b/Daily/sql/23_check_sort_area.sql deleted file mode 100644 index 9750fcb..0000000 --- a/Daily/sql/23_check_sort_area.sql +++ /dev/null @@ -1,6 +0,0 @@ -SELECT a.value "Disk Sorts", b.value "Memory Sorts", -ROUND((100*b.value)/DECODE((a.value+b.value), 0,1,(a.value+b.value)),2) "Pct Memory Sorts" -FROM v$sysstat a, v$sysstat b -WHERE a.name = 'sorts (disk)' -AND b.name = 'sorts (memory)'; -exit diff --git a/Daily/sql/24_disable_auto_tasks.sql b/Daily/sql/24_disable_auto_tasks.sql index bb744fe..8f254e8 100644 --- a/Daily/sql/24_disable_auto_tasks.sql +++ b/Daily/sql/24_disable_auto_tasks.sql @@ -1,60 +1,2 @@ --- --- lorsqu'on vérifie les options utilisées par la base, "Automatic SQL Tuning Advisor" sort aussi --- même si la base n'est pas licenciée avec Tuning Pack --- Ce script permet de voir et désactiver les tâches automatiques --- pour ne pas avoir à licencier Tuning Pack --- -set lines 180 pages 1000 -col client_name for a40 -col attributes for a60 -col service_name for a20 -select client_name, status,attributes,service_name from dba_autotask_client -/ - -BEGIN - DBMS_AUTO_TASK_ADMIN.disable( - client_name => 'auto space advisor', - operation => NULL, - window_name => NULL); -END; -/ - -BEGIN - DBMS_AUTO_TASK_ADMIN.disable( - client_name => 'sql tuning advisor', - operation => NULL, - window_name => NULL); -END; -/ - --- BEGIN --- DBMS_AUTO_TASK_ADMIN.disable --- ( --- client_name => 'auto optimizer stats collection', --- operation => NULL, --- window_name => NULL); --- END; --- / - -select client_name, status,attributes,service_name from dba_autotask_client -/ - -exit - --- pour réactiver les auto task remplacer DBMS_AUTO_TASK_ADMIN.disable par DBMS_AUTO_TASK_ADMIN.enable - --- BEGIN --- dbms_auto_task_admin.enable(client_name => 'sql tuning advisor', operation => NULL, window_name => NULL); --- END; --- / - --- BEGIN --- DBMS_AUTO_TASK_ADMIN.enable(client_name => 'sql tuning advisor', operation => NULL, window_name => NULL); --- END; --- / - --- BEGIN --- DBMS_AUTO_TASK_ADMIN.enable(client_name => 'auto optimizer stats collection', operation => NULL, window_name => NULL); --- END; --- / - +select client_name, status,attributes,service_name from dba_autotask_client; +exit