Tablespaces monitoring

Hi all! I need a script to monitor the status of the tablespaces of an Oracle database. I'm using win2k server and Oracle 9.2.0.4. I created this query:
select
  df.tablespace_name, df.file_name, dt.status,
  df.autoextensible, df.increment_by,
  df.bytes /1048576 MBytes,
  sum(fs.bytes)/1048576 free_space_mb,
  decode(df.maxbytes, 34359721984, 'UNLIMITED', to_char(df.maxbytes)) max_size
  dba_data_files df,
  dba_free_space fs,
  dba_tablespaces dt
where fs.file_id=df.file_id
and df.tablespace_name =dt.tablespace_name
group by
  fs.tablespace_name, df.file_name,df.bytes,
  dt.status, df.autoextensible,
  df.maxbytes, df.increment_by,df.tablespace_name
UNION
select
  t.tablespace_name, t.file_name, v.status,
  t.autoextensible, t.incremenT_BY,
  t.BYTES /1048576 MBYTES, -1 free_space,
  '' max_size
from
  v$tempfile v,
  dba_temp_files t
where v.name = t.file_name
As you can see, I'm not able to find free_space and max_size of the temporary tablespaces (now this parameters are equal to -1 and ''). Do you know how to correct this query? Thank you to everyone!
Ste.

In Metalink there are a lot of SQL Statements to do that.
Joel Pérez
http://otn.oracle.com/experts

