oracle sga_max_size=0,关于sga_max_size

在9208版本下:

关于sga_max_size,oracle文档中如下解释:

Parameter type

Big integer

Syntax

SGA_MAX_SIZE = integer [K | M | G]

Default value

Initial size of SGA at startup, dependent on the sizes of different pools in the SGA, such as buffer cache, shared pool, large pool, and so on.

Parameter class

Static

Range of values

0 to operating system-dependent

specifies the maximum size of SGA for the lifetime of the instance.

这个参数的值,如果在spfile或pfile中没有设置,那么其默认值将在实例启动时,根据各个pool的大小自动生成,如果之后需要动态增大某个pool的值,可能会失败。

如下测试:

SQL> show parameter sga_max_size

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

sga_max_size                         big integer 105977152

SQL> alter system set db_cache_size=100m;

alter system set db_cache_size=100m

*

ERROR at line 1:

ORA-02097: parameter cannot be modified because specified value is invalid

ORA-00384: Insufficient memory to grow cache

因此,如果需要动态增大某个pool的值,就需要手动设置sga_max_size的值,如下:

SQL> alter system set sga_max_size=200m scope=spfile;

System altered.

SQL> startup force

ORACLE instance started.

Total System Global Area  219223120 bytes

Fixed Size                   451664 bytes

Variable Size             184549376 bytes

Database Buffers           33554432 bytes

Redo Buffers                 667648 bytes

Database mounted.

Database opened.

SQL> alter system set db_cache_size=100m;System altered.

同样,下面是在10g下设置sga_max_size时,对操作系统共享内存段的使用情况。

bash-3.00$ ipcs -m

------ Shared Memory Segments --------

key        shmid      owner      perms      bytes      nattch     status

0x7c159aa0 32768      ora10g    640        213909504  15

bash-3.00$ exit

exit

SQL> alter system set sga_max_size=250m scope=spfile;

System altered.

SQL> startup force;

ORACLE instance started.

Total System Global Area  264241152 bytes

Fixed Size                  1218892 bytes

Variable Size             167773876 bytes

Database Buffers           92274688 bytes

Redo Buffers                2973696 bytes

Database mounted.

Database opened.

SQL> !

bash-3.00$ ipcs -m

------ Shared Memory Segments --------

key        shmid      owner      perms      bytes      nattch     status

0x7c159aa0 65536      ora10g    640        268435456  13

可见,sga_max_size的设置大小,决定了数据库启动时操作系统分配共享内存段的大小。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值