ajout de la colonne : nombre de datafile

This commit is contained in:
Yacine31
2025-11-24 18:11:27 +01:00
parent 0d2cd05d78
commit 4a47aa1862
2 changed files with 7 additions and 5 deletions

View File

@@ -1,9 +1,4 @@
prompt <h2>Détail des tablespaces : </h2> prompt <h2>Détail des tablespaces : </h2>
-- COL TABLESPACE_NAME FORMAT A20 HEAD "Nom Tablespace"
-- COL PCT_OCCUPATION_THEORIQUE FORMAT 990.00 HEAD "% Occup"
-- COL TAILLE_MIB FORMAT 99999990.00 HEAD "Taille MB"
-- COL TAILLE_MAX_MIB FORMAT 99999990.00 HEAD "Taille max MB"
-- COL TAILLE_OCCUPEE_MIB FORMAT 99999990.00 HEAD "Espace occupé MiB"
COL TABLESPACE_NAME FORMAT A20 HEAD "Tablespace" COL TABLESPACE_NAME FORMAT A20 HEAD "Tablespace"
COL alloc FORMAT 99999999.00 HEAD "Allocated MB" COL alloc FORMAT 99999999.00 HEAD "Allocated MB"
@@ -11,10 +6,12 @@ COL used FORMAT 99999999.00 HEAD "Used MB"
COL free FORMAT 99999999.00 HEAD "Free MB" COL free FORMAT 99999999.00 HEAD "Free MB"
COL max FORMAT 99999999.00 HEAD "MaxSize MB" COL max FORMAT 99999999.00 HEAD "MaxSize MB"
COL Pct_Used FORMAT 999.00 HEAD "% Used" COL Pct_Used FORMAT 999.00 HEAD "% Used"
COL nb_of_file FORMAT 999 HEAD "Nbr Of Files"
select /* db-html-report */ select /* db-html-report */
a.tablespace_name, a.tablespace_name,
t.bigfile, t.bigfile,
a.nb_of_file,
a.bytes_alloc/1024/1024 alloc, a.bytes_alloc/1024/1024 alloc,
(a.bytes_alloc - nvl(b.bytes_free, 0))/1024/1024 used, (a.bytes_alloc - nvl(b.bytes_free, 0))/1024/1024 used,
(nvl(b.bytes_free, 0))/1024/1024 free, (nvl(b.bytes_free, 0))/1024/1024 free,
@@ -24,6 +21,7 @@ from
( (
select select
f.tablespace_name, f.tablespace_name,
count(*) as nb_of_file,
sum(f.bytes) bytes_alloc, sum(f.bytes) bytes_alloc,
sum(decode(f.autoextensible, 'YES', f.maxbytes, 'NO', f.bytes)) maxbytes sum(decode(f.autoextensible, 'YES', f.maxbytes, 'NO', f.bytes)) maxbytes
from from
@@ -48,6 +46,7 @@ union all
select select
h.tablespace_name, h.tablespace_name,
dt.bigfile, dt.bigfile,
count(*) as nb_of_file,
(sum(h.bytes_free + h.bytes_used))/1024/1024 alloc, (sum(h.bytes_free + h.bytes_used))/1024/1024 alloc,
(sum(nvl(p.bytes_used, 0)))/1024/1024 used, (sum(nvl(p.bytes_used, 0)))/1024/1024 used,
(sum((h.bytes_free + h.bytes_used) - nvl(p.bytes_used, 0)))/1024/1024 free, (sum((h.bytes_free + h.bytes_used) - nvl(p.bytes_used, 0)))/1024/1024 free,

View File

@@ -7,6 +7,7 @@ COL used_mb FORMAT 99999999.00 HEAD "Used MB"
COL free_mb FORMAT 99999999.00 HEAD "Free MB" COL free_mb FORMAT 99999999.00 HEAD "Free MB"
COL max_mb FORMAT 99999999.00 HEAD "MaxSize MB" COL max_mb FORMAT 99999999.00 HEAD "MaxSize MB"
COL Pct_Used FORMAT 999.00 HEAD "% Used" COL Pct_Used FORMAT 999.00 HEAD "% Used"
COL nbr_of_files FORMAT 999 HEAD "Nbr Of Files"
COL BIGFILE FORMAT A8 HEAD "Bigfile" COL BIGFILE FORMAT A8 HEAD "Bigfile"
select /* db-html-report */ select /* db-html-report */
@@ -14,6 +15,7 @@ select /* db-html-report */
c.NAME, c.NAME,
a.tablespace_name, a.tablespace_name,
t.bigfile, t.bigfile,
a.nbr_of_files,
a.bytes_alloc/1024/1024 alloc_mb, a.bytes_alloc/1024/1024 alloc_mb,
(a.bytes_alloc - nvl(b.bytes_free, 0))/1024/1024 used_mb, (a.bytes_alloc - nvl(b.bytes_free, 0))/1024/1024 used_mb,
(nvl(b.bytes_free, 0))/1024/1024 free_mb, (nvl(b.bytes_free, 0))/1024/1024 free_mb,
@@ -24,6 +26,7 @@ from
select select
f.con_id, f.con_id,
f.tablespace_name, f.tablespace_name,
count(*) as nbr_of_files,
sum(f.bytes) bytes_alloc, sum(f.bytes) bytes_alloc,
sum(decode(f.autoextensible, 'YES', f.maxbytes, 'NO', f.bytes)) maxbytes sum(decode(f.autoextensible, 'YES', f.maxbytes, 'NO', f.bytes)) maxbytes
from from