Results 1 to 3 of 3

Thread: biggest tables

  1. #1
    Join Date
    Oct 2003
    Posts
    5

    Unanswered: biggest tables

    Hi

    Iīd like to select the biggest tables with shema sapr3
    and an output to biggest_tables.txt

    like

    COEP 10000M
    MSEG 5000M


    and nothing else!

    can you help me?

  2. #2
    Join Date
    Sep 2003
    Location
    Virginia, USA
    Posts
    246
    Put an inline view in your query that pre-orders your result set, then just select from the inline view. For example, to get your two biggest tables you would select where rownum < 3 of a presorted list of your tables.

    select segment_name "TABLE", bytes/1048576 "MB"
    from (select * from dba_segments order by BYTES desc)
    where rownum < 3;

    if you have multiple segments per table then you need to put the SUM function on line 1 and add a GROUP BY clause. Also, depending on your definition of "biggest" you would replace the BYTES column with other columns, or replace view dba_segments with another view.

    -Mark

  3. #3
    Join Date
    Oct 2003
    Posts
    5
    and with shema sapr3?????????

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •