Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • How To Transfer Passwords Between Databases (ref note: 199582.1) Oracle
  • find the files that are 1 day old. Linux/Unix
  • Oracle 10g Installation/Applying Patches Tips Oracle
  • Guide to Linux System Command Mastery Linux/Unix
  • move_arch_files.ksh Linux/Unix
  • tab.sql Oracle
  • How to find the real execution plan and binds used in that explain plan in Oracle 10g?? Oracle
  • CTAS with LONG Column for 9i and higher Oracle
  • Renaming Global Name GLOBAL_NAME Oracle
  • Wait.sql Oracle
  • Parallel DML Oracle
  • Locally Managed Tablespace and Dictionary managed tablespace (LMT-DMT) Oracle
  • Zip and unzip with tar Linux/Unix
  • pvm_metric.sql for gathering report from vmstat tables Oracle
  • move_arch_files.ksh 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

  • sid_wise_sql.sql Further explaination Oracle
  • Transfer SQL Profiles from One database to other database. Oracle
  • FRA Information. Oracle
  • block_ident.sql Oracle
  • Database logon trigger issue Oracle
  • oradebug ipcrm ipcs 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 (388)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (337)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • 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
  • 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

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Removing first line Linux/Unix
  • send email from unix mailx with attachment. Linux/Unix
  • How to collect CPU usage on Linux using Shell script Linux/Unix
  • .profile Linux/Unix
  • run this before doing any dbchange pvm_pre_change.sql Oracle
  • Monitor and Trace Unix processes using truss Linux/Unix
  • Kernel Parameters for Solaris Linux/Unix
  • find_log_switch.sql Find log switches in graphical manner Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme