0:拷贝备份的文件到恢复机,路径也备份时的路径一致;
1:使用默认的init.ora修改出initeagaodb.ora参数文件;
2:创建initeagaodb.ora参数文件中的相关文件目录,把目录创建在空闲分区比较大的分区,注意闪回目录在后续的recover时会被自动存储恢复的归档,应用后又被自动删除;3:使用startup nomount启动数据库;
4:使用rman恢复控制文件,注意此控制文件需要恢复到指定需要恢复时间点之后的备份,下面是恢复到8点中的备份
RMAN> restore controlfile from '/data4/130.177.65.815back/contorlfileback/controlc-1839368230-20120812-03';
5:启动数据库到mount状态
SQL> alter database mount;
6:重命名数据文件路径,以及restore需要的数据文件(数据文件id号可以备份日志中获取);
RMAN> run{
allocate channel ch1 type disk;
allocate channel ch2 type disk;
allocate channel ch3 type disk;
allocate channel ch4 type disk;
set newname for datafile 1 to '/data2/oradatarecovery/system01.dbf';
set newname for datafile 2 to '/data2/oradatarecovery/undotbs01.dbf';
set newname for datafile 3 to '/data2/oradatarecovery/sysaux01.dbf';
set newname for datafile 61 to '/data2/oradatarecovery/system02.dbf';
set newname for datafile 67 to '/data2/oradatarecovery/sysaux02.dbf';
set newname for datafile 69 to '/data2/oradatarecovery/eaunion_data01.dbf';
restore datafile 1,2,3,61,67,69;
switch datafile all;
release channel ch1;
release channel ch2;
release channel ch3;
release channel ch4;
}
7:recover数据库到指定时间点
RMAN> sql 'alter session set nls_Date_format="yyyy-mm-dd hh24:mi:ss"';
RMAN>recover database until time '2012-08-12 01:08:00' skip tablespace eaon_log,fnk_ta,z_dta,nion,zdan,eion_log,enex;
8:使用只读打开数据库后expdp出需要的数据即可
SQL> alter database open read only;
DBLINK 导出到别的库 …………………..
大致步骤如下(全部在恢复机上操作,把备份拷贝过来,拷贝的路径与备份时的路径一致):
1:创建参数文件
[oracle@sz dbs]$ cat initeagaodb.ora
db_name='eagaodb'
memory_target=10G
processes = 150
audit_file_dest='/data2/oradatarecovery/admin/orcl/adump'
db_block_size=8192
db_recovery_file_dest='/data2/oradatarecovery/flash_recovery_area'
db_recovery_file_dest_size=2G
diagnostic_dest='/data2/oradatarecovery/diag'
dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
# You may want to ensure that control files are created on separate physical
# devices
control_files = '/data2/oradatarecovery/control01.ctl','/data2/oradatarecovery/control02.ctl'
compatible ='11.2.0'
2:建立上述目录文件
3:启动数据库
SQL> startup nomount;
4:恢复控制文件
[oracle@szmlserver12_32 ~]$ rlwrap rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Thu Aug 23 12:05:05 2012
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: EAGAODB (not mounted)
RMAN> restore controlfile from '/data4/130.177.65.815back/contorlfileback/controlc-183936823