set linesize 200
set pagesize 100
column day format a15 heading 'Day'
column d_0 format a3 heading '00'
column d_1 format a3 heading '01'
column d_2 format a3 heading '02'
column d_3 format a3 heading '03'
column d_4 format a3 heading '04'
column d_5 format a3 heading '05'
column d_6 format a3 heading '06'
column d_7 format a3 heading '07'
column d_8 format a3 heading '08'
column d_9 format a3 heading '09'
column d_10 format a3 heading '10'
column d_11 format a3 heading '11'
column d_12 format a3 heading '12'
column d_13 format a3 heading '13'
column d_14 format a3 heading '14'
column d_15 format a3 heading '15'
column d_16 format a3 heading '16'
column d_17 format a3 heading '17'
column d_18 format a3 heading '18'
column d_19 format a3 heading '19'
column d_20 format a3 heading '20'
column d_21 format a3 heading '21'
column d_22 format a3 heading '22'
column d_23 format a3 heading '23'

select
        substr(to_char(FIRST_TIME,'YYYY/MM/DD,DY'),1,15) day,
        decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'00',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'00',1,0))) d_0,
        decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'01',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'01',1,0))) d_1,
        decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'02',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'02',1,0))) d_2,
        decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'03',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'03',1,0))) d_3,
        decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'04',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'04',1,0))) d_4,
        decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'05',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'05',1,0))) d_5,
        decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'06',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'06',1,0))) d_6,
        decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'07',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'07',1,0))) d_7,
        decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'08',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'08',1,0))) d_8,
        decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'09',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'09',1,0))) d_9,
        decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'10',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'10',1,0))) d_10,
        decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'11',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'11',1,0))) d_11,
        decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'12',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'12',1,0))) d_12,
        decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'13',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'13',1,0))) d_13,
        decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'14',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'14',1,0))) d_14,
        decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'15',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'15',1,0))) d_15,
        decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'16',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'16',1,0))) d_16,
        decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'17',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'17',1,0))) d_17,
        decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'18',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'18',1,0))) d_18,
        decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'19',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'19',1,0))) d_19,
        decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'20',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'20',1,0))) d_20,
        decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'21',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'21',1,0))) d_21,
        decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'22',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'22',1,0))) d_22,
        decode(sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'23',1,0)),0,'-',sum(decode(substr(to_char(FIRST_TIME,'HH24'),1,2),'23',1,0))) d_23,
count(*)            total
from
        v$log_history where first_time> sysdate-60
group by
        substr(to_char(FIRST_TIME,'YYYY/MM/DD,DY'),1,15)
order by
        substr(to_char(FIRST_TIME,'YYYY/MM/DD,DY'),1,15) desc;

----2

SELECT  to_char(first_time,'yyyy-mm-dd') Dt,  
to_char(first_time, 'Dy') dy,  
count(1) "Total",  
SUM(decode(to_char(first_time, 'hh24'),'00',1,0)) "h0",  
SUM(decode(to_char(first_time, 'hh24'),'01',1,0)) "h1",  
SUM(decode(to_char(first_time, 'hh24'),'02',1,0)) "h2",  
SUM(decode(to_char(first_time, 'hh24'),'03',1,0)) "h3",  
SUM(decode(to_char(first_time, 'hh24'),'04',1,0)) "h4",  
SUM(decode(to_char(first_time, 'hh24'),'05',1,0)) "h5",  
SUM(decode(to_char(first_time, 'hh24'),'06',1,0)) "h6",  
SUM(decode(to_char(first_time, 'hh24'),'07',1,0)) "h7",  
SUM(decode(to_char(first_time, 'hh24'),'08',1,0)) "h8",  
SUM(decode(to_char(first_time, 'hh24'),'09',1,0)) "h9",  
SUM(decode(to_char(first_time, 'hh24'),'10',1,0)) "h10",  
SUM(decode(to_char(first_time, 'hh24'),'11',1,0)) "h11",  
SUM(decode(to_char(first_time, 'hh24'),'12',1,0)) "h12",  
SUM(decode(to_char(first_time, 'hh24'),'13',1,0)) "h13",  
SUM(decode(to_char(first_time, 'hh24'),'14',1,0)) "h14",  
SUM(decode(to_char(first_time, 'hh24'),'15',1,0)) "h15",  
SUM(decode(to_char(first_time, 'hh24'),'16',1,0)) "h16",  
SUM(decode(to_char(first_time, 'hh24'),'17',1,0)) "h17",  
SUM(decode(to_char(first_time, 'hh24'),'18',1,0)) "h18",  
SUM(decode(to_char(first_time, 'hh24'),'19',1,0)) "h19",  
SUM(decode(to_char(first_time, 'hh24'),'20',1,0)) "h20",  
SUM(decode(to_char(first_time, 'hh24'),'21',1,0)) "h21",  
SUM(decode(to_char(first_time, 'hh24'),'22',1,0)) "h22",  
SUM(decode(to_char(first_time, 'hh24'),'23',1,0)) "h23" 
FROM V$log_history  
group by to_char(first_time,'yyyy-mm-dd') ,  
to_char(first_time, 'Dy')  
order by 1;

