調整Oracle sga的大小導致 ORA-00851和ORA-00844錯誤

來源:互聯網
上載者:User

調整Oracle sga的大小導致 ORA-00851和ORA-00844錯誤

今天調整了下Oracle sga的大小,結果重啟資料庫的時候報如下錯誤。
 SQL>alter system set sga_max_size=1024M scope=spfile;
 SQL> shutdown immediate
 SQL> startup
 ORA-00844: Parameter not taking MEMORY_TARGET into account
 ORA-00851: SGA_MAX_SIZE 1073741824 cannot be set to more than MEMORY_TARGET 784334848.
 在Oracle查了下,原來11g新增了個參數MEMORY_TARGET,其大小等於PGA+SGA,當sga的大小大於MEMORY_TARGET就會報如上錯誤。
 

解決方案:
 可以直接修改spflie檔案中MEMORY_TARGET的大小,可是由於之前沒查看spfile的位置,不知道spfile的具體位置,所以只能採用如下方法
 1.sqlplus  / as sysdba
 SQL>create pfile='/home/oracle/pfile' from spfile;
 建立pfile檔案,修改pfile檔案中的MEMORY_TARGET參數,
 然後重新建立spfile檔案
 SQL>create spfile from pfile='/home/oracle/pfile';
 

重啟結果又報下面的錯
 SQL> startup
 ORA-00845: MEMORY_TARGET not supported on this system
 這個是由於系統tmpfs小於MEMORY_TARGET導致的,需要調整tmpfs的大小
 vi /etc/fstab
 tmpfs                  /dev/shm                tmpfs  defaults,size=2G      0 0
 修改size的大小
 重新掛載
 mount -o remount /dev/shm
 驗證下
 df -h
 

現在終於可以正常啟動資料庫了
 SQL> startup
 ORACLE instance started.
 

Total System Global Area 1068937216 bytes
 Fixed Size                  2220200 bytes
 Variable Size            943722328 bytes
 Database Buffers          117440512 bytes
 Redo Buffers                5554176 bytes
 Database mounted.
 Database opened.

總結一下,以後調整sga的順序是,先調整tmpfs的大小,再調整MEMORY_TARGET 的大小,最後調整sga,保證tmpfs>MEMORY_TARGET >sga+pga

--------------------------------------------------------------------------------

Linux-6-64下安裝Oracle 12C筆記

在CentOS 6.4下安裝Oracle 11gR2(x64)

Oracle 11gR2 在VMWare虛擬機器中安裝步驟

Debian 下 安裝 Oracle 11g XE R2

--------------------------------------------------------------------------------

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.