Similar Messages

  • Oracle - CCMS Monitor Templates

    Hi,
    In RZ20, The Oracle (Tablespaces) monitor templates are not available under Database.
    And the MTE class CCMS_DB_mcmtc is not there in the list.
    How to Maintain the data for this MTE class. Is it possible to create new MTE class.?
    Please Advice.
    Thanks in Advance
    Arun
    Edited by: ARUN PARAMASIVAM on Feb 2, 2010 12:14 PM

    Hi Anil,
    Thanks for your quick response.
    Oracle Database Alert should be there by default under Database Alert Monitor right. But i am not able to find the Oracle Monitor Set Itself.
    I tried by running the program "RSDBMON0" in SE38. That also doen't help.
    Please advise on how to get the Oracle monitor set under Database.
    Thanks
    Arun

  • How to exclude undo and temp from "Tablespace Space Used (%)"

    Dear All
    Is it possible to exclude undo and temp tablespace monitoring from "Tablespace Space Used (%)" matric?
    Thanks & Regards
    Quazi Abdur Rab

    If you use TEMP >=100 as Warning, this warning can still be raised.
    What version of the database is it? If Oracle 10g, Grid Control (the agent) searches the alert table in the database for alerts, so the database raises the alert and the agent just passes this alert to Grid Control.
    If you are using Oracle 10g, you can use the following statement (connected as sys):
    DBMS_SERVER_ALERT.SET_THRESHOLD(
    metrics_id => DBMS_SERVER_ALERT.TABLESPACE_PCT_FULL,
    warning_operator => DBMS_SERVER_ALERT.OPERATOR_GT,
    warning_value => '90',
    critical_operator => DBMS_SERVER_ALERT.OPERATOR_GT,
    critical_value => '100',
    observation_period => 1,
    consecutive_occurrences => 1,
    instance_name => NULL,
    object_type => DBMS_SERVER_ALERT.OBJECT_TYPE_TABLESPACE,
    object_name => 'TEMP');
    This will create the GT (Greater Than) instead of GE (Greater Equal).
    Kind regards,
    Dave
    ps. I'm using GC 10.2.0.3.0, so thanks for the note that 10.2.0.4 doesn't take 100+ values.

  • Any Software/Program to keep track of growth of Datafiles and Tablespaces

    Hi,
    I am looking for a program that can keep an eye on the growth of the datafiles and tablespaces as well as it can raise an alert when the growth is critical regarding the space.
    Can anybody suggest me such program/tool/utility/script?
    Thanks in advance.
    Himanshu

    There are plenty of vendors out there that sell very high-end database monitoring tools. Quest has a whole suite of them. Any of these guys should have tablespace monitoring (and a variety of other reports) as part of the package.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • SYS Aux maintanence

    Can u somebody share the best practices on sysaux tablespace maintanence. It growing fast, thought the retention stuff are kept minimal

    Hi,
    The sysaux tablespace is a 10g feature that offloads noncritical application metadata from the system tablespace, reducing or eliminating hotspots in the system tablespace, in addition to consolidating the metadata that was previously in other tablespaces (oem_repository, etc).
    The applications that use the SYSAUX tablespace are not permanently tied to this tablespace, you can move them to another tablespace. Check out how your space is being used:
    SELECT occupant_name, schema_name, space_usage_kbytes
    FROM v$sys_occupants;
    ... if usage for an occupant such as Logminer is requiring heavy space usage consider moving it to another tablespace:
    sql> CREATE SMALLFILE TABLESPACE logminer_rep
    datafile '/oradata/logminer_rep01.dbf'
    size 10g
    autoextend on next 5g;
    Is there a move procedure for occupant:
    select occupant_name, move_procedure
    from v$sysaux_occupants;
    begin
    sys.dbms_logmnr_d.set_tablespace('logminer_rep);
    end;
    The sysaux tablespace is similar to system tablespace, it has a few restrictions.
    1. you can add datafiles to the tablespace:
    alter tablespace sysaux add
    datafile '/oradata/sysaux02.dbf' size 1G;
    or
    if define as a BIGFILE, use autoextend on
    you cannot:
    2. take sysaux offline
    3. drop sysaux
    4. rename sysaux
    Otherwise maintaining SYSAUX is similar to other tablespaces, monitor space and provision space as application behavior requires.

  • Tablespace size monitoring in Oracle 10g

    Hello
    Our environment: Oracle 10.2.0.3 3-node RAC, ASM, Linux x86-64
    We are using EM Grid Control as a monitoring tool for RAC databases.
    We have "tablespace SPACE USED (%)" metric configured for all RAC databases.
    For some reason this metric does not work all the time and it does not alert dba when warning or critical threshold reached.
    I'd like to hear from people how they monitor tablespace size in Oracle RAC environment with files in ASM.
    Thank you,
    Yelena

    Yelena,
    Your problem is realted to GC and it seems it's not configured properly. Kindly check and verify schedule also. May possible it's notifying to other person also..

  • How to exclude UNDO and temp tablespace using monitoring template

    hi,
    as per MOS note id 816920.1 undo and temp tablespace is excluded from monitoring starting version 11G onwards.It says that thresholds will need to be explicitly set if undo and temp needs to be monitored
    we have grid 12C implemented now with monitoring templates which sets thresholds for all tablespaces. does it apply that thresholds to undo and temp too?? we are receiving alerts for undo and temp tablespaces and we wish to disable them. We have undo tablespaces with different names in many databases as per naming conventions for that line of business.
    How can i exclude undo and temp tablespaces from monitoring using grid 12C monitoring templates. is there a way through templates where i can set thresholds of permanent tablespaces only???

    In EM12c, go to the 'Enterprise' menu, then 'Job', then 'Library'. There should be an out-of-the-box job called "DISABLE TABLESPACE USED (%) ALERTS FOR UNDO AND TEMP TABLESPACES" that you can run against your database targets, and that job will disable database-generated alerts.
    If a previous admin has set up EM12c-generated alerts for undo and temp, then yes, a monitoring template will take care of disabling them. Either remove those alerts from the existing monitoring template and apply them to your targets, or create a new monitoring template based on one database's current settings, remove those warning/critical thresholds for your undo and temp tablespaces, and apply it to your targets.

  • Tablespace growth monitoring script

    Hi,
    I am done with tablespace growth monitoring script.
    But I doesnot know how to configure it in WINDOWS to send alert MAIL.
    Is there any utility for mail configuration in windows.
    Please suggest any solution ASAP.
    Regards,
    Thiru

    It is called OEM alerts. I think we can have configuration in oracle eneterprise manager grid control for automated warnings for tablespace growth. You just have to read below link :
    http://download.oracle.com/docs/cd/B19306_01/server.102/b25159/monitor.htm#i1007180
    Something near to :
    Enterprise Manager Configuration--Management Services and Repository--Agent
    Regards
    Girish Sharma

  • Monitoring Used (%) space for tablespaces

    Hi everyone,
    I am currently using:
    Redhat Linux ES 5 2.6.18 and also
    Oracle 10g Release 2 for Linux x86 R10.2.0.3
    While monitoring my Tablespaces using OEM Database Control, I notice that two tablespaces were almost full.
    [SYSAUX] - Size: 290MB , Used 283MB (97% full)
    [SYSTEM] - Size: 320MB, Used 313MB (98% full)
    When I try to locate the datafiles of both tablespaces in its directory (/home/dba/oracle/oradata/oracle), it shows the allocated size (290MB for sysaux01.dbf & 320MB for system01.dbf) and not the used space.
    I got three questions to ask over here:
    1st- Why there isn't any warnings or alarms even though the tablespaces exceeds the critical size?
    2nd- How come the datafiles shows the allocated size of the tablespaces and not the Used space?]
    3rd- How can I find & monitor the actual used space of the tablespaces?
    4th- I have enabled the AutoExtend function but I am worry whether is there any other concern?
    I am still very new here.
    Please pardon me for anything that is improper.
    Looking forward for your expertise, guidance & help.
    Thanks for your attention.
    -Regards-
    ++ Kef Lim ++

    Hi,
    Here you have some scripts:
    TABLESPACE USAGE NOTES:
    Tablespace Name - Name of the tablespace
    Bytes Used - Size of the file in bytes
    Bytes Free - Size of free space in bytes
    Largest - Largest free space in bytes
    Percent Used - Percentage of tablespace that is being used - Careful if it is more than 85%
    select     a.TABLESPACE_NAME,
         a.BYTES bytes_used,
         b.BYTES bytes_free,
         b.largest,
         round(((a.BYTES-b.BYTES)/a.BYTES)*100,2) percent_used
    from      
              select      TABLESPACE_NAME,
                   sum(BYTES) BYTES
              from      dba_data_files
              group      by TABLESPACE_NAME
         a,
              select      TABLESPACE_NAME,
                   sum(BYTES) BYTES ,
                   max(BYTES) largest
              from      dba_free_space
              group      by TABLESPACE_NAME
         b
    where      a.TABLESPACE_NAME=b.TABLESPACE_NAME
    order      by ((a.BYTES-b.BYTES)/a.BYTES) desc
    SET SERVEROUTPUT ON
    SET PAGESIZE 1000
    SET LINESIZE 255
    SET FEEDBACK OFF
    PROMPT
    PROMPT Tablespaces nearing 0% free
    PROMPT ***************************
    SELECT a.tablespace_name,
           b.size_kb,
           a.free_kb,
           Trunc((a.free_kb/b.size_kb) * 100) "FREE_%"
    FROM   (SELECT tablespace_name,
                   Trunc(Sum(bytes)/1024) free_kb
            FROM   dba_free_space
            GROUP BY tablespace_name) a,
           (SELECT tablespace_name,
                   Trunc(Sum(bytes)/1024) size_kb
            FROM   dba_data_files
            GROUP BY tablespace_name) b
    WHERE  a.tablespace_name = b.tablespace_name
    AND    Round((a.free_kb/b.size_kb) * 100,2) < 10
    PROMPT
    SET FEEDBACK ON
    SET PAGESIZE 18
    Set Termout  On
    Set Heading  On
    clear breaks
    break on contents -
    skip 1
    compute Sum of alloc used free nbfrag on contents
    column tblsp         format a20 wrap          heading  "Tablespace Name"
    column Alloc         format 999,999           heading  "Alloc|(Mb)"
    column Free          format 999,999           heading  "Free|(Mb)"
    column used          format 999,999           heading  "Used|(Mb)"
    column pused         format 990.9             heading  "%|Used|Space"
    column fragmax       format 99,999.9          heading  "Largest|Free|Ext.(Mb)"
    column nbfrag        format 99999             heading  "Nb|frag"
    column contents      format a10               heading  "Content"
    column pct_ext_coal  format 999                     heading  "% Ext.|Coal."
    column ext_manage    format a7 wrap           heading  "Ext.|M."
    column autoext       format a7 wrap           heading  "Auto|Ext."
    select
           contents
         , nvl (dt.tablespace_name, nvl (fsp.tablespace_name, 'Unknown')) tblsp
         , alloc
         , alloc - nvl (free, 0)       Used
         , nvl (free, 0)               Free
         , ((alloc - nvl (free, 0)) / alloc) * 100  pused
         , nbfrag
         , fragmax
         , dfsc.pct_ext_coal pct_ext_coal
         , dt.ext_manage
         , df.inc                           autoext
      from
           ( select sum (bytes)/1048576     free
                  , max (bytes)/1048576     fragmax
                  , tablespace_name
                  , count(*)                nbfrag
              from  sys.dba_free_space
             group  by tablespace_name
           ) fsp
        ,  ( select sum(bytes)/1048576      alloc
                  , tablespace_name
                  , Decode(((inc * &Var_DB_BLOCK_SIZE)/1024), Null, 'No', 'Yes')     inc
               from sys.dba_data_files sddf
                  , sys.filext$        aut
              where sddf.file_id       =  aut.file#   (+)
              group by tablespace_name
                     , Decode(((inc * &Var_DB_BLOCK_SIZE)/1024), Null, 'No', 'Yes')
              Union
              select sum(bytes)/1048576      alloc
                   , tablespace_name
                   , Decode(((increment_by * &Var_DB_BLOCK_SIZE)/1024), Null, 'No', 'Yes')    inc
                from sys.dba_temp_files sddf
               group by tablespace_name
                      , Decode(((increment_by * &Var_DB_BLOCK_SIZE)/1024), Null, 'No', 'Yes')
           ) df
        ,  ( select contents
                  , tablespace_name
                  , initial_extent/1024     initial_ext
                  , next_extent/1024        next_ext
                  , pct_increase
                  , max_extents
                  , min_extents
                  , Substr(extent_management,1,5)       ext_manage
               from dba_tablespaces
           ) dt
         , ( select percent_extents_coalesced    pct_ext_coal
                  , tablespace_name
               from dba_free_space_coalesced
           ) dfsc
    where
           fsp.tablespace_name  (+)   =   dt.tablespace_name
       and
           df.tablespace_name   (+)   =   dt.tablespace_name
       and
           dfsc.tablespace_name (+)   =   dt.tablespace_name
    order
        by contents
         , pused desc
    ;Cheers,
    Francisco Munoz Alvarez
    http://www.oraclenz.com

  • How to monitor temp tablespace

    I server in 11gR2 and 10gR2.
    Is there a way to monitor its usage, like, who is using it, how much space a session is using, what are the objects crated, ie. temp tables.
    Thanks.

    Hi
    This might helpful
    select TABLESPACE_NAME, BYTES_USED, BYTES_FREE from V$TEMP_SPACE_HEADER;Also checkout the below link.
    http://blog.flimatech.com/2010/06/15/how-to-monitor-temp-tablespace-usage/
    Cheers
    Kanchana

  • How to exlcude tablespaces in Grid space usage monitoring

    Hi all,
    Here is my issue I need to exclude let say UNDO tablespases from begin monitored by Grid (space used and space free), one way is to select all other tablesapces that I do want to monitor but what If I have few hundred production databases and each have a number tablespaces, , is there way to exclude the tablespaces using wild card
    ie ! %UNDO%.
    Thanks Tom

    I believe this is explained in ML Doc 392268.1 (How to - Exclude a Tablespace From The Tablespace Used (%) Metric)
    HTH
    Srini

  • Monitoring Tablespaces for critical Total Size

    Hi,
    I know that from RZ20 and dbacockpit you can monitor the Tablespace Storage. These alerts are for actual physical storage. My question; is there a monitor/report that can warn you of tablespaces that are reaching their limit.
    E.G:
    In DB2 V8, the max tablespace size for a 16kb page size is 256 GB (Regular Data). Is there a way of monitoring a tablespace, to warn you that it is nearing this limit.
    Kind Regards,
    Chris Geladaris
    SAP NetWeaver Basis

    try https://www.sdn.sap.com/irj/sdn/db6?rid=/library/uuid/f03d5fb8-b619-2b10-c383-c6d56872829e
    cheers,
    -Sunil

  • Monitor oracle tablespaces in CEN

    Hi,
    I have managed to setup auto reaction methods for filesystems, which was a bit of a long method i opted for but it works wonders and i get emails for the specific system and file path. One aspect i am having trouble with is monitoring tablespaces. in DSWP i have setup the threshold levels for all the tablespaces and in RZ21 in SolMan i have setup an auto reaction method to monitor PSAPUNDO which quite often hits 80% and use this to test it. In the CEN system's RZ20 i cannot see the remote system's list of tablespaces other than SolMan's own tablespaces so opted to configure RZ21's "Manage Central Autoreactions" but the tablespace has hit pass 90% and no email was triggered. i have used the MTE class CCMS_ORAucPSAPUNDO and i wish the names were more meaningful which i assume 'u' means "used"
    Has anyone setup this sort of monitoring?
    thanks Mani

    Need to check does your agent uploading XML files? some cases it fails to upload then you need to upload manually
    emctl upload agentor reconfigure if any problem occurs still

  • Monitor tablespace space usage, excluding UNDO

    Hi
    I tried to setup a monitoring template that enables me to monitor the space usage of all tablespaces but UNDO. It seems to me that Grid Control does not provide this built-in feature and I cannot customize. It monitors ALL tablespaces usage.
    If I create RULE, then I need to check all tablespaces names except UNDO. I have almost 200 databases. If doing that, it consumes huge amounts of time.
    Any solutions???
    Any input is appreciated.
    Kevin

    The current setting is
    Tablespace Space Used (%)
    UNDOTBS > 101 101 None Every 5 Minutes
    All others > 5 10 None Every 5 Minutes
    Does that mean that if UNDOTBS is 101% full, which never happens, I will get email.
    OEM will not evaluate the second condition if the first condition dissatisfies. If that is the case, I shall never get email.
    Then I think I shall reverse the order. When I tried to use [Reorder] button, I cannot reverse the order. Probably, OEM considers [All Others] as the last execution conditionl.
    Kevin

  • Tablespace Size Monitoring

    Hello,
    can anyone tell me if it is possible that I can set up OEM to send alerts for tablespaces which reach > 20 gigabtyes. I know very little about PL/SQL, so If anyone can provide a sample of how to code this in a windows environment, I would be very appreciative,
    Regards
    user563613

    Check this:
    [http://download.oracle.com/docs/cd/B19306_01/server.102/b14196/montune001.htm#CACCIHAB]

Maybe you are looking for

  • How to print a text in java?

    How to print a text in java?

  • User  Management  Engine

    What is it that we acheive by connecting an r/3 system using the UM configuration in the system configuration Is it necessary that we , prior to mapping users in a portal to that in r/3, do the UM configuration?

  • How to install 8.17ops on redhat linux7.0

    Is there anyone can tell me how to install ops on redhat linux 7.0; Two pc server , and share out raid disk array ! Thanks !

  • Flash will not install on 10.8.4 for me...

    Cannot watch youtube. It says blocked plug in, so I download latest flash, it opens the installer but, the installer window after I enter my password, is blank... I wont show any prompts. Can someone help? Thanks!! my machine is a 2011 mbp quad i7 17

  • Tpopen TPERMERR xa_open returned XAER_RMERR

    Trouble during tmboot phase of servers... Resource management of the database extensions are failing even though the correct settings (ie. database name, user name/password, and TMS resource/TMSUDB2) are stated in the tuxedo configuration file. Recei