今天在授课的过程中,在修改参数时,遇到memory_max_target/memory_target设置过大,可能导致instance无法启动,报ORA-00845错误。
[oracle@pxboracle ~]$ oerr ora 00845
00845, 00000, "MEMORY_TARGET not supported on this system"
// *Cause: The MEMORY_TARGET parameter was not supported on this operating system or /dev/shm was not sized correctly on Linux.
// *Action: Refer to documentation for a list of supported operating systems. Or, size /dev/shm to be at least the SGA_MAX_SIZE on each Oracle instance running on the system.
解决的方案是增加tmpfs文件大小:
第一步:修改/etc/fstab中tmpfs对应的行;
将原来的tmpfs /dev/shm tmpfs defaults 0 0
改成tmpfs /dev/shm tmpfs default,size=2024M 0 0,这样tmpfs增大为2G,
[root@pxboracle ~]# vi /etc/fstab
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults,size=2048m 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
~
第二步:重新mount /dev/shm使之生效。
[root@pxboracle ~]# mount -o remount /dev/shm
第三步:验证tmpfs文件大小
[root@pxboracle ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
35G 30G 3.5G 90% /
/dev/sda1 99M 13M 82M 14% /boot
tmpfs 2.0G 516M 1.5G 26% /dev/shm
第四步: 重启数据库
SQL> alter system set memory_max_target=1g scope=spfile;
System altered.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORA-00845: MEMORY_TARGET not supported on this system
SQL> startup
ORACLE instance started.
Total System Global Area 1068937216 bytes
Fixed Size 2260088 bytes
Variable Size 742392712 bytes
Database Buffers 318767104 bytes
Redo Buffers 5517312 bytes
Database mounted.
Database opened.
SQL> show parameter memo
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
hi_shared_memory_address integer 0
memory_max_target big integer 1G
memory_target big integer 800M
shared_memory_address integer 0
SQL> alter system set memory_target=900m;
System altered.
SQL> show parameter memo
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
hi_shared_memory_address integer 0
memory_max_target big integer 1G
memory_target big integer 900M
shared_memory_address integer 0
SQL> show parameter sga
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
lock_sga boolean FALSE
pre_page_sga boolean FALSE
sga_max_size big integer 1G
sga_target big integer 516M
SQL> alter system set sga_target=600m;
System altered.
SQL> show parameter sga
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
lock_sga boolean FALSE
pre_page_sga boolean FALSE
sga_max_size big integer 1G
sga_target big integer 600M
SQL> show paramter pag
SP2-0158: unknown SHOW option "paramter"
SP2-0158: unknown SHOW option "pag"
SQL> show parameter pga
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
pga_aggregate_target big integer 0
SQL>
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/12798004/viewspace-2122116/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/12798004/viewspace-2122116/