SELECT
owner propietario , table_name tabla , TRUNC(sum(bytes)/1024/1024) MB
FROM
(SELECT segment_name table_name, owner, bytes
FROM dba_segments
WHERE segment_type = 'TABLE'
UNION ALL
SELECT i.table_name, i.owner, s.bytes
FROM dba_indexes i, dba_segments s
WHERE s.segment_name = i.index_name
AND s.owner = i.owner
AND s.segment_type = 'INDEX'
UNION ALL
SELECT l.table_name, l.owner, s.bytes
FROM dba_lobs l, dba_segments s
WHERE s.segment_name = l.segment_name
AND s.owner = l.owner
AND s.segment_type = 'LOBSEGMENT'
UNION ALL
SELECT l.table_name, l.owner, s.bytes
FROM dba_lobs l, dba_segments s
WHERE s.segment_name = l.index_name
AND s.owner = l.owner
AND s.segment_type = 'LOBINDEX')
--WHERE owner in UPPER('&owner')
GROUP BY table_name, owner
HAVING SUM(bytes)/1024/1024 > 10 /* Ignore really small tables */
ORDER BY SUM(bytes) desc
;
Oracle : tamaño de todas las tablas de la base de datos
Consulta para obtener el tamaño de todas las tablas de la Base de datos:
-
Para poder insertar saltos de línea con el comando echo en linux se usa la siguiente sintaxis : echo -e "\n linea 1 \n linea 2 \n...
-
Para obtener una lista con los objetos bloqueados ejecucutados: select substr(a.os_user_name,1,8) "OS User" , substr(b.object_na...
-
Para obtener cuando se creó una tabla usaremos la siguiente consulta: select object_name, created from user_objects where object_name = ...
No hay comentarios:
Publicar un comentario