在測試PlateSpine克隆的數據庫服務器時,由於資源有限,克隆過來的數據庫服務器只給了9G的內存,結果在測試時,老是會出現OOMkiller導致宕機,即out of memory killer,是linux下面當內存耗盡時的的一種處理機制。當內存較少時,OOM會遍歷整個進程鏈表,然後根據進程的內存使用情況以及它的oom score值最終找到得分較高的進程,然後發送kill信號將其殺掉。 於是調整了一下sga_target和sga_max_size這兩個參數,結果重啟的時候悲劇了:
[oracle@mylnx01 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Thu Dec 15 09:28:11 2016
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> startup
ORA-00821: Specified value of sga_target 3072M is too small, needs to be at least 12896M
SQL> startup nomount
ORA-00093: _shared_pool_reserved_min_alloc must be between 4000 and 0
SQL>
出現這個這個錯誤,突然想起來這個服務器設置過shared_pool_size參數,於是生成pfile,檢查initGSP.ora,如下所示,
SQL> create pfile='/u01/app/oracle/product/10.2.0/db_1/dbs/initGSP.ora' from spfile;
File created.
手工將.shared_pool_size設置為0, 然後啟動數據庫實例,問題解決。如下所示:
SQL> startup pfile='/u01/app/oracle/product/10.2.0/db_1/dbs/initGSP.ora'
ORACLE instance started.
Total System Global Area 3221225472 bytes
Fixed Size 2099752 bytes
Variable Size 637535704 bytes
Database Buffers 2533359616 bytes
Redo Buffers 48230400 bytes
Database mounted.
Database opened.
SQL> exit