Oracle study之--“ORA-00845: MEMORY_TARGET not supported on this system"错误

Oracle study之--“ORA-00845: MEMORY_TARGET not supported on this system"错误

系统环境:

   操作系统:RedHat EL6(64)

   Oracle:    Oracle 11g R2

 

故障案例:

在Oracle 11gR2下调整内存參数:memory_target

SQL> show parameter mem

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
hi_shared_memory_address             integer     0
memory_max_target                    big integer 400M
memory_target                        big integer 400M
shared_memory_address                integer     0
SQL> alter system set memory_max_target=1200m scope=spfile;

System altered.

SQL> alter system set memory_target=1200m scope=spfile;

System altered.

SQL> show parameter sga

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
lock_sga                             boolean     FALSE
pre_page_sga                         boolean     FALSE
sga_max_size                         big integer 400M
sga_target                           big integer 0
SQL> show parameter shared

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
hi_shared_memory_address             integer     0
max_shared_servers                   integer
shared_memory_address                integer     0
shared_pool_reserved_size            big integer 6710886
shared_pool_size                     big integer 0
shared_server_sessions               integer
shared_servers                       integer     1
SQL> alter system set shared_pool_size=500m scope=spfile;

System altered.

SQL> show parameter java

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
java_jit_enabled                     boolean     TRUE
java_max_sessionspace_size           integer     0
java_pool_size                       big integer 0
java_soft_sessionspace_limit         integer     0
SQL> alter system set java_pool_size=300m scope=spfile;

System altered.
<strong>调整完毕后,又一次启动Instance:</strong>

SQL> startup force;
ORA-00845: MEMORY_TARGET not supported on this system
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

查看linux系统文件系统:
[oracle@rh6 dbs]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              18G  5.2G   12G  32% /
tmpfs                 878M   72K  878M   1% /dev/shm
/dev/sda1             2.0G   62M  1.8G   4% /boot
/dev/sda3              12G  5.7G  5.4G  52% /u01
/dev/sda5             9.9G  4.9G  4.6G  52% /usr
/dev/sda7             4.2G  300M  3.7G   8% /var

---从以上能够看到。对于虚拟tmpfs的内存的文件系统。可用空间为878M,无法满足memory_target =1200M的内存需求

 

调整tmpfs:

<strong>[oracle@rh6 dbs]$ su -
Password: 

[root@rh6 ~]# umount tmpfs
umount: /dev/shm: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
</strong>
<strong>关闭和tmpfs相关的process:</strong>
 
<strong>[root@rh6 ~]# fuser -kc /dev/shm
/dev/shm:             2204m
</strong>
<strong>[root@rh6 ~]# umount tmpfs

[root@rh6 ~]# mount  -t tmpfs shmfs -o size=1300m /dev/shm
[root@rh6 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              18G  5.2G   12G  32% /
/dev/sda1             2.0G   62M  1.8G   4% /boot
/dev/sda3              12G  5.7G  5.4G  52% /u01
/dev/sda5             9.9G  4.9G  4.6G  52% /usr
/dev/sda7             4.2G  300M  3.7G   8% /var
shmfs                 1.3G     0  1.3G   0% /dev/shm
</strong>
<strong>改动fstab文件。当系统启动时mount tmpfs</strong>
<strong>[root@rh6 ~]# vi /etc/fstab
#
# /etc/fstab
# Created by anaconda on Sun Sep 29 16:52:59 2013
#
# 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
#
UUID=85ffcaeb-1855-4f6a-b1af-d4e13d7b8850 /                       ext4    defaults        1 1
UUID=0e7c052e-fc2a-402a-82cc-116e7629ef8f /boot                   ext4    defaults        1 2
UUID=cf98cf21-ba1f-4a3a-aac3-43406dd5fca1 /u01                    ext4    defaults        1 2
UUID=e3cf943c-48c4-4c4b-ba65-f11ba1f6a2e0 /usr                    ext4    defaults        1 2
UUID=c5dd449a-ce22-4d47-a6d3-2d09c0186489 /var                    ext4    defaults        1 2
UUID=e701d956-939e-441b-bad4-03b2057d4159 swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs    defaults,size=1300m        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@rh6 ~]# mount tmpfs
[root@rh6 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              18G  5.2G   12G  32% /
/dev/sda1             2.0G   62M  1.8G   4% /boot
/dev/sda3              12G  5.7G  5.4G  52% /u01
/dev/sda5             9.9G  4.9G  4.6G  52% /usr
/dev/sda7             4.2G  300M  3.7G   8% /var
tmpfs                 1.3G     0  1.3G   0% /dev/shm
</strong>
<strong>验证:</strong>
<strong>[root@rh6 ~]# umount /dev/shm
[root@rh6 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              18G  5.2G   12G  32% /
/dev/sda1             2.0G   62M  1.8G   4% /boot
/dev/sda3              12G  5.7G  5.4G  52% /u01
/dev/sda5             9.9G  4.9G  4.6G  52% /usr
/dev/sda7             4.2G  300M  3.7G   8% /var
[root@rh6 ~]# mount tmpfs
[root@rh6 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              18G  5.2G   12G  32% /
/dev/sda1             2.0G   62M  1.8G   4% /boot
/dev/sda3              12G  5.7G  5.4G  52% /u01
/dev/sda5             9.9G  4.9G  4.6G  52% /usr
/dev/sda7             4.2G  300M  3.7G   8% /var
tmpfs                 1.3G     0  1.3G   0% /dev/shm
[root@rh6 ~]# cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Sun Sep 29 16:52:59 2013
#
# 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
#
UUID=85ffcaeb-1855-4f6a-b1af-d4e13d7b8850 /                       ext4    defaults        1 1
UUID=0e7c052e-fc2a-402a-82cc-116e7629ef8f /boot                   ext4    defaults        1 2
UUID=cf98cf21-ba1f-4a3a-aac3-43406dd5fca1 /u01                    ext4    defaults        1 2
UUID=e3cf943c-48c4-4c4b-ba65-f11ba1f6a2e0 /usr                    ext4    defaults        1 2
UUID=c5dd449a-ce22-4d47-a6d3-2d09c0186489 /var                    ext4    defaults        1 2
UUID=e701d956-939e-441b-bad4-03b2057d4159 swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs    defaults,size=1300m        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0</strong>
<strong>[root@rh6 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              18G  5.2G   12G  32% /
/dev/sda1             2.0G   62M  1.8G   4% /boot
/dev/sda3              12G  5.7G  5.4G  52% /u01
/dev/sda5             9.9G  4.9G  4.6G  52% /usr
/dev/sda7             4.2G  300M  3.7G   8% /var
tmpfs                 1.3G     0  1.3G   0% /dev/shm

</strong>

又一次启动Instance:

[oracle@rh6 ~]$ sqlplus '/as sysdba'

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jun 25 11:34:39 2015

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

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 1252663296 bytes
Fixed Size                  2227944 bytes
Variable Size            1224737048 bytes
Database Buffers           16777216 bytes
Redo Buffers                8921088 bytes
Database mounted.
Database opened.


 

posted @ 2017-05-31 19:07  jzdwajue  阅读(130)  评论(0编辑  收藏  举报