oracle 查询归档增长量的更多相关文章

  1. oracle 查询 归档日志最大值和平均值

    select max(ss.size_GB), avg(ss.size_GB)  from (select s.*, rownum rn2          from (select a.*      ...

  2. 如何检查oracle的归档空间是否满了?

    如何检查oracle的归档空间是否满了? 关于如何检查归档空间是否慢了,大多数人会去先检查放归档的目录的磁盘空间是否满了,通过该归档目录空余情况来判断归档空间是否满了,但我觉得这个方法不一定代表实际情 ...

  3. 如何检查oracle的归档日志及空间占用率,清除归档日志

    如何解决“归档日志已满问题” 问题描述: 所用数据库为 Oracle 10g ,模式为归档模式,oracle 系统默认的归档空间为2G,由于日志过多,空间写满,数据库的redo文件不能归档,而出现or ...

  4. 如何检查oracle的归档空间是否满了

    如何检查oracle的归档空间是否满了   关于如何检查归档空间是否慢了,大多数人会去先检查放归档的目录的磁盘空间是否满了,通过该归档目录空余情况来判断归档空间是否满了,但我觉得这个方法不一定代表实际 ...

  5. oracle删除归档日志

    查看归档模式: SQL> archive log list; Database log mode Archive Mode Automatic archival Enabled Archive ...

  6. Oracle 查询出来的数据取第一条

    Oracle 查询出来的数据取第一条 --------------------------------------------------------------------------- 转载自:h ...

  7. Oracle查询和问题简记

    现在做两个版本的系统,一个用的数据库是Access,另一个就是Oracle了.每个数据库支持的的查询SQL语句都有所区别,这里主要针对Access和Oracle做 记录. 首先贴出遇到问题最多的一条语 ...

  8. 45 个非常有用的 Oracle 查询语句

    ​ 这里我们介绍的是 40+ 个非常有用的 Oracle 查询语句,主要涵盖了日期操作,获取服务器信息,获取执行状态,计算数据库大小等等方面的查询.这些是所有 Oracle 开发者都必备的技能,所以快 ...

  9. oracle 查询最近执行过的 SQL语句(转载)

    oracle 查询最近执行过的 SQL语句 (2014-06-09 18:02:43) 转载▼   分类: Database oracle 查询最近执行过的 SQL语句 select sql_text ...

随机推荐

  1. base64编码的作用【转】

    转自:https://www.zhihu.com/question/36306744/answer/71626823 X.509公钥证书也好,电子邮件数据也好,经常要用到Base64编码,那么为什么要 ...

  2. HDFS 安全模式的理解

    安全模式是hadoop的一种保护机制,用于保证集群中的数据块的安全性. 当集群启动的时候,会首先进入安全模式.当系统处于安全模式时会检查数据块的完整性.假设我们设置的副本数(即参数dfs.replic ...

  3. [PHP] 算法-原址排序数组使奇数位于偶数前面的PHP实现

    输入一个整数数组,实现一个函数来调整该数组中数字的顺序,使得所有的奇数位于数组的前半部分,所有的偶数位于数组的后半部分,并保证奇数和奇数,偶数和偶数之间的相对位置不变. 1.遍历数组,判断元素奇数偶数 ...

  4. canvas学习和滤镜实现

    最近学习了 HTML5 中的重头戏--canvas.利用 canvas,前端人员可以很轻松地.进行图像处理.其 API 繁多,这次主要学习常用的 API,并且完成以下两个代码: 实现去色滤镜 实现负色 ...

  5. Design--源自生活美学的色彩搭配网站(design-seeds)

    All the flowers of all the tomorrows are in the seeds of today. 色彩搭配网站--design-seeds.com // 所有的颜色值都是 ...

  6. debounce(防抖动函数)

    短时间内不重复触发一个事件 设置一个门槛值,表示两次 Ajax 通信的最小间隔时间.如果在间隔时间内,发生新的keydown事件,则不触发 Ajax 通信,并且重新开始计时.如果过了指定时间,没有发生 ...

  7. 【代码笔记】Web-JavaScript-JavaScript 变量

    一,效果图. 二,代码. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> ...

  8. express koa koa2 优缺点分析

    发布日期 2009年6月26日,TJ 提交 Express 第一次 commit.目前拥有 5000 多次 commit. 2013年8月17日, TJ 只身一人提交 Koa 第一次 commit.目 ...

  9. springboot 学习之路 22 (读取自定义文件)

    springboot读取自定义的properties文件: package com.huhy.demo.properties; import lombok.Data; import org.sprin ...

  10. 操作过程-CentOS7下添加新硬盘扩充已经存在的逻辑卷分区的存储空间

    Linux添加硬盘扩充已有分区存储空间方式 总体步骤 磁盘初始化分区 创建物理卷 扩展卷组 扩展逻辑卷 通知文件系统生效 ​ 磁盘初始化分区 [root@oracledb ~]# fdisk -l 磁 ...