Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • How to see which patches are applied. Oracle
  • Jai Shree Ram Linux/Unix
  • Composite Index creation tip from Vivek Oracle
  • DBMS_STATS Metalinks Notes Oracle
  • refre.sql Oracle
  • When error comes for temporary tablespace with version <= 9i Oracle
  • RAC 11g with vmware Oracle
  • checking connectivity between two servers Linux/Unix
  • New OFA for 11g Oracle
  • Formatter Explain plan Output 1 Oracle
  • TNSNAMES entries details Oracle
  • Wait Based Tuning Step by step with SQL statement Oracle
  • AWR settings- MMON is not taking snapshot. Oracle
  • All About oracle password and security from metalink Oracle
  • pvm_metric.sql for gathering report from vmstat tables Oracle

Query to Generate aggregate on every 30 mins.

Posted on 09-Feb-2010 By Admin No Comments on Query to Generate aggregate on every 30 mins.

select to_char(first_time, ‘RRRRMMDDHH24’),

COUNT (CASE WHEN TO_NUMBER(TO_CHAR(FIRST_time, ‘MI’)) <= 30 THEN 1 ELSE NULL END) COUNT1,
COUNT (CASE WHEN TO_NUMBER(TO_CHAR(FIRST_time, ‘MI’)) > 30 THEN 1 ELSE NULL END) COUNT2

FROM V$LOG_HISTORY

GROUP BY to_char(first_time, ‘RRRRMMDDHH24’)

order by 1

/

TO_CHAR(FI COUNT1 COUNT2

———- ———- ———-

2010020906 3 1

2010020907 3 1

2010020908 3 1

2010020909 3 1

2010020910 3 1

2010020911 3 1

2010020912 3 1

2010020913 3 1

2010020914 3 1

2010020915 3 1

2010020916 4 2

TO_CHAR(FI COUNT1 COUNT2

———- ———- ———-

2010020917 3 1

2010020918 3 1

2010020919 1 0

Oracle, SQL scripts

Post navigation

Previous Post: Distributed Transaction Troubleshooting.
Next Post: Generating XML from SQLPLUS

Related Posts

  • configUOCIOTTO.ora Oracle
  • Difference between SYNC and AFFIRM Oracle
  • create PLAN_TABLE command. Oracle
  • alter database backup controlfile to trace Oracle
  • Wait time tuning research Oracle
  • Error Handling in Proc Oracle

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • AWS (2)
  • Azure (1)
  • Linux/Unix (149)
  • Oracle (392)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (341)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • load SPM baseline from cursor cache05-Jun-2025
  • Drop all SPM baselines for SQL handle05-Jun-2025
  • Load SPM baseline from AWR05-Jun-2025
  • Drop specific SQL plan baseline – spm05-Jun-2025
  • findinfo.sql (SQL for getting CPU and Active session info)27-May-2025
  • SQL Tracker by SID sqltrackerbysid.sql22-Apr-2025
  • How to connect to Oracle Database with Wallet with Python.21-Mar-2025
  • JSON/XML Types in Oracle18-Mar-2025
  • CPU Core related projections12-Mar-2025
  • Exadata Basics10-Dec-2024

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • fuser to check who is using diretory Linux/Unix
  • Oracle Standby Database Library Index from Metalink Oracle
  • Zip and unzip with tar Linux/Unix
  • tblwopk.sql /* Find Tables Without PK */ Oracle
  • How to connect to Oracle Database with Wallet with Python. Oracle
  • Histogram Overview Oracle
  • Flowers Resize datafiles Oracle
  • fkwoind.sql fkwoindex.sql Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme