sga_target大于指定值的sga_max_size

当尝试设置Oracle的SGA目标大小时遇到ORA-00823错误,表明SGA_TARGET超过了SGA_MAX_SIZE。处理步骤包括登录sysdba,关闭数据库,修改初始化参数文件init.ora,确保SGA_TARGET小于SGA_MAX_SIZE,然后使用新参数文件启动并创建新的SPFILE。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

版本1

Oracle12c

版本2

 

版本3

 

关键字

内存释放

 

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

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

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

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

  1. 处理步骤
    1. 首先使用管理员登录
      1. Sqlplus 账户名/密码 as sysdba;
      2. 会提示连接空闲连接
      3. 输入:startup
      4. 提示:ORA-00823 Specified value of sga_target greater than sga_max_size
    2. 按照以下操作:
      1. shutdown immediate;
      2. 提示:

ORA-01034: ORACLE not available

ORA-27101: shared memory realm does not exist

  1. 输入:sqlplus /nolog,完成登录
    1. 连接数据库:conn /as sysdba
  2. 创建pfile文件:create pfile=’ C:\MyOracle\Oracle\product\12.1.0\dbhome_1\dbs\init1.ora’
    1. 提示:文件已创建
  3. 关闭数据库:exit;
    1. 关闭数据库后,去指定的路径修改init1.ora文件
  1. *.sga_target的数值要小于*.sga_max_size的数值,修改完成保存;
  1. 重新登录:sqlplus /nolog
  2. 连接:conn /as sysdba;
  3. 使用pfile文件启动:
    1. Startup pfile=’ C:\MyOracle\Oracle\product\12.1.0\dbhome_1\dbs\init1.ora’;
    2. 提示如下:

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

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

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>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值