从11月13号开始写个人公众号,主要是分享数据库相关知识,纯属玩玩。经常看大家讨论过程数据库,基本上都是开源、分布式数据库、数据库去O等等。本想着大家对Oracle没啥兴趣了呢,没想到周5的一篇Oracle 11.2.0.4的文章,阅读量超过了3000+,确实让我很震惊。
近一个月的时间中,超过540个朋友关注公众号,再次表示感谢支持!
之前经常遇到一些网友朋友微信问我们要数据库参数设置最佳实践;实际上所谓的最佳实践都是根据不同的环境有一些细微差异的,不可完全照搬,但可参考!这里我贡献一份,算是回馈大家的福利~~~
需要注意,如下参数仅供参考!
Parameter Name I# Begin value End value (if different)
_PX_use_large_pool * TRUE
_and_pruning_enabled * FALSE
_b_tree_bitmap_plans * FALSE
_bloom_filter_enabled * FALSE
_cleanup_rollback_entries * 20000
_clusterwide_global_transactions * FALSE
_cursor_obsolete_threshold * 1024
_datafile_write_errors_crash_instance * FALSE
_drop_stat_segment * 1
_gc_defer_time * 32
_gc_policy_time * 0
_gc_read_mostly_locking * FALSE
_gc_undo_affinity * FALSE
_ges_direct_free_res_type * CTARAHDXBB
_ipddb_enable * TRUE
_keep_remote_column_size * TRUE
_lm_sync_timeout * 1200
_lm_tickets * 5000
_optimizer_adaptive_cursor_sharing * FALSE
_optimizer_ads_use_result_cache * FALSE
_optimizer_enhanced_join_elimination * FALSE
_optimizer_extended_cursor_sharing * NONE
_optimizer_extended_cursor_sharing_rel * NONE
_optimizer_mjc_enabled * FALSE
_optimizer_partial_join_eval * FALSE
_optimizer_unnest_scalar_sq * FALSE
_optimizer_use_feedback * FALSE
_partition_large_extents * FALSE
_rollback_segment_count * 2000
_securefiles_concurrency_estimate * 50
_serial_direct_read * NEVER
_shared_pool_reserved_pct * 20
_smu_debug_mode * 134217728
_sql_plan_directive_mgmt_control * 0
_undo_autotune * FALSE
_use_adaptive_log_file_sync * FALSE
_use_single_log_writer * TRUE
archive_lag_target * 1800
audit_file_dest * /u01/app/oracle/admin/xxxx/adump
audit_trail * DB
cluster_database * TRUE
compatible * 19.0.0
control_file_record_keep_time * 31
db_block_size * 8192
db_cache_advice * OFF
db_create_file_dest * +DATADXX
db_files * 5000
db_name * XXXX
deferred_segment_creation * FALSE
diagnostic_dest * u01/app/oracle
dispatchers * (PROTOCOL=TCP) (SERVICE=xxxxXDB)
enable_ddl_logging * TRUE
event * 10949 trace name context forever:28401 trace name context forever, level 1:10849 trace name context forever, level 1:19823 trace name context forever, level 90
fast_start_mttr_target * 1800
instance_number 1 1
instance_number 2 2
instance_number 3 3
instance_number 4 4
listener_networks *
local_listener 1 (ADDRESS=(PROTOCOL=TCP)(HOST=xx.xx.xx.xx)(PORT=xx))
local_listener 2 (ADDRESS=(PROTOCOL=TCP)(HOST=xx.xx.xx.xx)(PORT=xx))
local_listener 3 (ADDRESS=(PROTOCOL=TCP)(HOST=xx.xx.xx.xx)(PORT=xx))
local_listener 4 (ADDRESS=(PROTOCOL=TCP)(HOST=xx.xx.xx.xx)(PORT=xx))
max_shared_servers * 0
memory_target * 0
nls_language * AMERICAN
nls_territory * AMERICA
open_cursors * 5000
parallel_execution_message_size * 32768
parallel_force_local * TRUE
pga_aggregate_target * 26843545600
processes * 15360
remote_listener * xxxx-scan:11521
remote_login_passwordfile * EXCLUSIVE
resource_manager_plan * force:
result_cache_max_size * 0
sec_max_failed_login_attempts * 100
session_cached_cursors * 1000
sga_max_size * 644245094400
sga_target * 644245094400
说明:
1、19c版本中,_gc_defer_time 可不设置,最小值为32ms,但是跟之前版本中有所不同;
2、_cursor_obsolete_threshold 参数根据业务实际情况设置,大部分环境通常设置200以下即可,曾经遇到过设置1024仍然出问题的,最后需修改应用解决问题。
3、_rollback_segment_count 参数通常大于所有节点并发之和即可,不需要太大,设置过大,数据库实例open会比较慢。
4、其他参数根据自身环境调整。