内存管理: 有两种管理式手动和自动。
启动 自动内存管理(Automatic Memory managemet)
1: show parameter target// 得到SGA_target和pga_aggregate_target的值
1: SELECT (value/1024/1024)||'M' FROM V$pagstat WHERE name='maximum PGA allocate';
2: //计算实例启动 之后分配给SGA的最大值
3: SHOW PARAMETER MEMORY_MAX_TARGET
4: //查看当前值
5: alter system set MEMORY_MAX_TARGET = 500M scope=spfile;
6: alter system set memory_target =410M scope=spfile;
7: alter system set sga_target =0 scope=spfile;
8: alter system set pga_aggregate_target = 0
用命令行来查看oracle的内存信息:
1: show SGA
2: SELECT *from v$SGA;
3: SELECT NAME,BYTES/1024/1024 || 'M' FROM V$sgainfo WHERE NAME= 'Buffer Cache Size';
4: //the actual size of database Buffer Cache
5: SELECT * from v$sgainfo;
6: SELECT component, (current_size/1024/1024)|| 'M' from v$memory_dynamic_compents
7: where component = 'shared pool';
SQL> SELECT component, (current_size/1024/1024)|| 'M' from v$memory_dynamic_components where component = 'java pool';
COMPONENT
----------------------------------------------------------------
(CURRENT_SIZE/1024/1024)||'M'
-----------------------------------------
java pool
4M
已用时间: 00: 00: 00.03
SQL> select name, bytes/1024/1024 || 'M' from V$SGAINFO WHERE NAME= 'Large Pool Size'
NAME BYTES/1024/1024||'M'
-------------------------------- -----------------------------------------
Large Pool Size 4M
已选择 1 行。
另外可以用企业管理器来查看Oracle内存的分配情况。
服务器—>数据库配置—>内存指导 。