13. You have executed this command to change the size of the database buffer cache:
SQL> ALTER SYSTEM SET DB_CACHE_SIZE=2516582;
System altered.
To verify the change in size, you executed this command:
SQL> SHOW PARAMETER DB_CACHE_SIZE
NAME TYPE VALUE
------------------- ----------- ------------------
db_cache_size big integer 4194304 4M
Why is the value set to 4194304 and not to 2516582?
A.because 4194304 is the granule size
B.because 4194304 is the standard block size
C.because 4194304 is the largest nonstandard block size defined in the database
D.because 4194304 is the total size of data already available in the database buffer cache
Answer: A 答案解析:sys@TEST0924> select 2516582/1024/1024 from dual;2516582/1024/1024-----------------2.39999962sys@TEST0924> select 4194304/1024/1024 from dual;4194304/1024/1024-----------------4All SGA components allocate and deallocate space in units of granules. Oracle Database tracks SGA memory use in internal numbers of granules for each SGA component.The memory for dynamic components in the SGA is allocated in the unit of granules. The granule size is determined by the amount of SGA memory requested when the instance starts. Specifically, the granule size is based on the valueof the SGA_MAX_SIZE initialization parameter. Table 6-1shows the granule size for different amounts of SGA memory.
Table 6-1 Granule Size
SGA Memory AmountGranule Size Less than or equal to 1 GB
4 MB
Greater than 1 GB and less than or equal to 8 GB
16 MB
Greater than 8 GB and less than or equal to 16 GB
32 MB
Greater than 16 GB and less than or equal to 32 GB
64 MB
Greater than 32 GB and less than or equal to 64 GB
128 MB
Greater than 64 GB and less than or equal to 128 GB
256 MB
Greater than 128 GB
512 MB
You can query the V$SGAINFO view to see the granule size that is being used by an instance. The same granule size is used for all components in the SGA.
If you specify a size for a component that is not a multiple of granule size, Oracle Database rounds the specified size up to the nearest multiple. For example, if the granule size is 4 MB and you specifyDB_CACHE_SIZE as 10 MB, the database actually allocates 12 MB.
如果指定的size不是granule size的整数倍,则rounds到整数倍,例如,如果granule size为4M,指定DB_CACHE_SIZE as 10 MB,不是4的整数倍,则实际上DB_CACHE_SIZEas 为12M。
一下是我的环境,因为我的sga大于1G,故granule size为16M。
sys@TEST0924> desc V$SGAINFO Name Null? Type----------------------------------------------------- -------- ------------------------------------NAME VARCHAR2(32)BYTES NUMBERRESIZEABLE VARCHAR2(3)sys@TEST0924> select * from V$SGAINFO ;NAME BYTES RES-------------------------------- ---------- ---Fixed SGA Size 2230952 NoRedo Buffers 20078592 NoBuffer Cache Size 1862270976 YesShared Pool Size 570425344 YesLarge Pool Size 16777216 YesJava Pool Size 16777216 YesStreams Pool Size 16777216 YesShared IO Pool Size 0 YesGranule Size 16777216 NoMaximum SGA Size 2505338880 NoStartup overhead in Shared Pool 117947968 NoFree SGA Memory Available 012 rows selected. 版权声明:本文为博主原创文章,未经博主允许不得转载。