您的位置:首页 > 其它

sga_target大于指定值的sga_max_size

2017-01-21 21:23 381 查看
版本1

Oracle12c

版本2

 

版本3

 

关键字

内存释放

 

问题现象
在释放Oracle的内存占用时,在设定sga的值的时候,可能会因为操作失误造成如下错误:
ORA-00823 Specified value of sga_target greater than sga_max_size

原因分析
(1)原因是设定的sga_target大于指定值的sga_max_size值;

(2)这个问题根据Oracle版本不同有不同结果。但是大原则,肯定是SGA_TARGET<=SGA_MAX_SIZE

(a)SGA_TARGET参数带来了ASMM的新特性,但是它的含义和SGA_MAX_SIZE的一样,也表示SGA最大的大小,于是它也就有了一个限制,那就是它的大小不能大于SGA_MAX_SIZE的大小

处理步骤
首先使用管理员登录
Sqlplus 账户名/密码 as sysdba;
会提示连接空闲连接
输入:startup
提示:ORA-00823 Specified value of sga_target greater than sga_max_size

按照以下操作:
shutdown immediate;
提示:

ORA-01034: ORACLE not available

ORA-27101: shared memory realm does not exist

输入:sqlplus /nolog,完成登录
连接数据库:conn /as sysdba

创建pfile文件:create pfile=’ C:\MyOracle\Oracle\product\12.1.0\dbhome_1\dbs\init1.ora’
提示:文件已创建

关闭数据库:exit;
关闭数据库后,去指定的路径修改init1.ora文件

*.sga_target的数值要小于*.sga_max_size的数值,修改完成保存;
重新登录:sqlplus /nolog
连接:conn /as sysdba;
使用pfile文件启动:
Startup pfile=’ C:\MyOracle\Oracle\product\12.1.0\dbhome_1\dbs\init1.ora’;
提示如下:

ORACLE instance started.

 

Total System Global Area 1920831488 bytes

Fixed Size 2268112 bytes

Variable Size 964690992 bytes

Database Buffers 947912704 bytes

Redo Buffers 5959680 bytes

Database mounted.

Database opened.

(9)关闭例程:shutdown immediate;

提示如下:

Database closed.

Database dismounted.

ORACLE instance shut down.

(10)根据pfile文件创建spfile文件:

SQL> create spfile frompfile='/home/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/init1.ora';提示文件创建完成

(11)之后,启动:SQL> startup;提示类似下面的:

ORACLE instance started.

 

Total System Global Area 1920831488 bytes

Fixed Size 2268112 bytes

Variable Size 964690992 bytes

Database Buffers 947912704 bytes

Redo Buffers 5959680 bytes

Database mounted.

Database opened.

(12)关闭数据库即可:SQL> exit

效果
重新登录数据库,连接正确:

C:\Users\NsnServer>sqlplus 用户名/密码 as sysdba

 

SQL*Plus: Release 12.1.0.2.0 Production on 星期一 12月 19 13:51:08 2016

 

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

 

连接到:

Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

With the Partitioning, OLAP, Advanced Analytics and Real Application Testing opt

ions

 

SQL>

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: