Calculate the free space of the table.

Hello, I have several large tables in my DB 9i.

After cleaning a lot of old data, I need to know how much space can be retrieved in the DB of relocation and reconstruction.

Can you please a provide a query to calculate?

Thank you in advance.

Collect statistics before executing the query.

SELECT table_name, ALL the ((blocks * 8), 2) / 1024 | "Mo" 'size of the Table. "
ROUND ((num_rows * avg_row_len/1024), 2) / 1024
|| "Mo" 'actual data size. "
PCT_FREE,
ROUND ((blocks * 8), 2) / 1024
-(ROUND ((blocks * 8), 2) * pct_free / 100) / 1024
-(ROUND ((num_rows * avg_row_len/1024), 2)) / 1024 "MB_Free_Space."
FROM dba_tables
WHERE TOWER ((blocks * 8), 2)
-(ROUND ((blocks * 8), 2) * pct_free / 100)
-(ROUND ((num_rows * avg_row_len/1024), 2)) > 0 and owner = 'SCHEMANAME. "
ORDER OF ROUND ((blocks * 8), 2)
-(ROUND ((blocks * 8), 2) * pct_free / 100)
-(ROUND ((num_rows * avg_row_len/1024), 2)) / / DESC;

Concerning
Asif Kabir

Tags: Database

