你好,游客 登录 注册 搜索
背景:
阅读新闻

ORA-00845: MEMORY_TARGET not supported on this system问题处理

[日期:2016-01-02] 来源:Linux社区  作者:mchdba [字体: ]

1,Oracle 11g设置归档重新登录启动报错

SQL> startup;                                                                                                                                                                                  
ORA-00845: MEMORY_TARGET not supported on this system                                                                                                                                          
SQL>

2,看Oracle的官方解释是:

Starting with Oracle Database 11g, the Automatic Memory Management feature requires more shared memory (/dev/shm)and file descriptors. The size of the shared memory should be at least the greater of MEMORY_MAX_TARGET and MEMORY_TARGET for each Oracle instance on the computer. If MEMORY_MAX_TARGET or MEMORY_TARGET is set to a non zero value, and an incorrect size is assigned to the shared memory, it will result in an ORA-00845 error at startup.

就是说MEMORY_MAX_TARGET的设置不能超过/dev/shm的大小,在oracle11g中新增的内存自动管理的参数MEMORY_TARGET,它能自动调整SGA和PGA,这个特性需要用到/dev/shm共享文件系统,而且要求/dev/shm必须大于MEMORY_TARGET,如果/dev/shm比MEMORY_TARGET小就会报错。

3,解决方案

2个修改地方:
在/etc/fstab里面,一是swap后面修改成defaults,size=11G,二是tmpfs后面修改成defaults,size=11G,修改完,如下所示

[root@testoracle1 oracle]# vim /etc/fstab


#
# /etc/fstab
# Created by anaconda on Tue Aug 18 16:46:25 2015
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_testoracle1-lv_root /                       ext4    defaults        1 1
UUID=e10af7be-cb8b-4454-965d-0c2275fe75b9 /boot                   ext4    defaults        1 2
/dev/mapper/vg_testoracle1-lv_swap swap                    swap    defaults,size=11G        0 0
tmpfs                   /dev/shm                tmpfs   defaults,size=11G        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
~                                                                             

修改完后,需要重新挂载一下,才能生效:

[root@testoracle1 oracle]# mount -o remount,size=11G /dev/shm
[root@testoracle1 oracle]# 

3,再次启动数据库,就不会报错了,正常启动:

SQL> startup;                                                                                                                                                                                  
ORACLE instance started.                                                                                                                                                                       

Total System Global Area 1.1358E+10 bytes
Fixed Size          2216744 bytes
Variable Size        8925482200 bytes
Database Buffers     2415919104 bytes
Redo Buffers           13946880 bytes
Database mounted.                                                                                                                                                                              
Database opened.                                                                                                                                                                               
SQL>  

4,标准的禁止归档模式:

SQL> alter system set log_archive_start=false scope=spfile; #禁用自归档

SQL> shutdown immediate;
SQL> startup mount; #重启数据库到mount模式
SQL> alter database noarchivelog; #修改为非归档模式
SQL> alter database open; #打数据文件
SQL> archive log list; #再次查看前归档模式

SQL> alter database noarchivelog;
alter database noarchivelog
*
ERROR at line 1:
ORA-38774: cannot disable media recovery - flashback database is enabled

SQL>

去查看闪回是否已经开启:

SQL> select flashback_on from v$database;                                                                                                                                                      

FLASHBACK_ON
------------------
YES

SQL> 

去关闭闪回功能:

SQL> alter database flashback off;                                                                                                                                                             

Database altered.

SQL>         

SQL> alter database flashback off;                                                                                                                                                             

Database altered.

再关闭归档。

SQL> alter database noarchivelog;                                                                                                                                                              

Database altered.

SQL> archive log list;                                                                                                                                                                         
Database log mode          No Archive Mode
Automatic archival         Disabled
Archive destination        /oracle/app/oracle/flash_recovery_area/archivelog
Oldest online log sequence     337
Current log sequence           339
SQL>

更多Oracle相关信息见Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12

本文永久更新链接地址http://www.linuxidc.com/Linux/2016-01/126987.htm

linux
相关资讯       ORA-00845 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款