admin 發表於 2016-7-18 14:15:38

Oracle 9i for Windows Platform 32bit 解決Memory-SGA 限制的的設定

Oracle 9i for Windows Platform 32bit 解決Memory-SGA 最多有1.7G限制的設定(AWE)
環境 : Windows 2003 Enterprise Edition SP2 (32bit Windows platform)
使用windows cluster機制& Oracle Failsafe實現oracle instance cluster。
Oracle: Oracle Enterprise Edition 9i (9.2.0.1 patch to 9208)
Memory: 8G RAM


由於Oracle on 32-bit Windows platforms,限制預設使用的SGA設定最多不能2G(實作上1.6G),而metalink上有解決方法,在此提出並將實作結果記錄下來:

Metalink doc:

Subject: Implementing Address Windowing Extensions (AWE) or VLM on Windows Platforms
Doc Id: 225349.1

設置的方式有2,稱之為"PAE" (Physical Address Extensions) 或"AWE" (Address Windowing Extensions) 這兩種方式可以交替使用。
而AWE的設定前提條件: Physical RAM在4G以上。
可使用的平台有
* Windows 2000 Datacenter Server
* Windows 2000 Advanced Server
* Windows 2003 Data Center Edition (32-Bit)
* Windows 2003 Enterprise Edition (32-Bit)
在以上的OS 平台,AWE可內嵌設定於OS層,因此不需要特別指定driver去驅動,就可使用多餘的memory。
而不能使用的平台有:
* Windows 2000 Server (Standard)
* Windows 2000 Professional
* Windows XP Home Edition
* Windows XP Professional
* Windows 2003 Standard Edition
* Windows 2003 Web Edition

ps: 64bit的windows platform 不需要AWE的設定,因為64bit-Windows platforms上,單一process最高可使用到8 TeraBytes的memory。

AWE in 32Bit RDMS release 版本為:
* Oracle 8.1.6.x
* Oracle 8.1.7.x
* Oracle 9.2.x
* Oracle 10.1.x
* Oracle 10.2.x
ps: Oracle does NOT implement AWE support in release 9.0.1.x
而且只限制Enterprise Edition and Standard Edition 才可生效!

##設定步驟##
1. OS level:

[*]   C:\boot.ini 修改內容:
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows Server 2003, Enterprise" /3GB /PAE /noexecute=optout /fastdetect
    "/3GB" 及"/PAE"同時設定的話,則Address space for ORACLE.exe會是3G,且要注意主機RAM是否最多到16G,若超過的話~則建議只使用一種即可。

[*]   確認user的系統權限
      在服務中設定的oracle SID 登入身份必需要被授與" Lock Page in Memory"的系統權限,一般oracle SID service登入身份會是" LocalSystem" account,請確認LocalSystem的帳號擁有此系統權限。
      設定方式: 開始\控制台\系統管理工具\本機安全性原則-->選擇--> "本機原則\使用者權利指派\鎖定記憶體分頁",
在本機安全性設定新增使用者或群組,並加入該使用者。這個設定是為了保留process的實際記憶體分頁,阻止系統將資料分頁至virtual虛擬記憶體中,這種方式會減少實際記憶體的可使用量。設定後記得重啟service。

[*]      基碼修改(新增: AWE_WINDOW_MEMORY)
       在HKLM\Software\Oracle\HomeX 新增一個基碼(reg_sz格式),計算單位為bytes,default為1g,因此新增值 AWE_WINDOW_MEMORY=1073741824
2. Database/Instance level:   

[*]      init.ora
   Add [ USE_INDIRECT_DATA_BUFFERS=TRUE ]         
      Add
注意: 若DB_CACHE_SIZE與USE_INDIRECT_DATA_BUFFERS=TRUE 同時存在時,會出現ORA-00385: cannot enable Very Large Memory with new buffer cache 的錯誤發生。
       因此只要設置DB_BLOCK_BUFFERS,移除DB_CACHE_SIZE的參數即可。其實buffer cache size的大小設定還要保留4G 的RAM下來給os或其它應用程式使用,因此可算出buffer cache最多可設定的值為多少。
      舉例說明: 8G RAM,use Default value of 1G for AWE_WINDOW_MEMORY,buffer cache最多可以設至的公式
      Max Buffer cache (Total Ram-4G + AWE_WINDOW_MEMORY) =8G-4G+1G=5G
而db block size=8192 ,則db_block_buffers的設定最大值為5G/8192 =5368709120/8192=655360
3. 重新啟動instance。
##完成設定##
總SGA size= ((db_block_buffers*buffer size ) + (shared_pool_size+large_pool_size +java_pool_size+log_buffers) +1MB
SGA +oracle 臨界值不能超過可用的虛擬記憶體,因為虛擬記憶體要計算buffer cache=db_block_buffer*db_block_size得出值。
註: 「監控mapping memory狀態」
可使用下列sql:select * from v$sysstat where statistic# in (154, 155);
10gr2: select statistic#, name from v$sysstat where name like '%map %';
若在10g要設定USER_INDIRECT_DATA_BUFFER,也就是使用AWE,則INIT.ORA不能使用SGA_TARGET的參數,SGA_TARGET=0。


頁: [1]
查看完整版本: Oracle 9i for Windows Platform 32bit 解決Memory-SGA 限制的的設定