Query to find the size the table occupies

I have a table with blob columns. How to find the size the table occupying? Thanks

DBMS_SPACE.SPACE_USAGE(
segment_owner IN varchar2,
segment_name IN varchar2,
segment_type IN varchar2,
unformatted_blocks OUT number,
unformatted_bytes OUT number,
fs1_blocks OUT number,
fs1_bytes OUT number,
fs2_blocks OUT number,
fs2_bytes OUT number,
fs3_blocks OUT number,
fs3_bytes OUT number,
fs4_blocks OUT number,
fs4_bytes OUT number,
full_blocks OUT number,
full_bytes OUT number,
partition_name IN varchar2 DEFAULT NULL);
Parameters
Parameter Description
segment_owner Schema name of the segment to be analyzed
segment_name Name of the segment to be analyzed
partition_name Partition name of the segment to be analyzed
segment_type Type of the segment to be analyzed (TABLE, INDEX, or CLUSTER)
OUTPUT ARGUMENTS
unformatted_blocks Total number of blocks that are unformatted
unformatted bytes Total number of bytes that are unformatted
fs1_blocks Number of blocks that has at least 0 to 25% free space
fs1_bytes Number of bytes that has at least 0 to 25% free space
fs2_blocks Number of blocks that has at least 25 to 50% free space
fs2_bytes Number of bytes that has at least 25 to 50% free space
fs3_blocks Number of blocks that has at least 50 to 75% free space
fs3_bytes Number of bytes that has at least 50 to 75% free space
fs4_blocks Number of blocks that has at least 75 to 100% free space
fs4_bytes Number of bytes that has at least 75 to 100% free space
ful1_blocks Total number of blocks that are full in the segment
full_bytes Total number of bytes that are full in the segment
Summary of DBMS_SPACE Subprograms
Example
variable unf number;
variable unfb number;
variable fs1 number;
variable fs1b number;
variable fs2 number;
variable fs2b number;
variable fs3 number;
variable fs3b number;
variable fs4 number;
variable fs4b number;
variable full number;
variable fullb number;
begin
dbms_space.space_usage('U1','T', 'TABLE',
:unf, :unfb,
:fs1, :fs1b,
:fs2, :fs2b,
:fs3, :fs3b,
:fs4, :fs4b,
:full, :fullb);
end;
print unf ;
print unfb ;
print fs4 ;
print fs4b;
print fs3 ;
print fs3b;
print fs2 ;
print fs2b;
print fs1 ;
print fs1b;
print full;
print fullb;
all the best
DN

