Free space in datafile

hi guys,
how to find the freespace in a datafile.
Thanx,

        File Id File Name                                                                                                                                                                                                                                                         Tablespace Name                                                               Current(MB)    Smallest(MB)        Save(MB)
              6 /dbdev/LIVE/D_DEV01.dbf                                                                                                                                                                                                                                       D_DEV (8192)                                                                          512             512               0
             12 /dbprod6/LIVE/D_DYN106.dbf                                                                                                                                                                                                                                    D_DYN1 (8192)                                                                        1024            1024               1
             11 /dbprod6/LIVE/D_DYN105.dbf                                                                                                                                                                                                                                    D_DYN1 (8192)                                                                        1024            1024               1
             25 /db_prod2/LIVE/I_DYN104.dbf                                                                                                                                                                                                                                   I_DYN1 (8192)                                                                        1024            1024               1
             13 /dbprod6/LIVE/D_DYN107.dbf                                                                                                                                                                                                                                    D_DYN1 (8192)                                                                        1024            1024               1
              7 /dbprod4/LIVE/D_DYN101.dbf                                                                                                                                                                                                                                    D_DYN1 (8192)                                                                        1024            1024               1
             26 /db_prod2/LIVE/I_DYN105.dbf                                                                                                                                                                                                                                   I_DYN1 (8192)                                                                        1024            1024               1
             29 /db_prod3/LIVE/I_PARTN02.dbf                                                                                                                                                                                                                                  I_PARTN (8192)                                                                       1024            1024               1
              9 /dbprod4/LIVE/D_DYN103.dbf                                                                                                                                                                                                                                    D_DYN1 (8192)                                                                        1024            1024               1
              8 /dbprod4/LIVE/D_DYN102.dbf                                                                                                                                                                                                                                    D_DYN1 (8192)                                                                        1024            1024               1
              5 /dbarch/LIVE/D_ARCH01.dbf                                                                                                                                                                                                                                     D_ARCH (8192)                                                                        1024            1024               1
             10 /dbprod4/LIVE/D_DYN104.dbf                                                                                                                                                                                                                                    D_DYN1 (8192)                                                                        1536            1536               1
              3 /dbprod1/LIVE/sysaux01.dbf                                                                                                                                                                                                                                    SYSAUX (8192)                                                                         420             419               2
             48 /db_prod3/LIVE/undotbs02.dbf                                                                                                                                                                                                                                  UNDOTBS1 (8192)                                                                        20              19               2
              4 /dbprod1/LIVE/users01.dbf                                                                                                                                                                                                                                     USERS (8192)                                                                            5               1               5
             19 /dbprod4/LIVE/D_STAT101.dbf                                                                                                                                                                                                                                   D_STAT1 (8192)                                                                         50              41              10
              1 /dbprod1/LIVE/system01.dbf                                                                                                                                                                                                                                    SYSTEM (8192)                                                                         647             619              29
             18 /dbprod4/LIVE/D_PAYROLL01.dbf                                                                                                                                                                                                                                 D_PAYROLL (8192)                                                                       50              22              29
             31 /db_prod2/LIVE/I_STAT101.dbf                                                                                                                                                                                                                                  I_STAT1 (8192)                                                                         50              14              37
             27 /db_prod2/LIVE/I_ENV01.dbf                                                                                                                                                                                                                                    I_ENV (8192)                                                                           50               2              49
             15 /dbprod6/LIVE/D_ENV01.dbf                                                                                                                                                                                                                                     D_ENV (8192)                                                                           50               2              49
             20 /db_prod3/LIVE/D_TMS.dbf                                                                                                                                                                                                                                      D_TMS (8192)                                                                          150             102              49
             30 /dbprod5/LIVE/I_PAYROLL1.dbf                                                                                                                                                                                                                                  I_PAYROLL (8192)                                                                       50               1              50
             21 /dbprod6/LIVE/D_WORK01.dbf                                                                                                                                                                                                                                    D_WORK (8192)                                                                        1024             927              98
              2 /dbprod1/LIVE/undotbs01.dbf                                                                                                                                                                                                                                   UNDOTBS1 (8192)                                                                       610             361             250
             28 /db_prod3/LIVE/I_PARTN01.dbf                                                                                                                                                                                                                                  I_PARTN (8192)                                                                       1536            1176             361
             24 /db_prod2/LIVE/I_DYN103.dbf                                                                                                                                                                                                                                   I_DYN1 (8192)                                                                        1536            1154             383
             22 /db_prod2/LIVE/I_DYN101.dbf                                                                                                                                                                                                                                   I_DYN1 (8192)                                                                        1536            1131             406
             14 /dbprod6/LIVE/D_DYN108.dbf                                                                                                                                                                                                                                    D_DYN1 (8192)                                                                        1024             616             409
             17 /db_prod3/LIVE/D_PARTN02.dbf                                                                                                                                                                                                                                  D_PARTN (8192)                                                                       1024             567             458
             16 /db_prod3/LIVE/D_PARTN01.dbf                                                                                                                                                                                                                                  D_PARTN (8192)                                                                       1024             555             470
             32 /db_prod2/LIVE/I_WORK.dbf                                                                                                                                                                                                                                     I_WORK (8192)                                                                        1024             511             514
             23 /db_prod2/LIVE/I_DYN102.dbf                                                                                                                                                                                                                                   I_DYN1 (8192)                                                                        1536             977             560Nice.
