当前位置导航:炫浪网>>网络学院>>编程开发>>Oracle教程

使用RMAN进行基于表空间的恢复

示范案例,仅供参考:
1.察看备份文件

$ rman target /



Recovery Manager: Release 10.1.0.2.0 - 64bit Production



Copyright (c) 1995, 2004, Oracle.  All rights reserved.



connected to target database: EYGLE (DBID=1337390772)



RMAN> list backup of datafile 1;





List of Backup Sets

===================



BS Key  Type LV Size       Device Type Elapsed Time Completion Time

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

17      Full    131M       DISK        00:01:50     29-MAR-05

        BP Key: 17   Status: AVAILABLE  Compressed: NO  Tag: TAG20050329T065513

        Piece Name: /data5/flash_recovery_area/EYGLE/backupset/

2005_03_29/o1_mf_nnndf_TAG20050329T065513_14k2tmx7_.bkp

  List of Datafiles in backup set 17

  File LV Type Ckp SCN    Ckp Time  Name

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

  1       Full 10605717   29-MAR-05 /opt/oracle/oradata/eygle/system01.dbf



2.mount数据库

RMAN> startup mount;

connected to target database (not started)

Oracle instance started

database mounted

Total System Global Area     314572800 bytes

Fixed Size                     1301704 bytes

Variable Size                261890872 bytes

Database Buffers              50331648 bytes

Redo Buffers                   1048576 bytes



3.恢复数据文件


RMAN> restore datafile 1;

Starting restore at 30-MAR-05

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=160 devtype=DISK

channel ORA_DISK_1: starting datafile backupset restore

channel ORA_DISK_1: specifying datafile(s) to restore from backup set

restoring datafile 00001 to /opt/oracle/oradata/eygle/system01.dbf

channel ORA_DISK_1: restored backup piece 1

piece handle=/data5/flash_recovery_area/EYGLE/backupset/2005_03_29/

o1_mf_nnndf_TAG20050329T065513_14k2tmx7_.bkp tag=TAG20050329T065513

channel ORA_DISK_1: restore complete

Finished restore at 30-MAR-05



 

4.恢复表空间



RMAN> recover tablespace system;

Starting recover at 30-MAR-05

using channel ORA_DISK_1

starting media recovery

