Log dba_extents : dba_extents « System Tables Data Dictionary « Oracle PL/SQL Tutorial






SQL>
SQL> CREATE TABLE extents_log
  2  (log_date            DATE,
  3  segment_name         VARCHAR2(81),
  4  segment_type         VARCHAR2(17),
  5  count_extents        NUMBER,
  6  bytes_extents        NUMBER);

Table created.

SQL>
SQL>
SQL>    INSERT INTO extents_log
  2     SELECT TRUNC(SYSDATE), segment_name, segment_type,
  3            COUNT(*), SUM(bytes)
  4     FROM   dba_extents
  5     WHERE  segment_name IN
  6            ('COL$', 'DEPENDENCY$', 'ERROR$', 'IDL_CHAR$',
  7             'IDL_SB4$', 'IDL_UB1$', 'IDL_UB2$', 'LINK$', 'OBJ$',
  8             'OBJAUTH$', 'SOURCE$', 'SYSAUTH$', 'TRIGGER$',
  9             'TRIGGERCOL$', 'USER$')
 10     GROUP BY    segment_name, segment_type;

13 rows created.

SQL>
SQL>
SQL> SELECT     segment_name, log_date, segment_type,
  2             count_extents, bytes_extents
  3  FROM       extents_log
  4  ORDER BY   segment_name, log_date;

SEGMENT_NAME    LOG_DATE  SEGMENT_TYPE      COUNT_EXTENTS BYTES_EXTENTS
--------------- --------- ----------------- ------------- -------------
DEPENDENCY$     25-JUL-08 TABLE                        17       2097152
ERROR$          25-JUL-08 TABLE                         2        131072
IDL_CHAR$       25-JUL-08 TABLE                        17       2097152
IDL_SB4$        25-JUL-08 TABLE                        18       3145728
IDL_UB1$        25-JUL-08 TABLE                        46      32505856
IDL_UB2$        25-JUL-08 TABLE                        28      13631488
LINK$           25-JUL-08 TABLE                         1         65536
OBJ$            25-JUL-08 TABLE                        17       2097152
OBJAUTH$        25-JUL-08 TABLE                         2        131072
SOURCE$         25-JUL-08 TABLE                        81      83886080
SYSAUTH$        25-JUL-08 TABLE                         1         65536

SEGMENT_NAME    LOG_DATE  SEGMENT_TYPE      COUNT_EXTENTS BYTES_EXTENTS
--------------- --------- ----------------- ------------- -------------
TRIGGER$        25-JUL-08 TABLE                         4        262144
TRIGGERCOL$     25-JUL-08 TABLE                         1         65536

13 rows selected.

SQL>
SQL>
SQL> drop table extents_log;

Table dropped.

SQL>
SQL>








30.30.dba_extents
30.30.1.Join dba_extents and dba_rollback_segs
30.30.2.Query dba_extents for segment name
30.30.3.Query DBA_EXTENTS for Extent number in the segment, Starting block number for the extent, Size of the extent in bytes, Size of the extent, in Oracle blocks
30.30.4.Query DBA_EXTENTS for Name of the segment, Type of segment (ex. TABLE, INDEX)
30.30.5.Query DBA_EXTENTS for Tablespace name,Owner of the segment
30.30.6.Log dba_extents