ba6.us - Dave's Database Related Stuff

  • home
  • blog
  • notes
  • projects
  • recent
  • about
  • !
Home › Real Time Monitoring of Oracle

Tag Cloud

apex data development export funnies Hint HTML import linux monitoring oem oracle performance perl pl/sql reporting rman scripting solaris sql sqlplus tuning unix windows
more tags

Search

RSS Feed

Blog Posts :

Navigation

  • Feed aggregator

User login

  • Request new password

Instance

dmann — Fri, 10/03/2008 - 15:49

General Status

select name, log_mode, open_mode 
  from v$database;

Archive Log Usage

This query summarizes Archive Log Switches for today. Change the where clause in this statement to change the time period analyzed.

select trunc(completion_time,'HH'), count(*)
from v$archived_log
where trunc(completion_time) = trunc(sysdate)
group by trunc(completion_time,'HH');

Transactions Per Second

Defined as User Commits + User Rollbacks.

-- Calculate Transactions Per Second
SET SERVEROUTPUT ON
DECLARE
    begindate date;
    enddate date;
    beginval number;
    endval number;
BEGIN

    select sysdate, sum(value) 
    into begindate, beginval
    from v$sysstat 
    where name in ('user commits','user_rollbacks');

    dbms_lock.sleep(5);

    select sysdate, sum(value) 
    into enddate, endval
    from v$sysstat 
    where name in ('user commits','user_rollbacks');

    dbms_output.put_line( (endval-beginval) || 
                          ' transactions');
    
    dbms_output.put_line( ((enddate-begindate) * 86400) || 
                          ' seconds');

    dbms_output.put_line( (endval-beginval) / ((enddate-begindate) * 86400) || 
                          ' transactions per second');

END;
/

Undo Status

alter session set NLS_DATE_FORMAT='DD-MON-YYYY HH24:MI:SS'; 
select usn, 
       state, 
       undoblockstotal "Total", 
       undoblocksdone "Done", 
       undoblockstotal-undoblocksdone "ToDo", 
       decode(cputime,
              0,
              'unknown',
              sysdate+(((undoblockstotal-undoblocksdone) / 
                       (undoblocksdone / cputime)) / 86400)) 
              "Estimated time to complete" 
from v$fast_start_transactions;
‹ Import/Export up Locks ›
  • Printer-friendly version
  • Add new comment


Cornify
  • home
  • blog
  • notes
  • projects
  • recent
  • about
  • !

Content Copyright 2006-2010. Links are copyright of respective owners.