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

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

  • I'm getting different readings for free space

    So I'm a little worried. I have an early 2008 MacBook Pro with a 750GB hard drive that I recently put in. I just did a system wipe and restore, and now I'm getting 2 different readings of vastly different amounts for free space. Disk Utility and About My Mac both label it at 433.29 Gigs, but Finder rates it at 590.3 Gigs! I'm fairly certain the About My Mac has the storage space correct. I have turned off mobile Time Machine backups, and I know there's a hidden partition for Recovery, but shouldn't Finder know about this? Disk Utility shows the hard drive as fine. Any other thoughts?

    See if this link offer some explanations:
    http://pondini.org/OSX/DiskSpace.html
    You might download from the Internet OmniDiskSweeper (free) and open it.  It will give you a record of all your files and the respective sizes and you can compare that to your MBP stats.
    Ciao.

  • 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
    /

  • 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....

  • Guidelines for Free Space needed to successfully burn DVD?

    I have been struggling for the last three weeks to get a successful burn of an iDVD (7.0.4) home movie using my 2005 iMacG5Power PC, OS10.5.6.
    The movie I’m trying to burn has the following characteristics:
    Edited in Final Cut Express (3.5), 45 minutes in length, with 10 Chapter Markers, and containing a 50-50 mix of 4x3 and 16x9 video clips downloaded into QuickTime files from a Sony TRV70 (standard Definition) and a Canon HD Vixia HV30. Although the Canon original mini-DV tapes are High Definition, I captured them as standard def in 16x9 format.
    From FCE, I exported the edited movie as a QuickTime, self contained “Sequence” movie file which has a total size of ~28Gigs.
    I dragged this Sequence QT movie file into iDVD having selected the Version 7.0 Sunflower theme, proceeded to author this theme with JPG pictures, and with inserted favorite iTunes selections. The iDVD movie file fully authored resulted in a 1.8G “.dvdproj” file, and a 3.2G “.img” file.
    I have ~52G of free space on my start up drive.
    I have not been able to get through a successful burn whether I use iDVD or Disk Utility or Toast 6.0 Time after time I get an error message at the very end of the iDVD process that says: “Multiplexer Error-There was an error during formatting”.
    I have tried burning the disc image using Disk Utility and with Toast with similar results, …….after about 4 hours of elapsed encoding time, the process quits and spits out the DVD media at a point that often is involved with writing lead-in or lead-out functions, or something that says no response from hardware.
    To check software and hardware functionality, today I spent “testing” all of this by using a random 3 minute portion of the overall 45 minute movie, and produced successful burns with iDVD, Disk Utility, and Toast.
    Question
    Is 52 G of free space on my start up drive sufficient for a Sequence QT movie of 28G ?
    Tougher Question
    How does one check his original edited FCE movie for potential errors that could affect the final burning process? (I have checked CHAPTER markers for placement, and frame spacing on either side of markers)
    The iDVD Project Info pane and Project flow map show no red warnings; I’m well within the size and time guidelines for Best Performance burning on a standard 4.7G DVD-R medium.
    Help…..this is getting frustrating. I think I did a great job editing this home movie, but the only way I will be able to show it off, is to have the family sit in front of the iMac!! Up till now, I have burned many one hour home movies using Tiger and iDVD 5 on this same iMac. What’s going on?
    Thanks in Advance,
    BoBo

    the less-desscriptive 'multiplexing error' message usually does NOT indicate not enough disk space.
    but ..
    check project
    • no involved file (audio, video, stills) should contain a 'bad character' in its name / | \ . … ; , ; ...
    • no part should be 'audio less' .. e.g. iPhoto slideshows without music can create such an error
    • you need at last 10-15GBs free on internal/if partitioned: MacOs-drive for using iDVD

  • Script for color space conversion RGB to CMYK - URGENT Help Wanted

    Excuse my ignorance with the basic nature of this question, I don't use InDesign, but I do have a pressing problem regarding it.
    My book publisher has just emailed to say that my photography book has been set for the printers in InDesign and the photographs have AdobeRGB color space (which was what I was aksed to send.) The printer needs the images to be in CMYK. The publisher said that he was "pretty sure Adobe Acrobat converts the InDesign files to CMYK" and that he has sent the printer RGB images in the past and they "came out OK". He said that if this will not work, he needs to convert all of the images separately to CMYK.
    Can you help with the following:
    1. Is he right about the above - can Adobe Acrobat convert the files?
    2. Can anyone offer me a script that will convert all of the images in InDesign to CMYK? or will he need to change them individually?
    Thanks for any suggestions with this urgent request.
    Stephen

    1. Acrobat can convert.
    2. No need for a script, if the printer needs CMYK, you can export a CMYK pdf.
    3. To get the highest quality conversions, you might want to do it in Photoshop.
    4. If the images are color managed and the printer has a modern work-flow a color managed RGB PDFX-4 pdf is probably the best way to go...
    Harbs

  • 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

  • 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 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/

  • Not Enough Free Space on NetBoot Image Partition

    Since the NetBoot server isn't all that popular, I'm going to explain how it works a bit before I get into my problem.
    I assume everyone knows how it works on the client end. You choose an image and your Mac boots that image over the network. Quick, easy, painless. It's a cool system. So on the server/admin side…
    Every version of OS X Server comes with it's own System Imaging Utility. So lets say you want to make a netboot image with some utilities on it. So you take an external hard drive. Make two partitions on it. On one partition, you set it up to be the netboot image. So you install all of the utilities you want installed. You configure all of the preferences just the way you want them. Set your background image, etc, etc. On the other image, you just do a quick clean plain installation of your OS. And you also install your OS X Server Admin tools (or in case of 10.8, the Server app). So once your image-to-be is configured, you boot the second partition, and run the imaging utility. This utility will turn your volume into a netboot image. A netboot image is basically just a folder with some .plists in it, a read-only disk image of your initial volume, and a kernel or two (10.5).
    NetBoot images are read-only. So when you boot them, you can make as many changes as you want. But once you shut down, all changes are lost. Every time any mac boots a netboot image, it is booting the image exactly as it was when you made it. The changes you make are stored in shadow files on the server that you can periodically toss, since they are only used during the current active session. Once you reboot, the shadow files are useless.
    So here is the problem: When you make a netboot image from a real volume, the utility only leaves a small amount of free space on the volume. Even though the disk image is read only, the amount of free space matters because that's still all you get to use. In other words, if the .dmg file in the netboot image i just made only has 900 MB of free space in the volume, then that's all I get for free space on any machine I boot off that image. Even though the image is read only, and all of the "free space" is actually being stored as shadow files on the server, that limit is still applied. And 900 MB is not very much free space. So you can boot a utilities volume and if a program eats up a lot of ram, that virtual memory can eat up what little free HD space you have, and suddenly your netboot image is not very functional.
    Now being the clever fellow that I am, I came up with a solution to this problem last time around. I used the following command to resize the partition (and only the partition) of the .dmg file, inside the netboot image (netboot images are just folders).
    hdiutil resize -size 60g -partitiononly NetBoot.dmg
    This resized the volumes to 60 GB. But it was all blank space, so the .dmg file's size did not change. It would just mount as a read only volume with 40 GB of free space instead of a few hundred MB. This little trick worked very well. But it's not working any more. I can't figure out why. But every time I try to run this command on the .dmg file, I get an error very similar to the following:
    hdiutil: resize request 125829120 is above maximum size 18005952 allowed.
    hdiutil: resize: failed. Invalid argument (22)
    I get this error while running 10.8, 10.7, or 10.6. I get this error whether I'm trying to resize an image containing 10.8, 10.7, 10.6, 10.5, 10.4 or 10.3. I get this error whether I convert the image to a read/write image first, or even a spare image first. I get this error whether the original hard drive that volumes were on, is partitioned as APM or GUID.
    The "maximum size" listed in the error message is different for each image I try to resize. It's as if the tool is trying to fit the increase volume inside the existing free space of the image's volume. Which isn't what I'm trying to do at all.
    I've been using netboot images filled with utilities for years now. And overall it works very very well. I started back when the first macbooks came out with no firewire. I quickly realized I needed a better solution than booting my Mac into firewire mode to repair other Macs. And then when I got into it, I realized I could host images of all different OS versions. So now I can plug my MBP into a client's network, and boot any Mac they have off of a utility volume of any version of Mac OS X needed, all the way down to 10.3, all at the same time. And I also have NetInstall volumes too that let me install OS X for all these versions as well. The only real quirk I've had over the years, is this 'free' space issue. In the past (before the last time I updated my images, where I used the command above to resize the partitions and solve the problem), what I've done when I've ran into a HD pinch while working, is to immediately start deleting apps I don't think I'm going to need, right off the netbooted Mac. This frees up space on the netboot volume and the system is happy. And again it's all read only, so I'm not actually making changes to the image itself. One real half assed solution I thought of was to set up all of my netboot volumes as having a 1 GB file in their trash and not emptying it before creating a netboot image from the volume. Then when this problem came up and the OS was running out of disk space, I could just empty the trash. I'm quite sure this little trick would have worked, but it's so half-assed. I'd much rather just have more free space on the mounted disk images.

    But how did my command work so perfectly last time? Here's an image. On the left, the info window of the disk image inside my 10.7 Utilities netboot image. On the right, the info window for that disk image's mounted volume. The file is only 7 GB and the volume is a 30 GB volume with ~23 GB free. None of the free space of the volume is using up any actual disk space in the .dmg file. I did this once, there's got to be a way to reproduce this again?
    Here's the same thing with my 10.6 Utilities netboot image. Also in case I'm not being clear, these netboot images these screen shots are of, are from the last time I updated my netboot images ~11 months ago. These are not my current batch that I'm trying to finalize.

  • Lots of free space that I cant use 5c

    Hi,
    I have a iphone 5c, and I can only put a small amount of music on it. There is months of music on my computer, but when I 'autofill' it only puts about a hundred songs on. Afterwards there is about 5gB of free space on my phone. I also cant update apps etc as it thinks there is no free space left. I have checked I am not resrving this space for free space in the settings and I have done a software update to 8.2 and also a restore, but no joy. Why is it doing this?

    You need an external disk that is formated as HFS+ with a GUID partition map.
    You can use either Carbon Copy Cloner or SuperDuper to create the clone.
    Once ypu have the clone you can boot from my holding down the option key ater power on.
    Once booted from the clone open Disk Utility.
    Select the internal drive.
    Click partition.
    Select single partition.
    Once drive has bee formated, restore the clone nack with the application used to make the original clone.
    Boot from internal drive.
    Allan

  • Cant reclaim free space from deleted trace file in bdump

    Hi ,
    Os : IBM aix 5.3
    Oracle : oracle 10.2.0.3 enterprise edition
    My /oracle space is only 2gb remaining .
    i deleted more 2gb trace files from bdump folder but when i check on os for free space its still showing that only 2gb is remaining for /oracle
    plz help me guys................

    Hi,
    You need to kill the OS PID's accessing the dump directory FS to get space released ..Refer below, how it can be done
    [oracle9i@M6UAT-DB:/home/oracle9i>]pwd
    /oracle/product/admin/M6CORP/udump
    [oracle9i@M6UAT-DB:/home/oracle9i>]fuser -c /oracle/product/admin/M6CORP/udump
    /oracle/product/admin/M6CORP/udump:   102612c  213018c  278544  327850c  340170c  356426c  466986c  495782c  516276c  565368c  610416c  626822c  647266c  696352c  704692c  708632c  745654c  753666c  766036c  778448c  794750c  798966c  852002c  864438c  880678c  884826c  892980c  905248c  925944c  938066c  950490c  958478c  966900c  974924c  979180c  991400c 1007816c 1015990c 1028342c 1032316c 1040494c 1044584c 1048790c 1064962c 1069198c 1077448c 1114204c 1130594c 1143014c 1146978c 1175638c 1191982c 1196276c 1216524c 1241106c 1249470c 1253520c 1261794c 1278186c 1290380c 1302720c 1306640c 1343604c 1347682c 1351874c 1355950c 1359928c 1372280c 1380602c 1384452c 1405106c 1454216c 1458424c 1462418c 1474594c 1482906c 1511456c 1515552c 1523846c 1527914c 1544408c 1548308c 1552392c 1560670c 1564732c 1568938c 1581288c 1597468c 1601616c 1630268c 1634464c 1650836c 1654816c 1667186c 1679502c 1683656c 1687722c 1695962c 1700028c 1703952c 1712276c 1720546c 1728524c 1732832c 1736736c 1744946c 1749098c 1757358c 1761474c 1769496c 1777784c 1781850c 1785944c 1789966c 1798162c 1806568c 1822912c 1851628c 1855700c 1867794c 1871934c 1892562c 1900660c 1904794c 1908936c 1917174c 1921244 1929398c 1937446c 1945762c 1957936c 1962036c 1994984c 1998914c 2039896c 2044122c 2060456c 2064548c 2068632c 2072672c 2076892c 2084908c 2089162c 2101466c 2105384c 2109494c 2125952c 2130136c 2134050c
    [oracle9i@M6UAT-DB:/home/oracle9i>]kill -9 102612  213018  278544  327850  340170  356426  466986  495782  516276  565368  610416  626822  647266Thanks,
    Ajay More
    http://moreajays.blogspot.com

  • 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

Maybe you are looking for

  • Folder similar to Res folder in OBIEE 11g

    Hi There is res folder in OBIEE 10g in OracleBI/web/app which acts as the source for all images on dashboards. Similar to res folder in OBIEE 10g, what is the respective folder in OBIEE 11g that acts as the source for all images on the dashboards. Pl

  • Get Map values using loops

    Hi, With a vector I can have a loop and to get the values with a index. Vector vec = new Vector() for(int idx=0; idx>vec.size(); idx++){     System.out.println(vec.get(idx).toString()); }I can do something similar with a map ? in other words have a l

  • Issues with JDBC Connection Pooling

    Hi all, I'm experiencing some unexpected behaviour when trying to use JDBC Connection Pooling with my BC4J applications. The configuraiton is - Web Application using BC4J in local mode Using Default Connection Stagegy Stateless Release Mode Retrievin

  • My Ipod Touch 3g has a stuck slider, can anyone help?

    About three days ago my ipod 3g suddenly died on me after rebooting and restoring to factory settings it finally came back alive and was able to sync my music, however the slider is now not wanting to work. No matter how many times I try to slide it

  • Insert data to Logical Database

    Hi all, can i insert the data throught logical database ? how to insert ? regards, Luke