首页 | 新闻 | 短信 | 邮件 | 商城 | 搜索 | 社区 | 在线 | 企业
搜狐首页 >> IT频道首页 >> 网狐教程 >> 程序开发(新) >> 数据库
提高ORACLE数据库的查询统计速度(5)
2002-08-26 16:15  作者: 刘亚波  转自: 赛迪网
   系统的基础数据库存表、名录表大约有数据80M;一个单位一般每年收发300次,收发料单大约有数据50M;系统冗余数据100M,系统辅助数据10M;因此,系统总共需要空间大约是240M,现在系统开辟数据空间500M,完全满足存储要求。由于系统使用了冗余数据,在查询常用数据时,避免了多表联结查询的情况,这样,虽然使用了更多的存储空间,但查询效率大幅度提高;同时,系统将需要经常联结查询的数据放在一簇,即将存放这些数据的空间在物理上相邻,这样也使查询速度大大提高。
  
  另外在oracle7.33数据库的Database目录下有一个Initorcl.ora文件,改变其中的设置也可以提高查询统计速度。该文件的内容如下:
  
  #
  # $Header: init.ora 1.2 94/10/18 16:12:36 gdudey Osd $ init.ora Copyr (c) 1991 Oracle
  #
  ##############################################################################
  # Example INIT.ORA file
  #
  # This file is provided by Oracle Corporation to help you customize
  # your RDBMS installation for your site. Important system parameters
  # are discussed, and example settings given.
  #
  # Some parameter settings are generic to any size installation.
  # For parameters that require different values in different size
  # installations, three scenarios have been provided: SMALL, MEDIUM
  # and LARGE. Any parameter that needs to be tuned according to
  # installation size will have three settings, each one commented
  # according to installation size.
  #
  # Use the following table to approximate the SGA size needed for the
  # three scenarious provided in this file:
  #
  # -------Installation/Database Size------
  # SMALL MEDIUM LARGE
  # Block 2K 4500K 6800K 17000K
  # Size 4K 5500K 8800K 21000K
  #
  # To set up a database that multiple instances will be using, place
  # all instance-specific parameters in one file, and then have all
  # of these files point to a master file using the IFILE command.
  # This way, when you change a public
  # parameter, it will automatically change on all instances. This is
  # necessary, since all instances must run with the same value for many
  # parameters. For example, if you choose to use private rollback segments,
  # these must be specified in different files, but since all gc_*
  # parameters must be the same on all instances, they should be in one file.
  #
  # INSTRUCTIONS: Edit this file and the other INIT files it calls for
  # your site, either by using the values provided here or by providing
  # your own. Then place an IFILE= line into each instance-specific
  # INIT file that points at this file.
  ###############################################################################
  
  db_name = oracle
  db_files = 20
  control_files = C:\ORAWIN95\DATABASE\ctl1orcl.ora
  
  compatible = 7.3.0.0.0
  
  db_file_multiblock_read_count = 8 # INITIAL
  # db_file_multiblock_read_count = 8 # SMALL
  # db_file_multiblock_read_count = 16 # MEDIUM
  # db_file_multiblock_read_count = 32 # LARGE
  
  db_block_buffers = 200 # INITIAL
  # db_block_buffers = 200 # SMALL
  # db_block_buffers = 550 # MEDIUM
  # db_block_buffers = 3200 # LARGE
  
  shared_pool_size = 3500000 # INITIAL
  # shared_pool_size = 3500000 # SMALL
  # shared_pool_size = 6000000 # MEDIUM
  # shared_pool_size = 9000000 # LARGE
  
  log_checkpoint_interval = 10000
  
  processes = 50 # INITIAL
  # processes = 50 # SMALL
  # processes = 100 # MEDIUM
  # processes = 200 # LARGE
  
  dml_locks = 100 # INITIAL
  # dml_locks = 100 # SMALL
  # dml_locks = 200 # MEDIUM
  # dml_locks = 500 # LARGE
  
  log_buffer = 8192 # INITIAL
  # log_buffer = 8192 # SMALL
  # log_buffer = 32768 # MEDIUM
  # log_buffer = 163840 # LARGE
  
  sequence_cache_entries = 10 # INITIAL
  # sequence_cache_entries = 10 # SMALL
  # sequence_cache_entries = 30 # MEDIUM
  # sequence_cache_entries = 100 # LARGE
  
  sequence_cache_hash_buckets = 10 # INITIAL
  # sequence_cache_hash_buckets = 10 # SMALL
  # sequence_cache_hash_buckets = 23 # MEDIUM
  # sequence_cache_hash_buckets = 89 # LARGE
  
  # audit_trail = true # if you want auditing
  # timed_statistics = true # if you want timed statistics
  max_dump_file_size = 10240 # limit trace file size to 5 Meg each
  
  # log_archive_start = true # if you want automatic archiving
  log_archive_dest=%ORACLE_HOME%\DATABASE\ARCHIVE
  
  # define directories to store trace and alert files
  background_dump_dest=%RDBMS73%\trace
  user_dump_dest=%RDBMS73%\trace
  
  db_block_size = 2048
  
  snapshot_refresh_processes = 1
  
  remote_login_passwordfile = shared
  
  可以修改该文件的db_file_multiblock_read_count,db_block_buffers,shared_pool_size,processes ,log_buffer,sequence_cache_entries,sequence_cache_hash_buckets等项(文件中均有提示),根据需要和系统使用的数据库服务器的特点适当改大数值,可以提高查询统计速度。这里要注意的是,必须将 log_archive_start = true 项改为False,设置才能生效。
  
  本文介绍的Oracle数据库设置方法均在用户实际使用中经过了严格测试,证明是有效和实用的。
  

我来说两句 去相关俱乐部 发短信息
     为搜狐IT频道查错 得每日精彩大奖——点击可了解详细信息
搜狐IT频道:体察IT业界动态,传播IT时尚生活——点击进入 >>滚动新闻
相关连接
最热点击

去东京迪斯尼,过桃色圣诞节!

精彩相册[男][女]
活力社员[男][女]
魅力情人[男][女]
美女 天若有情
帅哥 不帅照脸踢
·和弦铃声:
原来的我 挥着翅膀的女孩
·疯狂音效:
On…个头啊 翠花,接电话…
订阅任何彩信服务
三天内退订不收费!!!
请发表您的看法
用户: 匿名发出
您要为您所发的言论的后果负责,故请各位遵纪守法并注意语言文明。
留言:
*经营许可证编号:京ICP00000008号
*遵守《互联网电子公告服务管理规定》
*遵守《全国人大常委会关于维护互联网安全的规定》

新闻搜索
关键字:

三重奖励,百分百中奖
·找老乡尽在激情老乡会
·攒魔法袜子拿圣诞礼物
搜狐彩信最新推荐
·[] 眉飞色舞
·[] 厉鬼再现
热门词:必杀功 林忆莲
精彩订阅
新闻资讯
美国正式宣布萨达姆已被捕!
订阅 焦点新闻,了解详情


搜狐商城
·影视|徐静蕾我和爸爸
·音乐|欧美音乐盛典展
·书籍|黑客大曝光
·书籍|1元图书特卖场
·化妆|畅销精品优惠哦
·精品|zippo火机5折起
更多...


网站登录 - 搜狐招聘 - 广告服务 - 联系方式 - 保护隐私权 - 公司介绍
Copyright © 2003 Sohu.com Inc. All rights reserved. 搜狐公司 版权所有