博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
登录日志分析常用查询
阅读量:4350 次
发布时间:2019-06-07

本文共 1422 字,大约阅读时间需要 4 分钟。

-- 登陆总次数  每天  建议查最近一月      select to_char(t.create_on, 'yyyy-mm-dd'),count(1) from base_login_log t  where t.create_on>to_date('2017-12-01 00:00:00','yyyy-mm-dd hh24:mi:ss') group by to_char(t.create_on, 'yyyy-mm-dd')  order by to_char(t.create_on, 'yyyy-mm-dd')

 

 

-- 登陆总次数  每小时  建议查最近1天     select to_char(t.create_on, 'yyyy-mm-dd hh24'),count(1) from base_login_log t  where t.create_on>to_date('2017-12-13 00:00:00','yyyy-mm-dd hh24:mi:ss') group by to_char(t.create_on, 'yyyy-mm-dd hh24')  order by to_char(t.create_on, 'yyyy-mm-dd hh24')

 

-- 登录成功  每小时  建议查最近1天     select to_char(t.create_on, 'yyyy-mm-dd hh24'),count(1) from base_login_log t  where t.create_on>to_date('2017-12-13 00:00:00','yyyy-mm-dd hh24:mi:ss') and   t.login_status='用户登录'  group by to_char(t.create_on, 'yyyy-mm-dd hh24')  order by to_char(t.create_on, 'yyyy-mm-dd hh24')

 

 

-- 登录失败 每小时  建议查最近1天     select to_char(t.create_on, 'yyyy-mm-dd hh24'),count(1) from base_login_log t  where t.create_on>to_date('2017-12-01 00:00:00','yyyy-mm-dd hh24:mi:ss') and   t.login_status<>'用户登录'  group by to_char(t.create_on, 'yyyy-mm-dd hh24')  order by to_char(t.create_on, 'yyyy-mm-dd hh24')

 

-- 统计MAC登录次数        select  mac_address,count(1) from base_login_log t where t.create_on>to_date('2017-12-13 00:00:00','yyyy-mm-dd hh24:mi:ss') and  mac_address is not nullgroup by mac_address order by count(1) desc

 

转载于:https://www.cnblogs.com/hnsongbiao/p/8035141.html

你可能感兴趣的文章
SQL Server2012完全备份、差异备份、事务日志备份和还原操作
查看>>
Flash动画播放
查看>>
springmvc+mybatis+dubbo+zookeeper 分布式架构
查看>>
HDUOJ-----Computer Transformation
查看>>
HDUOJ-----2838Cow Sorting(组合树状数组)
查看>>
自定义控件之---抽屉式弹窗控件.
查看>>
一款纯css3实现的机器人看书动画效果
查看>>
加班与效率
查看>>
轻量级Modal模态框插件cta.js
查看>>
MyEclipse下SpringBoot+JSP整合过程及踩坑
查看>>
重定向和管道
查看>>
实验五
查看>>
STL学习笔记(第二章 C++及其标准程序库简介)
查看>>
Operator_countByValue
查看>>
Java 日期往后推迟n天
查看>>
Web应用漏洞评估工具Paros
查看>>
Git 和 Github 使用指南
查看>>
20180925-4 单元测试
查看>>
mysql的数据存储
查看>>
[转载] Activiti Tenant Id 字段释疑
查看>>