Elapsed: 00:00:00.06
SQL>
SQL> desc v$sga_dynamic_components;
Name 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>
SQL> select * from v$sga_dynamic_components;
COMPONENT CURRENT_SIZE MIN_SIZE MAX_SIZE USER_SPECIFIED_SIZE OPER_COUNT LAST_OPER_TYP LAST_OPER LAST_OPER GRANULE_SIZE
-------------------- ------------ ---------- ---------- ------------------- ---------- ------------- --------- --------- ------------
shared pool 92274688 92274688 0 0 0 STATIC 4194304
large pool 4194304 4194304 0 0 0 STATIC 4194304
java pool 4194304 4194304 0 0 0 STATIC 4194304
streams pool 0 0 0 0 0 STATIC 4194304
DEFAULT buffer cache 62914560 62914560 0 0 0 INITIALIZING 4194304
KEEP buffer cache 0 0 0 0 0 STATIC 4194304
RECYCLE buffer cache 0 0 0 0 0 STATIC 4194304
DEFAULT 2K buffer ca 0 0 0 0 0 STATIC 4194304
DEFAULT 4K buffer ca 0 0 0 0 0 STATIC 4194304
DEFAULT 8K buffer ca 0 0 0 0 0 STATIC 4194304
DEFAULT 16K buffer c 0 0 0 0 0 STATIC 4194304
DEFAULT 32K buffer c 0 0 0 0 0 STATIC 4194304
ASM Buffer Cache 0 0 0 0 0 STATIC 4194304
13 rows selected.
Buffer Cache Size
数据缓存,调高数据命中率可以提高性能。按数据块存放。
db_cache_size
db_keep_cache_size
db_recycle_cache_size
alter system set db_cache_size = xxx M
SQL> show parameter advice
NAME_COL_PLUS_SHOW_PARAM TYPE VALUE_COL_PLUS_SHOW_PARAM
--------------------------------------------------------------------------------
db_cache_advice string ON
SQL>
SQL> select * from v$db_cache_advice;
SQL>
Large Pool Size rman 和一些并行处理时候会用到。
Java Pool Size java存储过程的支持
1) 03:41:30 SQL> show sga
2)
3) Total System Global Area 285212672 bytes
4) Fixed Size 1218992 bytes
5) Variable Size 71304784 bytes
6) Database Buffers 209715200 bytes
7) Redo Buffers 2973696 bytes
8) 04:45:40 SQL>
9)
04:46:18 SQL> select name,bytes/(1024*1024) ,resizeable from v$sgainfo;
10)
11) NAME BYTES/(1024*1024) RES
12) -------------------------------- ----------------- ---
13) Fixed SGA Size 1.16252136 No
14) Redo Buffers 2.8359375 No
15) Buffer Cache Size 200 Yes
16) Shared Pool Size 60 Yes
17) Large Pool Size 4 Yes
18) Java Pool Size 4 Yes
19) Streams Pool Size 0 Yes
20) Granule Size 4 No ;区组大小为4M
21) Maximum SGA Size 272 No
22) Startup overhead in Shared Pool 36 No
23) Free SGA Memory Available 0
24)
04:49:34 SQL> select sum(bytes)/(1024*1024) size_in_mb from v$sgastat;
25)
26) SIZE_IN_MB
27) ----------
28) 276.003071
29)
30)
04:48:19 SQL> select * from v$sgastat;
31)
32) POOL NAME BYTES
33) ------------ -------------------------- ----------
34) shared pool KKJ WRK LAT 300
35) shared pool kfkhsh_kfdsg 2052
36) shared pool event statistics ptr arra 680
37) shared pool KGKP randnum 40000
38) large pool PX msg pool 206208
39) large pool free memory 3988096
40) java pool free memory 4194304
41)
42) 602 rows selected.
43)
04:50:37 SQL> show parameter sga;
44)
45) NAME TYPE VALUE
46) ------------------------------------ ----------- ------------------------------
47) lock_sga boolean FALSE
48) pre_page_sga boolean FALSE
49) sga_max_size big integer 272M
50) sga_target big integer 272M
SGA动态尺寸总计不能超过初始化参数SGA_MAX_SIZE的值。
如果sga_target超过了sga_max_size的大小,在Instance重新启动后,sga_max_size会调整成和sga_target一样大小的值。 如果在初始化参数里这些内存池设置为非零,则系统启动后,这些值将作为该参数对应的最小值运行。如果那个值在系统运行时不够,则Oracle将自动为其添加容量,以帮助其优化操作,直到内存使用达到SGA_TARGET所表明的上限。
[oracle@oraserv ~]$ !sql
sqlplus '/as sysdba';
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Mar 19 11:17:30 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
11:17:35 SQL> startup
ORACLE instance started.
Total System Global Area 419430400 bytes
Fixed Size 1219784 bytes
Variable Size 289407800 bytes
Database Buffers 125829120 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.
11:18:13 SQL> show parameter sga
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
lock_sga boolean FALSE
pre_page_sga boolean FALSE
sga_max_size big integer 400M
sga_target big integer 300M 11:18:23 SQL> alter system set sga_target=500m ; alter system set sga_target=500m * ERROR at line 1: ORA-02097: parameter cannot be modified because specified value is invalid ORA-00823: Specified value of sga_target greater than sga_max_size
11:18:38 SQL> alter system set sga_target=500m scope=spfile;
Total System Global Area 524288000 bytes
Fixed Size 1220360 bytes
Variable Size 176161016 bytes
Database Buffers 343932928 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.
11:19:30 SQL> show parameter sga;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
lock_sga boolean FALSE
pre_page_sga boolean FALSE
sga_max_size big integer 500M
sga_target big integer 500M
11:19:38 SQL>
2)、数据字典高速缓存区(Dictionary cache)
用于存放数据字典的信息,包括表、列定义以及权限信息)
库高速缓存和数据字典高速缓存大小是动态变化的,不是固定的。
SQL> alter system set share_pool_size=60m;
DB buffer
数据高速缓存(Database Buffer cache)用于存放最近访问的数据块信息,它由许多小缓冲区(缓冲区大小=数据尺寸)组成
Db_cache_size 定义标准的高速缓存尺寸
Db_nk_cache_size 定义非标准的高速缓存尺寸
Redo log buffer
重做日志缓存区(Redo log buffer),用于记载实例的变化。执行DDL或DML语句时,服务器进程首先将事物的变化记载到重做日志缓存区,然后才会修改数据高速缓存。
重做日志缓存区由很多重做记录(Redo record)组成,并且每条重做记录记载了被修改数据块的位置以及变换后的数据
Large pool
rac ping官方解释:
Every few seconds, the process in one instance sends messages to each instance. The message is received by PING on the target instance. The time for the round trip is measured and collected.
rac ping是用ops时的概念了,现在已经不用这个概念了,或许没有这个概念了。