Total space occupied by the table of tablespace

Hello

I'm looking for information find the total space occupied by a table stored in a tablespace. We can consider a scenario in which the table has data present in it, constraints, indexes, LOB columns and free space left on the total, that it has been allocated. I tried two queries, but don't think they give me what I'm looking for.

Select bytes from WHERE user_segments where nom_segment = "EMPLOYEES";

SELECT
lower (owner) as the owner
lower (table_name) AS table_name
nom_tablespace
num_rows
, blocks * 8/1024 AS size_mb
pct_free
compression
logging
From all_tables
Owner WHERE AS UPPER ('HR')
AND table_name = 'EMPLOYEE '.
ORDER BY 1, 2;

Basically, I need to get this information before executing some DML is on the table, after which, I'll check once again how much space is free after the operation. So kind to provide information to customers on space used and released for a table in a tablespace.

Now how do I go around to find the total space occupied by the table combining the factors mentioned above.


Thanks in advance.

Your queries refer to the segment info.

Here's how

create or replace procedure segments_for_table(p_table in varchar2, rc in out sys_refcursor) is
begin
open rc for
select l.table_name,s.segment_type,s.segment_name, s.bytes/(1024) kb
from user_segments s, user_lobs l
where l.table_name=p_table
and s.segment_name=l.segment_name
union
select i.table_name,s.segment_type,s.segment_name, s.bytes/(1024) kb
from user_segments s, user_indexes i
where i.table_name=p_table
and s.segment_name=i.index_name
union
select t.table_name,s.segment_type,s.segment_name, s.bytes/(1024) kb
from user_segments s, user_tables t
where t.table_name=p_table
and s.segment_name=t.table_name;
end;
/

-------------
Sybrand Bakker
Senior Oracle DBA

Tags: Database

