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

Thread: actual data in the database

  1. #1
    Join Date
    Dec 2002
    Posts
    62

    actual data in the database

    Hi,
    How can I find the actual data is in the database, Including indexes.

    Thanks in advance.

  2. #2
    Join Date
    Jan 2002
    Location
    Up s**t creek
    Posts
    1,525
    Do you mean objects? if so the following views will help

    DBA_OBJECTS, DBA_SEGMENTS

    Regards
    Jim
    Oracle Certified Professional
    "Build your reputation by helping other people build theirs."

    "Sarcasm may be the lowest form of wit but its still funny"

    Click HERE to vist my website!

  3. #3
    Join Date
    Feb 2003
    Location
    Kolkata, India
    Posts
    33
    can u be more specific on the term "actual data"?

  4. #4
    Join Date
    Dec 2002
    Posts
    62
    I mean I can have datafiles of 10GB but the data in it would be just 7GB . So how to find the amount of that data.

  5. #5
    Join Date
    Oct 2002
    Location
    CA
    Posts
    67
    YOu can query basically starting from datafile level to table/index level.

    v$datafile ---> v$tablespace ---> user_tables(dba_tables) or dba_indexes

    Then of course look at all data you want. Have fun.
    --------------------------------------
    It's not what the world does to you that matters. It's how you respond...

  6. #6
    Join Date
    Nov 2002
    Location
    New Delhi, INDIA
    Posts
    1,796
    Originally posted by ayushsingh
    I mean I can have datafiles of 10GB but the data in it would be just 7GB . So how to find the amount of that data.
    Well what i understand is that you want to see how much free space is available...

    Use DBA_FREE_SPACE and dba_segments to find that out...

    HTH
    Amar
    "There is a difference between knowing the path and walking the path."

    Amar's Blog  Get Firefox!

  7. #7
    Join Date
    Jan 2003
    Location
    Thailand
    Posts
    29
    Code:
    SELECT      tablespace_name TS, count('x') "NO_BlockID", sum(bytes)/1024/1024 "FreeSpaces"
    FROM         dba_free_space
    GROUP BY tablespace_name
    Regards,
    P.Peach

  8. #8
    Join Date
    Feb 2003
    Location
    France
    Posts
    2
    To have space use in your tablespaces :
    set lines 250
    set pages 200

    SELECT d.status "Status",
    d.tablespace_name "Name",
    d.contents "Type",
    TO_CHAR(NVL(a.bytes / 1024 / 1024, 0),'99,999,990.900') "Size (M)",
    TO_CHAR(NVL((a.bytes - NVL(f.bytes,0)) / a.bytes * 100, 0), '990.00') "Used %" ,
    round(NVL((a.bytes - NVL(f.bytes,0))/1024/1024, 0),2) ||'/'||NVL(a.bytes/1024/1024, 0) "Used (M)"
    FROM sys.dba_tablespaces d,
    (select tablespace_name, sum(bytes) bytes
    from dba_data_files
    group by tablespace_name) a,
    (select tablespace_name,sum(bytes) bytes
    from dba_free_space
    group by tablespace_name) f
    WHERE d.tablespace_name = a.tablespace_name(+)
    AND d.tablespace_name = f.tablespace_name(+);

    ---------------------------------------
    To Know space really used by a table (you may execute statistics)
    select table_name, blocks*8 || ' Ko' "Used" , EMPTY_BLOCKS *8 ||' Ko' "Free" from user_tables;

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