Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8183075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:03:12+00:00 2026-06-07T01:03:12+00:00

The query below outputs the logical reads on all tables in the database by

  • 0

The query below outputs the “logical reads” on all tables in the database by hour. Each snap_id is in a one hour time frame.

SELECT
    a.snap_id,
    e.begin_interval_time,
    e.end_interval_time,
    owner               as schema,
    object_name         AS table_name,
    logical_reads_delta as logical_reads_per_table
FROM
    dba_hist_seg_stat     a,
    dba_hist_seg_stat_obj b,
    dba_hist_sqlstat      c,
    dba_hist_snapshot     e
WHERE
        owner      !=  'SYS'
    and owner      !=  'SYSTEM'
    and a.snap_id   =  c.snap_id
    and c.snap_id   =  e.snap_id
    AND a.obj#      =  b.obj#
    AND a.dataobj#  =  b.dataobj#
    AND object_type = 'TABLE'
ORDER BY
    a.snap_id;

Output:

snap_id begin_interval_time       end_interval_time         schema table_name        logical_reads_per_table
------- ------------------------- ------------------------- ------ ----------------- -----------------------
8414    06/28/2012 7:00:11.006 AM 06/28/2012 8:00:16.540 AM WV90   WVT_WVPERFORATION 50288
8414    06/28/2012 7:00:11.006 AM 06/28/2012 8:00:16.540 AM WV90   WVT_WVPERFORATION 50288
8414    06/28/2012 7:00:11.006 AM 06/28/2012 8:00:16.540 AM WV90   WVT_WVPERFORATION 50288
8415    06/28/2012 8:00:16.540 AM 06/28/2012 9:00:21.516 AM EG     USER_GROUP_LIST   105328
8415    06/28/2012 8:00:16.540 AM 06/28/2012 9:00:21.516 AM EG     USER_GROUP_LIST   105328

I think there’s duplicates because of unique SQL_IDs that hit each table (not showing that).

I need to do a left-join(I think) and grouping to get the specified output I really want.

I would like the output to be something like this…

SNAP_ID | BEGIN_INTERVAL_TIME | END_INTERVAL_TIME ->>> OWNER | OBJECT_NAME | LOGICAL_READS_DELTA (logical reads in the time frame)

Ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T01:03:13+00:00Added an answer on June 7, 2026 at 1:03 am

    You can try using the DISTINCT keyword to remove duplicates.

    SELECT DISTINCT 
          a.snap_id, 
          e.begin_interval_time, 
          e.end_interval_time, 
          owner as schema, 
          object_name AS table_name, 
          logical_reads_delta as logical_reads_per_table
    FROM  dba_hist_seg_stat a, 
          dba_hist_seg_stat_obj b, 
          dba_hist_sqlstat c, 
          dba_hist_snapshot e
    WHERE owner != 'SYS'
          and owner!= 'SYSTEM'
          and a.snap_id=c.snap_id
          and c.snap_id=e.snap_id
          AND a.obj# = b.obj#
          AND a.dataobj# = b.dataobj#
          AND object_type = 'TABLE'
    ORDER BY a.snap_id;`
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following Query which produces the output below; SELECT TBLUSERS.USERID, TBLUSERS.ADusername, TBLACCESSLEVELS.ACCESSLEVELID,
I have tried the below query: select empno from ( select empno from emp
The code below only outputs single line(there are 2 in database that should be
The query below outputs this results: +------------+------------+ | testID | testStatus| +------------+------------+ | 1
I have these two tables setup and the below query running. The problem is
I use teradata and the below query outputs Altlüd when run using a teradata
In the query below: SELECT column FROM table LIMIT 18 OFFSET 8 how many
My LINQ query is not producing the expected output below. Basically, it's the sum
The query below returns rows that have both loginid and ip2 in the bumps
If the query below returns a 'template' id for any template assigned to a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.