热点推荐:ASP.Net | ADO.Net | VB.Net | Web服务器 | Access | MSSQL | MySQL | Oracle | .Net控件 | Win 9x | Win 2000 | Win 2003 | DOS | Unix | 注册表 | 应用其它 | 安装调试 | 基本操作 | 使用技巧 | 系统优化 |故障处理 | 个性风格 | 病毒安全 | 专杀工具
您现在的位置: 中华IT技术网 >> 数据库 >> Oracle >> 正文
全文
使用外部表分析eygle.com的网站访问日志
作者:水水雨雨    文章来源:Oracle    更新时间:2007-7-29
alter session set events = 'immediate trace name flush_cache';

  Session altered.

  Elapsed: 00:00:00.03

  SQL> select count(distinct(substr(ip_address_date,1,instr(ip_address_date,' ')))) uip

  2 from ealog;

  UIP

  ----------

  7528

  Elapsed: 00:00:02.15

  此时用了大约2秒的时间,也就是说,外部表的性能较数据库表大约慢了3倍左右。

  继续,我们可以查询当日网站中,哪些网页是被最频繁访问的:

  SQL> select replace((replace(acc_file,'GET ','www.eygle.com')),'HTTP/1.1') accfile,ct from (

  2 select ACC_FILE,count(*) ct from eygle_access_log_20061016

  3 where acc_file like '%htm%'

  4 group by acc_file order by ct desc)

  5 where rownum <21;

  ACCFILE CT

  -------------------------------------------------------------------------------- ----------

  www.eygle.com/index-tech.htm 110

  www.eygle.com/archives/2006/10/wish_home.html 103

  www.eygle.com/index-ha.htm 79

  www.eygle.com/me/fairy_tale_leaf.htm 77

  www.eygle.com/archives/2006/11/use_oracle_external_table.html 73

  www.eygle.com/index-sql.htm 69

  www.eygle.com/archives/2006/10/tom_oracle_9i10g.html 68

  www.eygle.com/archives/2008/08/my_book_services.html 63

  www.eygle.com/archives/2006/11/welcome_friend.html 62

  www.eygle.com/archives/2006/10/veritas_vcs_simulator.html 61

  www.eygle.com/index-case.htm 60

  www.eygle.com/archives/2004/08/aoaouiiciona.html 59

  www.eygle.com/archives/2006/08/oracle_fundbook_recommand.html 52

  www.eygle.com/archives/2006/08/5460_8174.html 49

  www.eygle.com/archives/2004/12/gmailaeaeoa.html 48

  www.eygle.com/archives/2005/06/howlsmovingcast.html 48

  www.eygle.com/gbook/index.html 48

  www.eygle.com/index-hist.htm 44

  www.eygle.com/index-special.htm 41

  www.eygle.com/index-f&l.htm 37

  20 rows selected.

  Elapsed: 00:00:06.31

  SQL>

  通过外部表及SQL查询,只要日志文件中存在的信息,都可以很容易的被获取和分析.

  -The End-

上一页  [1] [2] 

相关文章
最新更新
编辑推荐
热门图片
频道大全
文章阅读排行
周排行
月排行