Oracle9iR2(Solaris 10 on SPARC)で
Oracle のインスタンス・リスナー・EMDBControl の自動起動・停止設定 - ablog
の通り設定してもOracleインスタンスが起動しなかった。
/etc/init.d/dbora の行頭に「-x」を追加して、
#!/bin/sh -x
実行してみると、
# /etc/init.d/dbora start ... + su - oracle -c /export/home/oracle/app/oracle/product/9.2.0/bin/dbstart Sun Microsystems Inc. SunOS 5.10 Generic January 2005 Can't find init file for Database "orcl". Database "orcl" NOT started. ...
とエラーが出力される。
/export/home/oracle/app/oracle/product/9.2.0/bin/dbstart を見てみる。
... PFILE=${ORACLE_HOME}/dbs/init${ORACLE_SID}.ora ... if [ -f $PFILE ] ; then ... else echo "" echo "Can't find init file for Database \"${ORACLE_SID}\"." echo "Database \"${ORACLE_SID}\" NOT started." fi fi fi
初期化パラメータファイルがないと起動しないつくりになっている。SPFILEに対応してないの?
以下の通り書き換えてみた。
... PFILE=${ORACLE_HOME}/dbs/init${ORACLE_SID}.ora SPFILE=${ORACLE_HOME}/dbs/spfile${ORACLE_SID}.ora ... if [ -f $PFILE -o -f $SPFILE] ; then ...
実行してみると、
# /etc/init.d/dbora start Sun Microsystems Inc. SunOS 5.10 Generic January 2005 SQL*Plus: Release 9.2.0.7.0 - Production on 月 Jun 22 10:44:49 2009 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. SQL> アイドル・インスタンスに接続しました。 SQL> ORACLEインスタンスが起動しました。 Total System Global Area 323978952 bytes Fixed Size 730824 bytes Variable Size 285212672 bytes Database Buffers 33554432 bytes Redo Buffers 4481024 bytes データベースがマウントされました。 データベースがオープンされました。 SQL> Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.7.0 - Productionとの接続が切断されました。 Database "orcl" warm started. ...
起動した。成功。