_pool_size + xxxx
xxx: 是一个保留值,从目前的实验来看,基本是4M
步骤:
1.
alter system set sga_target=300m scope=both
create pfile from spfile;
shutdown immediate;
修改init.ora 文件,将这些参数的值设成0:
db_cache_size, shared_pool_size, java_pool_size,large_pool_size
2. 启动SQLPLUS,以新的pfile文件启动数据库
SQL> startup pfile='....'
让我们来看看调整的结果:
SQL> select name, block_size, current_size from v$buffer_pool;
name block_size current_size
-------------------------------------------------------------
KEEP 8192 204
SQL> Select pool, sum(bytes)/1024/1024 as "M bytes" from v$SGASTAT
group by pool;
pool M bytes
-------------------------------------------------
java pool 4
large pool 4
shared pool 84
205.002403
205.002403=buffer cache + log buffer + fixed sga + all others ...
改动java pool的值
SQL> alter system set java_pool_size=20M;
SQL> select name, block_size, current_size,prev_size from v$buffer_pool;
name block_size current_size prev_size
----------------------------------------------------------------------------------------------
KEEP 8192 188 204
SQL> Select pool, sum(bytes)/1024/1024 as "M bytes" from v$SGASTAT
group by pool;
pool M bytes
-------------------------------------------------
java pool 20
large pool 4
shared pool 84
189.002403
可以看出, db_cache_size的值已经被自动调小了.
再把java pool 的值改回去
SQL> alter system set java_pool_size=8M;
SQL> select name, block_size, current_size,prev_size from v$buffer_pool;
name block_size current_size prev_size
-----------------------------------------------------------------------------------
KEEP 8192 188 204
SQL> select name, block_size, current_size,prev_size from v$buffer_pool;
pool M bytes
--------------------------- |