基于时间点的不完全恢复

启动实例:

C:\Documents and Settings\Administrator>rman target /

Recovery Manager: Release 10.1.0.2.0 - Production

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

connected to target database (not started)


RMAN> set dbid=243775347;

executing command: SET DBID

RMAN> startup nomount;

Oracle instance started

Total System Global Area     314572800 bytes

Fixed Size                      788692 bytes
Variable Size                145487660 bytes
Database Buffers             167772160 bytes
Redo Buffers                    524288 bytes

恢复数据文件并MOUNT数据库

RMAN> restore controlfile from autobackup;

Starting restore at 22-8月 -10
using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=160 devtype=DISK

recovery area destination: D:\oracle\product\10.1.0\flash_recovery_area
database name (or lock name space) used for search: WELLCOMM
channel ORA_DISK_1: autobackup found in the recovery area
channel ORA_DISK_1: autobackup found: D:\ORACLE\PRODUCT\10.1.0\FLASH_RECOVERY_AR
EA\WELLCOMM\AUTOBACKUP\2010_08_22\O1_MF_S_727701076_6715BP89_.BKP
channel ORA_DISK_1: controlfile restore from autobackup complete
output filename=D:\ORACLE\PRODUCT\10.1.0\ORADATA\WELLCOMM\CONTROL01.CTL
output filename=D:\ORACLE\PRODUCT\10.1.0\ORADATA\WELLCOMM\CONTROL02.CTL
output filename=D:\ORACLE\PRODUCT\10.1.0\ORADATA\WELLCOMM\CONTROL03.CTL
Finished restore at 22-8月 -10

RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1

Restore数据库

RMAN> restore database;

Starting restore at 22-8月 -10
Starting implicit crosscheck backup at 22-8月 -10
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=160 devtype=DISK
Crosschecked 2 objects
Finished implicit crosscheck backup at 22-8月 -10

Starting implicit crosscheck copy at 22-8月 -10
using channel ORA_DISK_1
Finished implicit crosscheck copy at 22-8月 -10

searching for all files in the recovery area
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: D:\ORACLE\PRODUCT\10.1.0\FLASH_RECOVERY_AREA\WELLCOMM\AUTOBACKUP\2010
_08_22\O1_MF_S_727701076_6715BP89_.BKP

using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to D:\ORACLE\PRODUCT\10.1.0\ORADATA\WELLCOMM\SYSTEM01.D
BF
restoring datafile 00002 to D:\ORACLE\PRODUCT\10.1.0\ORADATA\WELLCOMM\UNDOTBS01.
DBF
restoring datafile 00003 to D:\ORACLE\PRODUCT\10.1.0\ORADATA\WELLCOMM\SYSAUX01.D
BF
restoring datafile 00004 to D:\ORACLE\PRODUCT\10.1.0\ORADATA\WELLCOMM\USERS01.DB
F
restoring datafile 00005 to D:\ORACLE\PRODUCT\10.1.0\ORADATA\WELLCOMM\EXAMPLE01.
DBF
restoring datafile 00006 to D:\ORACLE\PRODUCT\10.1.0\ORADATA\DATA01.DBF
channel ORA_DISK_1: restored backup piece 1
piece handle=D:\ORACLE\PRODUCT\10.1.0\FLASH_RECOVERY_AREA\WELLCOMM\BACKUPSET\201
0_08_22\O1_MF_NNNDF_TAG20100822T104836_6714052G_.BKP tag=TAG20100822T104836
channel ORA_DISK_1: restore complete
Finished restore at 22-8月 -10

进行基于时间点的恢复:


RMAN>  sql "alter session set nls_date_format=''yyyy-mm-dd hh24:mi:ss''";

sql statement: alter session set nls_date_format=''yyyy-mm-dd hh24:mi:ss''

RMAN>  recover database until time '2010-08-22 13:00:00';

Starting recover at 22-8月 -10
using channel ORA_DISK_1

starting media recovery

archive log thread 1 sequence 46 is already on disk as file D:\ORACLE\PRODUCT\10
.1.0\FLASH_RECOVERY_AREA\WELLCOMM\ARCHIVELOG\2010_08_22\O1_MF_1_46_67159SQX_.ARC

archive log thread 1 sequence 1 is already on disk as file D:\ORACLE\PRODUCT\10.
1.0\ORADATA\WELLCOMM\REDO03.LOG
archive log filename=D:\ORACLE\PRODUCT\10.1.0\FLASH_RECOVERY_AREA\WELLCOMM\ARCHI
VELOG\2010_08_22\O1_MF_1_46_67159SQX_.ARC thread=1 sequence=46
archive log filename=D:\ORACLE\PRODUCT\10.1.0\ORADATA\WELLCOMM\REDO03.LOG thread
=1 sequence=1
media recovery complete
Finished recover at 22-8月 -10

Resetlogs打开数据库:


RMAN> alter database open resetlogs;

database opened

至此数据恢复完毕.

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

转载于:http://blog.itpub.net/23203681/viewspace-671578/

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值