Backup And Recovery User's Guide-从RMAN开始-恢复整个数据库

使用RESTORE DATABASERECOVER DATABASE来还原整个数据库。

之前必须对所有需要的文件做过备份。

这里假设可以还原所有的数据文件到原来的位置,如果原来的位置不可访问,则要使用SET NEWNAME命令。

练习:恢复整个数据库

# 1. 准备恢复(上一练习)

# 2. 使数据库处于MOUNT状态

sys@TESTDB12>shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

sys@TESTDB12>startup mount;

ORACLE instance started.

Total System Global Area  839282688 bytes

Fixed Size                  2233000 bytes

Variable Size             532680024 bytes

Database Buffers          301989888 bytes

Redo Buffers                2379776 bytes

Database mounted.

# 3. 还原数据库

oracle@Redhat55.cuug.net:/home/oracle> rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Fri Jul 12 05:35:30 2013

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: TESTDB12 (DBID=2811829300, not open)

RMAN> restore database;

Starting restore at 12-JUL-13

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=20 device type=DISK

channel ORA_DISK_1: starting datafile backup set restore

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

channel ORA_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/TestDB12/system01.dbf

channel ORA_DISK_1: restoring datafile 00002 to /u01/app/oracle/oradata/TestDB12/sysaux01.dbf

channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/TestDB12/undotbs01.dbf

channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/TestDB12/users01.dbf

channel ORA_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/TestDB12/example01.dbf

channel ORA_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/TESTDB12/backupset/2013_07_12/o1_mf_nnndf_TAG20130712T053213_8xzm8xhf_.bkp

channel ORA_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/TESTDB12/backupset/2013_07_12/o1_mf_nnndf_TAG20130712T053213_8xzm8xhf_.bkp tag=TAG20130712T053213

channel ORA_DISK_1: restored backup piece 1

channel ORA_DISK_1: restore complete, elapsed time: 00:01:05

Finished restore at 12-JUL-13

# 4. 恢复数据库

RMAN> recover database;

Starting recover at 12-JUL-13

using channel ORA_DISK_1

starting media recovery

media recovery complete, elapsed time: 00:00:01

Finished recover at 12-JUL-13

# 5. 打开数据库

sys@TESTDB12>alter database open;

Database altered.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/17013648/viewspace-1081152/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/17013648/viewspace-1081152/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值