数据库运行的特别慢,请各位高手赐教,万分感谢!init.ora文件下的内容:#
# Copyright (c) 1991, 2000 by Oracle Corporation
#
##############################################################################
# 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.
#
# NOTE: Parameter values suggested in this file are based on conservative
# estimates for computer memory availability. You should adjust values upward
# for modern machines.
#
###############################################################################db_name = "lpszsdb"db_domain = taxinstance_name = lpszsdbservice_names = lpszsdb.taxdb_files = 1024  # INITIAL
# db_files = 80                                                       # SMALL
# db_files = 400                                                      # MEDIUM
# db_files = 1500                                                     # LARGEcontrol_files = ("D:\oracle\oradata\lpszsdb\control01.ctl", "D:\oracle\oradata\lpszsdb\control02.ctl", "D:\oracle\oradata\lpszsdb\control03.ctl")open_cursors = 300
max_enabled_roles = 30
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                                  # LARGEdb_block_buffers = 16384                                                   # 2048  # INITIAL
# db_block_buffers = 100                                              # SMALL
# db_block_buffers = 550                                              # MEDIUM
# db_block_buffers = 3200                                             # LARGEshared_pool_size = 67108864                                                   # 31457280  # INITIAL
# shared_pool_size = 3500000                                          # SMALL
# shared_pool_size = 5000000                                          # MEDIUM
# shared_pool_size = 9000000                                          # LARGElarge_pool_size = 614400
java_pool_size = 20971520log_checkpoint_interval = 10000
log_checkpoint_timeout = 1800processes = 150  # INITIAL
# processes = 50                                                      # SMALL
# processes = 100                                                     # MEDIUM
# processes = 200                                                     # LARGEparallel_max_servers = 5  # SMALL
# parallel_max_servers = 4 x (number of CPUs)                         # MEDIUM
# parallel_max_servers = 4 x (number of CPUs)                         # LARGElog_buffer = 262144                                                   # 32768  # INITIAL
# log_buffer = 32768                                                  # SMALL
# log_buffer = 32768                                                  # MEDIUM
# log_buffer = 163840                                                 # 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 5M each# Uncommenting the line below will cause automatic archiving if archiving has
# been enabled using ALTER DATABASE ARCHIVELOG.
# log_archive_start = true
# log_archive_dest_1 = "location=D:\oracle\oradata\lpszsdb\archive"
# log_archive_format = %%ORACLE_SID%%T%TS%S.ARC# If using private rollback segments, place lines of the following
# form in each of your instance-specific init.ora files:
#rollback_segments = ( RBS0, RBS1, RBS2, RBS3, RBS4, RBS5, RBS6 )# If using public rollback segments, define how many
# rollback segments each instance will pick up, using the formula
#   # of rollback segments = transactions / transactions_per_rollback_segment
# In this example each instance will grab 40/5 = 8
# transactions = 40
# transactions_per_rollback_segment = 5# Global Naming -- enforce that a dblink has same name as the db it connects to
global_names = false# Edit and uncomment the following line to provide the suffix that will be
# appended to the db_name parameter (separated with a dot) and stored as the
# global database name when a database is created.  If your site uses
# Internet Domain names for e-mail, then the part of your e-mail address after
# the '@' is a good candidate for this parameter value.
# db_domain = us.acme.com     # global database name is db_name.db_domain# Uncomment the following line if you wish to enable the Oracle Trace product
# to trace server activity.  This enables scheduling of server collections
# from the Oracle Enterprise Manager Console.
# Also, if the oracle_trace_collection_name parameter is non-null,
# every session will write to the named collection, as well as enabling you
# to schedule future collections from the console.
# oracle_trace_enable = trueoracle_trace_collection_name = ""
# define directories to store trace and alert files
background_dump_dest = D:\oracle\admin\lpszsdb\bdump
#Uncomment this parameter to enable resource management for your database.
#The SYSTEM_PLAN is provided by default with the database.
#Change the plan name if you have created your own resource plan.# resource_manager_plan = system_plan
user_dump_dest = D:\oracle\admin\lpszsdb\udumpdb_block_size = 8192remote_login_passwordfile = exclusiveos_authent_prefix = ""# The following parameters are needed for the Advanced Replication Option
job_queue_processes = 4
job_queue_interval = 10
open_links = 4distributed_transactions = 500
mts_dispatchers = "(PROTOCOL=TCP)(PRE=oracle.aurora.server.SGiopServer)"
# Uncomment the following line when your listener is configured for SSL
# (listener.ora and sqlnet.ora)
# mts_dispatchers = "(PROTOCOL=TCPS)(PRE=oracle.aurora.server.SGiopServer)"compatible = 8.1.0
sort_area_size = 524288               # 65536
sort_area_retained_size = 65536
通过系统信息扫描的内存为:总的物理内存:523,756k  可用的物理内存为: 97,708在线等,急呀,兄弟们,帮帮忙!

