ORA-00845

今天新装一个oracle,拷贝了另外台电脑上的参数文件,参数文件内容如下:

orcl.__db_cache_size=10066329*.control_files='/u02/oradata/orcl/control01.ctl','/u02/oradata/orcl/control02.ctl'
orcl.__db_cache_size=100663296
orcl.__java_pool_size=4194304
orcl.__large_pool_size=4194304
orcl.__oracle_base='/u01'#ORACLE_BASE set from environment
orcl.__pga_aggregate_target=134217728
orcl.__sga_target=239075328
orcl.__shared_io_pool_size=0
orcl.__shared_pool_size=121634816
orcl.__streams_pool_size=0
*.audit_file_dest='/u01/admin/orcl/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.db_block_size=8192
*.db_domain=''
*.db_name='orcl'
*.diagnostic_dest='/u01'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'
*.log_archive_dest_1='location=/u02/archlog'
*.memory_target=372244480
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sessions=170
*.standby_archive_dest='/u02/archlog'
*.undo_tablespace='UNDOTBS1'

想测试下数据库的参数是否正确,启动到nomount状态,结果报错:

[oracle@node2 admin]$ sqlplus  drb/drbmc@rzorcl as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Fri Jan 14 13:45:43 2011

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup nomount
ORA-00845: MEMORY_TARGET not supported on this system
粗略估计是内存的原因,google的结果基本一致, MEMORY_MAX_TARGET 的参数过大, /dev/shm 显示的虚拟内存不足。

[root@node2 u02]#  df -h | grep shm
tmpfs                 445M  232M  213M  53% /dev/shm

因为虚拟机,所以把内存从900加到了1200,重新启动后打开oracle正常。

[root@node2 ~]# df -h | grep shm
tmpfs                 593M  134M  459M  23% /dev/shm
[oracle@node2 ~]$ sqlplus  drb/drbmc@rzorcl as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Fri Jan 14 14:07:19 2011

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup nomount;
ORACLE instance started.

Total System Global Area  372449280 bytes
Fixed Size                  1336624 bytes
Variable Size             264243920 bytes
Database Buffers          100663296 bytes
Redo Buffers                6205440 bytes

打开数据库后的内存检测:

[root@node2 ~]# df -h | grep shm
tmpfs                 593M  223M  371M  38% /dev/shm

01 SQL> alter system set memory_max_target=3G scope=spfile ; 

02   

03 System altered.

04   

05 SQL> alter system set memory_target=2G scope=spfile ;      

06   

07 System altered.

08   

09 SQL> 

10 SQL> shutdown immediate 

11 Database closed.

12 Database dismounted.

13 ORACLE instance shut down.

14 SQL> startup ; 

15 ORA-00845: MEMORY_TARGET not supported on this system

#####################################其他方法#######################

      来自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 的大小:


1 [oracle@FWDB FWDB]$ df -h | grep shm

2 tmpfs                 2.0G     0  2.0G   0% /dev/shm

      还真是撞到这个枪口上了:

      马上把它加大:


1 [root@FWDB ~]# cat /etc/fstab | grep tmpfs

2 tmpfs                   /dev/shm                tmpfs   defaults,size=4G 0 0

      现在可以通过重启使这个配置生效,也可以通过重新挂载来修改其大小:


1 [root@FWDB ~]# mount -o remount,size=4G /dev/shm

2 [root@FWDB ~]# df -h | grep shm

3 tmpfs                 4.0G     0  4.0G   0% /dev/shm

      再次启动数据库,没有报错了。

你可能感兴趣的:(ora)