Tablespace Freespace

Hi All,
11.2.0.1
I got this script that produces "database freespace" report. I found this at google and it is very cool as it helps me identify when tablespace is running out of space or in "critical" condition.
Obvoiusly this is for 9i since it does not include TEMP. My problem is it does not include the TEMP tablespace if is currently running out of space on its current TS allocation. How do I include TEMP in this script?
Thanks,
pK
==========================
set pages 0
set lines 120
set feedback off
set term off
set echo off
set verify off
col total for 999999999999999
col used for 999999999999999
col free for 999999999999999
spool freespc.lst
select  sysdate,tbs.tablespace_name,
            tot.bytes total,
            tot.bytes-sum(nvl(fre.bytes,0)) used,
            sum(nvl(fre.bytes,0)) free,
            round((1-sum(nvl(fre.bytes,0))/tot.bytes)*100,2) pct,
            decode(
                greatest((1-sum(nvl(fre.bytes,0))/tot.bytes)*100, 90),
                90, '', '*'
            ) pct_warn
from    dba_free_space fre,
           (select tablespace_name, sum(bytes) bytes
           from    dba_data_files
           group by tablespace_name) tot,
           dba_tablespaces tbs
where   tot.tablespace_name    = tbs.tablespace_name
and     fre.tablespace_name(+) = tbs.tablespace_name
group by tbs.tablespace_name, tot.bytes, tot.bytes
order by 6, 2  ;
spool off
==================
OUTPUT
=======
TABLESPACE
TOTAL BYTES
USED
FREE
% USED
CRITICAL
INDX
26,214,400
1,048,576
25,165,824
4
XDB
20,971,520
1,048,576
19,922,944
5
UNDOTBS1
393,216,000
42,205,184
351,010,816
10.73
TOOLS
10,485,760
1,245,184
9,240,576
11.88
DRSYS
20,971,520
2,752,512
18,219,008
13.13
ODM
20,971,520
7,340,032
13,631,488
35
SYSAUX
1,080,033,280
923,598,848
156,434,432
85.52
EXAMPLE
151,388,160
143,851,520
7,536,640
95.02
USERS
83,886,080
79,757,312
4,128,768
95.08
SYSTEM
849,346,560
842,006,528
7,340,032
99.14

TABLESPACE_NAME
size MB
free MB
% used
UNDOTBS1
375
361
3
INDX
25
24
4
XDB
20
19
5
TOOLS
10
9
11
DRSYS
20
18
13
ODM
20
13
35
SYSAUX
1030
147
85
USERS
80
4
95
EXAMPLE
145
8
95
SYSTEM
810
7
99
TEMP **TEMP**
63
0
100
Well, I don't see any problem there. Your temporary tablespace simply isn't required. This could be possible if you have enough memory to carry out the sort operation.

