rman 全庫恢複asm資料庫

來源:互聯網
上載者:User

1、做全庫備份
 
注意:rman 可以把asm上的資料檔案備份到檔案系統,也可恢複
 
RMAN> run{
 allocate channel c1 type disk maxpiecesize=500m;
 backup current controlfile format '+dgasm/backup/ctl_%d_%s';
 backup full database format '+dgasm/backup/db_%d_%s_%p_%t';
 sql 'alter system archive log current';
 release channel c1;
 }2> 3> 4> 5> 6> 7>
allocated channel: c1
channel c1: SID=31 device type=DISK
Starting backup at 24-JUN-12
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
including current control file in backup set
channel c1: starting piece 1 at 24-JUN-12
channel c1: finished piece 1 at 24-JUN-12
piece handle=+DGASM/backup/ctl_ora11_19 tag=TAG20120624T172227 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:03
Finished backup at 24-JUN-12
Starting backup at 24-JUN-12
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00001 name=+DGASM/ora11/datafile/system.257.785186755
input datafile file number=00002 name=+DGASM/ora11/datafile/sysaux.258.785186845
input datafile file number=00003 name=+DGASM/ora11/datafile/undotbs1.259.785186901
input datafile file number=00004 name=+DGASM/ora11/datafile/users.261.785186921
channel c1: starting piece 1 at 24-JUN-12
channel c1: finished piece 1 at 24-JUN-12
piece handle=+DGASM/backup/db_ora11_20_1_786820952 tag=TAG20120624T172232 comment=NONE
channel c1: starting piece 2 at 24-JUN-12
channel c1: finished piece 2 at 24-JUN-12
piece handle=+DGASM/backup/db_ora11_20_2_786820952 tag=TAG20120624T172232 comment=NONE
channel c1: backup set complete, elapsed time: 00:01:22
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel c1: starting piece 1 at 24-JUN-12
channel c1: finished piece 1 at 24-JUN-12
piece handle=+DGASM/backup/db_ora11_21_1_786821034 tag=TAG20120624T172232 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 24-JUN-12
sql statement: alter system archive log current
released channel: c1
RMAN>
2、shutdown immediate  關閉資料庫,然後刪除user資料檔案,類比資料檔案損壞
ASMCMD> ls
SYSAUX.258.785186845
SYSTEM.257.785186755
UNDOTBS1.259.785186901
USERS.261.785186921
ASMCMD>
ASMCMD>
ASMCMD> rm -f USERS.261.785186921
ASMCMD> ls
SYSAUX.258.785186845
SYSTEM.257.785186755
UNDOTBS1.259.785186901
ASMCMD>
3、啟動資料到mount,然後open 出現下面的問題
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01157: cannot identify/lock data file 4 - see DBWR trace file
ORA-01110: data file 4: '+DGASM/ora11/datafile/users.261.785186921'
4、說明資料檔案出現問題,查看具體的問題
SQL> select * from v$recover_file
  2  ;
     FILE# ONLINE  ONLINE_ ERROR
---------- ------- ------- -----------------------------------------------------------------
   CHANGE# TIME
---------- ------------
         4 ONLINE  ONLINE  FILE NOT FOUND
         0
FILE NOT FOUND 說明該檔案丟失或者損壞,然後執行全庫恢複

  • 1
  • 2
  • 3
  • 下一頁

聯繫我們

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