Oracle11gSGA调整方法

2022/7/12 2:20:16

本文主要是介绍Oracle11gSGA调整方法,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

  • Oracle11gSGA调整方法

     

    oracle11g修改sga要先修改memory_target等参数,否则服务重启时会出现错误ORA-00844: Parameter not taking MEMORY_TARGET into account, see alert log for mo

    re information。

    Oracle内存参数结构:

      

     修改SGA必须保持的原则: 
    1.sga_target不能大于sga_max_size,可以设置为相等。 
    2.SGA加上PGA等其他进程占用的内存总数必须小于操作系统的物理内存。 

          具体命令操作如下:

     1 C:UsersAdministrator>sqlplus/nolog
     2  
     3 SQL*Plus: Release 11.1.0.6.0 - Production on 星期三 2月 22 10:51:08 2012
     4  
     5 Copyright (c) 1982, 2007, Oracle.  All rights reserved.
     6  
     7 SQL> conn sys/sys as sysdba;
     8 已连接。
     9 SQL> show sga;
    10  
    11 Total System Global Area  631926784 bytes
    12 Fixed Size                  1334996 bytes
    13 Variable Size             205521196 bytes
    14 Database Buffers          419430400 bytes
    15 Redo Buffers                5640192 bytes
    16 SQL> alter system set memory_max_target=700m scope=spfile;
    17  
    18 系统已更改。
    19  
    20 SQL> alter system set memory_target=700m scope=spfile;
    21  
    22 系统已更改。
    23  
    24 SQL> show sga;
    25  
    26 Total System Global Area  631926784 bytes
    27 Fixed Size                  1334996 bytes
    28 Variable Size             205521196 bytes
    29 Database Buffers          419430400 bytes
    30 Redo Buffers                5640192 bytes
    31 SQL> shutdown immediate;
    32 数据库已经关闭。
    33 已经卸载数据库。
    34 ORACLE 例程已经关闭。
    35 SQL> startup;
    36 ORACLE 例程已经启动。
    37  
    38 Total System Global Area  631926784 bytes
    39 Fixed Size                  1334996 bytes
    40 Variable Size             205521196 bytes
    41 Database Buffers          419430400 bytes
    42 Redo Buffers                5640192 bytes
    43 数据库装载完毕。
    44 数据库已经打开。
    45  
    46 SQL> alter system set sga_target=650m scope=spfile;
    47  
    48 系统已更改。
    49  
    50 SQL> alter system set sga_max_size=650m scope=spfile;
    51  
    52 系统已更改。
    53  
    54 SQL> shutdown immediate;
    55 数据库已经关闭。
    56 已经卸载数据库。
    57 ORACLE 例程已经关闭。
    58 SQL> startup;
    59 ORACLE 例程已经启动。
    60  
    61 Total System Global Area  686329856 bytes
    62 Fixed Size                  1335360 bytes
    63 Variable Size             205524928 bytes
    64 Database Buffers          473956352 bytes
    65 Redo Buffers                5513216 bytes
    66 数据库装载完毕。
    67 数据库已经打开。
    68 SQL> show sga;
    69  
    70 Total System Global Area  686329856 bytes
    71 Fixed Size                  1335360 bytes
    72 Variable Size             205524928 bytes
    73 Database Buffers          473956352 bytes
    74 Redo Buffers                5513216 bytes

    附:ora-00844错误解决办法:

    1 SQL> create pfile='c:inittest.ora' from spfile;
    2  
    3 文件已创建。

    (手动修改文件中对应的memory_target参数)

     1 SQL> startup pfile='c:inittest.ora';
     2 ORACLE 例程已经启动。
     3  
     4 Total System Global Area  631926784 bytes
     5 Fixed Size                  1334996 bytes
     6 Variable Size             205521196 bytes
     7 Database Buffers          419430400 bytes
     8 Redo Buffers                5640192 bytes
     9 数据库装载完毕。
    10 数据库已经打开。
    11 SQL> create spfile from pfile='c:inittest.ora';
    12  
    13 文件已创建。
    14  
    15 SQL> shutdown immediate;
    16 数据库已经关闭。
    17 已经卸载数据库。
    18 ORACLE 例程已经关闭。
    19 SQL> startup;
    20 ORACLE 例程已经启动。
    21  
    22 Total System Global Area  631926784 bytes
    23 Fixed Size                  1334996 bytes
    24 Variable Size             205521196 bytes
    25 Database Buffers          419430400 bytes
    26 Redo Buffers                5640192 bytes
    27 数据库装载完毕。
    28 数据库已经打开。


这篇关于Oracle11gSGA调整方法的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程