ORACLE_修改实例的内存大小

Posted ✧*꧁一品堂.技术学习笔记꧂*✧.

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ORACLE_修改实例的内存大小相关的知识,希望对你有一定的参考价值。


注:本文来源于:星火spark  《Oracle的实例占用内存调整

ORACLE_修改实例的内存大小

一:修改oracle数据库实例内存大小脚本

  1  ---- 1、操作 (oracle使用内存约等于 SGA+PGA,所以可以减少SGA与PGA解决你的问题,生产库慎用)
  2 alter system set sga_max_size=100m scope=spfile; --减少SGA大小,静态参数,重启后生效
  3 alter system set sga_target=80m scope=both; --动态参数;oracle推荐:启动时修改此参数,不要动态设置此参数
  4 alter system set pga_aggregate_target=40m sope=both; ---减少pga大小


二:知识点拓展:

SGA_MAX_SIZE的大小不是随意指定的,必须满足一定条件的。
sga_max_size=100M,必须满足SGA所有组件的最小和;至少满足db_cache_size,log_buffer,shared_pool_size,large_pool_size,java_pool_size总和的大小)

  1 oracle内存结构介绍:
  2 Introduction to Oracle Memory Structures
  3 Oracle uses memory to store information such as the following:
  4 
  5 Program code
  6 Information about a connected session, even if it is not currently active
  7 Information needed during program execution (for example, the current state of a query from which rows are being fetched)
  8 Information that is shared and communicated among Oracle processes (for example, locking information)
  9 Cached data that is also permanently stored on peripheral memory (for example, data blocks and redo log entries)
 10 The basic memory structures associated with Oracle include:
 11 System Global Area (SGA), which is shared by all server and background processes.
 12 Program Global Areas (PGA), which is private to each server and background process; there is one PGA for each process.
 13 
 14 1.sqlplus “/ as sysdba"  2. 3.create pfile=\'d:/cj.ora\' from spfile;  然后去你的oracle安装目录
 15   找一个init数据库名。ora这样一个文件
 16 
 17   把几个oracle内存参数改小点
 18 
 19   一个2G的内存是如下配置的:
 20 
 21   *.sga_max_size=712M
 22 
 23   *.large_pool_size=8M
 24 
 25   *.shared_pool_size=250M
 26 
 27   *.sort_area_size=0.5M
 28 
 29   *.db_cache_size=350M
 30 
 31   然后shutdown数据库
 32 
 33   1.shutdown immediate;  2. 3.create spfile from pfile=\'d:/cj2.ora\';  4. 5.startup;  然后启动,就可以了。
 34 
 35   以上就是调整oracle内存参数,减少数据库内存占用的方法介绍。

以上是关于ORACLE_修改实例的内存大小的主要内容,如果未能解决你的问题,请参考以下文章

关于内存管理

oracle数据库怎么查询他的cpu,内存大小和存储大小,急等

oracle安装时需要的虚拟内存大小

在Oracle实例关闭情况下如何修改spfile的参数

openstack 修改内存大小和vcu

Oracle单实例数据库安装配置