Oracle HowTo:如何在Linux上擴充套件SGA超過1.7G

tolywang發表於2007-07-13
今天一臺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 ( if u have a ksms.s file)
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 (if u have backup ksms.s file)
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.
            

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/35489/viewspace-84769/,如需轉載,請註明出處,否則將追究法律責任。

相關文章