v$sga分大块的记录sga的信息。
SQL> desc v$sga
Name Null? Type
----------------------------------------- -------- ----------------------------
NAME VARCHAR2(20)
VALUE NUMBER
SQL> select * from v$sga;
NAME VALUE
-------------------- ----------
Fixed Size 1218148
Variable Size 79694236
Database Buffers 54525952
Redo Buffers 2973696
1、fixed size部分为sga的固定部分,包含数据库和实例的状态信息等通用信息,后台进程需要访问这部分信息,不存储用户数据,通常只需要很小的一部分。
2、variable size部分包括shared_pool_size、java_pool_size和large_pool_size。
3、database buffer代表db_cache_size的大小。
4、redo buffer代表日志缓冲区的大小,这个值通常比参数log_buffer值稍大一些。
v$sgainfo
V$SGAINFO displays size information about the SGA, including the sizes of different SGA components, the granule size, and free memory.
Column | Datatype | Description |
---|---|---|
NAME | VARCHAR2(32) | Name of the SGA statistic |
BYTES | NUMBER | Size of the statistic (in bytes) |
RESIZEABLE | VARCHAR2(3) | Indicates whether the statistic is resizeable (YES) or not (NO) |
QL> select * from v$sgainfo;
NAME BYTES RES
-------------------------------- ---------- ---
Fixed SGA Size 1218148 No
Redo Buffers 2973696 No
Buffer Cache Size 54525952 Yes
Shared Pool Size 71303168 Yes
Large Pool Size 4194304 Yes
Java Pool Size 4194304 Yes
Streams Pool Size 0 Yes
Granule Size 4194304 No
Maximum SGA Size 138412032 No
Startup overhead in Shared Pool 33554432 No
Free SGA Memory Available 0
在内存的自动管理状态下查看内存各个组件的大小可以查看此视图。
内存分配的细节(V$SGASTAT)
在V$视图中,可以查询V$SGASTAT视图来提供有关SGA更详细的内存分配信息。这个视图提供了SGA和内存资源的动态信息(访问数据库时会出现相应变化)。这个语句非常详细地描述了SGA的尺寸。在V$SGA和V$SGASTAT视图中均包含记录FIXED_SGA、BUFFER_CACHE和LOG_BUFFER.V$SGASTAT视图可获取Oracle SGA详细的分类列表以及共享池分配中各存储容器的详细信息。