Similar Messages

  • Tablespace 0% free - Oracle / NT

    My client copies are failing due to lack of tablespace room.
    IN DB02 I have the following info:
    Total number                        6                
    Total size/kb             152.750.080                
    Total free/kb               2.607.104      1 %       
    Minimum free/kb                16.384                
    Max. autoextensible/kb    563,200,000                
    ON Freespace statistics I have:
    Tablespace            Freespace          
    Maximum/kb      Maximum/kb    Total/kb   
    SYSTEM               260032        260928
    PSAPUNDO                  0             0
    PSAPTEMP                  0             0
    PSAPIDS               19392         20544
    PSAPIDS640            12224         97408
    PSAPIDSUSR            16384         16384
    ON Critical Tables/IND...
    Tablespace     Freespace     /kb          Next extent/k
         Maximum     Total          
    PSAPUNDO          0     0     8.192
    PSAPUNDO          0     0     65.536
    PSAPUNDO          0     0     8.192
    PSAPUNDO          0     0     8.192
    PSAPUNDO          0     0     65.536
    PSAPUNDO          0     0     65.536
    PSAPUNDO          0     0     8.192
    PSAPUNDO          0     0     8.192
    PSAPUNDO          0     0     65.536
    PSAPUNDO          0     0     8.192
    I've tried to run DBA planning calendar the actions below:
    NEXT Extent. The following command was issued:
    BRCONNECT -u / -c -f next -t ALL,PSAPIDS,PSAPIDS640,PSAPIDSUSR,PSAPTEMP,PSAPUNDO  
    REsult:
    BR0903I Number of tables in locally managed tablespaces: 47323         
    BR0904I Number of indexes in locally managed tablespaces: 57328        
    BR0901I Number of tables to check (and adapt if needed) next extent: 0 
    BR0902I Number of indexes to check (and adapt if needed) next extent: 0
    BR0905W No tables/indexes found to check and adapt next extent         
    If I try on CMD  BRCONNECT -f NEXT I get the error
    ORA-01017: Invalid user/password; logon denied.
    How Can I extend the tablespaces? I need to finish my client copy.
    Thanks a lot.
    Message was edited by: Leonardo De Araujo

    Hi Leonardo,
    It's a while since I've worked on an Oracle based SAP system but this is what I remember.
    Do you know exactly which tablespace(s) are filling during the client copy ? You can probably see them on the SAP system log. I guess it will be one of BTABD/I, STABD/I, POOLD/I or CLUD/I.
    Once you've identified the tablespace(s) that have filled, you can add datafiles to the affected tablespace(s) using sapdba.
    The following SAP Help Portal URL may also be of use:
    http://help.sap.com/saphelp_47x200/helpdata/en/42/51b3144a1211d182b80000e829fbfe/frameset.htm
    Regards,
    Gary

  • Question - changing the NEXT extend size manually

    Hi Guys,
    I would like to get clarification on the subjected topic. During DB reorg, we have an option to change the next extend size manulay. If I want to change the next extend size , which is the best practise to follow on deciding the next extend size? Is there any method to calculate the best next extend size?
    Also, I would like to know , after a DB reorg - how continuous freespace in a tablespace changes...(i.e) DB02 --> Freespace statistics --> Tablespace --> freespace analysis
    Does the continuous freespace has any direct relation with the next extend size that we choos during the DB reorg?
    Please also share the link if there is any literature on this topic.
    Best regards,
    Vinodh.

    Hi Vinod,
    With New Versions of Oracle like 9i onwards DB reorg can be online and has featute of LMTS ( Locally managed Tablespaces) which eliminates the earlier limitaion of MAXEXTENTS and NEXT_EXTENT parameters.
    However if you are operating on earlier oracle version then you need to decide on the value of NEXT_EXTENT depending on the MAXEXTENTS value. If MAXEXTENTS limit is reaching rapidly then you can set NEXT_EXTENT to higher value but with disadvantage of incompletely filled blocks and hence wasteage of space.
    Freespace released doesnot hv any direct relation with next extent size. Freelists parameter will decide whether particular block is available or not.
    Hope this is helpful
    Regards
    Umesh

  • Alerts, Alerts, Alerts, Which ones to choose?

    Hi to all,
    There are so many choices when it comes to selecting from alerts. I know there is no correct answer to the question and you can choose anything you like and even emalgamate certain functions within alerts to you re liking.
    I am a Junior DBA and am preparing myself by trying to formulate a day by day, week by week, month by month schedule of tasks that need to be done within the life of a DBA.
    The scenario is; I am currently looking after 3 support contracts, They all have a multitude of needs and wants from their DB's, ranging from eBusiness Suites, 9i Apps Servers, 9.2 Db's and 10gDB as well as Apex.
    The first thing I wanted to tackle is which Alerts are the best to be monitoring. I don't want to pick everything because this will cause a lot of jobs being ran when they don't need to be. I also know that there are lots of tick boxes, when setting up alerts, that lead to the same answer. i.e. lack of space.
    Has anyone in the community set a "Alerts Rule of Thumb" or have any suggestions on tackling the problem.
    Any help from the community would be great!
    Look forward to hearing from you all.
    Thanks again.

    System stats outside DB:-
    Available device disk space to grow into if you use autoextend. Alert on 80% full.
    Alert on system runqueue being higher then 4 times the number of CPU's.
    Alert on 100% memory and hard paging activity.
    Alert on high IO (You will need a benchmark of average IO before setting so monitor IO)
    DB stats to alert on:-
    Archive area space.
    Tablespace rapid growth. Keep a history table and alert on growth over threshold. Perhaps 200M you chose your threshold...........
    TEMPspace 80%
    Tablespace freespace threshold 200MB free at all times in all tablespaces.....? Up to you. Depends on autoextend or not. and system storage available.
    To start you off the above should do others may add more?

  • Utl_smtp package을 이용한 메일발송

    전에 오라클 모니터링과 관련하여 민수님이 알려주신 utl_smtp package를 이용하여 메일받는 걸 테스트 중에 궁금한 사항이 생겼습니다.
    http://kr.forums.oracle.com/forums/thread.jspa?threadID=426721&tstart=15
    테이블 스페이스 사용량이 90%이상인 경우 메일 발송이 되게 하는 프로시져말인데요.
    메일내용에 '90%이상 사용하고 있는 테이블스페이스 리스트'를 포함 시키는 방법이 있나요?
    즉, alert 사항을 조건으로 만들었을 경우, 그 alert 내용을 메일 내용에 보여주는 방법이요.
    'WARNING: Tablespace Freespace Alert!!' <---- 이 메시지 대신
    모니터링이 필요한 테이블 스페이스가 보여지면 훨씬 좋을 것 같아서요.

  • IN DESPERATE NEED OF HELP WITH CODE...

    I HAVE DONE EVERTHING CORRECTLY: TABLE DROP SEQUENCE CHECKED, ALL SYNTAX WERE ALSO CHECKED AND SPELLING WERE ALSO VERIFIED... BUT I AM STILL HAVING PROBLEMS... HERE IS THE CODE....
    THANKS....
    set pause on
    spool output-file
    echo on
    rem Asfa Taitt
    rem Project2
    drop table T_ENROLL;
    drop table T_SECTION;
    drop table T_STUDENT;
    drop table T_INSTRUCTOR;
    drop table T_COURSES;
    drop table T_SCHOOL;
    drop table T_MAJOR;
    create table T_ENROLL (
    Semester Char(7),
    Course Char(7),
    Sec_No Char(4),
    Student_No integer,
    GOS Char(1),
    Major char(4),
    foreign key (Student_No) references T_STUDENT,
    foreign key (Course) references T_COURSES,
    foreign key (Sec_No) references T_SECTION,
    foreign key (Major) references T_MAJOR);
    create table T_SCHOOL (School char(4) not null,
    primary key (School));
    create table T_MAJOR (Major char(4) not null,
    School char(4),
    primary key (Major),
    foreign key (School) references T_SCHOOL);
    create table T_STUDENT (Student_No integer not null,
    Student_Name Char(20),
    Major char(4),
    primary key (Student_No),
    foreign key (Major) references T_MAJOR);
    create table T_INSTRUCTOR (Instructor_No integer not null,
    Instructor_Name Char(20),
    School char(4),
    primary key (Instructor_No),
    foreign key (School) references T_SCHOOL);
    create table T_COURSES (Course Char(7) not null,
    MAX_Allowed Integer,
    Credit_Hours Integer,
    GOA Char(1),
    primary key (Course));
    create table T_SECTION (semester Char(7),
    School char(4),
    Course Char(7),
    Sec_No Char(4) not null,
    Sec_Loc char(5),
    Section_Time char(13),
    Instructor_No integer,
    primary key (Sec_No),
    foreign key (Instructor_No) references T_INSTRUCTOR,
    foreign key (Course) references T_COURSES,
    foreign key (School) references T_SCHOOL);
    insert into T_COURSES values ('IFSM410',30,3,'R');
    insert into T_COURSES VALUES ('CMIS300',30,3,'R');
    insert into T_INSTRUCTOR values (111223333,'BABISKIN ROBERT G');
    insert into T_INSTRUCTOR values (222997777,'CODD TED E');
    insert into T_SECTION values ('SPR01','BUS','IFSM410','4031','RM32','TUTH3:30-5:00',111223333);
    insert into T_SECTION values ('SPR01','ENG','CMIS300','4011','RM407','MWF 1:30-2:30',222997777);
    insert into T_STUDENT values (222445555,'HARRIS JOHN H');
    insert into T_STUDENT values (215557777,'LITTLE BOB K');
    insert into T_STUDENT values (517443333,'JONES JANE G');
    insert into T_ENROLL values ('SPR01','IFSM410','4031',222445555,'R','IFSM');
    insert into T_ENROLL values ('SPR01','CMIS300','4011',215557777,'R','CMIS');
    insert into T_ENROLL values ('SPR01','CMIS300','4011',222445555,'R','IFSM');
    insert into T_ENROLL values ('SPR01','CMIS300','4011',517443333,'R','CMIS');
    insert into T_ENROLL values ('SPR01','IFSM410','4031',517443333,'R','CMIS');
    DELETE from T_ENROLL
    WHERE T_ENROLL.Student_No = 222445555 and T_ENROLL.Course = 'IFSM410';
    alter table
    commit;
    select * from T_INSTRUCTOR;
    select * from T_COURSES;
    spool ofF

    Try this.
    Rob
    -- First we need to define some tablespaces
    DEFINE idxtbs='idx01'
    DEFINE datatbs='data01'
    -- There is more then one way to skin a cat. You can disable all the constraints
    -- in these tables, then drop them.
    spool x
    Select 'alter table ' &#0124; &#0124; table_name &#0124; &#0124; ' drop constraint ' &#0124; &#0124; constraint_name &#0124; &#0124; ';'
    from user_constraints
    where table_name in (T_ENROLL;
    ,T_SECTION
    ,T_STUDENT
    ,T_INSTRUCTOR
    ,T_COURSES
    ,T_SCHOOL
    ,T_MAJOR);
    spool off
    @x.lst
    host del x.lst
    -- Now drop your tables
    set pause on
    spool output-file
    echo on
    rem Asfa Taitt
    rem Project2
    drop table T_ENROLL;
    drop table T_SECTION;
    drop table T_STUDENT;
    drop table T_INSTRUCTOR;
    drop table T_COURSES;
    drop table T_SCHOOL;
    drop table T_MAJOR;
    -- I changed all the chars to varchar2, this is much better form
    -- notice the addition of tablespace, freespace and storage
    create table T_ENROLL (
    Semester Varchar2(7),
    Course Varchar2(7),
    Sec_No Varchar2(4),
    Student_No integer,
    GOS Varchar2(1),
    Major varchar2(4)
    tablespace &datatbs
    pctfree 30
    pctused 70
    storage (initial 1M next 1M pctincrease 0)
    create table T_SCHOOL (School varchar2(4) not null)
    create table T_MAJOR (Major varchar2(4) not null,
    School varchar2(4)
    tablespace &datatbs
    pctfree 30
    pctused 70
    storage (initial 1M next 1M pctincrease 0)
    create table T_STUDENT (Student_No integer not null,
    Student_Name Varchar2(20),
    Major varchar2(4)
    tablespace &datatbs
    pctfree 30
    pctused 70
    storage (initial 1M next 1M pctincrease 0)
    create table T_INSTRUCTOR (Instructor_No integer not null,
    Instructor_Name Varchar2(20),
    School varchar2(4)
    tablespace &datatbs
    pctfree 30
    pctused 70
    storage (initial 1M next 1M pctincrease 0)
    create table T_COURSES (Course Varchar2(7) not null,
    MAX_Allowed Integer,
    Credit_Hours Integer,
    GOA Varchar2(1)
    tablespace &datatbs
    pctfree 30
    pctused 70
    storage (initial 1M next 1M pctincrease 0)
    create table T_SECTION (semester Varchar2(7),
    School varchar2(4),
    Course Varchar2(7),
    Sec_No Varchar2(4) not null,
    Sec_Loc varchar2(5),
    Section_Time varchar2(13),
    Instructor_No integer
    tablespace &datatbs
    pctfree 30
    pctused 70
    storage (initial 1M next 1M pctincrease 0)
    -- enable all your primary key and foreign key constraints seprate from creating the table.
    --t_enroll needs a primary key. always have a primary key.
    alter table t_enroll add constraint t_enroll_pk primary key (id)
    using index tablespace &idxtbs
    -- the alter table add constraint takes the form
    -- add constraint <constraint_name> foreign key <column name> references <tablename(column name)>
    alter table T_ENROLL add constraint t_enroll_fk1
    foreign key (student_no) references
    t_student(student_no)
    --do the same for the rest of your foreign keys.
    insert into T_COURSES values ('IFSM410',30,3,'R');
    insert into T_COURSES VALUES ('CMIS300',30,3,'R');
    insert into T_INSTRUCTOR values (111223333,'BABISKIN ROBERT G');
    insert into T_INSTRUCTOR values (222997777,'CODD TED E');
    insert into T_SECTION values ('SPR01','BUS','IFSM410','4031','RM32','TUTH3:30-5:00',111223333);
    insert into T_SECTION values ('SPR01','ENG','CMIS300','4011','RM407','MWF 1:30-2:30',222997777);
    insert into T_STUDENT values (222445555,'HARRIS JOHN H');
    insert into T_STUDENT values (215557777,'LITTLE BOB K');
    insert into T_STUDENT values (517443333,'JONES JANE G');
    insert into T_ENROLL values ('SPR01','IFSM410','4031',222445555,'R','IFSM');
    insert into T_ENROLL values ('SPR01','CMIS300','4011',215557777,'R','CMIS');
    insert into T_ENROLL values ('SPR01','CMIS300','4011',222445555,'R','IFSM');
    insert into T_ENROLL values ('SPR01','CMIS300','4011',517443333,'R','CMIS');
    insert into T_ENROLL values ('SPR01','IFSM410','4031',517443333,'R','CMIS');
    DELETE from T_ENROLL
    WHERE T_ENROLL.Student_No = 222445555 and T_ENROLL.Course = 'IFSM410';
    alter table
    commit;
    select * from T_INSTRUCTOR;
    select * from T_COURSES;
    spool ofF
    null

  • Query to check tablespace size and freespace

    hi experts
    i am using oracle 9i .
    want ot check freespace and size of tablespace could u plz tell me the query
    thanks
    varun

    add following for temp files -
    select sum(bytes)/1024 kbytes_alloc, tablespace_name
    from sys.dba_temp_files
    group by tablespace_name
    the new query will be
    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;
    cheers

  • Caclulate freespace from temporary tablespace

    i want to manage temporary tablespace.
    i want information like
    total_space,
    space_used,
    free_space from temporary tablespace

    RUN THIS
    select substr(a.tablespace_name,1,20) "TS_name", substr(a.file_name,1,35) "File_Name",
    round(sum(a.bytes)/1024/1024,2) "Size_MB",sum(NVL(b.bytes,0)) "FreeSpace" from dba_TEMP_files a,
    (select substr(tablespace_name,1,20) tablespace_name,file_id, round(sum(bytes_used)/1024/1024,2) used_sp,
    round(sum(blocks_free * 8192)/1024/1024,2) bytes from v$temp_space_header group by substr(tablespace_name,1,20),file_id ) b where
    a.tablespace_name=b.tablespace_name(+) and a.file_id=b.file_id(+) group by
    substr(a.tablespace_name,1,20), substr(a.file_name,1,35);
    thanks and regards
    kuljeet pal singh

  • Temporary tablespace - used and freespace size and percentage

    Hi,
    anyone here have a gd script to query the above?
    need to correctly calculate.
    thanks

    You should be more concerned of what's being used in temporary tablespace. As Oracle will reuse temp segment, free space in temp tablespace is not a good indicator.
    select * from v$sort_usage;

  • Freespace in Tablespaces

    Dear all,
    We are getting red alert message on Database administration in EWA report ,
    Kindly check below logs :
    We checked your system for tablespaces that may overflow in the near future.
    10.2.1 Tablespaces - Autoextend Limit
    Tablespace Size (KB) Free (KB) Avg. Chg/Week (KB) %-Used AutoExt %-Used after AutoExt
    PSAPSR3 200028160 316992 5557700 99 204.800.000 98
    PSAPSR3700 72826880 3591936 8429 95 174.080.000 40
    SYSAUX 430080 31616 12596 92 10.240.000 4
    You have set the 'autoextend' option for some tablespaces to a limited value. More than 95% of the limited size is already used.
    Recommendation: Increase the values for the limits as soon as possible, or use SAPDBA to add new data files to the tablespaces of the table above.
    Implementation: To determine the size required, consider the tablespaces' history of storage usage. Once you have added a data file, back up the extended tablespace. This ensures that the new state of the database can be recovered.
    Kindly advise to resovle the above issues ..

    Dear Shroff,
    Pls check the show table space details  through BRtools
    BR1001I BRSPACE 7.00 (49)
    BR1002I Start of BRSPACE processing: seerdask.dbw 2010-11-29 11.30.06
    BR0101I Parameters
    Name                           Value
    oracle_sid                     IRP
    oracle_home                    /oracle/IRP/102_64
    oracle_profile                 /oracle/IRP/102_64/dbs/initIRP.ora
    sapdata_home                   /oracle/IRP
    sap_profile                    /oracle/IRP/102_64/dbs/initIRP.sap
    space_function                 dbshow
    space_copy_dir                 /oracle/IRP/sapreorg
    scroll_lines                   20
    system_info                    orairp/orairp PRODORADB AIX 3 5 00018B6AD400
    oracle_info                    IRP 10.2.0.4.0 8192 51738 758307642 PRODORADB
    sap_info                       700 SAPSR3 0002LK0003IRP0011D11604089540015Mainte
    nance_ORA
    make_info                      rs6000_64 OCI_102 Aug  2 2010
    command_line                   /usr/sap/IRP/SYS/exe/run/brspace -p initIRP.sap -
    s 20 -l E -U -f dbshow -c tsinfo
    BR0280I BRSPACE time stamp: 2010-11-29 11.30.11
    BR1009I Name of database instance: IRP
    BR1010I BRSPACE action ID: seerdask
    BR1011I BRSPACE function ID: dbw
    BR1012I BRSPACE function: dbshow
    BR1036I Class of information to be shown: tsinfo
    BR0280I BRSPACE time stamp: 2010-11-29 11.30.14
    BR0659I List menu 259 + you can select one or more entries
    List of database tablespaces
    Pos.  Tablespace     Type  Status    ExtMan.  SegMan.  Backup  Files/AuExt.
          Total[KB]   Used[%]    Free[KB]  MaxSize[KB]  ExtSize[KB]  FreeExt.    Lar
    gest[KB]
      1 - PSAPSR3        DATA  ONLINE    LOCAL    AUTO      NO        20/20
         200192000     99.84      327168    204800000      4608000        21      79
    8720:655360:614400:593920:593920+
      2 - PSAPSR3700     DATA  ONLINE    LOCAL    AUTO      NO        17/17
          72826880     95.07     3591936    174080000    101253120        17     612
    3520:6123520:6103040:6082560:6082560+
      3 - PSAPSR3USR     DATA  ONLINE    LOCAL    AUTO      NO         1/1
             20480     90.00        2048     10240000     10219520         1    1021
    9520+:2048:0:0:0
      4 - PSAPTEMP       TEMP  ONLINE    LOCAL    MANUAL    NO         1/1
           4362240      0.00     4362240     10240000      5877760         0     587
    7760+:0:0:0:0
      5 - PSAPUNDO       UNDO  ONLINE    LOCAL    MANUAL    NO         1/1
          10240000      0.16    10223552     10240000            0       585     280
    1664:1372160:1024128:851968:474112
      6 - SYSAUX         DATA  ONLINE    LOCAL    AUTO      NO         1/1
            430080     94.23       24832     10240000      9809920        22     980
    9920+:17344:1728:704:576
      7 - SYSTEM         DATA  ONLINE    LOCAL    MANUAL    NO         1/1
            901120     99.38        5568     10240000      9338880         3     933
    8880+:5056:448:64:0
    Standard keys: c - cont, b - back, s - stop, r - refr, h - help
    BR0662I Enter your selection:
    Kindly advise for resolving the above issue .

  • How to release space of SYSAUX tablespace

    Hi,
    I am now using htmldb 2.0 and created tens of tables in one schema. Several tables are stored in tablespace SYSAUX. Since now I am trying to store a big file to the table(1GB), I found the tablespace grows pretty fast and I have to extend the size. The odd thing is when I delete that file from my table, SYSAUX tablespace seems not release any room and when I insert the big file again into the table, SYSAUX grows again. How can I release the space then? I can't image that why it can't release any room. I also check the occupants of SYSAUX and found one occupant called "other" takes over 90% of space. I tried to move it out of SYSAUX, it doesn't work. What do "other" do actually? I got completely lost. Any help will be greatly appreciated.
    Linke

    Hi,
    if you drop a table in Oracle 10g,
    you will find teh extents of this table in
    DBA_FREE_SPACE.
    in DBA_FREE_SPACE???
    I don't think so.
    SQL >select ddf.tablespace_name,round(total/1024/1024,3) ttlSize,round((total-nvl(freespace,0))/1024/1024,3) used, round((total-nvl(freespace,0))/total*100,2) usedpct
    from
    (select tablespace_name,sum(bytes) total from dba_data_files group by tablespace_name) ddf,
    (select tablespace_name,sum(bytes) freespace from dba_free_space group by tablespace_name) dfs
    where ddf.tablespace_name=dfs.tablespace_name(+) and ddf.tablespace_name='USERS'; 
    TABLESPACE_NAME                   TTLSIZE       USED    USEDPCT
    USERS                                  16      2.813 17.58
    SQL >create table test (col1 number) storage(initial 2m)
      2  /
    Table created.
    SQL >select ddf.tablespace_name,round(total/1024/1024,3) ttlSize,round((total-nvl(freespace,0))/1024/1024,3) used, round((total-nvl(freespace,0))/total*100,2) usedpct
    from
    (select tablespace_name,sum(bytes) total from dba_data_files group by tablespace_name) ddf,
    (select tablespace_name,sum(bytes) freespace from dba_free_space group by tablespace_name) dfs
    where ddf.tablespace_name=dfs.tablespace_name(+) and ddf.tablespace_name='USERS'; 
    TABLESPACE_NAME                   TTLSIZE       USED    USEDPCT
    USERS                                  16      4.813 30.08<--used 2mb
    SQL >select sum(bytes)/1024/1024 from dba_segments where tablespace_name='USERS'
      2  /
    SUM(BYTES)/1024/1024
                    6.75
    SQL >drop table test
      2  /
    Table dropped.
    SQL >select sum(bytes)/1024/1024 from dba_segments where tablespace_name='USERS'
      2  /
    SUM(BYTES)/1024/1024
                    6.75 <-- kept in the same tablespace

  • Huge drop in freespace in the database

    Hi all,
    I experienced a strange problem. Recently I had a new server installed and the database from the old server was migrated in to the new server. After doing so, I added additional datafiles to the tablespaces to increase the free space in the database.
    The volume of data transactions per day is more or less same for all days. After 2 years of data transactions, my 4000 MB datafile got depleted to around 500 MB freespace. Then two months back the new datafiles were added to increase the total size of the datafiles to 7000 MB. At this point I had 3500 MB of freespace.
    However, when I checked the freespace just after two months of adding additional datafiles, i find that there is only 2000 MB of free space.
    No abnormal database activities have been taken up during this period. What could be the reason for such huge drop in freespace..?
    regards
    thomaskprakash

    However, when I checked the freespace just after two months of adding additional datafiles, i find that there is only 2000 MB of free space.
    No abnormal database activities have been taken up during this period. What could be the reason for such huge drop in freespace..?There could me many reasons.
    First of all, you have checked your freespace after couple of months, did you calculate how much space it would have used in these two months for data and indexes?
    Second, your undo and temp might have increased or you may kept them as auto increase mode.
    Jaffar

  • Checking space in a tablespace ... yes, that one again

    I know this has been done to death, but I wanted to just go over what I do when OEM alerts me to a tablespace running out of space.
    First, I check the free space of the tablespace using this query:
    SET LINESIZE 100
    COLUMN TABLESPACE FORMAT A15
    select t.tablespace,  t.totalspace as " Totalspace(MB)",
    round((t.totalspace-fs.freespace),2) as "Used Space(MB)",
    fs.freespace as "Freespace(MB)",
    round(((t.totalspace-fs.freespace)/t.totalspace)*100,2) as "% Used",
    round((fs.freespace/t.totalspace)*100,2) as "% Free"
    from
    (select round(sum(d.bytes)/(1024*1024)) as totalspace, d.tablespace_name tablespace
    from dba_data_files d
    group by d.tablespace_name) t,
    (select round(sum(f.bytes)/(1024*1024)) as freespace, f.tablespace_name tablespace
    from dba_free_space f
    group by f.tablespace_name) fs
    where t.tablespace=fs.tablespace
    order by t.tablespace;
    Secondly, I check if it is autoextendible and what the MAXBYTES is.
    select file_name, bytes/1024/1024 size_MB, AUTOEXTENSIBLE, maxbytes/1024/1024 maxsize_MB from dba_data_files where tablespace_name = 'RBPTAB';
    To my understanding, if you don't do this you wont allow for what the datafile has been allowed to autoextend up to.  The first query will only give allocated size, not the real, actual, TOTAL size that it can grow to.
    Once you know that, from query 1, there is no space left, and from 2 it is really hitting its MAXSIZE,  (compare the MAXSIZE of 2 with the Used Space(MB) column from 1) ... then add a new one.
    Does this make sense?

    so much titles included, i think you should have to reduce the size of the sql query, to understand in a meaningful way,  

  • Script for adding datafile to tablespace

    Hi
    Does anyone have a template alter tablespace add datafile script handy?
    Basically, we need to, in the event of a tablespace alert, do two things:
    query that tablespace to see how much space is remaining.
    ascertain the size of the datafiles added to that tablespace already (to clarify what size we should make the additional datafile)
    finally, the command itself for adding the extra datafile.
    Thanks.
    10.0.2.0

    SELECT Total.tablespace_name "TSPACE_NAME",
    round(nvl(TOTAL_SPACE,0),2) Tot_space,
    round(nvl(USED_Space,0),2) Used_space,
    round(nvl(TOTAL_SPACE - USED_Space,0),2) Free_space,
    round(nvl(round(nvl((TOTAL_SPACE - USED_Space)*100,0),2)/(Total_space),0),2) "USED%"
    FROM
    (select tablespace_name, sum(bytes/1024/1024) TOTAL_SPACE
    from sys.dba_data_files
    group by tablespace_name
    ) Total,
    (select tablespace_name, sum(bytes/1024/1024) USED_Space
    from sys.dba_segments
    group by tablespace_name
    ) USED
    WHERE Total.Tablespace_name(+) = USED.tablespace_name and
    round(nvl(round(nvl((TOTAL_SPACE - USED_Space)*100,0),2)/(Total_space),0),2)< 20;
    the above query will display tablespaces which are having freespace below 20%
    select file_name,autoextensible,sum(bytes)/1024/1024,sum(maxbytes)/1024/1024
    from dba_data_files
    where tablespace_name='TBS_NAME'
    group by file_name,autoextensible;
    the above query will give details of datafiles like autoextensible or not etc.
    SELECT SUBSTR (df.NAME, 1, 40) file_name,dfs.tablespace_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,dfs.tablespace_name
    ORDER BY file_name;
    the above query will show how much freespace is left in each datafile.

  • Importan Tablespaces in R/3

    Dear All,
    Hi to all Basis Gurus'.
    I have a critical issue regarding space.
    Can anyone tell me what are the critical TableSpace in SAP R/3.I mean which Tablespaces usually get filled at regular Basis and need more space.
    Existing Tablespaces are :
    PSAP<SID>
    PSAP<SID>620
    PSAP<SID>USR
    PSAPTEMP
    PSAPUNDO
    SYSTEM
    Currently my PSAP<SID> tablespace is 91% used.And available FreeSpace on the disk is 27 GB
    I am not sure whether this is sufficent enough to carry on with the development activities.
    Regards
    KiranKumar.D

    Hi,
    The regular increase table name is PSAPBTABD & PSAPBTABI.
    Regards,
    Anil

Maybe you are looking for

  • How do I make a submit button work on a mobile oriented page?

    How do I make a submit button work on a mobile oriented page?  I have the .html file and the .data file (and one other kind), but it just spins and spins and spins when I try to send the form in (for an absence).  I'd like it to work on all devices. 

  • Problem with importing a clip from another iMovie project

    Hello I want to import a clip from one iMovie project to another iMovie project. Both projects are in 16:9, but when I import a clip it's no longer in 16:9. The clip is croped and I have a black bar on the right and left side. How can I solve this ?

  • [SOLVED] How to clean things up?

    Since I'm quite new to Arch, I must've installed a dozen packages which I don't need and only take space. Is there some sort of way to detect everything that isnt used? Since a lot of packaged depend on other packages before they can run properly I c

  • Photoshop CS6. Will it run on my computer?

    Hi. I would like to buy Photoshop CS6. Will it run on my computer without any problems? I've got Windows 7 Professional 64bit Service Pack 1. Intel(R) Core (TM) i5-2410M CPU @ 2.30 GHz. 4GB RAM. Graphics - Radeon HD 6490M. (some time ago I bought Aut

  • Big File vs Small file Tablespace

    Hi All, I have a doubt and just want to confirm that which is better if i am using Big file instead of many small datafile for a tablespace or big datafiles for a tablespace. I think better to use Bigfile tablespace. Kindly help me out wheather i am