Similar Questions

  • Calculate the free space of the lob segment / reclaim space?

    Friends...

    DB: 11 GR 2

    OS: Linux

    I am trying shrink lob segment and recover the free space between the business segments.

    This area in Oracle DB is new to me so try to learn and to shrink the segment.

    I went through various metalink doco (386341.1) but not be able to get answers for below...

    Issues related to the:

    1. how much free space is available in the lob segment?

    2 can I assume 'no LOB DATA' as the free space currently and even will be recovered once the segment will be shrunk?

    3. no disadvantage of using "ALTER TABLE... SHRINK SPACE.

    4. is it true if storage segment is 100 GB as many redo will be generated when trying to alter table... shrink the space?

    I'm following the steps below.

    1 find Segment name-> sys_lob123

    2. find the size of storage - > 100 GB

    3. find the size of the LOB data-> 70

    4. find the size of the data not LOB-> 30

    2. the storage size

    Select 'storage' from dba_extents bytes

    where nom_segment = 'sys_lob123. '

    100 GB

    3. the size of the LOB

    Select dbms_lob.getlength (col_lob) in the table_lob;

    70 GB

    4. the size of the LOB data not

    100-70 = 30 GB (i.e. #3 - #2)

    Thanks in advance and enjoy your time looking into this...

    Use DBMS_REDEFINITION to reorganize the LOB segment, it is the best way to retrieve a LOB segment space. Also use the clause "MEANS of COMPRESS" and SECURE LEADER, creating the temp table. There is no reason that you can use the BASIC FILE. It's online process, which means that your app can stay up to... However, make sure that monitor you the database when executing redef, as it can cause conflicts and slow down your application, in which case you must kill the reorg...

    If this process is not feasible or overwhelms you, "ALTER TABLE MOVE" is another option.

    With 'Displacement of Alter table', you need to rebuild all indexes after you move the LOB segment. Don't forget this is an offline process and your application needs a time out while you do this.

    Here is the query to list the 10 LOBs albums in your database-

    fixed line 160

    Col a20 PROPRIETARY format

    Col TABLE_NAME format a30

    Col COLUMN_NAME format a30

    Col nom_segment format a30

    size col 999 999 999 format

    SELECT *.

    FROM (SELECT b.owner,

    b.table_name,

    b.column_name,

    a.segment_name,

    SUM (a.bytes) / (1024 * 1024) "size".

    FROM dba_segments a, b dba_lobs

    WHERE a.segment_name LIKE '% SYS_LOB '.

    AND a.segment_name = b.segment_name

    AND a.owner NOT IN ('SYS', 'SYSTEM', 'GENERAL', "OUTLN")

    B.owner GROUP,

    b.table_name,

    b.column_name,

    a.segment_name

    ORDER BY DESC 5)

    WHERE ROWNUM<>

  • Calculation of the free space in a data file

    Hello

    I use Oracle database 11g (11.1.0.6). I need to calculate available disk space that exist in a special database for inserting new records. I look in the table dba_data_files for this information. I use the sub query to get the value of maxsize allocated in GB this until datafile that it can grow.

    Select maxbytes/1024/1024/1024 of dba_data_files where nom_tablespace = 'XXXX '.

    How to get the disk space available for the insertion of new records in a particular data file or a bunch of data files in a tablespace?


    Kind regards

    007

    007 wrote:
    Hi Helios - Gunes EROL,

    The Select sum (bytes) / 1024/1024/1024 "GB" of dba_data_files where nom_tablespace = 'xx' query tells you the sum of all files of size data in a tablespace. But I need the free space available in these data files. How to get it?

    Kind regards

    007

    Use

    select sum(bytes/1024/1024/1024) GB from dba_free_space where tablespace_name='tablespace name'
    

    Know schemae storage space

    select default_tablespace from dba_users where username='schema name';
    

    Know the perticular table tablespace

    select TABLESPACE_NAME from dba_tables where table_name='table name';
    

    Utimetly you will be insert in tablespace, little matter how many data file you have and how many girl and how many of them have the space available.
    So just to worry when the table space is saturated.

  • How to calculate the space needed to move a member to another pool?

    Dear,

    We move - Member3 - member to a pool of maintenance for the upgrade of the firmware.

    My question is how can we calculate the space needed to move a member to another pool?

    I have attached some pictures of SANHQ for the pool/ability/member of the group.

    PS To consider space group not the pool area, because we have a fourth demo maintenance pool member and we it will move to the default pool for the process of upgrade only.

    Kind regards

    Turki

    Try this:

    GrpName > show Member - poolinfo
    Name State Version discs capacity FreeSpace connections pool
    ---------- ------- ---------- ----- ---------- ---------- ----------- -------
    Virt2-Mem2 V6.0.6 (R3 16 6.8 TB TB 5.53 208 ActiveP online
    51932)                                             ool
    Virt2-Mem3 V6.0.6 (R3 16 6.8 TB TB 5.95 Alterna 36 online
    51932)                                             tePoo
    l
    Virt2-Mem1 V6.0.6 online (R3 16 23.08(a) TB TB 21.44 209 ActiveP
    51932)                                             ool

    Re: cancel the mapping.  Some points to remember.  Cancel the MAPPING does not work on the replicated volumes, it's either sync replication or point-in-time standard.   Also according to the file system, it will not immediately reclaim the unused space on existing volumes.   Some file systems like VMware VMFS does not cancel the map on the fly, but offer a CLI utility to create large balloon files then delete and send him UNMAP commands simultaneously.

    The basic rule is that you must have enough space to move the member selected out of the pool.   If this isn't the case, then the operation will not be allowed.  You may end up having to add the new Member to the pool until you can move a table.

    Note: If you do not already done, then the site of Equallogic, with FW downloads is a document that describes how to set the value of disktimeout for several OS.   This allows the host (or the guest virtual machines) to cross the short breakdown during a firmware update or a failover of controllers due to a failure of the CM.

    Kind regards

  • How free space on the partition system reserved when the usual FSUTIL USN DELETEJOURNAL command does not work?

    When you try to make the system images, I found that the system reserved (100 MB) partition can be a problem if it has less than 50 MB of free space.  In my case it was after execution of FSUTIL USN DELETEJOURNAL/d/n and 34 MB free disk space is only 40 MB.  I also tried without the flag/n.

    I had just restored the system from an image so I felt comfortable to make new changes.  I deleted the fonts and directories of different language from the startup directory (the directory of fonts took about 10 MB).

    I see a file name {hex 64 bit I think} in the System Volume Information directory, which was 32MB in size.  I tried to remove it but no luck.

    After you remove the fonts, and the other languages, I had a lot of free space to perform the system image.  I'm not comfortable actually using this image, go ahead yet, but I'm looking for someone who might know what is and isn't OK to do with this partition.  I would have done it 150 MB when I installed everything first if I had an idea I was going to suffer like that on a meager 18 MB.

    Thank you.

    Use one of the two utilities listed below to increase the size of the partition system 350 b.

    Partition Wizard Home Edition (free):
    http://www.partitionwizard.com/free-partition-manager.html
    Note: There is also a CD bootable or versions of the bootable Flash drive:
    CD: http://www.partitionwizard.com/partition-wizard-bootable-cd.html
    Flash player: http://www.partitionwizard.com/bootable-flash-drive.html
    Among the features and functions: create partition, Delete partition, format partition,.
    A partition resize, move partitions, Partition recovery after an accidental deletion,.
    Convert the partition, partition Explore, Hide partition, disk surface test.
    Change the drive letter, a partition active Set, Explorer (content display) of the partition.
    Note: To achieve any task using the "Operations pending" box at the bottom or top left.

    Alternative to Partition Wizard (a bit easier to use, but Partition Wizard and EASEUS have almost identical user interfaces)
    EASEUS Partition Master Home Edition (free):
    http://www.partition-tool.com/personal.htm
    How to create a bootable USB /Flash drive: http://www.partition-tool.com/resource/manage-partition/usb-partition-manager.htm
    Partition software ALL-IN-ONE and the most convenient hard disk partition manager Kit
    Includes Partition Manager, Disk & Partition copy Wizard and Partition MBR and GUID partition GPT disk recovery Wizard (table) on Windows 2000, XP, Vista, Windows 7 and Windows Server 2000/2003/2008 (32-bit and 64-bit).
    It allows users to resizePartition b, system drive extend, copy Disk & Partition, Partition merge, Split Partition, redistribute free space, convert dynamic disk, convert to disk GPT on the MBR, Partition Recovery and much more.

    J W Stuart: http://www.pagestart.com

  • 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

  • Calculate the space used in the database!

    Hi all

    I can calculate the space used by using one of the following ways:

    1. determine the size allocated by issuing

    SELECT SUM(d.bytes/1024/1024/1024)
    FROM dba_data_files;

    2 calculate the free space by issuing

    SELECT SUM(bytes/1024/1024/1024)
    from dba_free_space;

    Space used will be the value of the first statement - value of the second statement. This is manually!

    Is it possible to combine these two queries?

    Thank you!

    Dan.

    You can certainly combine queries

    SELECT (allocated.bytes - free.bytes )/1024/1024/1024 used_gb
      FROM (select sum(bytes) bytes from dba_data_files) allocated,
          (select sum(bytes) bytes from dba_free_space) free
    

    Normally, you could group tablespace as well.

    But if you want just the amount of space used, it is probably easier to just

    SELECT sum(bytes)/1024/1024/1024 used_gb
      FROM dba_segments
    

    Justin

  • Calculate the disk space required for the INDEX

    Hello

    How to calculate the disk space required to create an INDEX? Please tell me where I can get the details of resources.

    For example:
    I need to create a non-UNIQUE INDEX on the columns, an approximate size would do.

    < PRE >
    NOT NULL DATE EVENT_DATE
    APPT_DATE_SLOT VARCHAR2 (15)
    EVENT_STATUS VARCHAR2 (4)
    < / PRE >

    The table has some 7 300 000 rows. I would like to know how to calculate too.

    All AIDS are very much appreciated.

    A rough estimate of the index space will need is possible by

    adding the actual length expected from each column, plus 6 for the rowid, 2 for the number of the X-header of the rows in the table that will be so an entry

    Date are 7 bytes internal + 15 + 4 + 2 + 6 = 34 X 7.3 M = 248200000 X General fresh for the block header, initrans, etc...

    We will use 20% overhead block or 1.2 X 248200000 = 297840000, which is about 285 M

    The actual distribution will vary according to your method of range tablespace.

    HTH - Mark D Powell.

  • How to check the table reused in oracle 10g space?

    Hello..

    Of my system, I see table size keep growing event the deletion request is running. Because of this, I would like to check either the allowed oracle to reuse space table or not? If not then how can I enable it?


    Please help me...


    Thank you
    Balleur

    You can use dbms_space.space_usage to check for free space.

    Reuse of the space will depend on whether you use MSSM or SAMS, PCT_FREE, PCT_USED and the way in which new data is inserted?

    You can reduce or move the table and rebuild the index to reclaim space.

  • to know the amount of free space in a tablespace

    Hello

    I'm learning to oracle 9i release 9.2.0.1.0. I had created a tablespace 'TOOLS' to use the default tablespace for Statspack.
    I would like to know the amount of free space available in this table space. To do this, I ran the following query, but there was no selected lines:-

    SQL > select tablespace_name, bytes from dba_free_space
    2 where nom_tablespace = 'TOOLS. '

    no selected line

    SQL > select name from v$ tablespace;

    NAME
    ------------------------------
    CWMLITE
    DRSYS
    EXAMPLE OF
    INDX
    ODM
    SYSTEM
    TOOLS
    UNDOTBS1
    USERS
    XDB
    TEMP

    Can someone say the reason for this.

    Strange that the difference of 0.625 MB does not appear in free_space...
    But anyway, this tablespace is good as COMPLETE.

  • Import the structure of the table consumes only space in GB

    Hello
    I used oracle 9i Exp commmand to export a schema structure. (If no line) There are only 150 paintings and export is perfect without any warning.
    When I try to import into another schema, I see that it consumes 3 GB of space in the default tablespace for this scheme. I checked the free space in the tablespace before importing... There are 3 GB of free space...
    When I start the import, it is full and import crashes. It engages not just yet. Im not able to understand why 3 GB of space used for just the structure of the table.

    Help, please
    Thank you

    Yes, use "COMPRESS = N" in the export command line.

    Have you not move the tables (and the clear space) in the database target before you reimport? They contain no data if LINES = N has been specified.

  • Whenever I try to update my iPhone 6 for the ios10 it is said it is impossible and that an error occurred during the installation? I ' have enough free space, so I'm not real why he keeps now.

    Whenever I try to update my iPhone 6 for the ios10 it is said it is impossible and that an error occurred during the installation? I ' have enough free space, so I'm not real why he keeps now.

    Try to update via iTunes.

    See you soon,.

    GB

  • Free space of hard drive in the MacBook air changes seemingly at random

    In recent days, my hard drive went a few GB of free space, zero KB. I check with clean my mac and see, first that my free space of RAM with the passage of time is reduced up to 10 mg and space free hard drive then start reduced up to zero KB and after 20 sec RAM & hard return to normal space (increased).

    What is the problem?

    You seem to be two distinct topics: storage and RAM. It is normal that all RAM to use. Please read the section of memory to use the activity monitor to your Mac - Apple Support.

    Never use a 'cleansing' of utilities for any purpose. Uninstall "CleanMyMac.

  • What is the actual free space on my drive?

    It shows that my apps take 139,73 GB of storage. However, he also says that the size of my disk is 499,06 GB and free space is 460,58 GB, how is that possible?

    The article Apple below can help.

    Rebuild the index on your Mac - Apple Support Spotlight

  • I have an Air of MacBk 2010 &amp; I get the mssg "system is out of memory of the application", so it is impossible to open the Mail, Safari, etc.. But sometimes I can't. I deleted photos or videos for free space; no luck. What should do?

    I get the message "your system has wearied of the memory of the Application." So I can not open Mail, Safari, or any application.  However, I can periodically, the first thing in the morning, after I Shut Down & power up, not after a reboot.  I deleted a lot of photos and videos to free up space, but not luck.  IPhotos, I get the mssg. "cannot import pictures because not enough free space on the volume containing the iPhoto library."     The problem might be related to: 1 overheating, 2 PureVPN although I installed about 5 months ago and it was very good; 3. the MB Air was diverted (I'm worried that PureVPN may have something to do with it).  Or is this a sign that I need to get a new laptop?  Thanks for any help you can offer!

    release disk space and short-term memory are two different things. If your computer is running more disk space, it will have a negative effect on your system.

    Please post a report of etrecheck for further analysis.

    www.etrecheck.com

Maybe you are looking for