Oracle報錯:ORA-00845: MEMORY_TARGET not supported on this system
Oracle常見報錯之:ORA-00845: MEMORY_TARGET not supported on this system
1、 問題的提出
報錯如下:
[oracle@night ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on Thu Jul 25 15:39:40 2013
Copyright (c) 1982, 2009, Oracle. All rights reserved.
SQL> conn sys/ as sysdba
Enter password:
Connected to an idle instance.
SQL> startup
ORA-00845: MEMORY_TARGET not supported on this system
SQL>
2、 問題的解釋
在官方文件中,有好多地方提到這個錯誤,可以通過官方文件進一步的瞭解這個報錯的解釋,以便於更快更準確更透徹的解決問題
開啟官方文件的error messages標籤,可以看到有關錯誤程式碼的解釋
ORA-00845: 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.
或者利用官方文件的搜尋功能,搜尋錯誤程式碼,也可以找到相應的解釋和解決辦法
Setting Memory Target at Instance Startup on Linux
Starting with Oracle Database 11g Release 1 (11.1), Oracle provides the option of automatically managing SGA and PGA with a combined MEMORY_TARGETparameter without having to set SGA_TARGET and PGA_AGGREGATE_TARGET explicitly. This is supported on Linux, Windows, Solaris, HPUX, and AIX (reference Bug 7258378).
If you see the ORA-00845 error reported on Linux machines at Oracle instance startup when using the MEMORY_TARGET parameter, then check the size of /dev/shm. If /dev/shm is not configured, then mount it sized to be at least the value of MEMORY_TARGET. If /dev/shm is configured but the amount of available space reported (through df -k /dev/shm) is less than MEMORY_TARGET, then free the space or mount a larger /dev/shm to satisfy the MEMORY_TARGET size. Note that if you set theMEMORY_MAX_TARGET parameter greater than MEMORY_TARGET, then ensure that /dev/shm is sized to be at least the value of MEMORY_MAX_TARGET.
Memory Target for Oracle Database InstancesRunning Database Configuration Assistant (DBCA) defaults to this Automatic Memory Management option. In the case of upgrade or manual database creation,MEMORY_TARGET can be specified in the initialization parameter file.
如上的內容就詳細的解釋了該錯誤是由於/dev/shm小於MEMORY_TARGET的大小,或者是/dev/shm根本就沒有掛載,如果同時設定了MEMORY_TARGET和MENORY_MAX_TARGET,那麼/dev/shm至少必須和MEMORY_MAX_TARGET的大小一致
Insufficient Memory Target Errors
On Linux systems, if the operating system /dev/shm mount size is too small for the Oracle system global area (SGA) and program global area (PGA), then you encounter the following error:
ORA-00845: MEMORY_TARGET not supported on this system.
The cause of this error is an insufficient /dev/shm allocation. The total memory size of the SGA and PGA, which sets the initialization parameter MEMORY_TARGETor MEMORY_MAX_TARGET, cannot be greater than the shared memory file system (/dev/shm) on your operating system.
Background
Automatic Memory Management (AMM) has been updated in Oracle ASM 11g Release 2. It manages both the SGA and PGA together. It is managed by the Memory Manager Process (MMAN). In this release, note the following changes to AMM:
It uses MEMORY_TARGET instead of SGA_TARGET
It uses MEMORY_MAX_TARGET instead of SGA_MAX_SIZE (defaults to MEMORY_TARGET)
It uses memory allocated by /dev/shm
If the value of max_target is set to a value greater than the allocation for the /dev/shm size, then you may encounter the error ORA-00845: MEMORY_TARGET not supported on this system.
Note:
An ORA-00845 error can also occur if /dev/shm is not properly mounted. To rule out this possibility, run the command df -k to ensure that /dev/shm is mounted. For example:$ df -k
Filesystem 1K-blocks Used Available Use% Mounted on
shmfs 6291456 832356 5459100 14% /dev/shm
Solution
Increase the /dev/shm mountpoint size.
For example:
# mount -t tmpfs shmfs -o size=7g /dev/shm
To make this change persistent across system restarts, add an entry in /etc/fstab similar to the following:
shmfs /dev/shm tmpfs size=7g 0
如上的內容不僅講出了錯誤的原因,而且還大概的說了一下在oracle 11g中的自動記憶體管理,並且給出了該錯誤的解決的命令
3、問題的深入探究,到底什麼是 /dev/shm
首先來看一下linux系統中已經掛載的檔案系統
[oracle@night ~]$ df -Th
檔案系統 型別 容量 已用 可用 已用% 掛載點
/dev/sda2 ext3 16G 11G 3.9G 74% /
/dev/sda3 ext3 1.6G 37M 1.4G 3% /tmp
/dev/sda1 ext3 99M 12M 83M 13% /boot
tmpfs tmpfs 252M 0 252M 0% /dev/shm
可以看出我已經掛載了/dev/shm,但是該分割槽的檔案系統並不是普通的檔案系統型別,而是tmpfs檔案系統型別,那麼什麼是tmpfs格式的檔案系統型別呢?
tmpfs是linux的一種臨時檔案系統,它的大小是不固定的,預設的大小是實際記憶體的一半。
[root@night ~]# free -m
total used free shared buffers cached
Mem: 503 368 134 0 26 283
-/+ buffers/cache: 58 444
Swap: 2525 0 2525
[root@night ~]# df -Th /dev/shm/
檔案系統 型別 容量 已用 可用 已用% 掛載點
tmpfs tmpfs 252M 0 252M 0% /dev/shm
[root@night ~]#
預設的掛載點是/dev/shm,/dev/shm其實就是一個目錄,所以tmpfs也可以掛載到一個自定義的目錄。
[root@night ~]# file /dev/shm/
/dev/shm/: sticky directory
[root@night ~]# ll -d /dev/shm/
drwxrwxrwt 2 root root 40 07-25 21:43 /dev/shm/
[root@night ~]#
tmpfs可以使用系統記憶體,也可以使用swap,所以我可以把tmpfs的size適當的調高一點。
由於tmpfs是存在於記憶體中的,所以在解除安裝tmpfs或者是關機重啟linux作業系統的時候,tmpfs的內容就會丟失。
tmpfs是基於記憶體的,而swap是基於磁碟的,所以兩者是不同的,而且tmpfs的IO很高。
4、解決問題
前面已經知道了報錯是由於/dev/shm過小導致的,而且/dev/shm是一個tmpfs的檔案系統,該檔案系統是基於記憶體的,大小是隨著實體記憶體的大小動態改變的,一般為實體記憶體的一半;tmpfs檔案系統可以使用物理內容,也可以使用swap。
那麼根據這麼內容,來處理問題
首先看一下實體記憶體和swap的大小
[root@night ~]# free -m
total used free shared buffers cached
Mem: 503 369 134 0 26 283
-/+ buffers/cache: 58 444
Swap: 2525 0 2525
[root@night ~]#
由上可知道,RAM為500M左右,SWAP為2G
修改tmpfs大小,用root使用者
[root@night ~]# vim /etc/fstab
內容如下
LABEL=/ / ext3 defaults 1 1
LABEL=/tmp /tmp ext3 defaults 1 2
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults,size=1G 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
LABEL=SWAP-sda5 swap swap defaults 0 0
~
重新掛載/dev/shm
[root@night ~]# umount /dev/shm/
[root@night ~]# mount /dev/shm/
[root@night ~]# mount
/dev/sda2 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda3 on /tmp type ext3 (rw)
/dev/sda1 on /boot type ext3 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
none on /proc/fs/vmblock/mountPoint type vmblock (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
tmpfs on /dev/shm type tmpfs (rw,size=1G)
[root@night ~]# df -Th /dev/shm/
檔案系統 型別 容量 已用 可用 已用% 掛載點
tmpfs tmpfs 1.0G 0 1.0G 0% /dev/shm
[root@night ~]#
現在重新啟動oracle服務(切換oracle使用者)
[oracle@night ~]$ df -Th /dev/shm/
檔案系統 型別 容量 已用 可用 已用% 掛載點
tmpfs tmpfs 1.0G 0 1.0G 0% /dev/shm
[oracle@night ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on Thu Jul 25 22:05:01 2013
Copyright (c) 1982, 2009, Oracle. All rights reserved.
SQL> conn sys/ as sysdba
Enter password:
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 418484224 bytes
Fixed Size 1336932 bytes
Variable Size 281020828 bytes
Database Buffers 130023424 bytes
Redo Buffers 6103040 bytes
Database mounted.
Database opened.
SQL> !lsnrctl start
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 25-JUL-2013 22:07:06
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Starting /u01/app/oracle/product/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/night/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=night)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 25-JUL-2013 22:07:15
Uptime 0 days 0 hr. 0 min. 30 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/night/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=night)(PORT=1521)))
The listener supports no services
The command completed successfully
SQL> !ps -ef | grep thinkdba
oracle 4117 1 0 22:06 ? 00:00:00 ora_pmon_thinkdba
oracle 4119 1 0 22:06 ? 00:00:00 ora_vktm_thinkdba
oracle 4123 1 0 22:06 ? 00:00:00 ora_gen0_thinkdba
oracle 4125 1 0 22:06 ? 00:00:00 ora_diag_thinkdba
oracle 4127 1 0 22:06 ? 00:00:00 ora_dbrm_thinkdba
oracle 4129 1 0 22:06 ? 00:00:00 ora_psp0_thinkdba
oracle 4131 1 0 22:06 ? 00:00:00 ora_dia0_thinkdba
oracle 4133 1 1 22:06 ? 00:00:01 ora_mman_thinkdba
oracle 4135 1 0 22:06 ? 00:00:00 ora_dbw0_thinkdba
oracle 4137 1 0 22:06 ? 00:00:00 ora_lgwr_thinkdba
oracle 4139 1 0 22:06 ? 00:00:00 ora_ckpt_thinkdba
oracle 4141 1 0 22:06 ? 00:00:00 ora_smon_thinkdba
oracle 4143 1 0 22:06 ? 00:00:00 ora_reco_thinkdba
oracle 4145 1 1 22:06 ? 00:00:01 ora_mmon_thinkdba
oracle 4147 1 0 22:06 ? 00:00:00 ora_mmnl_thinkdba
oracle 4149 1 0 22:06 ? 00:00:00 ora_d000_thinkdba
oracle 4151 1 0 22:06 ? 00:00:00 ora_s000_thinkdba
oracle 4186 4066 2 22:06 ? 00:00:02 oraclethinkdba (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 4192 1 0 22:06 ? 00:00:00 ora_qmnc_thinkdba
oracle 4208 1 1 22:06 ? 00:00:00 ora_cjq0_thinkdba
oracle 4210 1 0 22:06 ? 00:00:00 ora_q000_thinkdba
oracle 4212 1 0 22:06 ? 00:00:00 ora_q001_thinkdba
oracle 4214 1 0 22:06 ? 00:00:00 ora_vkrm_thinkdba
oracle 4222 1 29 22:07 ? 00:00:17 ora_j002_thinkdba
oracle 4231 1 5 22:07 ? 00:00:03 ora_j006_thinkdba
oracle 4237 1 4 22:07 ? 00:00:02 ora_j007_thinkdba
oracle 4250 4066 0 22:08 pts/1 00:00:00 /bin/bash -c ps -ef | grep thinkdba
oracle 4252 4250 0 22:08 pts/1 00:00:00 grep thinkdba
SQL>
啟動成功了
檢視memory_target的大小
SQL> show parameter memory
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>
已經符合官方文件的說明了,/dev/shm大於memory_max_target的大小。
相關閱讀:
關於ORA-01000: maximum open cursors exceeded" 問題分析總結 http://www.linuxidc.com/Linux/2013-06/86057.htm
關於Oracle遊標的問題(ORA-01000: maximum open cursors exceeded) http://www.linuxidc.com/Linux/2009-01/18148.htm
Oracle ORA-01000:maximum open cursors exceeded http://www.linuxidc.com/Linux/2013-01/77754.htm
ORA-01000: maximum open cursors exceeded http://www.linuxidc.com/Linux/2013-02/80071.htm
更多Oracle相關資訊見Oracle 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=12
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29330852/viewspace-2120320/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle 11g報錯"ORA-00845: MEMORY_TARGET not supported on this system"Oracle
- oracle 11g報錯ORA-00845: MEMORY_TARGET not supported on this systemOracle
- ORA-00845: MEMORY_TARGET not supported on this system報錯解決
- ORA-00845 MEMORY_TARGET not supported on this system報錯解決
- ORA-00845 MEMORY_TARGET not supported on this system
- ORA-00845: MEMORY_TARGET not supported on this system
- Oracle11g啟動報:ORA-00845: MEMORY_TARGET not supported on this systemOracle
- startup ORA-00845: MEMORY_TARGET not supported on this system
- Oracle11g ORA-00845: MEMORY_TARGET not supported on this systemOracle
- ORA-00845: MEMORY_TARGET not supported on this system - Linux ServersLinuxServer
- ORA-00845 MEMORY_TARGET not supported
- MEMORY_TARGET not supported on this system
- HugePages與AMM不相容:ORA-00845: MEMORY_TARGET not supported on this system
- “ORA-00845: MEMORY_TARGET not supported on this system”不完全解決之道
- ORA-00845: MEMORY_TARGET not supported on this system 失敗的解決方案
- MEMORY_TARGET not supported on this system for linuxLinux
- linux下/dev/shm的大小引發ORA-00845: MEMORY_TARGET not supported on this systemLinuxdev
- 解決辦法:ORA-00845: MEMORY_TARGET not supported on thi
- ORA-00845 : MEMORY_TARGET not supported on this system(調大資料庫記憶體無法啟動)大資料資料庫記憶體
- ORA-00845: MEMORY_TARGET
- memory_max_target/memory_target設定過大報ORA-00845錯誤
- oracle 12C RAC 啟動報錯 ORA-00845Oracle
- ORA-00845 memory_target needs larger /dev/shmdev
- Oracle Fusion Middleware Supported System check,jdk,java .etc requirementsOracleJDKJavaUIREM
- System.Data.SqlClient is not supported on this platform.SQLclientPlatform
- Mac新建資料夾報錯,mkdir():Operation not supportedMac
- ORACLE11G解決ORA-00845錯誤Oracle
- 用putty連線AWS,報錯“No supported authentication methods available"AI
- 解決報錯error the @annotation pointcut expression is only supported at Java 5ErrorExpressJava
- Linux下安裝Oracle11g , MEMORY_TARGET(AMM)小於/dev/shm處理(ORA-00845)LinuxOracledev
- SAP Table function 執行報錯 feature not supported 該如何分析Function
- SAP PP使用ECR去修改Recipe主資料,報錯:Generation not supported
- angular(2+)報錯處理之 -- 關於function 、lambda、not supported等AngularFunction
- windows下curl報錯:curl : (1) Protocol https not supported or disabled in libcurlWindowsProtocolHTTP
- ORA-00845 錯誤處理
- IDEA中的.VUE檔案報錯 Export declarations are not supported by current JavaScript versionIdeaVueExportJavaScript
- 如何解決ORA-00845錯誤
- oracle dg報錯Oracle