首页 > 数据库 > Oracle > 关于granul,SGA 粒度管理。
Oracle的内存分配会为'Fixed SGA Size'和'Redo Buffers'共享整数倍个Granule。
SQL> startup
ORA-32004: obsolete and/or deprecated parameter(s) specified
ORACLE instance started.
Total System Global Area 1048576000 bytes
Fixed Size 2089376 bytes
Variable Size 801115744 bytes
Database Buffers 239075328 bytes
Redo Buffers 6295552 bytes
Database mounted.
Database opened.
SQL> set timing on
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Productio
NLSRTL Version 10.2.0.4.0 - Production
Elapsed: 00:00:00.01
SQL> SQL>
SQL> select * from v$sgainfo where name in ('Fixed SGA Size','Redo Buffers','Granule Size');
NAME BYTES RESIZE
---------------------------------------------------------------- ---------- ------
Fixed SGA Size 2089376 No
Redo Buffers 6295552 No
Granule Size 4194304 No
Elapsed: 00:00:00.05
SQL> SQL> select sum(bytes)/1024/1024 from v$sgainfo where name in ('Fixed SGA Size','Redo Buffers');
SUM(BYTES)/1024/1024
--------------------
7.99649048
Elapsed: 00:00:00.01
SQL> select * from v$sgainfo where name in ('Fixed SGA Size','Redo Buffers','Granule Size');
NAME BYTES RESIZE
---------------------------------------------------------------- ---------- ------
Fixed SGA Size 2089376 No
Redo Buffers 6295552 No
Granule Size 4194304 No
Elapsed: 00:00:00.01
SQL> SQL>
SQL> select
2 x.ksppinm name,
3 y.ksppstvl value,
4 y.ksppstdf isdefault,
5 decode(bitand(y.ksppstvf,7),1,'MODIFIED',4,'SYSTEM_MOD','FALSE') ismod,
6 decode(bitand(y.ksppstvf,2),2,'TRUE','FALSE') isadj
7 from
8 sys.x$ksppi x,
9 sys.x$ksppcv y
10 where
11 x.inst_id = userenv('Instance') and
12 y.inst_id = userenv('Instance') and
13 x.indx = y.indx and
14 x.ksppinm like '%_&par%'
15 order by
16 translate(x.ksppinm, ' _', ' ');
Enter value for par: _ksmg_granule_size
old 14: x.ksppinm like '%_&par%'
new 14: x.ksppinm like '%__ksmg_granule_size%'
no rows selected
Elapsed: 00:00:00.01
SQL> desc V$SGA_DYNAMIC_COMPONENTS
Name Null? Type
----------------------------------------------------------------------------------- -------- --------------------------------------------------------
COMPONENT VARCHAR2(64)
CURRENT_SIZE NUMBER
MIN_SIZE NUMBER
MAX_SIZE NUMBER
USER_SPECIFIED_SIZE NUMBER
OPER_COUNT NUMBER
LAST_OPER_TYPE VARCHAR2(13)
LAST_OPER_MODE VARCHAR2(9)
LAST_OPER_TIME DATE
GRANULE_SIZE NUMBER
SQL> select GRANULE_SIZE from V$SGA_DYNAMIC_COMPONENTS
2 ;
GRANULE_SIZE
------------
4194304
4194304
4194304
4194304
4194304
4194304
4194304
4194304
4194304
4194304
4194304
4194304
4194304
13 rows selected.
Elapsed: 00:00:00.00
SQL> select 4194304/1024/1024 from dual;
4194304/1024/1024
-----------------
4
Elapsed: 00:00:00.01
SQL> show sga
Total System Global Area 1048576000 bytes
Fixed Size 2089376 bytes
Variable Size 801115744 bytes
Database Buffers 239075328 bytes
Redo Buffers 6295552 bytes
SQL>
---------------------------------------------------------
相关视图:
gv$sga_dynamic_components
select * from v$sga_dynamic_components;
INST_ID COMPONENT CURRENT_SIZE MIN_SIZE MAX_SIZE USER_SPECIFIED_SIZE OPER_COUNT LAST_OPER_TYPE LAST_OPER_MODE LAST_OPER_TI GRANULE_SIZE
---------- --------------- ------------ ---------- ---------- ------------------- ---------- -------------------------- ------------------ ------------ ------------
1 shared pool 163577856 163577856 0 0 0 STATIC 4194304
1 large pool 4194304 4194304 0 0 0 STATIC 4194304
1 java pool 4194304 4194304 0 0 0 STATIC 4194304
1 streams pool 0 0 0 0 0 STATIC 4194304
1 DEFAULT buffer 239075328 239075328 0 0 0 INITIALIZING 4194304
cache
1 KEEP buffer cac 0 0 0 0 0 STATIC 4194304
he
1 RECYCLE buffer 0 0 0 0 0 STATIC 4194304
cache
1 DEFAULT 2K buff 0 0 0 0 0 STATIC 4194304
er cache
1 DEFAULT 4K buff 0 0 0 0 0 STATIC 4194304
er cache
1 DEFAULT 8K buff 0 0 0 0 0 STATIC 4194304
er cache
1 DEFAULT 16K buf 0 0 0 0 0 STATIC 4194304
fer cache
1 DEFAULT 32K buf 0 0 0 0 0 STATIC 4194304
fer cache
1 ASM Buffer Cach 0 0 0 0 0 STATIC 4194304
e
13 rows selected.
Elapsed: 00:00:00.00
SQL>
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/24487368/viewspace-1042855/ ,如需转载,请注明出处,否则将追究法律责任。