Bonjour,
Je suis toujours dans mon rapport SQL ; dans SQLPLUS je souhaite avoir ce tableau, issu du résultats de 4 requêtes sur 2 tables (toujours les mêmes) :
les 4 requêtes sont :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 TABLE | MONITORING | NUM_ROWS | LAST_ANALYZED | BYTES/1024/1024 | INSERTS | UPDATES | DELETES xxx | YES | 16875000 | 06-SEP-19 | 26700 Mo | 6826 | 477 | 12 yyy | YES | 786874001 | 06-SEP-19 | 99700 Mo | 416826 | 7777 | 0
R1 = select table_name TNN,monitoring from dba_tables where table_name like 'JVTLFZ%' or table_name like 'JKACCAMO%';
R2= select num_rows,last_analyzed from dba_tables where table_name like 'JVTLFZ%' or table_name like 'JKACCAMO%';
R3= select bytes/1024/1024 "Mo" from dba_segments where table_name like 'JVTLFZ%' or table_name like 'JKACCAMO%';
R4= select inserts,updates,deletes from sys.dba_tab_modifications where table_name like 'JVTLFZ%' or table_name like 'JKACCAMO%';
Donc plutôt que de les lancer et d'avoir 4 tableau, je souhaiterai un tableau regroupant ces 4 requêtes.
J'ai fait la requêtes suivante :
Mais ça me sort 500 000 fois les mêmes lignes ou presque :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 select T1.table_name, T1.monitoring, T2.bytes/1024/1024 "Mo", T1.num_rows, T1.last_analyzed, T3.inserts, T3.updates, T3.deletes from dba_tables T1, dba_segments T2, sys.dba_tab_modifications T3 where T1.table_name like 'JVTLF%' or T1.table_name like 'JKACCAMO%' and T1.table_name=T2.segment_name and T2.segment_name=T3.table_name;
Ca doit pas être complexe mais je sèche ...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 NUM_ROWS LAST_ANAL INSERTS UPDATES DELETES ---------- --------- ---------- ---------- ---------- JVTLFBARGP YES .0625 0 06-SEP-19 1650 0 1240 JVTLFBARGP YES .0625 0 06-SEP-19 1650 0 1240 JVTLFBARGP YES .0625 0 06-SEP-19 1650 0 1240 JVTLFBARGP YES .125 0 06-SEP-19 1650 0 1240 JVTLFBARGP YES .3125 0 06-SEP-19 1650 0 1240 JVTLFBARGP YES .0625 0 06-SEP-19 1650 0 1240 JVTLFBARGP YES .0625 0 06-SEP-19 1650 0 1240 JVTLFBARGP YES .125 0 06-SEP-19 1650 0 1240 JVTLFBARGP YES .0625 0 06-SEP-19 1650 0 1240
Une idée (ou plusieurs) ?
Partager