archive log thread 1 sequence 1760 is already on disk as file /data5/flash_recovery_area/
EYGLE/archivelog/2005_03_29/ o1_mf_1_1760_14kb696y_.arc archive log thread 1 sequence 1761 is already on disk as file /data5/flash_recovery_area/
EYGLE/archivelog/2005_03_29/ o1_mf_1_1761_14kl1fz5_.arc archive log thread 1 sequence 1762 is already on disk as file /data5/flash_recovery_area/
EYGLE/archivelog/2005_03_29/ o1_mf_1_1762_14l2kcg6_.arc archive log thread 1 sequence 1763 is already on disk as file /data5/flash_recovery_area/
EYGLE/archivelog/2005_03_29/ o1_mf_1_1763_14l2kgcc_.arc archive log thread 1 sequence 1764 is already on disk as file /data5/flash_recovery_area/
EYGLE/archivelog/2005_03_29/ o1_mf_1_1764_14l2knqw_.arc archive log thread 1 sequence 1765 is already on disk as file /data5/flash_recovery_area/
EYGLE/archivelog/2005_03_29/ o1_mf_1_1765_14l6b55s_.arc archive log thread 1 sequence 1766 is already on disk as file /data5/flash_recovery_area/
EYGLE/archivelog/2005_03_29/ o1_mf_1_1766_14l6b66r_.arc archive log thread 1 sequence 1767 is already on disk as file /data5/flash_recovery_area/
EYGLE/archivelog/2005_03_29/ o1_mf_1_1767_14l6b72w_.arc archive log thread 1 sequence 1 is already on disk as file /data5/flash_recovery_area/
EYGLE/archivelog/2005_03_29/ o1_mf_1_1_14l6w0ph_.arc archive log thread 1 sequence 1 is already on disk as file /data5/flash_recovery_area/
EYGLE/archivelog/2005_03_29/ o1_mf_1_1_14lndg1q_.arc archive log thread 1 sequence 2 is already on disk as file /data5/flash_recovery_area/
EYGLE/archivelog/2005_03_29/ o1_mf_1_2_14lrs0ty_.arc archive log thread 1 sequence 3 is already on disk as file /data5/flash_recovery_area/
EYGLE/archivelog/2005_03_29/ o1_mf_1_3_14lw1hj3_.arc archive log thread 1 sequence 4 is already on disk as file /data5/flash_recovery_area/
EYGLE/archivelog/2005_03_30/ o1_mf_1_4_14m5ytfz_.arc archive log thread 1 sequence 5 is already on disk as file /data5/flash_recovery_area/
EYGLE/archivelog/2005_03_30/ o1_mf_1_5_14mmzpdk_.arc archive log thread 1 sequence 6 is already on disk as file /data5/flash_recovery_area/
EYGLE/archivelog/2005_03_30/ o1_mf_1_6_14mylhfk_.arc archive log thread 1 sequence 7 is already on disk as file /data5/flash_recovery_area/
EYGLE/archivelog/2005_03_30/ o1_mf_1_7_14n93rxk_.arc archive log thread 1 sequence 8 is already on disk as file /data5/flash_recovery_area/
EYGLE/archivelog/2005_03_30/ o1_mf_1_8_14nq4n5n_.arc archive log thread 1 sequence 9 is already on disk as file /data5/flash_recovery_area/
EYGLE/archivelog/2005_03_30/ o1_mf_1_9_14o57ft3_.arc archive log filename=/data5/flash_recovery_area/EYGLE/archivelog/ 2005_03_29/ o1_mf_1_1760_14kb696y_.arc thread=1 sequence=1760 archive log filename=/data5/flash_recovery_area/EYGLE/archivelog/ 2005_03_29/ o1_mf_1_1761_14kl1fz5_.arc thread=1 sequence=1761 archive log filename=/data5/flash_recovery_area/EYGLE/archivelog/ 2005_03_29/ o1_mf_1_1762_14l2kcg6_.arc thread=1 sequence=1762 archive log filename=/data5/flash_recovery_area/EYGLE/archivelog/ 2005_03_29/ o1_mf_1_1763_14l2kgcc_.arc thread=1 sequence=1763 archive log filename=/data5/flash_recovery_area/EYGLE/archivelog/ 2005_03_29/ o1_mf_1_1764_14l2knqw_.arc thread=1 sequence=1764 archive log filename=/data5/flash_recovery_area/EYGLE/archivelog/ 2005_03_29/ o1_mf_1_1765_14l6b55s_.arc thread=1 sequence=1765 archive log filename=/data5/flash_recovery_area/EYGLE/archivelog/ 2005_03_29/ o1_mf_1_1766_14l6b66r_.arc thread=1 sequence=1766 archive log filename=/data5/flash_recovery_area/EYGLE/archivelog/ 2005_03_29/ o1_mf_1_1767_14l6b72w_.arc thread=1 sequence=1767 archive log filename=/data5/flash_recovery_area/EYGLE/archivelog/ 2005_03_29/ o1_mf_1_1_14l6w0ph_.arc thread=1 sequence=1 archive log filename=/data5/flash_recovery_area/EYGLE/archivelog/ 2005_03_29/ o1_mf_1_1_14lndg1q_.arc thread=1 sequence=1 archive log filename=/data5/flash_recovery_area/EYGLE/archivelog/ 2005_03_29/ o1_mf_1_2_14lrs0ty_.arc thread=1 sequence=2 archive log filename=/data5/flash_recovery_area/EYGLE/archivelog/ 2005_03_29/ o1_mf_1_3_14lw1hj3_.arc thread=1 sequence=3 archive log filename=/data5/flash_recovery_area/EYGLE/archivelog/ 2005_03_30/ o1_mf_1_4_14m5ytfz_.arc thread=1 sequence=4 archive log filename=/data5/flash_recovery_area/EYGLE/archivelog/ 2005_03_30/ o1_mf_1_5_14mmzpdk_.arc thread=1 sequence=5 archive log filename=/data5/flash_recovery_area/EYGLE/archivelog/ 2005_03_30/ o1_mf_1_6_14mylhfk_.arc thread=1 sequence=6 archive log filename=/data5/flash_recovery_area/EYGLE/archivelog/ 2005_03_30/ o1_mf_1_7_14n93rxk_.arc thread=1 sequence=7 media recovery complete Finished recover at 30-MAR-05

5.启动数据库


RMAN> alter database open;

database opened

RMAN>

相关内容
赞助商链接