sga_target大于Sga_max_size

问题现象

在释放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’from spfile;

提示:文件已创建

关闭数据库: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>

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值