oracle 11g RMAN異機恢複過程

來源:互聯網
上載者:User

原庫確定資料檔案,記錄檔,tempfile 檔案資訊

select group#,status,type, member from v$logfile;

col name format a65

select file#,name,bytes/1024/1024 MB from v$datafile;

select name from v$controlfile;

1.建立執行個體

oradim (命令列下包含多種可選項,可自行選擇)

oradim -new -sid maxld

在已有資料庫啟動並執行情況下需要注意設定環境變數

c:\set oracle_sid=demo

c:\sqlplus / as sysdba

2.建立或修改初始化參數檔案

手頭有其他資料庫的情況下

sql>create pfile from spfile

此檔案在dbhome_1下的database中

根據實際情況修改pfile檔案

替換SID等

例如

orcl.__db_cache_size=205520896 替換為 demo.__db_cache_size=205520896

3.建立相應的目錄結構

*.audit_file_dest='C:\app\Administrator\admin\demo\adump'

*.control_files='C:\app\Administrator\oradata\demo\control01.ctl',

'C:\app\Administrator\flash_recovery_area\demo\control02.ctl'

4.啟動執行個體

sql>startup nomount

5.拷貝修改pfile,準備控制檔案。

cp /oracle10/oradata/ora10/control01.ctl .

SQL> startup mount pfile='/tmp/pfile10.ora';

ORACLE instance started.

6. 恢複資料庫。

run {

ALLOCATE CHANNEL ch0 TYPE disk;

set newname for datafile 1 to 'C:\app\Administrator\oradata\system01.dbf';

set newname for datafile 2 to 'C:\app\Administrator\oradata\sysaux01.dbf';

set newname for datafile 3 to 'C:\app\Administrator\oradata\undotbs01.dbf';

set newname for datafile 4 to 'C:\app\Administrator\oradata\users01.dbf';

set newname for datafile 5 to 'C:\app\Administrator\oradata\MAXIMO_DATA.dbf';

set newname for datafile 6 to 'C:\app\Administrator\oradata\MAXIMO_index.dbf';

set newname for datafile 7 to 'C:\app\Administrator\oradata\MAXIMO_DATA02.dbf';

set newname for datafile 8 to 'C:\app\Administrator\oradata\MAXIMO_index02.dbf';

set newname for tempfile 1 to 'C:\app\Administrator\oradata\temp01.dbf';

set newname for tempfile 2 to 'C:\app\Administrator\oradata\MAXIMO_temp.dbf';

restore database;

switch datafile all;

switch tempfile all;

release channel ch0;

}

recover database;

處理redolog

處理tempfile

本欄目更多精彩內容:http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/

聯繫我們

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