首页 > 数据库 > Oracle > [20220415]为什么没有子子池.txt
[20220415]为什么没有子子池.txt
--//前一阵子分析sga heap转储,我发现生产系统_kghdsidx_count=7,分成7个子池,但是我发现没有再细分4个子子池(也叫孙子池)。
--//看看是什么原因导致这样的情况。
1.环境:
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
SYS@127.0.0.1:9014/zzzz> @ hide _kghdsidx_count
NAME DESCRIPTION DEFAULT_VALUE SESSION_VALUE SYSTEM_VALUE ISSES ISSYS_MOD
--------------- ------------------ ------------- ------------- ------------ ----- ---------
_kghdsidx_count max kghdsidx count TRUE 7 7 FALSE FALSE
SYS@127.0.0.1:9014/zzzz> @ hide _enable_shared_pool_durations
NAME DESCRIPTION DEFAULT_VALUE SESSION_VALUE SYSTEM_VALUE ISSES ISSYS_MOD
----------------------------- -------------------------------------- ------------- ------------- ------------ ----- ---------
_enable_shared_pool_durations temporary to disable/enable kgh policy TRUE FALSE FALSE FALSE FALSE
--//我看了以前的工作笔记,发现如果设置sga_target=0 ,会出现_kghdsidx_count=1的情况,同时_enable_shared_pool_durations=false.
--//链接 : http://blog.itpub.net/267265/viewspace-2305567/ =>[20190104]sga_target 的设置和ORA-04031错误.txt
--//我仔细看了我的测试,发现只要设置sga_target 非0 ,不会出现这样的情况,实际上上面链接的测试分析有错,注意往下看。
SYS@127.0.0.1:9014/zzzz> create pfile='/tmp/@.ora' from spfile;
File created.
--//检查参数文件才发现,不知道安装者为什么设置许多隐含参数。
*._add_col_optim_enabled=FALSE
*._awr_disabled_flush_tables=''
*._bloom_filter_enabled=FALSE
*._cleanup_rollback_entries=2000
*._clusterwide_global_transactions=FALSE
*._datafile_write_errors_crash_instance=FALSE
*._gc_defer_time=3
*._gc_policy_time=0
*._gc_read_mostly_locking=FALSE
*._gc_undo_affinity=FALSE
*._ksmg_granule_size=67108864
*._lm_lms_priority_dynamic=FALSE
*._memory_imm_mode_without_autosga=FALSE
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*._PX_use_large_pool=TRUE
*._resource_manager_always_off=TRUE
*._resource_manager_always_on=FALSE
*._serial_direct_read='NEVER'
*._smu_debug_mode=134217728
*._system_trig_enabled=TRUE
*._undo_autotune=FALSE
*._use_adaptive_log_file_sync='FALSE'
--//我看了最大可能就是_memory_imm_mode_without_autosga 参数。
2.简单测试看看:
$ cat initxxxx.ora
db_name=xxxx
instance_name=xxxx
sga_target=50G
sga_max_size=50G
_add_col_optim_enabled=FALSE
_awr_disabled_flush_tables=''
_bloom_filter_enabled=FALSE
_cleanup_rollback_entries=2000
_clusterwide_global_transactions=FALSE
_datafile_write_errors_crash_instance=FALSE
_gc_defer_time=3
_gc_policy_time=0
_gc_read_mostly_locking=FALSE
_gc_undo_affinity=FALSE
_ksmg_granule_size=67108864
_lm_lms_priority_dynamic=FALSE
_PX_use_large_pool=TRUE
_resource_manager_always_off=TRUE
_resource_manager_always_on=FALSE
_serial_direct_read='NEVER'
_smu_debug_mode=134217728
_system_trig_enabled=TRUE
_undo_autotune=FALSE
_use_adaptive_log_file_sync='FALSE'
$ export ORACLE_SID=xxxx
SYS@xxxx> startup nomount
ORACLE instance started.
Total System Global Area 5.3447E+10 bytes
Fixed Size 2281912 bytes
Variable Size 4563406408 bytes
Database Buffers 4.8855E+10 bytes
Redo Buffers 26464256 bytes
SYS@xxxx> @ hide _enable_shared_pool_durations
NAME DESCRIPTION DEFAULT_VALUE SESSION_VALUE SYSTEM_VALUE ISSES_MODI ISSYS_MODIFIABLE
----------------------------- -------------------------------------- ------------- ------------- ------------ ---------- ------------------
_enable_shared_pool_durations temporary to disable/enable kgh policy TRUE TRUE TRUE FALSE FALSE
--//这样基本可以排除了这些隐含参数的影响。到底是那个参数导致影响出现这样的情况呢?
--//create pfile ='/tmp/xxxx.ora' from spfile;
$ grep sga_target /tmp/xxxx.ora
zzzz1.__sga_target=20266876928
zzzz2.__sga_target=20266876928
*.sga_target=0
--//*.sga_target=0的影响吗?给参数文件initxxxx.ora追加1行:
*.sga_target=0
SYS@xxxx> startup nomount
ORACLE instance started.
Total System Global Area 5.3447E+10 bytes
Fixed Size 2281912 bytes
Variable Size 5.3284E+10 bytes
Database Buffers 134217728 bytes
Redo Buffers 26464256 bytes
SYS@xxxx> @ hide _enable_shared_pool_durations
NAME DESCRIPTION DEFAULT_VALUE SESSION_VALUE SYSTEM_VALUE ISSES_MODI ISSYS_MODIFIABLE
----------------------------- -------------------------------------- ------------- ------------- ------------ ---------- ------------------
_enable_shared_pool_durations temporary to disable/enable kgh policy TRUE FALSE FALSE FALSE FALSE
--//噢,还是怪自己没有仔细检查:
SYS@ywdb1> show parameter sga_target
NAME TYPE VALUE
---------- ----------- -----
sga_target big integer 0
--//实际上这个是一个先入为主的判断错误,我认为sga_target=0,这样_kghdsidx_count=1,实际上还受隐含参数shared_pool_size的影响。
--//我以前的分析测试有错,我重复演示我以前遇到的问题。
$ cat initxxxx.ora
db_name=xxxx
instance_name=xxxx
sga_target=0
sga_max_size=50G
##shared_pool_size=2G
--//重启实例略。
SYS@xxxx> @ hide _kghdsidx_count
NAME DESCRIPTION DEFAULT_VALUE SESSION_VALUE SYSTEM_VALUE ISSES_MODI ISSYS_MODIFIABLE
---------------------------------------- -------------------------------------- ---------------------- ---------------------- ---------------------- ---------- ------------------
_kghdsidx_count max kghdsidx count TRUE 1 1 FALSE FALSE
SYS@xxxx> @ hide _enable_shared_pool_durations
NAME DESCRIPTION DEFAULT_VALUE SESSION_VALUE SYSTEM_VALUE ISSES_MODI ISSYS_MODIFIABLE
---------------------------------------- -------------------------------------- ---------------------- ---------------------- ---------------------- ---------- ------------------
_enable_shared_pool_durations temporary to disable/enable kgh policy TRUE FALSE FALSE FALSE FALSE
--//_kghdsidx_count =1 ,_enable_shared_pool_durations=false.
--//导致先入为主的认为sga_target=0,_kghdsidx_count=1这样的错误思维,这个测试我忽略这样情况下shared_pool_size的大小,
SYS@xxxx> @ hide shared_pool_size
NAME DESCRIPTION DEFAULT_VALUE SESSION_VALUE SYSTEM_VALUE ISSES_MODI ISSYS_MODIFIABLE
-------------------- ----------------------------------- ------------- ------------- ------------ ---------- ------------------
__shared_pool_size Actual size in bytes of shared pool TRUE 402653184 402653184 FALSE IMMEDIATE
_io_shared_pool_size Size of I/O buffer pool from SGA TRUE 4194304 4194304 FALSE FALSE
shared_pool_size size in bytes of shared pool TRUE 402653184 402653184 FALSE IMMEDIATE
--//402653184/1024/1024 = 384M ,这样建立的实例shared_pool_size = 384M. 没有大于512M。这样_kghdsidx_count=1是正常的。
--//取消shared_pool_size=2G的注解
$ cat initxxxx.ora
db_name=xxxx
instance_name=xxxx
sga_target=0
sga_max_size=50G
shared_pool_size=2G
--//重启实例略。
SYS@xxxx> @ hide _kghdsidx_count
NAME DESCRIPTION DEFAULT_VALUE SESSION_VALUE SYSTEM_VALUE ISSES_MODI ISSYS_MODIFIABLE
---------------------------------------- --------------------------------------- ---------------------- ---------------------- ---------------------- ---------- ------------------
_kghdsidx_count max kghdsidx count TRUE 4 4 FALSE FALSE
SYS@xxxx> @ hide _enable_shared_pool_durations
NAME DESCRIPTION DEFAULT_VALUE SESSION_VALUE SYSTEM_VALUE ISSES_MODI ISSYS_MODIFIABLE
---------------------------------------- --------------------------------------- ---------------------- ---------------------- ---------------------- ---------- ------------------
_enable_shared_pool_durations temporary to disable/enable kgh policy TRUE FALSE FALSE FALSE FALSE
--//_kghdsidx_count =4 ,_enable_shared_pool_durations=false.
--//可以看出实际上设置sga_target=0 ,最大的问题是_enable_shared_pool_durations=false.导致没有子子池出现。
--//这样链接http://www.itpub.net/thread-2104417-1-1.html的问题也可以解析sga_target=0的情况下,_enable_shared_pool_durations=false。
--//这样就没有子子池。
--//也许以上链接的问题,就是分配不均匀导致的ora-04031错误。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/267265/viewspace-2887221/ ,如需转载,请注明出处,否则将追究法律责任。