Similar Questions

  • How can you recover disk space occupied by the updates of Windows XP, leading up to the installation of Windows XP SP3? __

    How can you recover disk space occupied by the updates of Windows XP, leading up to the installation of Windows XP SP3?

    SP3 after Installation Cleanup - http://www.aumha.net/viewtopic.php?f=62&t=33827 MS - MVP - Elephant Boy computers - Don ' t Panic!

  • Question about full scan of the Table and Tablespaces

    Good evening (or morning).

    I read the Concepts of Oracle (I am new to Oracle) and it seems that, based on the way in which Oracle allocates and manages the storage of the local the following is true:

    Principle: A table which is often accessible by using a full table scan (for some reason any) would be better resident in its own dedicated tablespace.

    The main reason I came to this conclusion is that when you perform a full table scan, Oracle doesn't diluvium IO, reading probably one step at a time. If datafile (s) of storage space only contain data for a single table, then a reading series will have to skip segments containing the data in the other tables (as is the case if the tablespace is shared with other tables). The performance improvement is probably low, but it seems that there is a very similarly.

    I wish I had the thoughts of DBA experienced about the assumption above.

    Thank you for your contribution,

    John.

    a reading series will not jump the segments that contain data from other tables

    You are referring to a misleading picture of the operation.

    Let's say 'A' table is a table among a number of tables in a tablespace that consists of one or more data files.
    Since this is one of the many tables, it may not start at the beginning of a data file. His first measure may be somewhere in the middle of the file. The next step may not be nearby with the first step. The 3rd degree can be in different data file.
    So, it's the picture where you see Oracle having to jump the other tables when you do a FullTableScan.

    Now, view the same image:
    Measure 1 is in the 1000 to the 1127 block block (IE 128 blocks) in the data file 6
    Measure 2 is the 2400 block 2527 block in the data file 6
    3 is to the block to block 9371 9245 in datafile 12

    How Oracle does not have a FullTableScan? It starts with the segment header to get a map of the extent (it would read UET$ in a dictionary managed tablespace). He knows now what degrees it should read.
    What is doing?

    He made a call to the operating system to read 1000 blocks Oracle 1127 in the data file 6.
    The operating system then translates this call to starts and ID ranges and the block of the file system.
    The operating system puts this request to the storage subsystem.
    The storage subsystem and then translated the BONE, ID, blockrange to the drive starts, track, sector.
    Assume that these are all the neighbor on the single disc (that is, the volume is not distributed over multiple LUNS and disks).
    Storage reads the information and sends it to the operating system. This can still mean multiple readings, because the head (or several heads because the disc is made up of several trays) does not read 1 MB in an "appeal".
    The operating system then collects the 1 MB and passes it to Oracle.
    Oracle then fills buffers in its cache buffers--(PS: Astuce!) Tip! (: don't you know that it will be not be neighbor memory locations?)
    Microseconds past milliseconds.
    The disc is still spinning (it stops ). It has "evolved" - a different set of blocks are now under the read head.

    Oracle is now asking the OS for blocks of 2400 to 2527 in the data file 6.
    Oracle did not to "jump the other tables. He just made a separate call to the OS with a new range of blocks.
    The operating system now translates the block ID and filenumber at its own mapping.
    Storage then made his translation.
    The disc under the head blocks are very (almost certain) to be a different from blocks together. Not even those corresponding to 1128 Oracle Oracle datafile block 6. Not even the ones corresponding to 2400 block Oracle in Oracle data files.
    We are suffering now fetch - and reading the disk.

    and the story continues...

    And what happens if there is finally another user on the same system? Between the first blocks 1000-1127 call and the second call to blocks 2400-2527, that other user requested blocks 2000 (IE made a call from reading one piece).
    And, after the second measure is read by the user FullTableScan, a third user has requested block 2048 in a single block read call.

    It is important that the Table is not in the neighbor extensions? Even if you did put the table in "adjacent areas" they are not likely to be contiguous on the disk. Even if they are nearby on the disk, they are not likely to be able to read without delay, because the disc has passed.
    And we have not even spoken interleaving where readings from multiple disks need to be coordinated.

    So why still prefer 1Mo diluvium readings in Oracle? Because most SOAs allow a single OS call of up to 1 MB. Therefore, the overhead of Oracle making a call to read 1 MB are experienced only once. If the operating system allowed a maximum of 256KB reads diluvium, even a reading of 1 MB measurement must be carried out as 4 separate calls to the OS (and, recursively, 4 separate calls to the OS for the storage subsystem). We try to reduce the number of calls from software that we do. We cannot reduce the time of access and reading (but allows us to achieve more high "parallelism" in readings striping).

    Hemant K Collette
    http://hemantoracledba.blogspot.com

  • My macbook shows 119 GB of total space instead of the designed 120 GB

    I erased my macbook SSD to install el captain and since then, the total space available about this mac > storage shows 119.45 instead of 120.77 as before. No idea how to solve this problem?

    Not sure why he showed 120.77 before, 120,77 sounds like the physical capacity of the drive, however the usable storage volume will always be a little lower than this, 9% to be precise. See the article below for more information on this topic, its normal.

    ard-disk-loses-some-space-after-formatting-https://www.DaniWeb.com/hardware-and-software/Microsoft-Windows/threads/432819/h

    I hope that answers your question!

  • move the table in tablespace

    Could you please move and write me as a script tables in the tablespace?

    Hello

    RHELSENSEI wrote:

    Could you please move and write me as a script tables in the tablespace?

    (1) move the Table script

    SELECT 'ALTER TABLE '.

    || owner

    || '.'

    || table-name

    || "MOVE THE TABLESPACE NOM_TABLESPACE;

    FROM dba_tables

    Owner WHERE LIKE "% TABLE_NAME";

    (2) script index Rebuld

    SELECT "ALTER INDEX".

    || owner

    || '.'

    || index_name

    || "REBUILD THE TABLESPACE NOM_TABLESPACE;

    OF dba_indexes

    Owner WHERE LIKE "% TABLE_NAME";

    Thank you

  • Running Total and partial in the tables in the ADF

    Hi, I use Jdeveloper 11.1.2.3.0...

    Please I just discovered the ADF table subtotal and total function in oracle Docs, but it does not specify the steps on how to do this... Im not a pro, so please if anyone has a link or a link to a tutorial or can tell me the steps to take in order to accomplish the subtotal and total in my table from the ADF, I'll be very grateful.

    I await your response.
    Thank you

    OBYYS

    http://www.techartifact.com/blogs/2012/11/ADF-Groovy-for-total-sum-of-a-column-in-a-table.html

  • I can not print complete E-Mail due to the space occupied by the personal dashboard. The right side of the screen is taken by the dashboard. How can I remove the dashboard, that is to say, the column to the right of the screen?

    There is not enough room for the message between folders on the left and the (advertising) dashboard on the right.  Therefore, I often use the slide bar on the bottom of the screen to read the entire lines of the message.  For this reason, I can not print a full e-mail.

    How can I eliminate or reduce the dashboard?

    The ads are not visible under the eyes. Click the button in the toolbar of the message header in the reading pane:

    Le The full view button

    To print the message alone, click the three dots in the command bar and select print.

  • How can I recover the disk space occupied by the uninstall information of Microsoft Update for all accepted updates.

    I would like to know how to do this for MS Windows XP Home and (especially) MS Windows Vista Home Premium (my sons PC is running out of space fast disk - I think because of updates).

    WinXP: See http://aumha.net/viewtopic.php?f=62&t=33827

    Vista: See http://aumha.net/viewtopic.php?f=77&t=33209 ~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft

  • 384 GB of space occupied by the Windows folder

    I have Windows 7OS. Windows folder in the c drive takes 384 GB. How to reduce its size?

    Thanks for your replies.

    As Gerry said, disc cleanup has not shown these temporary files.

    I followed the steps in the below link and deleted these files

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-files/cabxxxx-files-found-in-windowstemp-folder/2e86137e-7e6b-4cb7-9a3c-4ee73f665742?auth=1

    It works very well

  • ORA-01653: unable to extend the table SYS. ARGUMENT$ 13 in the SYSTEM tablespace

    I created the new database manually.

    When I @?/rdbms/admin/catproc.sql put this sql to execute.

    for some time he said created, granted. but after somewhere, it gives me the error.

    ORA-01653: unable to extend the table SYS. ARGUMENT$ 13 in the SYSTEM tablespace

    Please help me on this.

    Thank you in advance.

    Your query does not tablespace SYSTEM size. It provides a list of tablespaces. And may not be a complete list because I can't UNDO and TEMP tablespace. In all cases, based on the output, you have not created a user storage space, so all the tables you create in SYSTEM tablespace and finally you ran out of space. You need create user storage space if you don't have any. You want to change the non-system and non-system tablespaces value default tablespace users. Even if you don't have a non-system tablespaces, tables will be created in the tablespace default user unless you explicitly specify one. You must move the tables/indexes existing user for the non-system tablespaces.

    SY.

    PS to get the size of the SYSTEM tablespace, you will need to run:

    Select sum (bytes) / 1024/1024 tablespace_size_in_mb
    from dba_data_files
    where nom_tablespace = 'SYSTEM '.

  • Penetrating a tablespace of the table again to $ FGA_LOG

    Hi all

    I look at entering one new tablespace (other than the SYSTEM) of the table of $ FGA_LOG.

    This table grew too big and made the SYSTEM tablespace more 13 GB.

    I'm on 10.2.0.3.0, I know that there a package to perform this task in 11g, but I can't upgrade for the moment

    Thank you very much

    Hello

    I think that it is not a good idea... This action can cause upgrades of concerning problems or, in some backup/restore scenarios. How to export or copy the contents of FGA_LOG$ in another table, located in a different tablespace? So, after that, you can clean the $ FGA_LOG (truncate) in order to save space in the SYSTEM tablespace:

    1. create the table fga_log tablespace in select * from fga_log$;
    2 - truncate table fga_log$;

    I'm on 10.2.0.3.0, I know that there a package to perform this task in 11g, but I can't upgrade for the moment

    Are you talking about the DBMS_AUDIT_MGMT. Procedure SET_AUDIT_TRAIL_LOCATION? If Yes, for more information, take a look at the Note: 72460.1 on the My Oracle Support website (formerly Metalink)... of course if you have a valid account of the ITUC.

    See you soon

    [url eduardolegatti.blogspot.com] Legatti

  • Index rebuild required after truncate the table and load data

    Hello


    I have a situation that we truncate tables bit and then we loaded data [only content] on these tables. What you need to rebuild the index online is necessary or not?


    And another question is if we drop a few clues is the total amount of space is released or not. And re-create indexes will use the same amount of space. As I don't have disk space more? In this situation, rebuild the index online will be a better idea...

    Can you please on this...


    truncate the table some the few loading tables + reconstruction markings online is the best (or) droping little tables, a few tables loading + re-create the index is better

    Can you suggest the best way... We have a time that it currently we don't have enough space on the disk... [Option should not effect the space]

    user13095767 wrote:
    Ok. I have it...

    u want to say if we disbale the index while loading... Next, we need to spend the time to build.

    If the indexes are enabled, then rebuild again is not necessary after loading tables...

    Please answer if my understanding is correct...

    above is correct

    >

    If so, how abt the differences in the space occupied by the spaces of storage during the index rebuild and re-create... T he acquires more space if recreate us [deletion and creation] or rebuild online is preferable to an index...?

    space used is the same for all options.

  • size of the table on disk

    Hello

    Wanted to know the size of a table on the disk.  Assume I have a Table with 10 columns...  Only, Varchar2, number and Date fields.  For example, of same data in the CSV file with all fields in complete occupation like the VARCHAR2 data size field and have 100 000 files occupy 100 MB on the disk.  In this case just wanted to know, table also occupies space on the disk?  If not, what is the approximate percentage of diviation?

    If there is an index defined on 3 columns of the table and the types of fields for these 3 columns would be, field Date and a numeric field, third field as field Varchar2 (100) respectively.  In this case, about how much additional disk space will be ustilized in percentage?

    Please note that I am not interested on any other sizing as DB dimensions, other dimensions of the diagram, software size, etc., etc., I wanted to just know, if I have a 1 GB of data in the CSV file and I load in the Table, will take an equal amount of size on the disk or there is a major difference.  Of course, I know that because of the definition of the width to the table field, there is a major change in the use of disk space.  However, for highest estimate, just consider that Varchar2 column size and the actual data in CSV is even.

    Thank you

    -Anand

    The best way to find out – load a representative sample of data and check the size of the segments / the index of the table.

    The size will be different, for sure. DATEs are 7 bytes. VARCHAR2 takes at least one byte over the data size. NUMBER would take usually less space it is used by the CSV format.

    In addition, the Oracle tables are stored in a heap structure and generally have unused space allocated to the table.

    John

  • Reorganization of the table

    All,

    I found a few tables are very fragmented in our database of production and continues to re - organize. I intend to use 'change the method of displacement of the table '.

    Database version: 11.2.0.3

    Name of the table: Test Tablespaces: users, tools - they already have enough space for the move.

    During the race, this database of impact will this order?  This will allow DML and DDL operations?  Please let me know what has be to consider other things.

    SQL> alter table test move tablespace tools;
    
    
    Table altered.
    
    
    SQL>  select status from dba_objects where object_name='TEST_INDX';
    
    
    STATUS
    -------
    VALID
    
    
    SQL>  alter table test move tablespace users;
    
    
    Table altered.
    
    
    SQL> select status from dba_objects where object_name='TEST_INDX';
    
    
    STATUS
    -------
    VALID
    

    Thank you

    Why do you feel compelled to do something?

    If you regularly remove 'huge', and then nothing else to do.

    If "SHRINK you" the size of the table, you force only Oracle to expand yet; before the next deletion.

    What you propose would be similar to replace the gas tank on your car you consume gasoline in order to eliminate all the space as 'wasted' in there.

    The problem arises when you want to fill. You develop the tank; just to keep more gasoline.

  • How to check the amount of memory used during execution of the program to save data in the table?

    Hi any idea how to read or check use all memory space by accumulating the table with the data?

    My program works like this: -.

    (1) values are acquired and displayed on the table

    (2) the values are acquireduring the next event and appear in the next row in the table.

    (3) and this continues...

    Please notify

    Thanks in advance

    Hi astroboy,.

    You can use 'Flatten channel' to get the size of your data.

    Mike

Maybe you are looking for