Total System Global Area 4275781632bytes Fixed Size 2260088bytes Variable Size 2801795976bytes Database Buffers 1459617792bytes Redo Buffers 12107776bytes
-- 可以通过查询 select * from v$sgainfo where name = 'Fixed SGA Size'; SQL> select * from v$sgainfo wherename = 'Fixed SGA Size';
NAME BYTES RESIZEABL -------------------- ---------- --------- Fixed SGA Size 2260088No
-- Variable size 包括 Shared Pool Size、Java Pool Size、Large Pool Size 和 Streams Pool Size。 Variable Size 2801795976 bytes
-- 可以通过查询 select * from v$sgainfo where name in ('Shared Pool Size','Java Pool Size','Large Pool Size','Streams Pool Size');
SQL> select * from v$sgainfo wherenamein ('Shared Pool Size','Java Pool Size','Large Pool Size','Streams Pool Size');
NAME BYTES RESIZEABL -------------------- ---------- --------- Shared Pool Size 587202560 Yes Large Pool Size 805306368 Yes Java Pool Size 33554432 Yes Streams Pool Size 1375731712 Yes
-- 注意:这个 SQL 总和在 11G 查询出来的结果跟 Variable Size 的值有出入,在 19C 查出来是一模一样 SQL> select sum(bytes) from v$sgainfo wherenamein ('Shared Pool Size','Java Pool Size','Large Pool Size','Streams Pool Size');
-- 可以通过查询 select * from v$sgainfo where name = 'Redo Buffers'; SQL> select * from v$sgainfo wherename = 'Redo Buffers';
NAME BYTES RESIZEABL -------------------- ---------- --------- Redo Buffers12107776No
以上 SGA 组件内存分配的相关信息可以从 v$sgainfo 中查看:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
SQL> select * from v$sgainfo;
NAME BYTES RESIZEABL ---------------------------------------- ---------- --------- Fixed SGA Size 2260088 No Redo Buffers 12107776 No Buffer Cache Size 1459617792 Yes Shared Pool Size 587202560 Yes Large Pool Size 805306368 Yes Java Pool Size 33554432 Yes Streams Pool Size 1375731712 Yes Shared IO Pool Size 0 Yes Granule Size 16777216 No Maximum SGA Size 4275781632 No Startup overhead in Shared Pool 498329672 No Free SGA Memory Available 0
这部分内容无法从 alert 日志中获取相关信息,所以直接打印在 sqlplus 启动过程中,也可以通过 show sga 查看:
1 2 3 4 5 6 7
SQL> show sga
Total System Global Area 4275781632bytes Fixed Size 2260088bytes Variable Size 2801795976bytes Database Buffers 1459617792bytes Redo Buffers 12107776bytes
## 启动后台进程,一共 17个 Mon Aug 2616:56:592024 PMON started with pid=2, OS id=57755 Mon Aug 2616:56:592024 PSP0 started with pid=3, OS id=57757 Mon Aug 2616:57:002024 VKTM started with pid=4, OS id=57759 at elevated priority VKTM running at (1)millisec precision with DBRM quantum (100)ms Mon Aug 2616:57:002024 GEN0 started with pid=5, OS id=57763 Mon Aug 2616:57:002024 DIAG started with pid=6, OS id=57765 Mon Aug 2616:57:002024 DBRM started with pid=7, OS id=57767 Mon Aug 2616:57:002024 DIA0 started with pid=8, OS id=57769 Mon Aug 2616:57:002024 MMAN started with pid=9, OS id=57771 Mon Aug 2616:57:002024 DBW0 started with pid=10, OS id=57773 Mon Aug 2616:57:002024 LGWR started with pid=11, OS id=57775 Mon Aug 2616:57:002024 CKPT started with pid=12, OS id=57777 Mon Aug 2616:57:002024 SMON started with pid=13, OS id=57779 Mon Aug 2616:57:002024 RECO started with pid=14, OS id=57781 Mon Aug 2616:57:002024 MMON started with pid=15, OS id=57783 Mon Aug 2616:57:002024 MMNL started with pid=16, OS id=57785