Adith

Similar Messages

  • How to find free space in datafiles of perticular schema?

    hai,
    whats the query to find out free space in datafiles and index files related free space for perticular schmea?
    Regards
    dba

    There are lots of scripts available on Metalink which report free space in tablespaces/datafiles.
    Note: 1019999.6 - Script: To List Tablespace, Datafiles and Free Space
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=1019999.6
    Note: 145531.1 - How to Determine Which Tablespaces Do Not Have Enough Free Space
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=145531.1

  • Script for Free Space in Datafiles

    Hi
    Got the below script from metalink [130866.1] to identify free space within a data file.Couple of questions
    1)Is dba_Free_Space an exact indicator of how much space is available in a file.
    2) What is the significance of using blocks in vs using bytes.
    cursor c_freespace(v_file_id in number) is
    select block_id, block_id+blocks max_block
    from dba_free_space
    where file_id = v_file_id
    order by block_id desc;
    Thanks in advance for you help.
    Script for checking backwards for free space at end of file
    REM Script is meant for Oracle version 9 and higher
    REM -----------------------------------------------
    set serveroutput on
    exec dbms_output.enable(1000000);
    declare
    cursor c_dbfile is
    select f.tablespace_name,f.file_name,f.file_id,f.blocks,t.block_size
    from dba_data_files f,
    dba_tablespaces t
    where f.tablespace_name = t.tablespace_name
    and t.status = 'ONLINE'
    order by f.tablespace_name,f.file_id;
    cursor c_freespace(v_file_id in number) is
    select block_id, block_id+blocks max_block
    from dba_free_space
    where file_id = v_file_id
    order by block_id desc;
    /* variables to check settings/values */
    dummy number;
    checkval varchar2(10);
    block_correction number;
    /* running variable to show (possible) end-of-file */
    file_min_block number;
    /* variables to check if recycle_bin is on and if extent as checked is in ... */
    recycle_bin boolean:=false;
    extent_in_recycle_bin boolean;
    /* exception handler needed for non-existing tables note:344940.1 */
    sqlstr varchar2(100);
    table_does_not_exist exception;
    pragma exception_init(table_does_not_exist,-942);
    begin
    /* recyclebin is present in Oracle 10.2 and higher and might contain extent as checked */
    begin
    select value into checkval from v$parameter where name = 'recyclebin';
    if checkval = 'on'
    then
    recycle_bin := true;
    end if;
    exception
    when no_data_found
    then
    recycle_bin := false;
    end;
    /* main loop */
    for c_file in c_dbfile
    loop
    /* initialization of loop variables */
    dummy :=0;
    extent_in_recycle_bin := false;
    file_min_block := c_file.blocks;
    begin
    <<check_free>>
    for c_free in c_freespace(c_file.file_id)
    loop
    /* if blocks is an uneven value there is a need to correct with -1 to compare with end-of-file which is even */
    block_correction := (0-mod(c_free.max_block,2));
    if file_min_block = c_free.max_block+block_correction
    then
    /* free extent is at end so file can be resized */
    file_min_block := c_free.block_id;
    else
    /* no more free extent at end of file, file cannot be further resized */
    exit check_free;
    end if;
    end loop;
    end;
    /* check if file can be resized, minimal size of file 16 blocks */
    if (file_min_block = c_file.blocks) or (c_file.blocks <= 16)
    then
    dbms_output.put_line('Tablespace: '||c_file.tablespace_name||' Datafile: '||c_file.file_name);
    dbms_output.put_line('cannot be resized no free extents found');
    dbms_output.put_line('.');
    else
    /* file needs minimal no of blocks which does vary over versions */
    if file_min_block < 16
    then
    file_min_block := 16;
    end if;
    dbms_output.put_line('Tablespace: '||c_file.tablespace_name||' Datafile: '||c_file.file_name);
    dbms_output.put_line('current size: '||(c_file.blocks*c_file.block_size)/1024||'K'||' can be resized to: '||round((file_min_block*c_file.block_size)/1024)||'K (reduction of: '||round(((c_file.blocks-file_min_block)/c_file.blocks)*100,2)||' %)');
    /* below is only true if recyclebin is on */
    if recycle_bin
    then
    begin
    sqlstr:='select distinct 1 from recyclebin$ where file#='||c_file.file_id;
    execute immediate sqlstr into dummy;
    if dummy > 0
    then
    dbms_output.put_line('Extents found in recyclebin for above file/tablespace');
    dbms_output.put_line('Implying that purge of recyclebin might be needed in order to resize');
    dbms_output.put_line('SQL> purge tablespace '||c_file.tablespace_name||';');
    end if;
    exception
    when no_data_found
    then null;
    when table_does_not_exist
    then null;
    end;
    end if;
    dbms_output.put_line('SQL> alter database datafile '''||c_file.file_name||''' resize '||round((file_min_block*c_file.block_size)/1024)||'K;');
    dbms_output.put_line('.');
    end if;
    end loop;
    end;
    Example output for Oracle version 9 and higher:
    Tablespace: TEST Datafile: /oradata/v112/test01.dbf
    cannot be resized no free extents found
    Tablespace: UNDOTBS1 Datafile: /oradata/v112/undotbs01.dbf
    current size: 9384960K can be resized to: 106496K (reduction of: 98.87 %)
    SQL> alter database datafile '/oradata/v112/undotbs01.dbf' resize 106496K;
    Tablespace: USERS Datafile: /oradata/v112/users01.dbf
    current size: 328960K can be resized to: 117248K (reduction of: 64.36 %)
    Extents found in recyclebin for above file/tablespace
    Implying that purge of recyclebin might be needed in order to resize
    SQL> purge tablespace USERS;
    SQL> alter database datafile '/oradata/v112/users01.dbf' resize 117248K

    Hi
    Got the below script from metalink [130866.1] to identify free space within a data file.Couple of questions
    1)Is dba_Free_Space an exact indicator of how much space is available in a file.
    2) What is the significance of using blocks in vs using bytes.
    cursor c_freespace(v_file_id in number) is
    select block_id, block_id+blocks max_block
    from dba_free_space
    where file_id = v_file_id
    order by block_id desc;
    Thanks in advance for you help.
    Script for checking backwards for free space at end of file
    REM Script is meant for Oracle version 9 and higher
    REM -----------------------------------------------
    set serveroutput on
    exec dbms_output.enable(1000000);
    declare
    cursor c_dbfile is
    select f.tablespace_name,f.file_name,f.file_id,f.blocks,t.block_size
    from dba_data_files f,
    dba_tablespaces t
    where f.tablespace_name = t.tablespace_name
    and t.status = 'ONLINE'
    order by f.tablespace_name,f.file_id;
    cursor c_freespace(v_file_id in number) is
    select block_id, block_id+blocks max_block
    from dba_free_space
    where file_id = v_file_id
    order by block_id desc;
    /* variables to check settings/values */
    dummy number;
    checkval varchar2(10);
    block_correction number;
    /* running variable to show (possible) end-of-file */
    file_min_block number;
    /* variables to check if recycle_bin is on and if extent as checked is in ... */
    recycle_bin boolean:=false;
    extent_in_recycle_bin boolean;
    /* exception handler needed for non-existing tables note:344940.1 */
    sqlstr varchar2(100);
    table_does_not_exist exception;
    pragma exception_init(table_does_not_exist,-942);
    begin
    /* recyclebin is present in Oracle 10.2 and higher and might contain extent as checked */
    begin
    select value into checkval from v$parameter where name = 'recyclebin';
    if checkval = 'on'
    then
    recycle_bin := true;
    end if;
    exception
    when no_data_found
    then
    recycle_bin := false;
    end;
    /* main loop */
    for c_file in c_dbfile
    loop
    /* initialization of loop variables */
    dummy :=0;
    extent_in_recycle_bin := false;
    file_min_block := c_file.blocks;
    begin
    <<check_free>>
    for c_free in c_freespace(c_file.file_id)
    loop
    /* if blocks is an uneven value there is a need to correct with -1 to compare with end-of-file which is even */
    block_correction := (0-mod(c_free.max_block,2));
    if file_min_block = c_free.max_block+block_correction
    then
    /* free extent is at end so file can be resized */
    file_min_block := c_free.block_id;
    else
    /* no more free extent at end of file, file cannot be further resized */
    exit check_free;
    end if;
    end loop;
    end;
    /* check if file can be resized, minimal size of file 16 blocks */
    if (file_min_block = c_file.blocks) or (c_file.blocks <= 16)
    then
    dbms_output.put_line('Tablespace: '||c_file.tablespace_name||' Datafile: '||c_file.file_name);
    dbms_output.put_line('cannot be resized no free extents found');
    dbms_output.put_line('.');
    else
    /* file needs minimal no of blocks which does vary over versions */
    if file_min_block < 16
    then
    file_min_block := 16;
    end if;
    dbms_output.put_line('Tablespace: '||c_file.tablespace_name||' Datafile: '||c_file.file_name);
    dbms_output.put_line('current size: '||(c_file.blocks*c_file.block_size)/1024||'K'||' can be resized to: '||round((file_min_block*c_file.block_size)/1024)||'K (reduction of: '||round(((c_file.blocks-file_min_block)/c_file.blocks)*100,2)||' %)');
    /* below is only true if recyclebin is on */
    if recycle_bin
    then
    begin
    sqlstr:='select distinct 1 from recyclebin$ where file#='||c_file.file_id;
    execute immediate sqlstr into dummy;
    if dummy > 0
    then
    dbms_output.put_line('Extents found in recyclebin for above file/tablespace');
    dbms_output.put_line('Implying that purge of recyclebin might be needed in order to resize');
    dbms_output.put_line('SQL> purge tablespace '||c_file.tablespace_name||';');
    end if;
    exception
    when no_data_found
    then null;
    when table_does_not_exist
    then null;
    end;
    end if;
    dbms_output.put_line('SQL> alter database datafile '''||c_file.file_name||''' resize '||round((file_min_block*c_file.block_size)/1024)||'K;');
    dbms_output.put_line('.');
    end if;
    end loop;
    end;
    Example output for Oracle version 9 and higher:
    Tablespace: TEST Datafile: /oradata/v112/test01.dbf
    cannot be resized no free extents found
    Tablespace: UNDOTBS1 Datafile: /oradata/v112/undotbs01.dbf
    current size: 9384960K can be resized to: 106496K (reduction of: 98.87 %)
    SQL> alter database datafile '/oradata/v112/undotbs01.dbf' resize 106496K;
    Tablespace: USERS Datafile: /oradata/v112/users01.dbf
    current size: 328960K can be resized to: 117248K (reduction of: 64.36 %)
    Extents found in recyclebin for above file/tablespace
    Implying that purge of recyclebin might be needed in order to resize
    SQL> purge tablespace USERS;
    SQL> alter database datafile '/oradata/v112/users01.dbf' resize 117248K

  • Oracle 11g - How to repair block corruption(on free space) in datafile

    Hi,
    I have a tablesopace with 3 datafiles, out of which one datafile has corrupted block. But no objects or data is affected as the corrupted block os in free space. This was shown in the alert logs.
    Please see below the details:
    Wed Apr 06 15:30:04 2011
    SMON: Restarting fast_start parallel rollback
    SMON: ignoring slave err,downgrading to serial rollback
    ORACLE Instance geooap (pid = 12) - Error 1578 encountered while recovering transaction (10, 6) on object 149755.
    Errors in file f:\oracle11g\diag\rdbms\geooap\geooap\trace\geooap_smon_5540.trc:
    ORA-01578: ORACLE data block corrupted (file # 7, block # 54053)
    ORA-01110: data file 7: 'F:\ORACLE11G\ORADATA\GEOOAP\ORDER_DATA_01.DBF'
    GEOAP:
    Fri Apr 01 14:57:48 2011
    Errors in file f:\oracle11g\diag\rdbms\geop\geop\trace\geop_arc1_2156.trc:
    ORA-00235: control file read without a lock inconsistent due to concurrent update
    Fri Apr 01 14:57:58 2011
    ================================================================
    The corruption is being reported in a free space block of the ORDER_DATA_01.DBF.
    I’ve checked all the tables (and indexes) in this tablespace and none report corruption.
    =====================================================Is there any action I need to take to remove corruption at this point?It is not affected any operation on the database yet.
    What is the best way to do get rid of the corrupt block, without dropping and rebuillding the full tablespace(which is around 6 GB -total of 3 datafiles)
    Thanks a lot

    Can RMAN recover the datablock from this cold backup(which is a week old, the data file was not corrupted then) ?Please note that to do the recovery, you would need the backup and the archivelog files since the backup. Think about what you are asking to do. Its a single block whose recovery you are asking from a week old backup which obviously would be on an much older SCN compared to the rest of the database. How would you make that block consistent with the rest of the datafile. If you don't have archivelog in that db whose block is corrupted, you may forget that block and any data that it might ever had. Also, please read the documentation about the block recovery which explains the requirements very clearly,
    http://download.oracle.com/docs/cd/E11882_01/backup.112/e10642/rcmblock.htm#BRADV89784
    From the above link, 1st point,
    The target database must run in ARCHIVELOG mode and be open or mounted with a current control file.HTH
    Aman....

  • Reclaim free space in datafiles

    Hello:
    I have taken over management of one of our test servers with Oracle 9i on Windows2000 and have noticed that there are two files that are much larger than the space that is actually being used:
    D:\ORACLE\ORADATA\ORCL\SYSTEM01.DBF - 17964M - (Used 1,542M)
    D:\ORACLE\ORADATA\ORCL\DATA01.DBF - 12511M - (Used 243M)
    How can I reclaim all of this unused space?

    Remember it is always best to reclaim space by moving all the objects to another tablespace and reclaiming all space. This will free up space within the tables and indexes as well.
    I use the following script to generate the commands for me:
    resizea.sql:
    drop table alan99;
    set pages 50
    create table alan99 as
    select max(block_id+blocks) block_id,file_id from dba_extents
    group by file_id;
    column tablespace_name format a15
    column pct format 999.99
    set wrap off
    set lines 120
    set trunc off
    column file_id format 999
    spool resizea.lst
    select b.bytes/1024/1024-a.bytes/1024/1024 CURRENT_meg,
    a.file_id,a.tablespace_Name,'alter database datafile '''||b.file_name||''' resize '
    ||trunc(c.block_id*8192/1024/1024+1)||'m;'
    from dba_free_space a,dba_data_files b, alan99 c
    where a.file_id=b.file_id
    and a.block_id=c.block_id and a.file_id=c.file_id
    order by current_meg;
    set termout off
    drop table alan99;
    set termout on
    spool off
    select 'Your output has been saved as resizea.lst' from dual;
    A script that will tell you what is inside is:
    column owner format a30
    column object format a30
    set lines 120
    set wrap off
    set trunc off
    set pages 50
    set feedback on
    column file_id format 999
    select     /*+ Rule */     'free space' owner     /*"owner" of free space*/
    ,          ' ' object          /*blank object name*/
    ,          file_id                    /*file id for the extent header*/
    ,          block_id               /*block id for the extent header*/
    ,          blocks                    /*length of the extent, in blocks*/
    from          dba_free_space
    where          file_id=&1
    union
    select     /*+ Rule */ substr(owner,1,20)||' '||substr(segment_type,1,9) /*owner name (first 20 chars)*/
    ,          substr(segment_name,1,32)||'.'||partition_name     /*segment name*/
    ,          file_id                    /*file id for the extent header*/
    ,          block_id               /*block id for the extent header*/
    ,          blocks                    /*length of the extent, in blocks*/
    from           dba_extents
    where          file_id=&1
    order by     3,4
    /

  • Query to find out pertcular schema related datafiles free space????

    hai,
    whats the query to find out free space in datafiles and index files related free space for perticular schmea?
    Regards
    dba

    If you wish to get free space in index tablespace then use following query:
    select b.tablespace_name, tbs_size SizeMb, a.free_space FreeMb
    from
    (select tablespace_name, round(sum(bytes)/1024/1024 ,2) as free_space
    from dba_free_space group by tablespace_name) a,
    (select tablespace_name, sum(bytes)/1024/1024 as tbs_size
    from dba_data_files group by tablespace_name
    UNION
    select tablespace_name, sum(bytes)/1024/1024 tbs_size
    from dba_temp_files
    group by tablespace_name ) b
    where a.tablespace_name(+)=b.tablespace_name
    and a.tablespace_name='INDX';
    and if you get info for all tablespace then :
    select b.tablespace_name, tbs_size SizeMb, a.free_space FreeMb
    from
    (select tablespace_name, round(sum(bytes)/1024/1024 ,2) as free_space
    from dba_free_space group by tablespace_name) a,
    (select tablespace_name, sum(bytes)/1024/1024 as tbs_size
    from dba_data_files group by tablespace_name
    UNION
    select tablespace_name, sum(bytes)/1024/1024 tbs_size
    from dba_temp_files
    group by tablespace_name ) b
    where a.tablespace_name(+)=b.tablespace_name;

  • How much free space will be left after import ?

    Hallo. I need to replace all schemas on integration server using those on production server. I want to know how much free space will be left on /data at integration server after this kind of refresh. Both databases are Oracle 9 so I will use exp/imp. Here is how I do it. Could you check if I think good? On target server there is 72 GB free space on /data.
    Filesystem Size Used Avail Capacity Mounted
    /dev/vgsmxdata/lvsmxcopy 194.74G 122.56G 72.18G 63% /data
    Overall size of schemas to be exported from SOURCE_DB is 150 GB. The same schemas on TARGET_DB takes 90GB. So difference is 60GB. Free space in datafiles in TARGET_DB is 30GB. Does it mean that in first place the free space in datafiles will be filled and after that datafiles would be extended? That would mean that a database would extend to 150GB and free space on /data would be 40 GB after refresh. Am I right?
    SELECT 'TOTAL :'||SUM(ALLOCATED_MB),
    'USED :'||SUM(USED_MB) USED,
    'FREE :'||SUM(FREE_SPACE_MB)
    FROM (SELECT SUBSTR (df.NAME, 1, 40) file_name, df.bytes / 1024 / 1024 allocated_mb,
    ((df.bytes / 1024 / 1024) - NVL (SUM (dfs.bytes) / 1024 / 1024, 0)) used_mb,
    NVL (SUM (dfs.bytes) / 1024 / 1024, 0) free_space_mb
    FROM v$datafile df, dba_free_space dfs
    WHERE df.file# = dfs.file_id(+)
    GROUP BY dfs.file_id, df.NAME, df.file#, df.bytes
    ORDER BY file_name);
    SOURCE_DB@Server1
    TOTAL(MB) :170860.984375
    USED(MB) :152777.859375
    FREE(MB) :18083.125
    TARGET_DB@Server2
    TOTAL(MB) :121634,984375
    USED(MB) :92853,109375
    FREE(MB) :28781,875
    Edited by: Przemek P on Oct 9, 2012 10:48 AM

    Przemek P wrote:
    Hallo. I need to replace all schemas from one server to another. I want to know how much free space will be left on /data after this kind of refresh. Both servers are Oracle 9 so I will use exp/imp. Here is how I do it. Could you check if I think good? On target server there is 72 GB free space on /data.
    Filesystem Size Used Avail Capacity Mounted
    /dev/vgsmxdata/lvsmxcopy 194.74G 122.56G 72.18G 63% /data
    Overall size of schemas to be exported from SOURCE_DB is 150 GB. The same schemas on TARGET_DB takes 90GB. So difference is 60GB. Free space in datafiles in TARGET_DB is 30GB. Does it mean that in first place the free space in datafiles will be filled and after that datafiles would be extended? That would mean that a database would extend to 150GB and free space on /data would be 40 GB after refresh. Am I right?
    yes

  • How does repeated snapshot import impact tablespace free space?

    Hello,
    Our client is doing DEC-2014 reconciliation in FCM. Every time he changes profile mappings he has to do snapshot import again. So far he did at least ten times snapshot import for DEC-2014 period. In our FCM database Tablespace FCM_TX_TS_DATA free space is reduced 7 GB for this period already by querrying dba_free_space table.
    By my understanding during the repeated snapshot import for the same period, the previous load data is deleted and the current load data is inserted. After data delete the table space will not be set free, and high water mark will not be reset.
    During snapshot import will the deleted blocks from the previous load be reclaimed when new load data is inserted in the table? If not, what is the best way to reclaim the free space in FCM_TX_TS_DATA tablespace?
    Thanks,
    Hongfei Liu (AT&T)

    Przemek P wrote:
    Hallo. I need to replace all schemas from one server to another. I want to know how much free space will be left on /data after this kind of refresh. Both servers are Oracle 9 so I will use exp/imp. Here is how I do it. Could you check if I think good? On target server there is 72 GB free space on /data.
    Filesystem Size Used Avail Capacity Mounted
    /dev/vgsmxdata/lvsmxcopy 194.74G 122.56G 72.18G 63% /data
    Overall size of schemas to be exported from SOURCE_DB is 150 GB. The same schemas on TARGET_DB takes 90GB. So difference is 60GB. Free space in datafiles in TARGET_DB is 30GB. Does it mean that in first place the free space in datafiles will be filled and after that datafiles would be extended? That would mean that a database would extend to 150GB and free space on /data would be 40 GB after refresh. Am I right?
    yes

  • Free space available in tablespace

    Hi, Any one help me how to check how much free space available on a particular Tablespace. Appreciate if you provide query.
    Thanks & Regards
    Bhaskara

    This SQL will return free space by datafile in the tablespace.
    SELECT a.name FileName, a.status, c.bytes/1024 CurrentSize, a.create_bytes/1024 SizeCreated,
    sum(b.bytes/1024) FreeSpace, max(b.bytes/1024) LargeFragment
    from sys.v_$datafile a, sys.dba_free_space b, sys.dba_data_files c
    where a.file# = b.file_id(+)
    and a.file#=c.file_id
    and c.tablespace_name='XXXXXXXXXXXXXXXXX'
    group by a.name, a.status, c.bytes, a.create_bytes
    ORDER BY a.name;
    I just posted an integrated set of GUI tools to administer the Oracle database.
    One of the many functions is to view and maintain all database objects including tablespaces and datafiles. It also has a graphical function to monitor space allocation for tablespaces. You may need same help to get started, so feel free to contact me ([email protected]). The link is http://www.barsoft.net/

  • Block Corruption In Free Space Chuck Of A Datafile

    Hi all,
    I have run into this issue where both dbv and rman have caught a block corruption on one of the datafiles. When I checked these blocks, they did not belong to any segments and I was able to verify that this block ID falls in the block_id + blocks range in the dba_free_space where file_id = 41.
    My questions are ...
    - why is rman complaining about a bad block in free space? It will never need to back it up any way?
    - According to note 28814.1, this type of corruption can be ignored and if when oracle needs to use this block, it will simply create/rewrite a new image without the corrupted data. Have you been affected by this issue? If yes, what did you do?
    Thank you

    1. "why is rman complaining about a bad block in free space? It will never need to back it up any way?"
    Because it is doing its job.
    2. "Have you been affected by this issue? If yes, what did you do?"
    In what version? I generally find it helpful to read the docs and check discussions of issues on metalink.

  • Free space problem in / with oracle-xe-11.2.0-1.0.x86_64

    Hi,
    I'm trying to install Oracle-xe-11g on Red Hat 5.6, but I have the following problem:
    [root@localhost] rpm -ivhf oracle-xe-11.2.0-1.0.x86_64.rpm
    Preparing... ########################################### [100%]
    installing package oracle-xe-11.2.0-1.0.x86_64 needs 180MB on the / filesystem
    However I have enough free space in /, df command shows:
    Filesystem 1K-blocks Used Available Use% Mounted on
    /dev/sda2 3960348 3326380 429544 89% /
    /dev/sda3 30368632 4066116 24734976 15% /home
    /dev/sda1 46633 11310 32915 26% /boot
    tmpfs 2198372 0 2198372 0% /dev/shmHow do I fix it?
    Thank you in advantage
    Edited by: 905637 on 03-ene-2012 4:43

    How do I fix it?Add Space.
    Looks like you've got a less than 4G total for / with about 420MB free. That's nowhere near enough space, out-of-the-box the datafiles alone take about 1G.
    Try bumping sda2 up another 4G, or add a (at least) 4G partition and mount it at /usr/lib/oracle
    Per the Linux install guide ... "Disk Space ... 1.5GB minimum" http://docs.oracle.com/cd/E17781_01/install.112/e18802/toc.htm#BABHICJH
    Edited by: clcarter on Jan 3, 2012 11:40 AM
    add install doc URL

  • Claiming of free space in data files

    I have a problem for claiming the free space in few data files .There is the data in the files at fragmented places i.e. the free space is below the high water mark.DB is production db and Export/Import is not possible due to time consideration. How to get back that space. Please reply soon.....

    Dolly, the term HWM in Oracle is normally only used to describe the last used block in a table allocation. There is no way to reclaim unused blocks below the HWM in a table without reorganizing the table though Oracle will resuse the space for new rows if the pct_used threshold allows (or ASSM) allows it do so.
    You can sometimes release free (unused) blocks above the HWM of a table using the alter table shrink option.
    You can perform a similar function on extendable datafiles between the last allocated object extent and the end of file.
    As Justin said, you need to explain your situation better.
    -- Mark D Powell --

  • Re-use of free space

    Hi,
    after a large client delete or after important data archiving, does Oracle re-use new freed space into datafile ? ... we need to delete a large client and then copy e new mid-size client but we haven't a lot of free space in dev system.
    Regards.
    Ganimede Dignan.

    Hello Ganimede,
    >> after a large client delete or after important data archiving, does Oracle re-use new freed space into datafile ?
    Oracle reuses the freed space inside the same segment. For example if you have freed space in table MSEG, you can reuse the allocated space only for table MSEG (=same segment).
    For indexes its a little bit "special", because the freed space (in blocks) can only be reused if they are completely empty, because of the index must be sorted.
    You can take a look at the ALL_TABLES on column AVG_SPACE to estimate the freed size in the tables (but take care, the values are only updated on statistic gathering):
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_2105.htm#i1592091
    Regards
    Stefan

  • Table Partitions and Rolling Window: free space not reclaimed

    I have a couple of processes that involve the rolling window scenario where we drop an old partition and add a new partition monthly. We are seeing, however, that free space is not being reclaimed, and so I keep having to feed new datafiles into the tablespace (which is LMT). I was (mistakenly, it seems) under the impression that dropping a partition frees up that space for re-use.
    We're currently on Oracle 10gR2 (10.2.0.2), but these tablespaces were orginally created in 9i. I've read that one solution is to implement "table shrinking," however I also see that is only available on tables in an ASSM tablespace. I see that ASSM is the default for tablespaces in 10gR2, but since my tablespaces were created in 9i, I assume they are not ASSM.
    I'd like to see what other people think of this scenario. Surely a lot of people do the rolling window scenario and need space reclaimed.

    No, it is of concern because Sanadra was messing with the partitions. She could have inadvertantly caused something to happen, in this case the free-space issue, and it's imperative to get all of the details.
    My iMac 27' Late-2012 does not have a fusion drive, yet shows that the type is "internal" the original poster doesn't indicate that.

  • ORA-1653: unable to extend table - but enough space for datafile

    We encountered this problem in one of our database Oracle Database 10g Release 10.2.0.4.0
    We have all datafiles in all tablespaces specified with MAXSIZE and AUTOEXTEND ON. But last week database could not extend table size
    Wed Dec  8 18:25:04 2013
    ORA-1653: unable to extend table PCS.T0102 by 128 in                 tablespace PCS_DATA
    ORA-1653: unable to extend table PCS.T0102 by 8192 in                tablespace PCS_DATA
    Wed Dec  8 18:25:04 2013
    ORA-1653: unable to extend table PCS.T0102 by 128 in                 tablespace PCS_DATA
    ORA-1653: unable to extend table PCS.T0102 by 8192 in                tablespace PCS_DATA
    Wed Dec  8 18:25:04 2013
    ORA-1653: unable to extend table PCS.T0102 by 128 in                 tablespace PCS_DATA
    ORA-1653: unable to extend table PCS.T0102 by 8192 in                tablespace PCS_DATA
    Datafile was created as ... DATAFILE '/u01/oradata/PCSDB/PCS_DATA01.DBF' AUTOEXTEND ON  NEXT 50M MAXSIZE 31744M
    Datafile PCS_DATA01.DBF had only 1GB size. Maximum size is 31GB but database did not want to extend this datafile.
    We used temporary solution and we added new datafile to same tablespace. After that database and our application started to work correctly.
    There is enough free space for database datafiles.
    Do you have some ideas where could be our problem and what should we check?
    Thanks

    ShivendraNarainNirala wrote:
    Hi ,
    Here i am sharing one example.
    SQL> select owner,table_name,blocks,num_rows,avg_row_len,round(((blocks*8/1024)),2)||'MB' "TOTAL_SIZE",
      2   round((num_rows*avg_row_len/1024/1024),2)||'Mb' "ACTUAL_SIZE",
      3   round(((blocks*8/1024)-(num_rows*avg_row_len/1024/1024)),2) ||'MB' "FRAGMENTED_SPACE"
      4   from dba_tables where owner in('DWH_SCHEMA1','RM_SCHEMA_DDB','RM_SCHEMA') and round(((blocks*8/1024)-(num_rows*avg_row_len/1024/1024)),2) > 10 ORDER BY FRAGMENTED_SPACE;
    OWNER           TABLE_NAME                        BLOCKS   NUM_ROWS AVG_ROW_LEN TOTAL_SIZE           ACTUAL_SIZE          FRAGMENTED_SPACE
    DWH_SCHEMA1     FP_DATA_WLS                        14950     168507          25 116.8MB              4.02Mb               112.78MB
    SQL> select tablespace_name from dba_segments where segment_name='FP_DATA_WLS' and owner='DWH_SCHEMA1';
    TABLESPACE_NAME
    DWH_TX_DWH_DATA
    SELECT /* + RULE */  df.tablespace_name "Tablespace",
           df.bytes / (1024 * 1024) "Size (MB)",
           SUM(fs.bytes) / (1024 * 1024) "Free (MB)",
           Nvl(Round(SUM(fs.bytes) * 100 / df.bytes),1) "% Free",
           Round((df.bytes - SUM(fs.bytes)) * 100 / df.bytes) "% Used"
      FROM dba_free_space fs,
           (SELECT tablespace_name,SUM(bytes) bytes
              FROM dba_data_files
             GROUP BY tablespace_name) df
    WHERE fs.tablespace_name   = df.tablespace_name
    GROUP BY df.tablespace_name,df.bytes
    UNION ALL
    SELECT /* + RULE */ df.tablespace_name tspace,
           fs.bytes / (1024 * 1024),
           SUM(df.bytes_free) / (1024 * 1024),
           Nvl(Round((SUM(fs.bytes) - df.bytes_used) * 100 / fs.bytes), 1),
           Round((SUM(fs.bytes) - df.bytes_free) * 100 / fs.bytes)
      FROM dba_temp_files fs,
           (SELECT tablespace_name,bytes_free,bytes_used
              FROM v$temp_space_header
             GROUP BY tablespace_name,bytes_free,bytes_used) df
    WHERE fs.tablespace_name   = df.tablespace_name
    GROUP BY df.tablespace_name,fs.bytes,df.bytes_free,df.bytes_used
    ORDER BY 4 DESC;
    set lines 1000
    col FILE_NAME format a60
    SELECT SUBSTR (df.NAME, 1, 60) file_name, df.bytes / 1024 / 1024 allocated_mb,
    ((df.bytes / 1024 / 1024) - NVL (SUM (dfs.bytes) / 1024 / 1024, 0))
    used_mb,
    NVL (SUM (dfs.bytes) / 1024 / 1024, 0) free_space_mb
    FROM v$datafile df, dba_free_space dfs
    WHERE df.file# = dfs.file_id(+)
    GROUP BY dfs.file_id, df.NAME, df.file#, df.bytes
    ORDER BY file_name;
    Tablespace                      Size (MB)  Free (MB)     % Free     % Used
    DWH_TX_DWH_DATA                     11456       8298         72         28
    FILE_NAME                                                    ALLOCATED_MB    USED_MB FREE_SPACE_MB
    /data1/FPDIAV1B/dwh_tx_dwh_data1.dbf                                 1216       1216             0
    /data1/FPDIAV1B/dwh_tx_dwh_data2.dbf                                10240       1942          8298
    SQL> alter database datafile '/data1/FPDIAV1B/dwh_tx_dwh_data2.dbf' resize 5G;
    alter database datafile '/data1/FPDIAV1B/dwh_tx_dwh_data2.dbf' resize 5G
    ERROR at line 1:
    ORA-03297: file contains used data beyond requested RESIZE value
    Although , we did moved the tables into another TB , but it doesn't resolve the problem unless we take export and drop the tablespace aand again import it .We also used space adviser but in vain .
    As far as metrics and measurement is concerned , as per my experience its based on blocks which is sparse in nature related to HWM in the tablespace.
    when it comes to partitions , just to remove fragmentation by moving their partitions doesn't help  .
    Apart from that much has been written about it by Oracle Guru like you .
    warm regards
    Shivendra Narain Nirala
    how does free space differ from fragmented space?
    is all free space considered by you to be fragmented?
    "num_rows*avg_row_len" provides useful result only if statistics are current & accurate.

Maybe you are looking for

  • DPS Single Edition - what if Apple rejects your app?

    If you pay for a single edition license and Apple rejects your application after viewing, where do you stand with Adobe? Are you able to make the changes needed to the app, then rebuild and re-submit? Is it like a professional, or enterprise edition

  • ICC factory profiles

    Recently, I am not sure how, but my factory icc profiles for my iMac G5 have disappeared. My screen is now a very washed and light in color. My computer specs are: iMac G5 1.8Ghz 512 MB of RAM GeForce FX5200 17 inch display with no iSight Running 10.

  • For Sale Brand New CanonEOS-1DsMarkIII......$2500usd

    We are WEEDON ELECTRONICS LTD UK.We deal on all kinds of cameras and cam corders,Laptops,Mobile Phones,Musical Instruments and elctronics gadgets in general.We sale at a very good rate because we buy in large quantity from the manufacturer.When You b

  • In Production Order Window

    Dear Experts, My problem is related to UDF defined in Production Window like Start Date/Time and End Date/Time = Consume time. When user enter the value inStart Date/Time and End Date/Time then he get the Automatically Time consumption Value. So it's

  • Can't restore bookmarks. "Unable to process the backup file." I have tried every solution I can find online.

    I am running W7 and FF 14.01. My admin account FF works fine. My working account has the problems. In the past I have been able to get the bookmarks back but not this time. The bookmarks were there yesterday morning and gone in the afternoon. Nothing