原因:由于机器使用阿里云服务器,初期内存较大,所以选择中途降配,由8G减少到4G,降配完成后,数据库无法正常启动,报以下错误
ORA-00845: MEMORY_TARGET not supported on this system
经过查资料了解其原理后
原因可能:ORACLE MEMORY_TARGET参数设置超过了oracle服务器本身内存、或超过了现在服务器空闲内存(就是oracle启动时无法获取设置的内存),或者 超过了
/dev/shm的大小/. 这些都有可能造成以上错误、
问题确认:
确认为oracle MEMORY_TARGET参数设置SGA大于操作系统的空闲内存,
超过了
/dev/shm的大小
修改MEMORY_TARGET的值为合适的范围之内(如果是正式环境切oracle需要设置MEMORY_TARGET的内存,需要增加服务器内存,本初不讨论)
1.备份现有spfile文件
SQL> startup pfile=/app/oracle/admin/orcl/pfile/init.ora.103201271612
SQL>
alter
system
set
memory_max_target=1258M scope=both;
alter
system
set
memory_max_target=1258200M scope=both
ERROR
at
line 1:
ORA-02095: specified initialization parameter cannot be modified
SQL>
alter
system
set
memory_max_target=1258M scope=spfile;
alter
system
set
memory_max_target=1258M scope=spfile
ERROR
at
line 1:
ORA-32001: write
to
SPFILE requested but
no
SPFILE
is
in
use//spfile文件可能不存在
SQL> shutdown immediate;
Database
closed.
Database
dismounted.
ORACLE instance shut down
SQL> startup nomount
ORA-01078: failure
in
processing system parameters
LRM-00109: could
not
open
parameter file
'/app/oracle/product/11.2.0/dbhome_2/dbs/initorcl.ora'
#
NAME
TYPE VALUE
memory_target big
integer
1168M
SQL> show parameter memory_max_target;
NAME
TYPE VALUE
memory_max_target big
integer
1168M
SQL>
alter
system
set
memory_max_target=1G scope=spfile;
alter
system
set
memory_max_target=1G scope=spfile
ERROR
at
line 1:
ORA-32001: write
to
SPFILE requested but
no
SPFILE
is
in
use
SQL> show parameter spfile;
NAME
TYPE VALUE
spfile string
#
SQL>
create
spfile
from
pfile;
File created.
SQL> shutdown immediate;
Database
closed.
Database
dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System
Global
Area 1219260416 bytes
Fixed
Size
2212856 bytes
Variable
Size
738200584 bytes
Database
Buffers 469762048 bytes
Redo Buffers 9084928 bytes
Database
mounted.
Database
opened.
SQL> show parameter spfile;
NAME
TYPE VALUE
spfile string /app/oracle/product/11.2.0/dbh
ome_2/dbs/spfileorcl.ora
NAME
TYPE VALUE
memory_max_target big
integer
1344M
SQL> show parameter memory_target;
NAME
TYPE VALUE
memory_target big
integer
1G