Similar Messages

  • Query to find the no of columns in a table

    Is there a query to find the total number of columns in a table?

    Dou you know read?
    -- the number of rows in a table named yourtable:
    select count(1) from yourtable;
    -- the number of columns in a table
    -- If is a user's table:
    select count(1)
    from user_tab_columns
    where table_name='YOURTABLE'
    --If it is´t
    select count(1)
    from DBA_tab_columns
    where owner = 'USEROWNER'
    and table_name='YOURTABLE'

  • Give me the sql query which calculte the table size in oracle 10g ecc 6.0

    Hi expert,
    Please  give me the sql query which calculte the table size in oracle 10g ecc 6.0.
    Regards

    Orkun Gedik wrote:
    select segment_name, sum(bytes)/(1024*1024) from dba_segments where segment_name = '<TABLE_NAME>' group by segment_name;
    Hi,
    This delivers possibly wrong data in MCOD installations.
    Depending on Oracle Version and Patchlevel dba_segments does not always have the correct data,
    at any time esp. for indexes right after being rebuild parallel (Even in DB02 because it is using USER_SEGMENTS).
    Takes a day to get the data back in line (never found out, who did the correction at night, could be RSCOLL00 ?).
    Use above statement with "OWNER = " in WHERE for MCOD or connect as schema owner and use USER_SEGMENTS.
    Use with
    segment_name LIKE '<TABLE_NAME>%'
    if you like to see the related indexes as well.
    For partitioned objects, a join from dba_tables / dba_indexes to dba_tab_partitions/dba_ind_partitions to dba_segments
    might be needed, esp. for hash partitioned tables, depending on how they have been created ( partition names SYS_xxxx).
    Volker

  • Query to find the Salary table details  HRMS 11i

    I am looking  query to find the persons salary details in Oralce EBS 11i.
    I tried the below query bu it didn'ty work.
    SELECT papf.employee_number
    ,papf.full_name
    ,pj.NAME job
    ,haou.NAME ORGANIZATION
    ,ppp.proposed_salary_n salary
    FROM per_all_people_f papf
    ,per_all_assignments_f paaf
    ,per_jobs pj
    ,hr_all_organization_units haou
    ,per_position_definitions ppd
    ,per_all_positions pap
    ,per_pay_proposals ppp
    WHERE 1 = 1
    AND SYSDATE BETWEEN papf.effective_start_date AND papf.effective_end_date
    AND papf.current_employee_flag = 'Y'
    AND papf.employee_number IS NOT NULL
    AND paaf.person_id = papf.person_id
    AND SYSDATE BETWEEN paaf.effective_start_date AND paaf.effective_end_date
    AND paaf.job_id = pj.job_id
    AND paaf.organization_id = haou.organization_id
    AND paaf.position_id = pap.position_id
    AND pap.position_definition_id = ppd.position_definition_id
    AND ppp.pay_proposal_id = (SELECT MAX (pay_proposal_id)
    FROM per_pay_proposals
    WHERE assignment_id = paaf.assignment_id)
    In our case all the below tables have 0 records..
    select count(*) from PER_PAY_PROPOSALS ;
      COUNT(*)
             0
    select count(*) from pay_element_entry_values_f;
      COUNT(*)
             0
    select count(*) from PAY_ELEMENT_ENTRY_VALUES_F;
      COUNT(*)
             0
    select count(*) from PAY_ELEMENT_ENTRIES_F;
      COUNT(*)
             0

    Hi,
    Your results clearly states that there is no salary data which is been captured as well as there are no element entries which are assigned to any assignment.
    Please do the below which will insert records in salary as well as element entries table:
    1. Add a salary proposal to any active employee (People Enter and Maination --> Search for any employee --> Assignment --> Salary) - This will insert a record in PER_PAY_PROPOSALS table
    2. Add an element entry to any active assignment (People Enter and Maination --> Search for any employee --> Assignment --> Entries) - This will insert a record in PAY_ELEMENT_ENTRIES_F and PAY_ELEMENT_ENTRY_VALUES_F table
    Hope this clarifies.
    Thanks,
    Sanjay

  • Query to find the size of trigger?

    query to find the size of trigger?

    Can you define what the size of a trigger would be?
    I suppose one measure might be to get the DDL for the trigger (DBMS_METADATA.GET_DDL) and do a DBMS_LOB.GetLength on the CLOB that is returned. I'm hard-pressed to find that a meaningful number, but it is a measure of "size".
    Justin

  • Query to find the Base tables of views

    Hi,
    Can you pl let me know the query to find the base tables on which the view is based.I looked into views like ci_view_definitions but i could not find them.
    Thanks for your help
    thanx,
    Suji.

    select vw.name viewname, nvl( tabdef.name, vwdef.name) "based on"
    from   ci_view_definitions vw
    ,      i$sdd_vwtab
    ,      ci_view_definitions vwdef
    ,      ci_table_definitions tabdef
    where  view_ref = vw.id
    and    table_ref = tabdef.id (+)
    and    table_ref = vwdef.id (+)

  • Query to find the size of a schema

    Hi,
    Can you give me the Oracle query to find the size of a schema ?
    Thanks,
    Smitha

    Hi,
    Following query tell you the size of schema.
    SELECT owner,
    Sum(bytes)/1024/1024 AS total_size_mb
    FROM dba_segments
    WHERE owner = Upper('&1')
    GROUP BY owner
    Regards,
    Awais Riaz

  • Query to find the  second maximum date in a table

    please give me the query to find the second maximum date in a table

    You can try with this
    SELECT empno
          ,hiredate
      FROM emp        a
    WHERE 2          = (SELECT COUNT(DISTINCT hiredate)
                           FROM emp        b
                          WHERE b.hiredate      >= a.hiredate
    OR
    SELECT empno
          ,hiredate
      FROM (SELECT ROWNUM      row_num
                  ,empno
                  ,hiredate
              FROM emp        a
          ORDER BY hiredate   ASC
    WHERE row_num             = 2;Regards
    Arun

  • How can i find the tables which dont contain any data under my database ?

    Can you please suggest me a way to find the tables which dont contain any data under my database ?
    Regards,
    Renu

    Can you please suggest me a way to find the tables which dont contain any data under my database ?
    For the schema that you've logged in to, you could do something like this:
    test@XE>
    test@XE> @test
    test@XE> --
    test@XE> set serveroutput on size 1000000
    test@XE>
    test@XE> declare
      2    n_count  number;
      3  begin
      4    for rec in (select object_name from user_objects
      5                where object_type = 'TABLE')
      6    loop
      7      execute immediate 'select count(*) from '||rec.object_name
      8      into n_count;
      9      if (n_count = 0) then
    10        dbms_output.put_line(rec.object_name);
    11      end if;
    12    end loop;
    13  end;
    14  /
    BONUS
    RUN_STATS
    PL/SQL procedure successfully completed.
    test@XE>
    test@XE>For the other schemas, you could query from dba_objects and probably display the owner as well.
    HTH
    isotope

  • Using column value is it possible to find the table name in the database?

    Hi all,
    using column value is it possible to find the table name in the database?
    guys i need the table value
    Note:
    oracle-9i
    for example:
    i don't know NIC(column value) in which table in the database.
    Thank you,
    with regards,
    JP.
    Edited by: Guest on Feb 27, 2012 5:42 AM

    Hi,
    As far as I understand what you are asking for I would suggest 4 data dictionaries that will help you to know the table name from the column names
    1. USER_TAB_COLS
    2. ALL_TAB_COLS
    3. DBA_TAB_COLS
    4. COLS
    These can give you detail information about the columns and respective tables at user, schema, dba level. Further information on the table can be found by querying ALL_OBJECTS table giving table_name as Object_name, or you can join the data dictionaries too.
    To know about various data dictionaries avalible in Oracle please query select * from cat;
    Let us know if you need further assistance.
    Twinkle

  • Is it possible to find the  table based on the Date ?

    Dear Team ,
    Is it possible to find the table based on the Date ?
    I have created an table ,But forgot the Table Name .
    Is it possible to find the Tables created on particular Date .
    Regards ,
    Augustine

    as date is record the time also below query will work.
    select * from user_objects
    where
    object_type = 'TABLE' and
    to_date(created,'DD-MON-YYYY') =to_date('<your date value in DD-MON-YYYY format>','DD-MON-YYYY');
    Edited by: shaileshM on Feb 24, 2010 9:39 PM

  • Query to find the memory of database in oracle,sql

    Hi All,
    Please let me know the query to find the memory of database in oracle,sql.
    Thanks,
    sajith

    How do I find the overall database size?
    The biggest portion of a database's size comes from the datafiles. To find out how many megabytes are allocated to ALL datafiles:
    select sum(bytes)/1024/1024 "Meg" from dba_data_files;
    To get the size of all TEMP files:
    select nvl(sum(bytes),0)/1024/1024 "Meg" from dba_temp_files;
    To get the size of the on-line redo-logs:
    select sum(bytes)/1024/1024 "Meg" from sys.v_$log;
    Putting it all together into a single query:
    select a.data_size+b.temp_size+c.redo_size "total_size"
    from ( select sum(bytes) data_size
    from dba_data_files ) a,
    ( select nvl(sum(bytes),0) temp_size
    from dba_temp_files ) b,
    ( select sum(bytes) redo_size
    from sys.v_$log ) c;
    Another query ("Free space" reports data files free space):
    col "Database Size" format a20
    col "Free space" format a20
    select round(sum(used.bytes) / 1024 / 1024 ) || ' MB' "Database Size"
    , round(free.p / 1024 / 1024) || ' MB' "Free space"
    from (select bytes from v$datafile
    union all
    select bytes from v$tempfile
    union all
    select bytes from v$log) used
    , (select sum(bytes) as p from dba_free_space) free
    group by free.p
    This is what I use :P From http://www.orafaq.com/wiki/Oracle_database_FAQ#How_do_I_find_the_overall_database_size.3F

  • Query to find the latest record with respect to the current status

    Dear gurus
    I have the following data in a table
    Customernum
    bkcode
    reqtdate
    Prevstat
    currstat
    The data will be like this
    CustomerNum bkcode reqdate prevstat currstat
    5900 1 03-Aug-12 0 1
    5900 1 06-Aug-12 1 0
    5900 5 22-Jun-12 0 1
    If a customer has an issue to solved, a record is added with bkcode , register date and currstat will be 1
    If the issue is resolved for the bookingcode,a new record is added, the currentstatus will become 0. and prev stat will show 1. Row no 1 and 2 reflects this case
    If this table is queried for finding the unresolved issues. the output should be only the Last row of the above example. since issue with bookingcode 1 has been resolved
    I have trying hard to get this thing confused what to use Lead or Max
    Kindly guide me

    Hi,
    one way here:
    WITH mytable(CustomerNum, bkcode, reqdate, prevstat, currstat)
    AS
       SELECT 5900, 1, TO_DATE('03-Aug-12', 'DD-Mon-YY'), 0, 1 FROM DUAL UNION ALL
       SELECT 5900, 1, TO_DATE('06-Aug-12', 'DD-Mon-YY'), 1, 0 FROM DUAL UNION ALL
       SELECT 5900, 5, TO_DATE('22-Jun-12', 'DD-Mon-YY'), 0, 1 FROM DUAL
    SELECT CustomerNum, bkcode, reqdate, prevstat, currstat
      FROM (SELECT a.*
                 , ROW_NUMBER() OVER (PARTITION BY CustomerNum, bkcode
                                           ORDER BY reqdate DESC) AS rn
              FROM mytable a
    WHERE rn=1
       AND currstat=1;
    CUSTOMERNUM     BKCODE REQDATE     PREVSTAT   CURRSTAT
           5900          5 22-JUN-12          0          1Regards.
    Al
    Edited by: Alberto Faenza on Dec 18, 2012 5:23 PM
    Changed again!! Previous logic was wrong

  • SQL Query to find the Notify upon Completion employees

    Hi,
    I am looking for a query to find the names of the employees/users who are notified upon the completion of the Concurrent Programs. I know how to find the concurrent program details but not able to find notify upon completion employees details. Please help me.
    Thanks,
    KM

    Thanks Scott for responding. There is no any custom code. Here is the navigation to reach there:
    System Administrator -> Requests -> View -> Specific Requests -> Open any request ->View Details -> Options -> Notify the following people
    I am looking for the query to find these notified people using SQL Query.Query FND_CONCURRENT_REQUESTS table (NOTIFY_ON_PP_ERROR column) -- http://etrm.oracle.com/pls/et1211d9/etrm_pnav.show_object?c_name=FND_CONCURRENT_REQUESTS&c_owner=APPLSYS&c_type=TABLE
    Thanks,
    Hussein

  • Is their,Query to find the which tempfile our Database currently using ?

    Hi All,
    Is their,Query to find the which tempfile our Database currently using ?
    Regards,
    DB

    select property_name,property_value from database_properties where property_name like '%TABLE%';
    John Watson
    Oracle Certified Master DBA
    http://skillbuilders.com
    Edited by: JohnWatson on May 14, 2013 12:27 PM
    (assuming that you mean temporary tablespace rarther thsn tempfile)

  • Query to find the class name that has the maximum number of students ?

    I need the query to find the [class Name] which has the most number of students. please look below at the tables
    Students Table                                                                     
    StudentId     StudentName  ClassID                                    
    1                  xxx                   1                                           
    2                  yyy                   1                                           
    3                  zzz                   1  
    4                  fff                    2
    5                   ttt                  2
     Classes Table
     ClassID          ClassNane
     1                    CSHARP
     2                    JSHARP
    The result should be : CSHARP
    since there are 3 students in CSHARP and 2 students in JSHARP class
    Appreciate your help
    Thanks

    Try:
    DECLARE @Classes TABLE (
    ClassID INT identity(1, 1) PRIMARY KEY
    ,ClassName VARCHAR(50)
    INSERT INTO @Classes (ClassName)
    VALUES ('CSharp')
    ,('JSharp')
    DECLARE @Students TABLE (
    StudentID INT identity(1, 1) PRIMARY KEY
    ,StudentName VARCHAR(10)
    ,ClassID INT
    INSERT INTO @Students (
    StudentName
    ,ClassID
    VALUES (
    'xxx'
    ,1
    'yyy'
    ,1
    'zzz'
    ,1
    'fff'
    ,2
    'ttt'
    ,2
    SELECT TOP (1)
    WITH TIES C.ClassName
    FROM @Classes C
    INNER JOIN @Students S ON C.ClassID = S.ClassID
    GROUP BY C.ClassID
    ,C.ClassName
    ORDER BY COUNT(S.StudentID) DESC
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

Maybe you are looking for

  • Can I use a NTSC monitor with my European MacBook Pro?

    Hi I moved from Europe to the US and took my Macbook Pro with me. Now I need a second computer monitor (thinking Dell u2410). Can I buy one here in the US or will the whole PAL vs. NTSC thing have an effect? Thanks for helping Cheers Jakob

  • Dreamweaver MX 2004 Update?

    I've tried to update my Dreamweaver MX 2004 - but everytime I start going through the install it says that Dreamweaver is not found within the Macromedia/Dreamweaver folder and therefore can't install. I've verified that the application is in that fo

  • Account not credited after payment

    My Skype name is Soxmum, Julia Thomas. I made an EFT payment on the 9th March and my account has still not been credited, usually it's credited very quickly. My order no. [removed for privacy] Payment ref no. xxxxxxxxxxxxxxx I can email you proof is

  • Qosmio X500 - How to increase the screen resolution?

    Hi, Does anybody know how to increase the screen resolution? My qosmio X500 is 1920 x 1080 and I want to raise it to 1920 x 1200. Thank you/Red

  • How to clear all data when the form loading at the first time

    hi I am using JDevloper 10g and I have adfForm page, I want to clear all data when I load the page for the first time. When I did it using RefreshCondition on the pageDef in the executables like( <executables> <iterator id="FinCompaniesInformaton1Vie