判斷ORACLE啟動時使用spfile還是pfile

來源:互聯網
上載者:User

標籤:select   bytes   oracle   iss   mat   sele   art   targe   href   

自Oracle 9i以後啟動的時候預設使用的初始設定檔案是spfile,我們可以通過如下三種方式來判斷是SPFILE還是PFILE方式啟動資料庫。
1、show parameter spfile
2、show parameter pfile
3、看v$spparameter視圖

1、通過查看spfile、pfile視圖
用spfile啟動資料庫:
SQL> show parameter pfile;
NAME                                 TYPE     VALUE
------------------------------------ -------- ------------------------------
spfile                               string   C:\ORACLE\PRODUCT\10.2.0\DB_1\
                                              DATABASE\SPFILEWWL.ORA
SQL> show parameter spfile;
NAME                                 TYPE     VALUE
------------------------------------ -------- ------------------------------
spfile                               string   C:\ORACLE\PRODUCT\10.2.0\DB_1\
                                              DATABASE\SPFILEWWL.ORA
用pfile啟動資料庫
SQL> startup pfile=c:\initwwl.ora
ORACLE instance started.
Total System Global Area 1610612736 bytes
Fixed Size                  2066080 bytes
Variable Size             385878368 bytes
Database Buffers         1207959552 bytes
Redo Buffers               14708736 bytes
Database mounted.
Database opened.
SQL> col type format a8
SQL> show parameter pfile;
NAME                                 TYPE     VALUE
------------------------------------ -------- ------------------------------
spfile                               string
SQL> show parameter spfile;
NAME                                 TYPE     VALUE
------------------------------------ -------- ------------------------------
spfile                               string
SQL> 


我們在這裡可以很明顯的發現,使用spfile啟動資料庫,在查看show parameter pfile和show parameter spfile 都能看到spfile參數檔案的路徑。
反之使用pfile啟動的資料庫,我們無論是查看show parameter pfile還是show parameter spfile 都無法看到pfile參數檔案的路徑。

2、通過v$spparameter視圖
   使用spfile啟動資料庫,我們可以看到查詢出來的結果是spfile
SQL> select decode(count(*),1,‘spfile‘,‘pfile‘) from v$spparameter where rownum=1 and isspecified = ‘TRUE‘;

DECODE(COUNT
------------
spfile


使用pfile啟動資料庫,我們可以看到查詢出來的結果是pfile。
SQL> select decode(count(*),1,‘spfile‘,‘pfile‘) from v$spparameter where rownum=1 and isspecified =‘TRUE‘;
DECODE(COUNT
------------
pfile


判斷ORACLE啟動時使用spfile還是pfile

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.