将内存使用量从 16GB 减少到 8GB - Oracle
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20395506/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Reduce Memory Usage from 16GB to 8GB - Oracle
提问by RobinHood
I had created a oracle instance using "Database Configuration Assistant". My system is having 64GB RAM. I had given 16GB to oracle instance, in Initialization Parameters Wizard.
我使用“数据库配置助手”创建了一个 oracle 实例。我的系统有 64GB RAM。我在初始化参数向导中为 oracle 实例提供了 16GB。
Now i want to reduce that 16GB to 8GB. So that, the RAM occupied by oracle will be 8GB. I had tried this in SQL Developer,
现在我想将 16GB 减少到 8GB。这样,oracle 占用的 RAM 将为 8GB。我曾在 SQL Developer 中尝试过,
ALTER SYSTEM SET pga_aggregate_target = 8289 M;
ALTER SYSTEM SET sga_target = 1536 M;
I had restarted the oracle service. It not got reflected. Still the oracle is using 16GB.
我已经重新启动了 oracle 服务。它没有得到反映。oracle 仍然使用 16GB。
I dont know whether this is correct. Whether system reboot is needed for this.? or else how to reduce the memory usage.
我不知道这是否正确。是否需要重启系统。?或者如何减少内存使用。
回答by Guido Leenders
There are various ways to define the amount of memory used. Historically, you needed a lot of settings to change to impact total memory footprint. Nowadays, it is often by default setting only one and start tweaking later (when the Oracle installer does not screw up; it often sets things wrongly).
有多种方法可以定义使用的内存量。从历史上看,您需要更改大量设置才能影响总内存占用量。现在,默认情况下通常只设置一个,稍后开始调整(当 Oracle 安装程序没有搞砸时;它经常设置错误)。
I would check the following:
我会检查以下内容:
select *
from v$parameter
where name like '%size%'
or
name like '%target%'
Check which ones have been set and need changing. It can be settingslike shared_pool_size, memory_target, sga_target, and others.
检查哪些已设置并需要更改。它可以是 shared_pool_size、memory_target、sga_target 等设置。
When you change it, some settings (depends on version and edition) can be changed while the instance is open and running, while some require a restart. Also, sometimes you are using a text file (pfile) and in some instance you may be using a binary file (spfile). Binary file is pre-condition to allow online changing without restarting.
当您更改它时,某些设置(取决于版本和版本)可以在实例打开和运行时更改,而有些则需要重新启动。此外,有时您使用的是文本文件 (pfile),而在某些情况下,您可能使用的是二进制文件 (spfile)。二进制文件是允许在线更改而无需重新启动的前提条件。
You will probably succeed using something like:
您可能会成功使用以下内容:
alter system set NAME = VALUE scope=[spfile|both]
as sys user. Scope=spfile only changes the spfile, both changes runtime and spfile. When using a pfile like init*.ora, you just edit the text file and restart your instance.
作为 sys 用户。Scope=spfile 仅更改 spfile,同时更改运行时和 spfile。使用 init*.ora 之类的 pfile 时,您只需编辑文本文件并重新启动您的实例。
To quickly restart, the best way is IMHO:
要快速重启,最好的方法是恕我直言:
startup force
Please decreasing size, you will generally not have a problem assuming that the size is sufficient to handle the load. Do it in a test environment first. When increasing and depending on platform, please make sure first that your new settings can be handled. For instance, increasing memory allocated on Linux may require you to change kernel settings. Otherwise, your Oracle instance will not start unless the corrections are made first.
请减小尺寸,假设尺寸足以处理负载,您通常不会有问题。首先在测试环境中进行。在增加和依赖平台时,请首先确保您的新设置可以处理。例如,增加在 Linux 上分配的内存可能需要您更改内核设置。否则,除非先进行更正,否则您的 Oracle 实例将不会启动。