Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • ipcs -l Linux/Unix
  • Important Script Method for tuning Oracle
  • PLSQL Table Syntax 2 Oracle
  • ORA-3136 Oracle
  • Process Map for CPU and Memory for OS processes Linux/Unix
  • How to Make Trace Files Created by Oracle Readable by All Users ? Oracle
  • Roles and Stored Procs II Oracle
  • Add new columns in dataframe Python/PySpark
  • How to connect to Oracle Database with Wallet with Python. Oracle
  • Explain Plan Doesn’T Change For Sql After New Statistics Generated Oracle
  • Find long Running Transaction Linux/Unix
  • scripts to take listener.log backup Linux/Unix
  • Find sort details from Db find_sort.sql Oracle
  • Optimizer SORT Operations Oracle
  • Resolving RMAN Hung Jobs 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

  • online_bkup.sql Oracle
  • Find average Row Length and other table size calculation. metalink notes Oracle
  • Jai Shree Ram Oracle
  • How to Use DBMS_STATS to Move Statistics to a Different Database Oracle
  • Gather Stats manually using DBMS_STATS after disabling DBMS_SCHEDULER jobs as previous entry Oracle
  • Oracle Release Explaination 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 (387)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (336)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • 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
  • Reading config file from other folder inside class24-Sep-2024
  • Python class import from different folders22-Sep-2024
  • Transfer SQL Profiles from One database to other database.05-Sep-2024
  • Load testing on Oracle 19C RAC with HammerDB18-Jan-2024
  • Add new columns in dataframe30-Sep-2023

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • TRUNCATE table and disabling referential constraints. Oracle
  • Optimizer SORT Operations Oracle
  • Find long Running Transaction Linux/Unix
  • sql_doing_fts.sql Oracle
  • Drop database in Oracle 10g Oracle
  • refre.sql Oracle
  • crtgr.sql /* For creating trigger from data dictionary */ Oracle
  • Sending SQLPLUS output in HTML format Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme