[20120120]startup nomount訪問引數檔案的順序.txt

lfree發表於2012-01-20
檢查startup nomount訪問引數檔案的順序.

export ORACLE_SID=noexist
strace -o noexist.txt sqlplus sys as sysdba

$ rlsqlplus

SQL*Plus: Release 11.2.0.1.0 Production on Fri Jan 20 08:48:12 2012

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Enter password:
Connected to an idle instance.

08:48:14 SQL> exit
Disconnected
$ export ORACLE_SID=noexist
$ strace -o noexist.txt sqlplus sys as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Fri Jan 20 08:50:04 2012

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Enter password:
Connected to an idle instance.

08:50:05 SQL> startup nomount
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0/db_1/dbs/initnoexist.ora'
08:50:11 SQL> quit
Disconnected

$egrep -i "noexist|spfile" noexist.txt
--沒有結果!why?在沒有執行startup nomount之前觀察,發現
$ ps -ef
...
oracle    3825  3248  0 09:13 pts/0    00:00:00 sqlplus     as sysdba
oracle    3828  3825  0 09:13 ?        00:00:00 oraclenoexist (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
...

sqlplus會派生一個oraclenoexist經常.

$strace -o noexist1.txt  -p  3828

再執行startup nomount,退出後.執行如下:

# egrep -i "noexist|spfile" noexist1.txt
stat("/u01/app/oracle/product/11.2.0/db_1/dbs/spfilenoexist.ora", 0x7fff12a3a8a8) = -1 ENOENT (No such file or directory)
stat("/u01/app/oracle/product/11.2.0/db_1/dbs/spfile.ora", 0x7fff12a3a8a8) = -1 ENOENT (No such file or directory)
open("/u01/app/oracle/product/11.2.0/db_1/dbs/initnoexist.ora", O_RDONLY) = -1 ENOENT (No such file or directory)

可以確定startup nomount啟動引數檔案的查詢順序是:
dbs目錄下的:
spfile.ora => spfile.ora => init.ora

瞭解這個順序對於定位啟動問題很重要.

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

相關文章