ORA-00838 问题解决方法
2019-07-18 本文已影响0人
子幕离
ORA-00838 问题解决方法
在关闭Oracle服务后,重启时遇到如下问题:
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORA-01078: failure in processing system parameters
ORA-00838: Specified value of MEMORY_TARGET is too small, needs to be at least 31744M
-问题出现原因
修改该Oracle参数set sga_target,导致memory_target参数不够造成上述错误,
注:memory_target=pre_page_sga +sga_target
Oracle11G一般调整memory_target 参数,其他自动调整,无需自己调整。
-修改Oracle内存前最好备份spfile,spfilede的默认地址为
cd /home/u01/app/oracle/product/11.2.0/db_1/dbs
数据库因为做了rac,所有以名称为spfileorcl1
[root@rac01 ~]# cd /home/u01/app/oracle/product/11.2.0/db_1/dbs
[root@rac01 dbs]# ll
总用量 56
-rw-rw----. 1 oracle asmadmin 1544 7月 18 01:04 hc_orcl1.dat
-rw-r--r-- 1 oracle asmadmin 1885 7月 18 00:02 init07.ora
-rw-r--r-- 1 oracle oinstall 2853 6月 24 2016 init.ora
-rw-r--r-- 1 oracle oinstall 2851 6月 24 2016 init.ora.bak
-rw-r----- 1 oracle oinstall 35 6月 24 2016 initorcl1.ora
-rw-r--r-- 1 oracle oinstall 1940 6月 24 2016 initorcl1.ora.bak2
-rw-r--r-- 1 oracle oinstall 1882 6月 24 2016 initorcl1.ora.bak.rac01
-rw-r-----. 1 oracle oinstall 1536 6月 8 2016 orapworcl1
-rw-r----- 1 oracle asmadmin 5632 7月 18 18:20 spfileorcl1.ora
-rw-r----- 1 oracle asmadmin 4608 6月 24 2016 spfileorcl1.ora.bak
-rw-r--r-- 1 root root 4608 7月 18 00:23 spfileorcl1.ora.bak.190717
-修改sga_target过程
SQL> show parameter sga;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
lock_sga boolean FALSE
pre_page_sga boolean FALSE
sga_max_size big integer 30G
sga_target big integer 10G
SQL> show parameter memory;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
hi_shared_memory_address integer 0
memory_max_target big integer 30G
memory_target big integer 29G
shared_memory_address integer 0
SQL> alter system set sga_target=29G scope=spfile;
System altered
SQL> alter system set sga_target=29G scope=spfile sid = 'orcl1';
System altered
-解决方法
1.将备份好的文件修改名称
spfileorcl1.ora.bak 修改为 spfileorcl1.ora
2.用spfileorcl1.ora文件生成pfile生成的文件命名为init07.ora(spfile为二进制文件,pfile为文本文件)
SQL> create pfile='/home/u01/app/oracle/product/11.2.0/db_1/dbs//init07.ora' from spfile='/home/u01/app/oracle/product/11.2.0/db_1/dbs/spfileorcl1.ora';
File created.
3.用生成的pfile为参数启动Oracle服务
SQL> startup pfile='/home/u01/app/oracle/product/11.2.0/db_1/dbs/init07.ora';
ORACLE instance started.
Total System Global Area 3.2068E+10 bytes
Fixed Size 2244192 bytes
Variable Size 2.4562E+10 bytes
Database Buffers 7381975040 bytes
Redo Buffers 122376192 bytes
Database mounted.
Database opened.
4.在Oracle启动成功后重新生成spfile,不然以后重启还得用pfile当参数
SQL> create spfile from pfile='/home/u01/app/oracle/product/11.2.0/db_1/dbs/init07.ora';
File created.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 3.2068E+10 bytes
Fixed Size 2244192 bytes
Variable Size 2.4562E+10 bytes
Database Buffers 7381975040 bytes
Redo Buffers 122376192 bytes
Database mounted.
Database opened.
5.另一台实列,可以用orac1的pfile文件为参数启动
总结
本次遇到这个问题后,网上查了很多资料,写的都很模糊,记录自己解决问题方法,供参考