Oracle 在Linux X86上使用超過2G的SGA
在Linux X86上,SGA最大使用2G記憶體,如果設定超過2G的SGA,會報如下錯誤
ORA-27123: unable to attach to shared memory segment |
可以透過使用shared memory file的方式使用超過2G的sga。
下面演示其過程(RedHat as 4+Oracle 10.2.0.1)
[@more@]1、SGA過大的錯誤演示
SQL> alter system set sga_target=3G scope=spfile; System altered. SQL> startup force ORA-27123: unable to attach to shared memory segment SQL> exit Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options |
2、Mount ramfs 檔案系統,並保證可以被oracle使用者訪問
以下下過程用root使用者操作
[root@linux32 ~]# umount /dev/shm [root@linux32 ~]# mount -t ramfs ramfs /dev/shm [root@linux32 ~]# chown oracle:dba /dev/shm |
然後將上面的三個命令加入到/etc/rc.local檔案最後,修改後的檔案如下所示
[root@linux32 ~]# cat /etc/rc.local #!/bin/sh # # This script will be executed *after* all the other init scripts. # You can put your own initialization stuff in here if you don't # want to do the full Sys V style init stuff. touch /var/lock/subsys/local umount /dev/shm mount -t ramfs ramfs /dev/shm chown oracle:dba /dev/shm |
3、設定shared pool可以使用的記憶體
編輯/etc/security/limits.conf檔案,加入標記為紅色的兩行
最後數字的計算公式為(假設要使用1g的shared pool,計算公式為 1×1024×1024=1048576),
[root@linux32 ~]# cat /etc/security/limits.conf # /etc/security/limits.conf # ...... #@student - maxlogins 4 # End of file oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 oracle soft memlock 1048576 oracle hard memlock 1048576 |
可以在另一個終端中重新用oracle使用者登入,檢視設定是否生效
[oracle@linux32 ~]$ ulimit -l 1048576 |
4、設定SHMMAX引數值
編輯/etc/sysctl.conf檔案,按照如下規則設定如下3行
kernel.shmmax = 2147483648 #Linux主機記憶體的一半,單位為byte,但最大最不能超過4294967295 kernel.shmmni = 4096 #一般固定為4094 kernel.shmall = 2097152 #應該>或= kernel.shmmax/kernel.shmmni |
使用sysctl -p命令使設定生效
[root@linux32 ~]# sysctl -p |
5、修改oracle的pfile檔案
以下操作使用oracle使用者操作
使用spfile生產pfile檔案
[oracle@linux32 dbs]$ strings spfileorcl.ora > init.ora.bak |
編輯init.ora.bak檔案,增加標記為紅色的三行
*.db_block_size=8192 ...... *.use_indirect_data_buffers=true *.db_block_buffers = 393216 *.shared_pool_size = 452984832 |
db_block_buffers表示db_block_size的大小,如欲使用3g的db_block_size,則公司為:(3×1024×1024/8=393216)(8代表db_block_size為8k)
shared_pool_size表示shared pool的大小,單位為byte,不能超過步驟3設定的記憶體大小,否則啟動時會報告如下錯誤:
ORA-27102: out of memory Linux Error: 28: No space left on device |
然後將*.sga_max_size和*.sga_target行刪掉
6、使用修改好的pfile檔案啟動
[oracle@linux32 dbs]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.1.0 - Production on Wed Jan 20 21:52:40 2010 Copyright (c) 1982, 2005, Oracle. All rights reserved. Connected to an idle instance. SQL> startup pfile='?/dbs/init.ora.bak' ORACLE instance started. Total System Global Area 3724541952 bytes Fixed Size 1218076 bytes Variable Size 486541796 bytes Database Buffers 3221225472 bytes Redo Buffers 15556608 bytes Database mounted. Database opened. |
生成spfile
SQL> create spfile from pfile='?/dbs/init.ora.bak'; File created. |
使用spfile啟動
SQL> startup force; ORACLE instance started. Total System Global Area 3724541952 bytes Fixed Size 1218076 bytes Variable Size 486541796 bytes Database Buffers 3221225472 bytes Redo Buffers 15556608 bytes Database mounted. Database opened. |
顯示sga情況
SQL> show sga Total System Global Area 3724541952 bytes Fixed Size 1218076 bytes Variable Size 486541796 bytes Database Buffers 3221225472 bytes Redo Buffers 15556608 bytes SQL> show parameter sga NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ lock_sga boolean FALSE pre_page_sga boolean FALSE sga_max_size big integer 3552M sga_target big integer 0 |
--end--
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22049049/viewspace-1030758/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 在Oracle Linux 7.1上安裝DockerOracleLinuxDocker
- 在 Linux 上使用 tarballLinux
- 在Linux上使用CANLinux
- 在 Linux 上使用 MultitailLinuxAI
- Linux下如何使用X86 CPU的GPIOLinux
- MikroTik RouterOS x86最大記憶體只能支援2GROS記憶體
- ordebug 手動修改Oracle sga scnOracle
- Docker Desktop 現在可以在 Linux 上使用DockerLinux
- 在 Linux 上使用 Window Maker 桌面Linux
- oracle12c之 控制pdb中sga 與 pga 記憶體使用Oracle記憶體
- 在Linux上使用的10種雲備份方案Linux
- 在 Linux 上使用 Ksnip 註釋截圖Linux
- Oracle Rac 修改SGA_TARGET值無變化Oracle
- 一次Oracle診斷案例-SGA與SwapOracle
- Oracle Exadata與SGA快取記憶體CQOracle快取記憶體
- Kettle 在 linux 上的部署Linux
- 10 款你可以透過 Wine 在 Linux 上玩的遊戲Linux遊戲
- 10 款你可以通過 Wine 在 Linux 上玩的遊戲Linux遊戲
- 使用Linux 上的 ChromebookvLinuxChrome
- 使用Linux 上的 ChromebookLinuxChrome
- ORACLE RAC 11.2.0.4 ASM加盤導致叢集重啟之ASM sga設定過小OracleASM
- 教你在 Linux 上使用 Calibre 建立電子書Linux
- iVend Retail:超過80%的網民使用過“線上購買,店內取貨”AI
- oracle SGA區基礎知識與檢視命令Oracle
- 在ARM+LINUX上使用pppd拔號上網(GPRS)流程Linux
- Oracle記憶體結構(一)----SGA的區域資訊(轉)Oracle記憶體
- 【ASK_ORACLE】LOCK_SGA引數失效的解決辦法Oracle
- Linux之x86架構Linux架構
- WATConsult:50%的印度使用者在Instagram上購物過
- WINDOWS平臺上擴充套件SGA (zt)Windows套件
- 使用免費的Oracle雲服務-在雲主機上安裝Oracle Database 19cOracleDatabase
- ThinkWithGoogle:世界盃在谷歌和YouTube上的搜尋量超過奧運會Go谷歌
- Quartzy:《Let It Go》在 Spotify 上的播放次數已經超過 2.8 億次quartzGo
- 使用 xclip 在 Linux 命令列中複製貼上Linux命令列
- 無需sudo使用Podman在Linux上執行容器Linux
- 關於32位oracle擴充套件SGA的一些問題Oracle套件
- 在Oracle Linux 7.1中使用原始碼來安裝PostgreSQL 9.6OracleLinux原始碼SQL
- NPD:在智慧手機上花費超過1000美元的消費者不到10%
- Oracle 指令碼 線上哪些索引從來沒有被使用過Oracle指令碼索引