Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • To see mem usage and CPU usage system wide. Linux/Unix
  • RAC 11g with vmware Oracle
  • Flowers Resize datafiles Oracle
  • proc.sql Oracle
  • Identical Dblink Issue… Oracle
  • Find Command Linux/Unix
  • export import with parameter file. Oracle
  • How to find who is using which Rollback segment and how many rows or blocks in that rollback segments, Oracle
  • My Test Case On 21-OCT-2005 Oracle
  • When error comes for temporary tablespace with version <= 9i Oracle
  • Standby Database Behavior when a Datafile is Resized on the Primary Database Note:123883.1 Oracle
  • How to analyze statspack or AWR report. Oracle
  • TOP-N Sql to find Nth max or Top N rows Oracle
  • 339939.1 Running Cluster Verification Utility to Diagnose Install Problems Oracle
  • Getting started with notebook Python/PySpark

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

  • ext#.sql Oracle
  • How to calculate PROCESSES parameter Oracle
  • 10g RAC: Troubleshooting CRS Root.sh Problems Oracle
  • Test Case for Inserting Multiple (2.3 Million rows in 26 Seconds) Oracle
  • 272332.1 CRS 10g Diagnostic Collection Guide Oracle
  • tblwopk.sql /* Find Tables Without PK */ 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
  • SYSOPER Mystery Oracle
  • Rollback force for distributed transactions Oracle
  • To find explain plan for a statement that occurred in past. Oracle
  • Parallel DML Oracle
  • plan10g.sql good1 Oracle
  • v$event_name Oracle
  • lck.sql Oracle
  • Read CSV file using PySpark Python/PySpark

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme