探索Oracle之RMAN_07 參數檔案丟失恢複

來源:互聯網
上載者:User

Oracle資料庫的參數檔案有兩種一種是pfile(初始化參數檔案),還有一種是spfile(伺服器初始化參數檔案);實際上spfile是pfile衍生過來的一新參數檔案,應用9i以後的版本,在9i之前的版本都不支援,只支援pfile;而且pfile是不能通過oracle命令來進行備份的,只有spfile才支援備份。

 通過RMAN的備份來實現參數檔案的恢複,僅適用於9i以後

1、通過rman備份參數檔案:

RMAN> backupspfile;

 

Starting backupat 05-JUL-12

using channelORA_DISK_1

channelORA_DISK_1: starting full datafile backupset

channelORA_DISK_1: specifying datafile(s) in backupset

including currentSPFILE in backupset

channelORA_DISK_1: starting piece 1 at 05-JUL-12

channelORA_DISK_1: finished piece 1 at 05-JUL-12

piecehandle=/DBBak/bak_WWL_07_05_03nfbi5c_1_1 tag=TAG20120705T175348 comment=NONE

channelORA_DISK_1: backup set complete, elapsed time: 00:00:02

Finished backupat 05-JUL-12

 

Starting ControlFile and SPFILE Autobackup at 05-JUL-12

piecehandle=/DBSoft/product/10.2.0/db_1/dbs/c-5520179-20120705-01 comment=NONE

Finished ControlFile and SPFILE Autobackup at 05-JUL-12

 

RMAN>

 

2、備份完之後,我們可以看到如下備份資訊:

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- ------------ ----------- ------------ ---------------

3       Full   80.00K     DISK        00:00:01     05-JUL-12     

        BP Key: 3   Status: AVAILABLE  Compressed: NO  Tag: TAG20120705T175348

        Piece Name:/DBBak/bak_WWL_07_05_03nfbi5c_1_1

  SPFILE Included: Modification time: 05-JUL-12

 

3、類比參數檔案丟失:

SQL> showparameter spfile;

 

NAME                                 TYPE        VALUE

----------------------------------------------- ------------------------------

spfile                               string      /DBSoft/product/10.2.0/db_1/db

                                                s/spfileWWL.ora

SQL>

 

刪除參數檔案:

[oracle@wwldb ~]$ rm /DBSoft/product/10.2.0/db_1/dbs/spfileWWL.ora

[oracle@wwldb ~]$ ls /DBSoft/product/10.2.0/db_1/dbs/spfileWWL.ora

ls: /DBSoft/product/10.2.0/db_1/dbs/spfileWWL.ora: No such file ordirectory

 

[oracle@wwldb dbs]$ ll 

total 7240

drwxr-xr-x 2 oracle oinstall   4096 Jul  5 18:25 bak

-rw-rw---- 1 oracle oinstall   1544 May 16 16:44 hc_WWL.dat

-rw-rw---- 1 oracle oinstall      24 May 23 15:52 lkDUMMY

-rw-rw---- 1 oracle oinstall     24 May 16 16:47 lkWWL

-rw-r----- 1 oracle oinstall   1536 May 21 15:05 orapwWWL

drwxr-xr-x 2 oracle oinstall   4096 Jul  5 18:25 pfilebak

-rw-r----- 1 oracle oinstall 7389184 Jul  5 17:53 snapcf_WWL.f

[oracle@wwldb dbs]$    

我們可以看到這裡面pfile和spfile都沒有了,那麼資料庫肯定是起不來的,這個時候需要資料庫起來肯定需要恢複spfile或手工寫一個pfile來供資料庫的啟動。

  • 1
  • 2
  • 下一頁

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.