Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • set_env_dba Linux/Unix
  • Oracle Standby Database Library Index from Metalink Oracle
  • Adding or Dropping Online Redo Log Files When Physical Standby in place Oracle
  • Another export with Query Oracle
  • 272332.1 CRS 10g Diagnostic Collection Guide Oracle
  • to see when crontab is changed. Linux/Unix
  • ext#.sql Oracle
  • Validating ORACLE_SID againt oratab file. Linux/Unix
  • Drop database in Oracle 10g Oracle
  • For Perl DBI installation and testing program PHP/MYSQL/Wordpress
  • pvmehta.com SQL scripts
    Find which sessions is accessing object that prevent your session to have exclusive locks in Oracle Oracle
  • Finding last recovered file on DR and remove all chanracters before any “/” Linux/Unix
  • DBMS_UTILITY PACKAGE Oracle
  • All About oracle password and security from metalink Oracle
  • scripts to take listener.log backup Linux/Unix

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

  • Oracle 11g Environment Setup Oracle
  • column level grant syntax Oracle
  • When error comes for temporary tablespace with version <= 9i Oracle
  • eplan.sql Oracle
  • create user with unlimited quota Oracle
  • Handling LOB data in Oracle 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
  • Optimizer SORT Operations Oracle
  • plan10g.sql Oracle
  • SQL Tracker by SID sqltrackerbysid.sql Oracle
  • xargs use Linux/Unix
  • arch_configUOCIOTTO.ora Oracle
  • Rman Notes -1 Oracle
  • Python class import from different folders Python/PySpark
  • oracle fast start failover best practice Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme