DBAsupport.com Forums - Powered by vBulletin
Results 1 to 9 of 9

Thread: Num of extents for a table???

  1. #1
    Join Date
    Feb 2002
    Posts
    166

    Question

    Which data dictionary view could you query to display the number of extents allocated to the employee table?

    A. DBA_EXTENTS
    B. DBA_FREE _SPACE
    C. USER_TABLES
    D. DBA_TABLES
    E. DBA_TABLESPACES

    I don't think there is a right answer!
    MCSE/MCDBA, OCP DBA 8i
    Working on SCJP -> SCJD

  2. #2
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    dba_extents of course

  3. #3
    Join Date
    Dec 2001
    Location
    New Jersey
    Posts
    292
    Yes, DBA_EXTENTS using the SEGMENT_NAME column for the name of the table, SEGMENT_TYPE for 'TABLE', and possibly OWNER if you knew whose schema it belonged to.

    You'll have to do a little math based on the storage setting of the table, but DBA_EXTENTS will give you BYTES and BLOCKS.
    Edward Haskins, OCP
    OraKnowledge, Inc.
    www.oraknowledge.com

    --"Live" Instructor-led Online Training for Oracle9i, Java and XML--

  4. #4
    Join Date
    Feb 2002
    Posts
    166
    So we have to know the storage parameters for the table to calculate the num of extents by bytes or blocks??? I don't know if it is a real exam question, only saw it somewhere and wrote it down.
    MCSE/MCDBA, OCP DBA 8i
    Working on SCJP -> SCJD

  5. #5
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    No, you don't need any information on storage parameters of a table to get the number of its extents from the DBA_EXTENTS view. The most simple query from it will give you the answer:

    SELECT COUNT(*) AS number_of_extents
    FROM dba_extents
    WHERE owner = 'THE_OWNER'
    AND segment_name = 'THE_TABLE';
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  6. #6
    Join Date
    Feb 2002
    Posts
    166
    Thx a lot, clear now. :-) I'm still a little bit mess for data dictionary view.
    MCSE/MCDBA, OCP DBA 8i
    Working on SCJP -> SCJD

  7. #7
    Join Date
    Dec 2001
    Location
    New Jersey
    Posts
    292
    O.K., somebody smack me if I'm not seeing what JMODIC is attempting to do with the COUNT(*) above. I know it's late...1:20am (and I did drink a couple beers tonight), but COUNT(*) on the dba_extents view to obtain the number of extents allocated to a particular table?? Maybe it will make sense in the morning!
    Edward Haskins, OCP
    OraKnowledge, Inc.
    www.oraknowledge.com

    --"Live" Instructor-led Online Training for Oracle9i, Java and XML--

  8. #8
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    he is just showing it how can you obtain number of extents from dba_extents

  9. #9
    Join Date
    Dec 2001
    Location
    New Jersey
    Posts
    292
    ooops, my bad...much clearer now that it's morning! ;-)
    Edward Haskins, OCP
    OraKnowledge, Inc.
    www.oraknowledge.com

    --"Live" Instructor-led Online Training for Oracle9i, Java and XML--

Posting Permissions

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


Click Here to Expand Forum to Full Width