SQL> show parameter sga;更改SGA大小:
NAME TYPE VALUE
----------- ------------------------------
lock_sga boolean FALSE
pre_page_sga boolean FALSE
sga_max_size big integer 2G
sga_target big integer 2G
SQL> alter system set sga_max_size=4096M scope=spfile;如果是RAC环境,需要这样增加sid='*':
System altered.
SQL> alter system set sga_target=4096M scope=spfile;
System altered.
alter system set sga_target=20G scope=spfile sid='*';重启使更改生效:
SQL> shutdown immediate;如果更改spfile导致数据库无法启动,可以在pfile后填加附加参数,现在一般的pfile都是一行SPFILE='spfileSID.ora',在后边加参数会覆盖spfile的已有参数:
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 4294967296 bytes
Fixed Size 2026296 bytes
Variable Size 805307592 bytes
Database Buffers 3472883712 bytes
Redo Buffers 14749696 bytes
Database mounted.
Database opened.
SQL> show parameter sga;
NAME TYPE VALUE
----------- ------------------------------
lock_sga boolean FALSE
pre_page_sga boolean FALSE
sga_max_size big integer 4G
sga_target big integer 4G
SQL> alter system set lock_sga=true scope=spfile;启动后,可以重新设置scope=spfile的参数,再删除pfile里后加的信息即可。
System altered.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORA-27102: out of memory
Linux-x86_64 Error: 12: Cannot allocate memory
[oracle@erpdevdb dbs]$ vi initerpstudydb.ora
SPFILE='+DGSTUDY/erpstudydb/spfileerpstudydb.ora'
lock_sga=false
SQL> startup
ORACLE instance started.
更多回帖