解决方案 »

  1.   

    如果你用unix 的话,速度应该没问题,我们数据量少点也有几十万条,内存也是512M,
    速度很快的,不过用windows的话没试过。
      

  2.   

    db_block_buffer,db_block_size,share_pool_size都太小了,如果不是做HTTP服务,java_pool_size不用设这么大.
    一般情况下,db_block_size可以设置为8K,SGA可以设置成机器物理内存的25%-50%,db_block_buffer*db_block_size可以与share_pool_size相当,但对大型的应用,share_pool_size不要超过5OOMB,这种情况下db_block_buffer*db_block_size越大越好.
      

  3.   

    ORACLE  8.1.X  版本  
     
    SGA=((db_block_buffers  *  block  size)+(shared_pool_size+large_pool_size+java_pool_size+log_buffers)+1MB  
     
    理论上SGA可占OS系统物理内存的1/2——1/3,我们可以根据需求调整  
     
    我推荐SGA=0.45*(OS  RAM)  
     
    假设服务器运行ORACLE  8.1.X  版本,  OS系统内存为2G  MEM,  db_block_size  是8192  bytes,    
    除了运行ORACLE数据库外,  没有其它的应用程序或服务器软件.  
     
    这样SGA合计约为921M  (  0.45*2048M  ),    
     
    设shared_pool_size  300M  (300*1024*1024  bytes)  
     
    设database  buffer  cache  570M  (72960*8192  bytes)  
     
     initorasid.ora文件里具体各参数如下:  
     
    shared_pool_size  =  314572800  
    #  300  M  
     
    db_block_buffers  =  72960  
    #  570  M  
     
    log_buffer  =  524288  
    #  512k  (128K*CPU个数)  
     
    large_pool_size  =  31457280  
    #  30  M  
     
    java_pool_size  =  20971520  
    #  20  M  
     
    sort_area_size  =  524288  
    #  512k  (65k--2M)  
     
    sort_area_retained_size  =  524288  
    #  MTS  时  sort_area_retained_size  =  sort_area_size  
     
    SUN  Solaris里/etc/system文件里的几个参数同样跟内存分配有关  
     
    ORACLE安装时缺省的设置:  建议修改的设置:    
    set  shmsys:shminfo_shmmax=4294967295    
    set  shmsys:shminfo_shmmin=1    
    set  shmsys:shminfo_shmmni=100    
    set  shmsys:shminfo_shmseg=15    
    set  semsys:seminfo_semmns=200    
    set  semsys:seminfo_semmni=70    
    set  ulimit=3000000      
    set  semsys:seminfo_semmni=315  
    set  semsys:seminfo_semmsl=300  
    set  semsys:seminfo_semmns=630  
    set  semsys:seminfo_semopm=315  
    set  semsys:seminfo_semvmx=32767  
    set  shmsys:shminfo_shmmax=4294967295  
    set  shmsys:shminfo_shmmni=315  
    set  shmsys:shminfo_shmseg=10  
    set  shmsys:shminfo_shmmin=1    
     
    其中这些参数的含义  
     
    shmmax  -  共享内存段,建议设大点,  达到最大SGA  
    shmmin  -  最小的共享内存段.  
    shmmni  -  共享内存标志符的数量.  
    shmseg  -  一个进程可分配的最大内存段数.  
    shmall  -  最大可允许的内存数,比SGA还要大.  
    semmns  -  信号灯,跟ORACLE的PROCESS数有关.  
    semmsl  -  一个信号灯中最大的信号灯数.  
     
     
    ---------------------------------------------------------------  
     
    分析你的init.ora  
    shared  pool    31,457,280    #30M  
    data  buffers  4326*8192=  35,438,592  #35M  
    large  pool    614,400        #600K  
    #多线程  
    mts_dispatchers  =  "(protocol=TCP)(tick=15)(pool=true)"  
    ---------------------  
    这样,如果你认为你的语句已经优化了,如果你的内存也不是太大的话。  
    对于  shared  pool和data  buffers的大小已经够了。  
    但是,你又用了多线程,又只把large  pool配置了600k  
    你要么先把多线程去掉,要么把large  pool加大(30M)试试(多线程用到了large  pool)。  
    最后,把你的init文件中的一些参数还调整一下  
    db_file_multiblock_read_count  =  8    #可以加大到16  or  32试试  
    把  
    oracle_trace_collection_name  =  ""  
    system_plan  
     shared_pool_size 以字节为单位,指定共享池的大小。共享池包含如: 共享游标、存储的过程、控制结构和并行执行消息缓冲区等对象。较大的值能改善多用户系统的性能。这个值不需要太大,一般不超过150M
    db_block_buffers 缓冲区高速缓存中 Oracle 块的数量。database_buffers=db_block_buffers×db_block_size.这个值越大越好,只要整个SGA不超过系统物理内存限制,给最大值
      

  4.   

    倒是应该去学习一下statspack~
    www.eygle.com