求助 oracle 12c 修改内存database 12c如此的占内存吗

《专业级Oracle Database 12c安装、配置与维护》([美]Ian Abramson,Michael Abbey,Michelle Malcher,等)【摘要 书评 试读】- 京东图书
京 东 价:
[定价:¥]
PLUS会员专享价
您购买此商品可享受专属价
增值业务:
重  量:
选择系列:
搭配赠品:
服务支持:
加载中,请稍候...
加载中,请稍候...
加载中,请稍候...
专业级Oracle Database 12c安装、配置与维护
商品介绍加载中...
扫一扫,精彩好书免费看
京东商城向您保证所售商品均为正品行货,京东自营商品开具机打发票或电子发票。
凭质保证书及京东商城发票,可享受全国联保服务(奢侈品、钟表除外;奢侈品、钟表由京东联系保修,享受法定三包售后服务),与您亲临商场选购的商品享受相同的质量保证。京东商城还为您提供具有竞争力的商品价格和,请您放心购买!
注:因厂家会在没有任何提前通知的情况下更改产品包装、产地或者一些附件,本司不能确保客户收到的货物与商城图片、产地、附件说明完全一致。只能确保为原厂正货!并且保证与当时市场上同样主流新品一致。若本商城没有及时更新,请大家谅解!
权利声明:京东上的所有商品信息、客户评价、商品咨询、网友讨论等内容,是京东重要的经营资源,未经许可,禁止非法转载使用。
注:本站商品信息均来自于合作方,其真实性、准确性和合法性由信息拥有者(合作方)负责。本站不提供任何保证,并不承担任何法律责任。
印刷版次不同,印刷时间和版次以实物为准。
价格说明:
京东价:京东价为商品的销售价,是您最终决定是否购买商品的依据。
划线价:商品展示的划横线价格为参考价,并非原价,该价格可能是品牌专柜标价、商品吊牌价或由品牌供应商提供的正品零售价(如厂商指导价、建议零售价等)或该商品在京东平台上曾经展示过的销售价;由于地区、时间的差异性和市场行情波动,品牌专柜标价、商品吊牌价等可能会与您购物时展示的不一致,该价格仅供您参考。
折扣:如无特殊说明,折扣指销售商在原价、或划线价(如品牌专柜标价、商品吊牌价、厂商指导价、厂商建议零售价)等某一价格基础上计算出的优惠比例或优惠金额;如有疑问,您可在购买前联系销售商进行咨询。
异常问题:商品促销信息以商品详情页“促销”栏中的信息为准;商品的具体售价以订单结算页价格为准;如您发现活动商品售价或促销信息有异常,建议购买前先联系销售商咨询。
加载中,请稍候...
加载中,请稍候...
加载中,请稍候...
加载中,请稍候...
加载中,请稍候...
加载中,请稍候...
加载中,请稍候...
浏览了该商品的用户还浏览了
加载中,请稍候...
七日畅销榜
新书热卖榜
iframe(src='//www.googletagmanager.com/ns.html?id=GTM-T947SH', height='0', width='0', style='display: visibility:')Posts - 801,
Articles - 0,
Comments - 1546
18:50 by 潇湘隐者, ... 阅读,
1)下载Oracle Database 12cRelease 1安装介质
官方的下载地址:
URL地址2需要先注册,然后才能登陆下载,注册登陆界面
关于这两者有啥区别: 听一个同事说,用metalink 账号下载的安装文件完整一些。具体情况是不是如此,还不得而知。
地址1下载的文件为:
linuxamd64_12c_database_1of2.zip
linuxamd64_12c_database_2of2.zip
地址2下载的文件为:
2)检查硬件要求(Check Hardware Requirements)
2.1 Check CPU
[root@getoraclelnx01 tmp]#
[root@getoraclelnx01 tmp]# grep "model name" /proc/cpuinfo
model name&&&&& : Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz
model name&&&&& : Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz
model name&&&&& : Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz
model name&&&&& : Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz
model name&&&&& : Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz
model name&&&&& : Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz
model name&&&&& : Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz
model name&&&&& : Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz
[root@getoraclelnx01 tmp]# cat /proc/cpuinfo | grep "processor" | wc -l
[root@getoraclelnx01 tmp]#& cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l
[root@getoraclelnx01 tmp]#
2.2 Check Memory&
[root@getoraclelnx01 tmp]# grep MemTotal /proc/meminfo
MemTotal:&&&&&&
[root@getoraclelnx01 tmp]# grep SwapTotal /proc/meminfo
SwapTotal:&&&&&
[root@getoraclelnx01 tmp]# free -g
&&&&&&&&&&&&&& total&&&&&&&&&& used&&&&&&& free&&&& shared&&& buffers&&&& cached
Mem:&&&&&&&& 23&&&&&&&&&&&&& 7&&&&&&&&&&&& 16&&&&&&&&&&& 0&&&&&&&&&&&&& 0&&&&&&&&&&&&&& 5
-/+ buffers/cache:&&&&& 1&&&&&&&&&&&& 22
Swap:&&&&&&& 35&&&&&&&&&&&& 0&&&&&&&&&&&& 35
[root@getoraclelnx01 tmp]#
Oracle 12c 对系统内存的最低要求为1G,推荐2G或更大的内存,从上面结果可以知道系统内存23G,完全满足要求。
Oracle对交换分区(Swap Space)的推荐设置如下,这里Swap Space为35G,不是16G,需要做一下调整。
2.3 Check Disk Capacity
Oracle 12c 企业版的需要6.4G大小的磁盘空间,标准版需要6.1G大小的磁盘空间。/tmp 需要至少1G的大小。从上面结果得知,磁盘空间完全满足。
3)检查软件要求(Checking the Software Requirements)
3.1 操作系统版本检测
&&&& Oracle 12 c 只支持64位的Linux系统。不支持32Linux平台,这也许是以后的趋势了。Operating System Requirements for x86-64 Linux Platforms。 Oracle 的官方文档明确列出了支持下面三个Linux版本
Supported Oracle Linux 6 and Red Hat Enterprise Linux 6 Distributions for x86-64
Supported Oracle Linux 5 and Red Hat Enterprise Linux 5 Distributions for x86-64
Supported SUSE Distributions for x86-64
[root@getoraclelnx01 /]# uname -m
[root@getoraclelnx01 /]# uname -r
2.6.32-200.13.1.el5uek
[root@getoraclelnx01 /]# more /etc/redhat-release
Red Hat Enterprise Linux Server release 5.7 (Tikanga)
[root@getoraclelnx01 ~]# uname -a
Linux getoraclelnx01.gfg1.esquel.com 2.6.32-200.13.1.el5uek #1 SMP Wed Jul 27 21:02:33 EDT
x86_64 x86_64 GNU/Linux
[root@getoraclelnx01 Server]# lsb_release -id
Distributor ID: EnterpriseEnterpriseServer
Description: Enterprise Linux Enterprise Linux Server release 5.7 (Carthage)
[root@getoraclelnx01 Server]#
3.2 检查oracle 12c所需包
关于Oracle 12c所需包,从官方文档看,不同版本的操作系统似乎有所不同,Oracle Linux 5 and Red Hat Enterprise Linux 5需要安装下面一些包
binutils-2.17.50.0.6
compat-libstdc++-33-3.2.3
compat-libstdc++-33-3.2.3 (32 bit)
gcc-c++-4.1.2
glibc-2.5-58
glibc-2.5-58 (32 bit)
glibc-devel-2.5-58
glibc-devel-2.5-58 (32 bit)
libaio-0.3.106
libaio-0.3.106 (32 bit)
libaio-devel-0.3.106
libaio-devel-0.3.106 (32 bit)
libgcc-4.1.2
libgcc-4.1.2 (32 bit)
libstdc++-4.1.2
libstdc++-4.1.2 (32 bit)
libstdc++-devel 4.1.2
libXext-1.0.1
libXext-1.0.1 (32 bit)
libXtst-1.0.1
libXtst-1.0.1 (32 bit)
libX11-1.0.3
libX11-1.0.3 (32 bit)
libXau-1.0.1
libXau-1.0.1 (32 bit)
libXi-1.0.1
libXi-1.0.1 (32 bit)
sysstat-7.0.2
rpm -q binutils compat-libstdc++ gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel libXext libXtst libX11 libXau libXi make sysstat
如上所示,还需要安装包 compat-libstdc++和 libaio-devel相关包
[root@getoraclelnx01 Server]# rpm -ivh compat-libstdc++-33-3.2.3-61.i386.rpm
warning: compat-libstdc++-33-3.2.3-61.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
package compat-libstdc++-33-3.2.3-61.i386 is already installed
[root@getoraclelnx01 Server]# rpm -ivh compat-libstdc++-33-3.2.3-61.x86_64.rpm
warning: compat-libstdc++-33-3.2.3-61.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
package compat-libstdc++-33-3.2.3-61.x86_64 is already installed
[root@getoraclelnx01 Server]# ls *libaio-devel*
libaio-devel-0.3.106-5.i386.rpm libaio-devel-0.3.106-5.x86_64.rpm
[root@getoraclelnx01 Server]# rpm -ivh libaio-devel-0.3.106-5.i386.rpm
warning: libaio-devel-0.3.106-5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:libaio-devel ########################################### [100%]
[root@getoraclelnx01 Server]# rpm -ivh libaio-devel-0.3.106-5.x86_64.rpm
warning: libaio-devel-0.3.106-5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:libaio-devel ########################################### [100%]
[root@getoraclelnx01 Server]#
如上所示,既可以用rpm安装,也可以用yum本地源进行安装,这个就看那个方便以及个人的喜好、习惯了。一般推荐用yum安装,不过需要进行配置。具体可以参见我的博客。
4)系统配置准备
4.1 创建Oracle用户和用户组
[root@getoraclelnx01 Server]# groupadd dba
[root@getoraclelnx01 Server]# groupadd oinstall
[root@getoraclelnx01 Server]# useradd -g oinstall -G dba oracle
[root@getoraclelnx01 Server]# id oracle
uid=502(oracle) gid=503(oinstall) groups=503(oinstall),502(dba)
[root@getoraclelnx01 Server]#
创建了oracle用户以及相关用户组后,需要设置oracle用户密码。
4.2 创建安装目录
[root@getoraclelnx01 Server]#
[root@getoraclelnx01 Server]# mkdir -p /u01/app/oracle
[root@getoraclelnx01 Server]# chown -R oracle:oinstall /u01/app/oracle
[root@getoraclelnx01 Server]# chmod -R 775 /u01/app/oracle
[root@getoraclelnx01 Server]#
4.3 Disable SELinux
[root@getoraclelnx01 ~]# /usr/sbin/sestatus
SELinux status: disabled
[root@getoraclelnx01 ~]# /usr/sbin/getenforce
[root@getoraclelnx01 ~]#
从上面可以看出SELinux已经被禁用了,如果没有禁用,则可以通过下面命令禁用
getenforce (returns "Enforcing")
setenforce 0
getenforce (returns "Permissive")
End to restore it to enforcing
setenforce 1
getenforce (returns "Enforcing")
[root@getoraclelnx01& os]# /usr/sbin/sestatus
SELinux status:&&&&&&&&&&&&&&&& disabled
[root@getoraclelnx01& os]# /usr/sbin/getenforce
[root@getoraclelnx01& os]#
Disable secure linux by editing the "/etc/selinux/config" file, making sure the SELINUX flag is set as follows.
SELINUX=disabled
4.4 修改系统内核参数
在修改系统内核参数前,你可以用命令先查看一下当前各类系统参数的值,亦或直接查看配置文件/etc/sysctl.conf
[root@getoraclelnx01 ~]# getconf PAGESIZE
[root@getoraclelnx01 ~]# sysctl -a | grep sem
kernel.sem = 250
[root@getoraclelnx01 ~]# sysctl -a | grep shm
kernel.shmmax =
kernel.shmall =
kernel.shmmni = 4096
vm.hugetlb_shm_group = 0
[root@getoraclelnx01 ~]# sysctl -a | grep file-max
fs.file-max = 2414060
[root@getoraclelnx01 ~]# sysctl -a | grep ip_local_port_range
net.ipv4.ip_local_port_range =
[root@getoraclelnx01 ~]#
关于内核参数的一些设置建议,可以参考下面资料:
kernel.shmmax
关于内核参数kernel.shmmax,oracle 建议,kernel.shmmax的值不能少于物理内存的一半,而且要大于Oracle中sga-max-size的值,否则会造成oracle性能下降
一般32bit操作系统,直接设置为系统支持的最大内存即可,64bit操作系统设置大于sga-max-size的值即可
如:当前内存为2G 则kernel.shmmax = 2*97152
当前内存为8G则 kernel.shmmax = 7*40032
Kernel.shmall
Shmall指系统一次可以使用的共享内存段的最大数量,以页为单位。Oracle默认设置为 kernel.shmall = 2097152
即最大8G(/),(在调整SGA时需要注意,SGA大小设置不可超过该值),根据系统内存大小和使用的不同可以参考如下:设置的一般规律
kernel.shmall = 8G/4k=k=2097152
kernel.shmall = 16G/4k=k=4194304
---内存16G
kernel.shmall = 32G/4k=k=8388608
---内存32G
(RedHat linux系统中页大小为4096即4K,实际环境以getconf PAGE_SIZE结果为准)
kernel.shmmni
shmmni 指系统共享内存段的最大数量
oracle设置默认值为4096,一般是足够用了,不需要调整
文件句柄数的相关内核参数设置
fs.file-max
fs.file-max指系统能够打开最大的文件句柄数
oracle建议设置为65536,一般不用修改
信号的相关内核参数设置
kernel.sem
kernel.sem是指 semmsl,semmns,semopm,semmni这4个参数
semmsl 指每个线号集的最大信号数,Oracle建议是设置为oracle的最大进程数+10
semmni 指整个系统的信号集的最大数量
semmns 指整个系统的信号总数,也就是semmni*semmsl的结果
semopm 指每个semop系统调用可以执行的信号操作的最大数量
oracle默认设置
semmsl=250
semmns=3200
semopm=100
semmni=128
即kernel.sem= 250
例:在oracle
ora.init文件参数中设置PROCESSES参数为5000
则semmsl=5010,semmni=128,semmns=semmsl* semmni=641280
另外semopm建议设置等于semmsl值即5010
那么kernel.sem=
网络相关的内核参数设置
net.core.rmem_default
net.core.rmem_default 指网络套接字的默认接收缓冲区的大小,oracle建议设置为265K即262144
net.core.rmem_max
net.core.rmem_max 指网络套接字的最大接收缓冲区的大小,oracle10g及以前版本建议设置为256k即262144
oracle11g建议设置为4M 即4194304
net.core.wmem_default
net.core.wmem_default指网络套接字的默认发送缓冲区的大小,oracle建议设置为265K即262144
net.core.wmem_max
net.core.wmem_max
指网络套接字的最大发送缓冲区的大小,oracle10g及以前版本建议设置为256k即262144
oracle11g建议设置为1M即1048576
net.ipv4.ip_local_port_range
net.ipv4.ip_local_port_range ,指本地的允许打开随机端口范围
oracle10g前建议端口范围为,oracle11g建议端口范围为:
并忽略oracle安装程序任何关于这个参数的警告
Asynchronous I/O相关的内核参数设置
fs.aio-max-nr
fs.aio-max-nr 指系统允许的最大的异步IO请求大小
oracle默认设置为1M即1048576,一般不用更改
修改前最后先备份一下/etc/sysctl.conf,以防万一。
[root@getoraclelnx01 ~]# cp /etc/sysctl.conf /etc/sysctl.conf.bak
[root@getoraclelnx01 ~]# vi /etc/sysctl.conf 添加或修改下面参数
kernel.shmmax =
kernel.shmall = 6029312
kernel.shmmni = 4096
kernel.sem =250 8
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144
net.ipv4.ip_local_port_range =
fs.file-max=65536
fs.aio-max-nr=1048576
kernel.shmall =physical RAM size / pagesize (getconf PAGESIZE) -- If the defaults are greater then leave it.
kernel.shmall = 内存大小/4k=23G*k = 6029312
kernel.shmmax = 20*971520 而默认的为,那么使用默认值
修改完成后保存,然后运行sysctl -p 命令使之生效
4.5 设置用户限制
在/etc/security/limits.conf中添加如下配置。
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 10240
Add the following line to the "/etc/pam.d/login" file,
if it does not already exist.
session required /lib/security/pam_limits.so
session required pam_limits.so
Add the following to
/etc/profile if Oracle user will use the bash shell.
if [ $USER = "oracle" ]; then
ulimit -u 16384
ulimit -n 65536
4.6 配置环境变量
首先切换到oracle账户 ,编辑修改主目录下 .bash_profile
TMP=/ export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/u01/app/ export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1; export ORACLE_HOME
ORACLE_SID= export ORACLE_SID
ORACLE_TERM= export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/ export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/ export CLASSPATH
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
ulimit -u 16384 -n 65536
使配置生效
[oracle@getoraclelnx01 ~]$ source .bash_profile
[oracle@getoraclelnx01 ~]$
解压安装镜像文件
[oracle@getoraclelnx01 tmp]$ unzip Vof2.zip
[oracle@getoraclelnx01 tmp]$ unzip Vof2.zip
安装步骤截图
在这一步时,无法继续,因为oracle账户无法创建oraInventory目录,所以必须先创建该用户并授权
[root@getoraclelnx01 ~]# mkdir -p /u01/app/oraInventory
[root@getoraclelnx01 ~]# chown -R oracle:oinstall /u01/app/oraInventory
[root@getoraclelnx01 ~]# chmod -R 775 /u01/app/oraInventory
验证参数时,fs.file-max设置为65536,但是ORACLE推荐使用,net.core.wmem_max大小为262144,oracle 推荐使用1048576,修改内核参数,运行sysctl -p使之生效。然后重新验证通过
[root@getoraclelnx01 ~]# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 2
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax =
kernel.shmall = 6029312
kernel.shmmni = 4096
kernel.sem = 250 8
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.ip_local_port_range =
fs.file-max = 6815744
fs.aio-max-nr = 1048576
[root@getoraclelnx01 ~]#
运行过程会提示让你用root账户执行2个脚本,你将脚本的文件拿下来,在root账户下执行即可。
[参考资料]:
Database Quick Installation Guide for Linux x86-64 e17718.pdfOracle 12C 新特性:限制PGA使用内存的大小_数据库技术_Linux公社-Linux系统门户网站
你好,游客
Oracle 12C 新特性:限制PGA使用内存的大小
来源:Linux社区&
作者:hbxztc
我们都知道,在12C之前,对于PGA内存的管理是使用PGA_AGGREGATE_TARGET参数来控制的,但这个参数也只是一个参考值,实例只是尽量保证总的PGA使用量在这个值范围内,当会话使用的PGA内存超过这个限制时,Oracle也不能做出什么强制措施来限制使用内存的大小。12.1.0.1版本中引入了新特性:使用PGA_AGGREGATE_LIMIT参数来限制Oracle实例PGA使用内存的上限。后台进程ckpt每三秒检查一次PGA使用的内存总量,如果超过限制就采取终止会话的方式来降低PGA内存的使用量,对于SYS用户进程和后台进程不包括job队列不会被终止掉。有了这个限制,不会造成PGA内存疯涨,导致内存耗尽。官方文档:http://docs.oracle.com/database/121/TGDBA/tune_pga.htm#TGDBA95344 默认地PGA_AGGREGATE_LIMIT参数为2G或200%的PGA_AGGREGATE_TARGET值或PROCESSES参数值*3M测试数据库版本12.1.0.2
SQL& select * from v$ & BANNER& & & & & & & & & & & & & & & & & & & & &
CON_ID -------------------------------------------------------------------------------- ---------- Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production& & & &
0 PL/SQL Release 12.1.0.2.0 - Production& & & & & & & & & & & & & & 0 CORE& & 12.1.0.2.0& Production& & & & & & & & & & & & & & & & 0 TNS for Linux: Version 12.1.0.2.0 - Production& & & & & & & & & & & & & 0 NLSRTL Version 12.1.0.2.0 - Production& & & & & & & & & & & & & & 0
查看PGA_AGGREGATE_LIMIT参数值大小为2GSQL& show parameter pga & NAME& & & & & & & & & &
VALUE ------------------------------------ ----------- ------------------------------ pga_aggregate_limit& & & & & big integer 2G pga_aggregate_target& & & & & &
big integer 250M
创建测试用户
SQL& alter session set container=pdb_ & Session altered. & SQL& create user & User created. & SQL& & Grant succeeded. & SQL& conn zx/zx@pdb_orcl Connected.
创建一个包用于演示占用PGASQL& create or replace package demo_pkg & 2& as& 3& & & & & type array is table of char(2000) index by binary_ & 4& & & & & g_ & 5& & 6& / & Package created.
查看当前会话sid和使用PGA内存情况SQL& select userenv('sid') & USERENV('SID') -------------- & & & & & & 22 --当前会话sid为22 SQL& select a.name, to_char(b.value, '999,999,999') bytes, & 2& & & &
to_char(round(b.value/), '99,999.9' ) mbytes & 3& & from v$statname a, v$mystat b & 4&
where a.statistic# = b.statistic# & 5& &
and a.name like '%ga memory%'; & NAME& & & & & & & & & & & & & & & & & & & & & & & & & & & & & &
BYTES& & & & MBYTES ---------------------------------------------------------------- ------------ --------- session uga memory& & & & & & & & & & & & & & & & & & & & & & & & & 2,301,312& & &
2.2 session uga memory max& & & & & & & & & & & & & & & & & & & & & & & 2,424,824& & &
2.3 session pga memory& & & & & & & & & & & & & & & & & & & & & & & & & 3,715,176& & &
3.5 session pga memory max& & & & & & & & & & & & & & & & & & & & & & & 3,715,176& & &
3.5 --当前会话使用PGA内存为3.5MB
执行前面创建的包,查看PGA内存使用情况--循环执行200000次查看PGA内存使用情况 SQL& begin& 2& & & & & for i in 1 .. 200000 & 3& & & & & loop & 4& & & & & & & & & demo_pkg.g_data(i) := 'x'; & 5& & & & & & 6& & 7& / & PL/SQL procedure successfully completed. & SQL& select a.name, to_char(b.value, '999,999,999') bytes, & 2& & & &
to_char(round(b.value/), '99,999.9' ) mbytes & 3& & from v$statname a, v$mystat b & 4&
where a.statistic# = b.statistic# & 5& &
and a.name like '%ga memory%'; & NAME& & & & & & & & & & & & & & & & & & & & & & & & & & & & & &
BYTES& & & & MBYTES ---------------------------------------------------------------- ------------ --------- session uga memory& & & & & & & & & & & & & & & & & & & & & & & & 470,213,072& &
448.4 session uga memory max& & & & & & & & & & & & & & & & & & & & & & 470,213,072& &
448.4 session pga memory& & & & & & & & & & & & & & & & & & & & & & & & 471,773,288& &
449.9 session pga memory max& & & & & & & & & & & & & & & & & & & & & & 471,773,288& &
449.9 --共使用449MB内存,可以算出循环执行次占用的PGA就会超过设置的2G SQL& begin& 2& & & & & for i in 1 .. 1000000 & 3& & & & & loop & 4& & & & & & & & & demo_pkg.g_data(i) := 'x'; & 5& & & & & & 6& & 7& / begin* ERROR at line 1: ORA-04036: PGA memory used by the instance exceeds PGA_AGGREGATE_LIMIT --报错ORA-4036超过了PGA_AGGREGATE_LIMIT设置的2G
调整PGA_AGGREGATE_LIMIT为4G后再次执行报错的过程,就没有问题了SQL& conn / as sysdba Connected. SQL& alter system set PGA_AGGREGATE_LIMIT=4G; & System altered. & SQL& conn zx/zx@pdb_orcl Connected. SQL& begin& 2& & & & & for i in 1 .. 1000000 & 3& & & & & loop & 4& & & & & & & & & demo_pkg.g_data(i) := 'x'; & 5& & & & & & 6& & 7& / & PL/SQL procedure successfully completed. & SQL& show parameter pga & NAME& & & & & & & & & & & & & & & &
TYPE& & & & VALUE ------------------------------------ ----------- ------------------------------ pga_aggregate_limit& & & & & & & & & big integer 4G pga_aggregate_target& & & & & & & &
big integer 250M
取消PGA限制,设置pga_aggregate_limit=0即可。alter system set PGA_AGGREGATE_LIMIT=0;
更多Oracle相关信息见 专题页面
本文永久更新链接地址:
相关资讯 & & &
& (昨 19:35)
& (10月04日)
& (08月21日)
& (10月16日)
& (08月28日)
& (08月21日)
   同意评论声明
   发表
尊重网上道德,遵守中华人民共和国的各项有关法律法规
承担一切因您的行为而直接或间接导致的民事或刑事法律责任
本站管理人员有权保留或删除其管辖留言中的任意内容
本站有权在网站内转载或引用您的评论
参与本评论即表明您已经阅读并接受上述条款

我要回帖

更多关于 oracle12c 内存设置 的文章

 

随机推荐