Oracle8 Tuning
〜準備〜
0.更新履歴
- 2001.01.19 新規作成
1.はじめに
このドキュメントは,Solaris2.6(4CPU)上で稼動するOracle8i 8.1.5を使い,パフォーマンスチューニングを行うためのものである.
パフォーマンスチューニングといえども,Oracleのパラメータを変更する程度でどの程度速度向上が見られるかを計測するだけで,SQL文等のアプリケーションチューニングではない.
2.準備
2.1.確認
db1% svrmgrl Oracle Server Manager Release 3.1.5.0.0 - Production (c) Copyright 1997, Oracle Corporation. All Rights Reserved. Oracle8i Enterprise Edition Release 8.1.5.0.0 - Production With the Partitioning and Java options PL/SQL Release 8.1.5.0.0 - Production SVRMGR> connect internal/oracle as sysdba Connected. SVRMGR> |
- サーバマネージャを起動する.
- connectの際のas sysdaがあったほうが良いらしい.
- show parametersを使い,設定内容を確認しておく.
- Oracleが起動していないとコマンドは使えないので注意する.
SVRMGR> show parameters NAME TYPE VALUE ----------------------------------- ------- ------------------------------ O7_DICTIONARY_ACCESSIBILITY boolean TRUE always_anti_join string NESTED_LOOPS always_semi_join string standard aq_tm_processes integer 0 audit_file_dest string ?/rdbms/audit audit_trail string NONE background_core_dump string partial background_dump_dest string /oracle/app/oracle/admin/o8i/b backup_tape_io_slaves boolean FALSE bitmap_merge_area_size integer 1048576 blank_trimming boolean FALSE buffer_pool_keep string buffer_pool_recycle string commit_point_strength integer 1 compatible string 8.1.0 control_file_record_keep_time integer 7 control_files string /oracle/data/oradata/o8i/contr core_dump_dest string /oracle/app/oracle/admin/o8i/c cpu_count integer 4 create_bitmap_area_size integer 8388608 cursor_space_for_time boolean FALSE db_block_buffers integer 8192 db_block_checking boolean FALSE db_block_checksum boolean FALSE db_block_lru_latches integer 2 db_block_max_dirty_target integer 8192 db_block_size integer 2048 db_domain string testInstall.com db_file_direct_io_count integer 64 db_file_multiblock_read_count integer 8 db_file_name_convert string db_files integer 200 db_name string o8i db_writer_processes integer 1 dblink_encrypt_login boolean FALSE dbwr_io_slaves integer 0 disk_asynch_io boolean TRUE distributed_transactions integer 10 dml_locks integer 164 enqueue_resources integer 384 ent_domain_name string event string fast_start_io_target integer 8192 fast_start_parallel_rollback string LOW fixed_date string gc_defer_time integer 10 gc_files_to_locks string gc_releasable_locks integer 0 gc_rollback_locks string global_names boolean FALSE hash_area_size integer 131072 hash_join_enabled boolean TRUE hash_multiblock_io_count integer 0 hi_shared_memory_address integer 0 hs_autoregister boolean TRUE ifile file instance_groups string instance_name string o8i instance_number integer 0 java_max_sessionspace_size integer 0 java_pool_size string 20971520 java_soft_sessionspace_limit integer 0 job_queue_interval integer 60 job_queue_processes integer 0 large_pool_size string 0 license_max_sessions integer 0 license_max_users integer 0 license_sessions_warning integer 0 lm_locks integer 12000 lm_procs integer 127 lm_ress integer 6000 local_listener string lock_name_space string lock_sga boolean FALSE log_archive_dest string log_archive_dest_1 string log_archive_dest_2 string log_archive_dest_3 string log_archive_dest_4 string log_archive_dest_5 string log_archive_dest_state_1 string enable log_archive_dest_state_2 string enable log_archive_dest_state_3 string enable log_archive_dest_state_4 string enable log_archive_dest_state_5 string enable log_archive_duplex_dest string log_archive_format string %t_%s.dbf log_archive_max_processes integer 1 log_archive_min_succeed_dest integer 1 log_archive_start boolean FALSE log_buffer integer 163840 log_checkpoint_interval integer 10000 log_checkpoint_timeout integer 1800 log_checkpoints_to_alert boolean FALSE log_file_name_convert string max_commit_propagation_delay integer 700 max_dump_file_size string 10000 max_enabled_roles integer 20 max_rollback_segments integer 30 mts_dispatchers string (ADDRESS=(PARTIAL=YES)(PROTOCO mts_listener_address string mts_max_dispatchers integer 5 mts_max_servers integer 20 mts_multiple_listeners boolean FALSE mts_servers integer 1 mts_service string o8i.testInstall.com nls_calendar string nls_comp string nls_currency string nls_date_format string nls_date_language string nls_dual_currency string nls_iso_currency string nls_language string AMERICAN nls_numeric_characters string nls_sort string nls_territory string AMERICA nls_time_format string nls_time_tz_format string nls_timestamp_format string nls_timestamp_tz_format string object_cache_max_size_percent integer 10 object_cache_optimal_size integer 102400 open_cursors integer 50 open_links integer 4 open_links_per_instance integer 4 optimizer_features_enable string 8.1.5 optimizer_index_caching integer 0 optimizer_index_cost_adj integer 100 optimizer_max_permutations integer 80000 optimizer_mode string CHOOSE optimizer_percent_parallel integer 0 optimizer_search_limit integer 5 oracle_trace_collection_name string oracle_trace_collection_path string ?/otrace/admin/cdf oracle_trace_collection_size integer 5242880 oracle_trace_enable boolean FALSE oracle_trace_facility_name string oracled oracle_trace_facility_path string ?/otrace/admin/fdf os_authent_prefix string os_roles boolean FALSE parallel_adaptive_multi_user boolean FALSE parallel_automatic_tuning boolean FALSE parallel_broadcast_enabled boolean FALSE parallel_execution_message_size integer 2148 parallel_instance_group string parallel_max_servers integer 5 parallel_min_percent integer 0 parallel_min_servers integer 0 parallel_server boolean FALSE parallel_server_instances integer 1 parallel_threads_per_cpu integer 2 partition_view_enabled boolean FALSE plsql_load_without_compile boolean FALSE plsql_v2_compatibility boolean FALSE pre_page_sga boolean FALSE processes integer 30 query_rewrite_enabled boolean FALSE query_rewrite_integrity string enforced rdbms_server_dn string read_only_open_delayed boolean FALSE recovery_parallelism integer 0 remote_dependencies_mode string TIMESTAMP remote_login_passwordfile string EXCLUSIVE remote_os_authent boolean FALSE remote_os_roles boolean FALSE replication_dependency_tracking boolean TRUE resource_limit boolean FALSE resource_manager_plan string rollback_segments string r01, r02, r03, r04 row_locking string always serial_reuse string DISABLE serializable boolean FALSE service_names string o8i.testInstall.com session_cached_cursors integer 0 session_max_open_files integer 10 sessions integer 38 shadow_core_dump string PARTIAL shared_memory_address integer 0 shared_pool_reserved_size string 786432 shared_pool_size string 15728640 sort_area_retained_size integer 0 sort_area_size integer 65536 sort_multiblock_read_count integer 2 sql92_security boolean FALSE sql_trace boolean FALSE standby_archive_dest string ?/dbs/arch star_transformation_enabled string FALSE tape_asynch_io boolean TRUE text_enable boolean FALSE thread integer 0 timed_os_statistics integer 0 timed_statistics boolean FALSE transaction_auditing boolean TRUE transactions integer 41 transactions_per_rollback_segment integer 5 use_indirect_data_buffers boolean FALSE user_dump_dest string /oracle/app/oracle/admin/o8i/u utl_file_dir string SVRMGR> |
- バッファに関するパラメータは,次の様に表示させることができる.
SVRMGR> show parameters buffer NAME TYPE VALUE ----------------------------------- ------- ------------------------------ buffer_pool_keep string buffer_pool_recycle string db_block_buffers integer 8192 log_buffer integer 163840 use_indirect_data_buffers boolean FALSE SVRMGR> |
- SGAに関する情報は,次の様に表示させることができる.
SVRMGR> show sga Total System Global Area 35077520 bytes Fixed Size 64912 bytes Variable Size 18055168 bytes Database Buffers 16777216 bytes Redo Buffers 180224 bytes SVRMGR> |
1.2.初期化パラメータファイル(init.ora)の編集
- ディレクトリを移動する.
db1% cd $ORACLE_HOME/dbs db1% pwd /oracle/app/oracle/product/8.1.5/dbs db1% ls init.ora initdw.ora inito8i.ora lkO8I orapwo8i db1% |
- 今回インストールしたOracleのインスタンスはo8iなので,inito8i.oraが対象となる.
- 中身を確認する.
db1% cat inito8i.ora # # Copyright (c) 1991, 1998 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 = o8i db_domain = testInstall.com instance_name = o8i service_names = o8i.testInstall.com # db_files = 80 # SMALL # db_files = 400 # MEDIUM # db_files = 1500 # LARGE control_files = ("/oracle/data/oradata/o8i/control01.ctl", "/oracle/data/oradata/o8i/c ontrol02.ctl") # db_file_multiblock_read_count = 8 # SMALL # db_file_multiblock_read_count = 16 # MEDIUM # db_file_multiblock_read_count = 32 # LARGE db_block_buffers = 8192 # INITIAL # db_block_buffers = 100 # SMALL # db_block_buffers = 550 # MEDIUM # db_block_buffers = 3200 # LARGE shared_pool_size = 15728640 # INITIAL # shared_pool_size = 3500000 # SMALL # shared_pool_size = 5000000 # MEDIUM # shared_pool_size = 9000000 # LARGE java_pool_size = 20971520 log_checkpoint_interval = 10000 log_checkpoint_timeout = 1800 processes = 30 # INITIAL # processes = 50 # SMALL # processes = 100 # MEDIUM # processes = 200 # LARGE log_buffer = 163840 # INITIAL # log_buffer = 32768 # SMALL # log_buffer = 32768 # MEDIUM # log_buffer = 163840 # LARGE # audit_trail = false # if you want auditing # timed_statistics = false # if you want timed statistics # max_dump_file_size = 10000 # 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=/oracle/app/oracle/admin/o8i/arch" # log_archive_format = %t_%s.dbf # If using private rollback segments, place lines of the following # form in each of your instance-specific init.ora files: rollback_segments = (r01, r02, r03, r04) # 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/10 = 4: # transactions = 40 # transactions_per_rollback_segment = 10 # 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 = true # define directories to store trace and alert files background_dump_dest = /oracle/app/oracle/admin/o8i/bdump core_dump_dest = /oracle/app/oracle/admin/o8i/cdump user_dump_dest = /oracle/app/oracle/admin/o8i/udump db_block_size = 2048 remote_login_passwordfile = exclusive os_authent_prefix = "" # The following parameters are needed for the Advanced Replication Option job_queue_processes = 0 job_queue_interval = 60 distributed_transactions = 10 open_links = 4 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)" mts_servers = 1 compatible = "8.1.0"db1% |
- init.oraファイル中のtimes_statisticsをTRUEに設定する.
# audit_trail = false # if you want auditing # timed_statistics = false # if you want timed statistics timed_statistics = true # if you want timed statistics # max_dump_file_size = 10000 # limit trace file size to 5M each # Uncommenting the line below will cause automatic archiving if archiving has |
- Oracleをシャットダウンし,再起動する.
- 再度サーバマネージャを起動し,show parametesコマンドで設定内容を確認してみる.
thread integer 0 timed_os_statistics integer 0 timed_statistics boolean TRUE transaction_auditing boolean TRUE transactions integer 41 transactions_per_rollback_segment integer 5 use_indirect_data_buffers boolean FALSE user_dump_dest string /oracle/app/oracle/admin/o8i/u utl_file_dir string SVRMGR> |