当前位置导航:炫浪网>>网络学院>>编程开发>>Oracle教程

如何在Linux上扩展SGA超过1.7G


  今天一台Linux服务器扩展了一下内存,达到4G,开发的人自己修改了一下SGA结果数据库无法启动了.
  
  启动不了时,出的错误是这个样子的:
  [oracle@neirong oracle]$ sqlplus "/ as sysdba"
  
  SQL*Plus: Release 9.2.0.4.0 - Production on Fri Nov 25 15:43:26 2005
  
  Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
  
  Connected to an idle instance.
  
  SQL> startup
  ORA-27123: unable to attach to shared memory segment
  Linux Error: 22: Invalid argument
  Additional information: 1
  Additional information: 458753
  SQL> exit
  Disconnected
  
  在32位平台上,缺省的SGA最大只能扩展到1.7G,如果需要支持更大的内存,就需要降低mapped_base,重新Link Oracle软件.
  
  俺的平台为:
  [oracle@neirong bdump]$ cat /etc/redhat-release
  Red Hat Enterprise Linux AS release 3 (Taroon Update 2)
  
  简单操作如下:
  cd $ORACLE_HOME/rdbms/lib
  cp ksms.s ksms.s.bak
  genksms -s 0x12000000 > ksms.s
  make -f ins_rdbms.mk ksms.o
  make -f ins_rdbms.mk ioracle
  
  此处先备份ksms.s文件,如果编译过程中出现错误,保证操作可以被恢复:
  
  恢复步骤大致如下:
  
  cd $ORACLE_HOME/rdbms/lib
  cp ksms.s.bak ksms.s
  genksms > ksms.s
  make -f ins_rdbms.mk ksms.o
  make -f ins_rdbms.mk ioracle
  
  以下是操作日志:
  [oracle@neirong dbs]$ cd $ORACLE_HOME/rdbms/lib
  [oracle@neirong lib]$ genksms -s 0x12000000 > ksms.s
  [oracle@neirong lib]$ make -f ins_rdbms.mk ksms.o
  
  [oracle@neirong lib]$ make -f ins_rdbms.mk ioracle
  - Linking Oracle
  rm -f /opt/oracle/product/9.2.0/rdbms/lib/oracle
  gcc -o /opt/oracle/product/9.2.0/rdbms/lib/oracle -L/opt/oracle/product/9.2.0/rdbms/lib/
  -L/opt/oracle/product/9.2.0/lib/ -L/opt/oracle/product/9.2.0/lib/stubs/
  -Wl,-E `test -f /opt/oracle/product/9.2.0/rdbms/lib/skgaioi.o && echo
  /opt/oracle/product/9.2.0/rdbms/lib/skgaioi.o` /opt/oracle/product/9.2.0/rdbms/lib/opimai.o
  /opt/oracle/product/9.2.0/rdbms/lib/ssoraed.o /opt/oracle/product/9.2.0/rdbms/lib/ttcsoi.o
  /opt/oracle/product/9.2.0/lib/nautab.o /opt/oracle/product/9.2.0/lib/naeet.o
  /opt/oracle/product/9.2.0/lib/naect.o /opt/oracle/product/9.2.0/lib/naedhs.o
  /opt/oracle/product/9.2.0/rdbms/lib/config.o -lserver9 -lodm9 -lskgxp9 -lskgxn9 -lclient9
  -lvsn9 -lwtcserver9 -lcommon9 -lgeneric9 /opt/oracle/product/9.2.0/rdbms/lib/defopt.o
  -lknlopt `if /usr/bin/ar tv /opt/oracle/product/9.2.0/rdbms/lib/libknlopt.a | grep
  xsyeolap.o > /dev/null 2>&1 ; then echo "-loraolap9" ; fi`
  -lslax9 -lpls9 -lplp9 -lserver9 -lclient9 -lvsn9 -lwtcserver9 -lcommon9 -lgeneric9
  -lknlopt -lslax9 -lpls9 -lplp9 -ljox9 -lserver9 -locijdbcst9 -lwwg9
  `cat /opt/oracle/product/9.2.0/lib/ldflags`  -lnsslb9 -lncrypt9 -lnsgr9 -lnzjs9
  -ln9 -lnl9 -lnro9 `cat /opt/oracle/product/9.2.0/lib/ldflags`  -lnsslb9 -lncrypt9
  ......
  mv -f /opt/oracle/product/9.2.0/bin/oracle /opt/oracle/product/9.2.0/bin/oracleO
  mv /opt/oracle/product/9.2.0/rdbms/lib/oracle /opt/oracle/product/9.2.0/bin/oracle
  chmod 6751 /opt/oracle/product/9.2.0/bin/oracle
  
  此后数据库可以以超过1.7G的SGA区设置启动:
  SQL> startup
  ORACLE instance started.
  
  Total System Global Area 2685476820 bytes
  Fixed Size          454612 bytes
  Variable Size      1073741824 bytes
  Database Buffers     1610612736 bytes
  Redo Buffers         667648 bytes
  Database mounted.
  Database opened.
相关内容
赞助商链接