Oracle 数据库异机恢复(归档模式)
操作必须在服务器上进行(在192.168.12.71上执行)
0、按需要恢复的日期,把距恢复日期最近的全部备份和全部备份日期后的日志备份一同拷贝到需要恢复的机器上;
1、用RMAN登陆
C:\Users\Administrator>rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Tue Sep 23 20:48:42 2014
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1252729974)
2、关闭以前的数据库
RMAN> shutdown immediate;
using target database control file instead of recovery catalog database closed database dismounted Oracle instance shut down
3、启动数据库到非安装状态
RMAN> startup nomount;
connected to target database (not started) Oracle instance started
Total System Global Area 16535285760 bytes
Fixed Size 2192176 bytes Variable Size 7113542864 bytes Database Buffers 9395240960 bytes Redo Buffers 24309760 bytes
4、用最新的controlfile备份文件恢复(注意日期)
RMAN> restore controlfile from 'f:\C-1252729974-20140923-00';
Starting restore at 23-SEP-14 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=958 device type=DISK
channel ORA_DISK_1: restoring control file channel ORA_DISK_1: restore complete, elapsed time: 00:00:01 output file name=D:\APP\ORADATA\ORCL\CONTROL01.CTL output file name=D:\APP\FLASH_RECOVERY_AREA\ORCL\CONTROL02.CTL Finished restore at 23-SEP-14
5、安装数据库 RMAN>
alter database mount;
database mounted released channel: ORA_DISK_1
6、删除以前的备份集
RMAN> delete backup;
Starting implicit crosscheck backup at 23-SEP-14 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=958 device type=DISK Crosschecked 101 objects Finished implicit crosscheck backup at 23-SEP-14
Starting implicit crosscheck copy at 23-SEP-14 using channel ORA_DISK_1 Finished implicit crosscheck copy at 23-SEP-14
searching for all files in the recovery area cataloging files... no files cataloged
using channel ORA_DISK_1
List of Backup Pieces BP Key BS Key Pc# Cp# Status Device Type Piece Name ------- ------- --- --- ----------- ----------- ---------- 2 2 1 1 EXPIRED DISK E:\ORG_FULLBACK\03PFIO5N_1_1.BAK
.......................................
Do you really want to delete the above objects (enter YES or NO)? YES
deleted backup piece backup piece handle=E:\ORG_FULLBACK\03PFIO5N_1_1.BAK RECID=2 STAMP=855204024 deleted backup piece backup piece handle=E:\CONTRL_FILE_BK\C-1252729974-20140810-00 RECID=4 STAMP=855 219576 deleted backup piece backup piece handle=E:\CONTRL_FILE_BK\C-1252729974-20140810-01 RECID=5 STAMP=855 239758 deleted backup piece backup piece handle=E:\CONTRL_FILE_BK\C-1252729974-20140810-02 RECID=6 STAMP=855 243672 deleted backup piece backup piece handle=E:\CONTRL_FILE_BK\C-1252729974-20140811-00 RECID=9 STAMP=855 295326 deleted backup piece backup piece handle=E:\CONTRL_FILE_BK\C-1252729974-20140812-00 RECID=12 STAMP=85 5381808 deleted backup piece backup piece handle=E:\CONTRL_FILE_BK\C-1252729974-20140813-00 RECID=15 STAMP=85 5468188 deleted backup piece backup piece handle=E:\CONTRL_FILE_BK\C-1252729974-20140814-00 RECID=18 STAMP=85 5554586 deleted backup piece backup piece handle=E:\CONTRL_FILE_BK\C-1252729974-20140815-00 RECID=21 STAMP=85 5640982 deleted backup piece backup piece handle=E:\CONTRL_FILE_BK\C-1252729974-20140816-00 RECID=24 STAMP=85 5727449 deleted backup piece backup piece handle=E:\CONTRL_FILE_BK\C-1252729974-20140817-00 RECID=27 STAMP=85 5814046 deleted backup piece backup piece handle=E:\CONTRL_FILE_BK\C-1252729974-20140817-01 RECID=30 STAMP=85 5816707 deleted backup piece backup piece handle=E:\CONTRL_FILE_BK\C-1252729974-20140818-00 RECID=33 STAMP=85 5900156 deleted backup piece backup piece handle=E:\CONTRL_FILE_BK\C-1252729974-20140819-00 RECID=36 STAMP=85 5986586 deleted backup piece backup piece handle=E:\ORACLE_FULL_BK\3VPI5N6S_1_1 RECID=123 STAMP=857922794 deleted backup piece backup piece handle=E:\ORACLE_INC_BK\48PICHU2_1_1 RECID=132 STAMP=858146759 deleted backup piece backup piece handle=E:\ORACLE_INC_BK\4BPIF601_1_1 RECID=134 STAMP=858232880 deleted backup piece backup piece handle=E:\ORACLE_INC_BK\4CPIF67P_1_1 RECID=135 STAMP=858233122 deleted backup piece backup piece handle=E:\ORACLE_FULL_BK\4APIF2EP_1_1 RECID=137 STAMP=858229223 deleted backup piece backup piece handle=E:\ORACLE_FULL_BK\4EPIF91H_1_1 RECID=138 STAMP=858235955 deleted backup piece backup piece handle=E:\CONTRL_FILE_BK\C-1252729974-20140914-01 RECID=139 STAMP=8 58235963 deleted backup piece backup piece handle=E:\ORACLE_INC_BK\4GPIHQBF_1_1 RECID=140 STAMP=858319218 deleted backup piece backup piece handle=E:\ORACLE_INC_BK\4HPIHQDV_1_1 RECID=141 STAMP=858319299 deleted backup piece backup piece handle=E:\CONTRL_FILE_BK\C-1252729974-20140915-00 RECID=142 STAMP=8 58319370 deleted backup piece backup piece handle=E:\ORACLE_INC_BK\4JPIKEND_1_1 RECID=143 STAMP=858405617 deleted backup piece backup piece handle=E:\ORACLE_INC_BK\4KPIKEPU_1_1 RECID=144 STAMP=858405709 deleted backup piece backup piece handle=E:\CONTRL_FILE_BK\C-1252729974-20140916-00 RECID=145 STAMP=8 58405789 deleted backup piece backup piece handle=E:\ORACLE_INC_BK\4MPIN33K_1_1 RECID=146 STAMP=858492043 deleted backup piece backup piece handle=E:\ORACLE_INC_BK\4NPIN36P_1_1 RECID=147 STAMP=858492132 deleted backup piece backup piece handle=E:\CONTRL_FILE_BK\C-1252729974-20140917-00 RECID=148 STAMP=8 58492218 deleted backup piece backup piece handle=E:\ORACLE_INC_BK\4PPIPNFC_1_1 RECID=149 STAMP=858578417 deleted backup piece backup piece handle=E:\ORACLE_INC_BK\4QPIPNIB_1_1 RECID=150 STAMP=858578511 deleted backup piece backup piece handle=E:\CONTRL_FILE_BK\C-1252729974-20140918-00 RECID=151 STAMP=8 58578581 deleted backup piece backup piece handle=E:\CONTRL_FILE_BK\C-1252729974-20140918-01 RECID=153 STAMP=8 58586351 deleted backup piece backup piece handle=E:\0918\4UPIPVCT_1_1 RECID=154 STAMP=858586535 deleted backup piece backup piece handle=E:\0918\4VPIQ83P_1_1 RECID=155 STAMP=858595450 deleted backup piece backup piece handle=E:\CONTRL_FILE_BK\C-1252729974-20140918-02 RECID=156 STAMP=8 58595469 deleted backup piece backup piece handle=E:\ORACLE_INC_BK\51PISBSN_1_1 RECID=157 STAMP=858664861 deleted backup piece backup piece handle=E:\ORACLE_INC_BK\52PISBVS_1_1 RECID=158 STAMP=858664970 deleted backup piece backup piece handle=E:\CONTRL_FILE_BK\C-1252729974-20140919-00 RECID=159 STAMP=8 58665048 deleted backup piece backup piece handle=E:\ORACLE_INC_BK\54PIV07G_1_1 RECID=160 STAMP=858751260 deleted backup piece backup piece handle=E:\ORACLE_INC_BK\55PIV0D2_1_1 RECID=161 STAMP=858751400 deleted backup piece backup piece handle=E:\CONTRL_FILE_BK\C-1252729974-20140920-00 RECID=162 STAMP=8 58751478 deleted backup piece backup piece handle=E:\ORACLE_FULL_BK\57PJ1H2R_1_1 RECID=163 STAMP=858834025 deleted backup piece backup piece handle=E:\ORACLE_FULL_BK\58PJ1NLQ_1_1 RECID=164 STAMP=858840791 deleted backup piece backup piece handle=E:\ORACLE_FULL_BK\59PJ1NP9_1_1 RECID=165 STAMP=858840878 deleted backup piece backup piece handle=E:\CONTRL_FILE_BK\C-1252729974-20140921-00 RECID=166 STAMP=8 58840961 deleted backup piece backup piece handle=E:\ORACLE_INC_BK\5BPJ48VA_1_1 RECID=167 STAMP=858924013 deleted backup piece backup piece handle=E:\ORACLE_INC_BK\5CPJ491U_1_1 RECID=168 STAMP=858924098 deleted backup piece backup piece handle=E:\CONTRL_FILE_BK\C-1252729974-20140922-00 RECID=169 STAMP=8 58924163 deleted backup piece backup piece handle=E:\ORACLE_INC_BK\5EPJ6TBC_1_1 RECID=170 STAMP=859010427 deleted backup piece backup piece handle=E:\ORACLE_INC_BK\5FPJ6TES_1_1 RECID=171 STAMP=859010529 Deleted 52 objects
7、注册新的备份集(按日期依次注册,第一个是距恢复日期前的最近的一次全备份)
RMAN> catalog backuppiece 'f:\57PJ1H2R_1_1';
cataloged backup piece backup piece handle=F:\57PJ1H2R_1_1 RECID=172 STAMP=859064129
RMAN> catalog backuppiece 'f:\58PJ1NLQ_1_1';
cataloged backup piece backup piece handle=F:\58PJ1NLQ_1_1 RECID=173 STAMP=859064143
RMAN> catalog backuppiece 'f:\59PJ1NP9_1_1';
cataloged backup piece backup piece handle=F:\59PJ1NP9_1_1 RECID=174 STAMP=859064162
RMAN> catalog backuppiece 'f:\5BPJ48VA_1_1';
cataloged backup piece backup piece handle=F:\5BPJ48VA_1_1 RECID=175 STAMP=859064178
RMAN> catalog backuppiece 'f:\5CPJ491U_1_1';
cataloged backup piece backup piece handle=F:\5CPJ491U_1_1 RECID=176 STAMP=859064195
RMAN> catalog backuppiece 'f:\5EPJ6TBC_1_1';
cataloged backup piece backup piece handle=F:\5EPJ6TBC_1_1 RECID=177 STAMP=859064226
RMAN> catalog backuppiece 'f:\5FPJ6TES_1_1';
cataloged backup piece backup piece handle=F:\5FPJ6TES_1_1 RECID=178 STAMP=859064245
8、恢复数据库(更改文件路径) 命令发出后,是漫长的等待,大概2个小时.......
RMAN>run{
set newname for datafile 1 to 'D:\APP\ORADATA\ORCL\SYSTEM01.DBF'; set newname for datafile 2 to 'D:\APP\ORADATA\ORCL\SYSAUX01.DBF'; set newname for datafile 3 to 'D:\APP\ORADATA\ORCL\UNDOTBS01.DBF'; set newname for datafile 4 to 'D:\APP\ORADATA\ORCL\USERS01.DBF'; set newname for datafile 5 to 'D:\JDEDWARDS\ORCL\SY900T01.DBF'; set newname for datafile 6 to 'D:\JDEDWARDS\ORCL\SY900I01.DBF'; set newname for datafile 7 to 'D:\JDEDWARDS\ORCL\SVM900T01.DBF'; set newname for datafile 8 to 'D:\JDEDWARDS\ORCL\SVM900I01.DBF'; set newname for datafile 9 to 'D:\JDEDWARDS\ORCL\OL900T01.DBF'; set newname for datafile 10 to 'D:\JDEDWARDS\ORCL\OL900I01.DBF'; set newname for datafile 11 to 'D:\JDEDWARDS\ORCL\DD900T01.DBF'; set newname for datafile 12 to 'D:\JDEDWARDS\ORCL\DD900I01.DBF'; set newname for datafile 13 to 'D:\JDEDWARDS\ORCL\PD900T01.DBF'; set newname for datafile 14 to 'D:\JDEDWARDS\ORCL\PD900T02.DBF'; set newname for datafile 15 to 'D:\JDEDWARDS\ORCL\PD900I01.DBF'; set newname for datafile 16 to 'D:\JDEDWARDS\ORCL\PRODCTLI01.DBF'; set newname for datafile 17 to 'D:\JDEDWARDS\ORCL\PRODCTLT01.DBF'; set newname for datafile 18 to 'D:\JDEDWARDS\ORCL\PRODDTAI01.DBF'; set newname for datafile 19 to 'D:\JDEDWARDS\ORCL\PRODDTAT01.DBF'; set newname for datafile 20 to 'D:\JDEDWARDS\ORCL\PY900T01.DBF'; set newname for datafile 21 to 'D:\JDEDWARDS\ORCL\PY900T02.DBF'; set newname for datafile 22 to 'D:\JDEDWARDS\ORCL\PY900I01.DBF'; set newname for datafile 23 to 'D:\JDEDWARDS\ORCL\CRPCTLI01.DBF'; set newname for datafile 24 to 'D:\JDEDWARDS\ORCL\CRPCTLT01.DBF'; set newname for datafile 25 to 'D:\JDEDWARDS\ORCL\CRPDTAI01.DBF'; set newname for datafile 26 to 'D:\JDEDWARDS\ORCL\CRPDTAT01.DBF'; set newname for datafile 27 to 'D:\JDEDWARDS\ORCL\DV900T01.DBF'; set newname for datafile 28 to 'D:\JDEDWARDS\ORCL\DV900T02.DBF'; set newname for datafile 29 to 'D:\JDEDWARDS\ORCL\DV900I01.DBF'; set newname for datafile 30 to 'D:\JDEDWARDS\ORCL\TESTCTLI01.DBF'; set newname for datafile 31 to 'D:\JDEDWARDS\ORCL\TESTCTLT01.DBF'; set newname for datafile 32 to 'D:\JDEDWARDS\ORCL\TESTDTAI01.DBF'; set newname for datafile 33 to 'D:\JDEDWARDS\ORCL\TESTDTAT01.DBF'; set newname for datafile 34 to 'D:\JDEDWARDS\ORCL\PS900T01.DBF'; set newname for datafile 35 to 'D:\JDEDWARDS\ORCL\PS900T02.DBF'; set newname for datafile 36 to 'D:\JDEDWARDS\ORCL\PS900I01.DBF'; set newname for datafile 37 to 'D:\JDEDWARDS\ORCL\PS900CTLI01.DBF'; set newname for datafile 38 to 'D:\JDEDWARDS\ORCL\PS900CTLT01.DBF'; set newname for datafile 39 to 'D:\JDEDWARDS\ORCL\PS900DTAI01.DBF'; set newname for datafile 40 to 'D:\JDEDWARDS\ORCL\PS900DTAT01.DBF'; set newname for datafile 41 to 'D:\JDEDWARDS\ORCL\SVM900BT01.DBF'; set newname for datafile 42 to 'D:\JDEDWARDS\ORCL\SVM900BI01.DBF'; set newname for datafile 43 to 'D:\JDEDWARDS\ORCL\CRPDTAT02.DBF'; set newname for datafile 44 to 'D:\JDEDWARDS\ORCL\CRPDTAT03.DBF'; set newname for datafile 45 to 'D:\JDEDWARDS\ORCL\PRODDTAT02.DBF'; set newname for datafile 46 to 'D:\JDEDWARDS\ORCL\PRODDTAT03.DBF'; set newname for datafile 47 to 'D:\APP\ORADATA\ORCL\TESTDTAT02.DBF'; set newname for datafile 48 to 'D:\JDEDWARDS\ORCL\PRODDTAT04.DBF'; set newname for datafile 49 to 'D:\JDEDWARDS\ORCL\CRPDTAT04.DBF'; set newname for datafile 50 to 'D:\JDEDWARDS\ORCL\CRPDTAT05.DBF'; set newname for datafile 51 to 'D:\JDEDWARDS\ORCL\CRPDTAI02.DBF'; set newname for datafile 52 to 'D:\JDEDWARDS\ORCL\CRPDTAT06.DBF'; set newname for datafile 53 to 'D:\JDEDWARDS\ORCL\PRODDTAT06.DBF'; set newname for datafile 54 to 'D:\JDEDWARDS\ORCL\PRODDTAT05.DBF'; set newname for datafile 55 to 'D:\JDEDWARDS\ORCL\SVM900BT02.DBF'; set newname for datafile 56 to 'D:\APP\ORADATA\ORCL\SYSTEM02.DBF'; set newname for datafile 57 to 'D:\JDEDWARDS\ORCL\PRODDTAI02.DBF'; set newname for datafile 58 to 'D:\JDEDWARDS\ORCL\PRODDTAT07.DBF'; set newname for datafile 59 to 'D:\JDEDWARDS\ORCL\PRODDTAT08.DBF'; set newname for datafile 60 to 'D:\JDEDWARDS\ORCL\PRODDTAT09.DBF'; set newname for datafile 61 to 'D:\JDEDWARDS\ORCL\PRODDTAT10.DBF'; set newname for datafile 62 to 'D:\APP\ORADATA\ORCL\SVM900T02.DBF'; restore database; }
9、转换文件路径
RMAN> run{ set newname for datafile 1 to 'D:\APP\ORADATA\ORCL\SYSTEM01.DBF'; set newname for datafile 2 to 'D:\APP\ORADATA\ORCL\SYSAUX01.DBF'; set newname for datafile 3 to 'D:\APP\ORADATA\ORCL\UNDOTBS01.DBF'; set newname for datafile 4 to 'D:\APP\ORADATA\ORCL\USERS01.DBF'; set newname for datafile 5 to 'D:\JDEDWARDS\ORCL\SY900T01.DBF'; set newname for datafile 6 to 'D:\JDEDWARDS\ORCL\SY900I01.DBF'; set newname for datafile 7 to 'D:\JDEDWARDS\ORCL\SVM900T01.DBF'; set newname for datafile 8 to 'D:\JDEDWARDS\ORCL\SVM900I01.DBF'; set newname for datafile 9 to 'D:\JDEDWARDS\ORCL\OL900T01.DBF'; set newname for datafile 10 to 'D:\JDEDWARDS\ORCL\OL900I01.DBF'; set newname for datafile 11 to 'D:\JDEDWARDS\ORCL\DD900T01.DBF'; set newname for datafile 12 to 'D:\JDEDWARDS\ORCL\DD900I01.DBF'; set newname for datafile 13 to 'D:\JDEDWARDS\ORCL\PD900T01.DBF'; set newname for datafile 14 to 'D:\JDEDWARDS\ORCL\PD900T02.DBF'; set newname for datafile 15 to 'D:\JDEDWARDS\ORCL\PD900I01.DBF'; set newname for datafile 16 to 'D:\JDEDWARDS\ORCL\PRODCTLI01.DBF'; set newname for datafile 17 to 'D:\JDEDWARDS\ORCL\PRODCTLT01.DBF'; set newname for datafile 18 to 'D:\JDEDWARDS\ORCL\PRODDTAI01.DBF'; set newname for datafile 19 to 'D:\JDEDWARDS\ORCL\PRODDTAT01.DBF'; set newname for datafile 20 to 'D:\JDEDWARDS\ORCL\PY900T01.DBF'; set newname for datafile 21 to 'D:\JDEDWARDS\ORCL\PY900T02.DBF'; set newname for datafile 22 to 'D:\JDEDWARDS\ORCL\PY900I01.DBF'; set newname for datafile 23 to 'D:\JDEDWARDS\ORCL\CRPCTLI01.DBF'; set newname for datafile 24 to 'D:\JDEDWARDS\ORCL\CRPCTLT01.DBF'; set newname for datafile 25 to 'D:\JDEDWARDS\ORCL\CRPDTAI01.DBF'; set newname for datafile 26 to 'D:\JDEDWARDS\ORCL\CRPDTAT01.DBF'; set newname for datafile 27 to 'D:\JDEDWARDS\ORCL\DV900T01.DBF'; set newname for datafile 28 to 'D:\JDEDWARDS\ORCL\DV900T02.DBF'; set newname for datafile 29 to 'D:\JDEDWARDS\ORCL\DV900I01.DBF'; set newname for datafile 30 to 'D:\JDEDWARDS\ORCL\TESTCTLI01.DBF'; set newname for datafile 31 to 'D:\JDEDWARDS\ORCL\TESTCTLT01.DBF'; set newname for datafile 32 to 'D:\JDEDWARDS\ORCL\TESTDTAI01.DBF'; set newname for datafile 33 to 'D:\JDEDWARDS\ORCL\TESTDTAT01.DBF'; set newname for datafile 34 to 'D:\JDEDWARDS\ORCL\PS900T01.DBF'; set newname for datafile 35 to 'D:\JDEDWARDS\ORCL\PS900T02.DBF'; set newname for datafile 36 to 'D:\JDEDWARDS\ORCL\PS900I01.DBF'; set newname for datafile 37 to 'D:\JDEDWARDS\ORCL\PS900CTLI01.DBF'; set newname for datafile 38 to 'D:\JDEDWARDS\ORCL\PS900CTLT01.DBF'; set newname for datafile 39 to 'D:\JDEDWARDS\ORCL\PS900DTAI01.DBF'; set newname for datafile 40 to 'D:\JDEDWARDS\ORCL\PS900DTAT01.DBF'; set newname for datafile 41 to 'D:\JDEDWARDS\ORCL\SVM900BT01.DBF'; set newname for datafile 42 to 'D:\JDEDWARDS\ORCL\SVM900BI01.DBF'; set newname for datafile 43 to 'D:\JDEDWARDS\ORCL\CRPDTAT02.DBF'; set newname for datafile 44 to 'D:\JDEDWARDS\ORCL\CRPDTAT03.DBF'; set newname for datafile 45 to 'D:\JDEDWARDS\ORCL\PRODDTAT02.DBF'; set newname for datafile 46 to 'D:\JDEDWARDS\ORCL\PRODDTAT03.DBF'; set newname for datafile 47 to 'D:\APP\ORADATA\ORCL\TESTDTAT02.DBF'; set newname for datafile 48 to 'D:\JDEDWARDS\ORCL\PRODDTAT04.DBF'; set newname for datafile 49 to 'D:\JDEDWARDS\ORCL\CRPDTAT04.DBF'; set newname for datafile 50 to 'D:\JDEDWARDS\ORCL\CRPDTAT05.DBF'; set newname for datafile 51 to 'D:\JDEDWARDS\ORCL\CRPDTAI02.DBF'; set newname for datafile 52 to 'D:\JDEDWARDS\ORCL\CRPDTAT06.DBF'; set newname for datafile 53 to 'D:\JDEDWARDS\ORCL\PRODDTAT06.DBF'; set newname for datafile 54 to 'D:\JDEDWARDS\ORCL\PRODDTAT05.DBF'; set newname for datafile 55 to 'D:\JDEDWARDS\ORCL\SVM900BT02.DBF'; set newname for datafile 56 to 'D:\APP\ORADATA\ORCL\SYSTEM02.DBF'; set newname for datafile 57 to 'D:\JDEDWARDS\ORCL\PRODDTAI02.DBF'; set newname for datafile 58 to 'D:\JDEDWARDS\ORCL\PRODDTAT07.DBF'; set newname for datafile 59 to 'D:\JDEDWARDS\ORCL\PRODDTAT08.DBF'; set newname for datafile 60 to 'D:\JDEDWARDS\ORCL\PRODDTAT09.DBF'; set newname for datafile 61 to 'D:\JDEDWARDS\ORCL\PRODDTAT10.DBF'; set newname for datafile 62 to 'D:\APP\ORADATA\ORCL\SVM900T02.DBF'; switch datafile all; }
10、更改redo文件位置(用sqlplus,另开窗口)
C:\Users\Administrator>sqlplus sys as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Mon Sep 22 15:18:20 2014
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Enter password:
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> ALTER DATABASE RENAME FILE 'E:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO01.LOG' to 'D:\APP\ORADATA\ORCL\REDO01.LOG'; SQL> ALTER DATABASE RENAME FILE 'E:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO02.LOG' to 'D:\APP\ORADATA\ORCL\REDO02.LOG'; SQL> ALTER DATABASE RENAME FILE 'E:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO03.LOG' to 'D:\APP\ORADATA\ORCL\REDO03.LOG'; SQL> ALTER DATABASE RENAME FILE 'E:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO04.LOG' to 'D:\APP\ORADATA\ORCL\REDO04.LOG'; SQL> ALTER DATABASE RENAME FILE 'E:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO05.LOG' to 'D:\APP\ORADATA\ORCL\REDO05.LOG'; SQL> ALTER DATABASE RENAME FILE 'E:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO01B.LOG' to 'D:\APP\ORADATA\ORCL\REDO01B.LOG'; SQL> ALTER DATABASE RENAME FILE 'E:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO02B.LOG' to 'D:\APP\ORADATA\ORCL\REDO02B.LOG'; SQL> ALTER DATABASE RENAME FILE 'E:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO03B.LOG' to 'D:\APP\ORADATA\ORCL\REDO03B.LOG'; SQL> ALTER DATABASE RENAME FILE 'E:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO04B.LOG' to 'D:\APP\ORADATA\ORCL\REDO04B.LOG';
可以一同复制粘贴下边的到Sqlplus:
ALTER DATABASE RENAME FILE 'E:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO01.LOG' to 'D:\APP\ORADATA\ORCL\REDO01.LOG';
ALTER DATABASE RENAME FILE 'E:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO02.LOG' to 'D:\APP\ORADATA\ORCL\REDO02.LOG';
ALTER DATABASE RENAME FILE 'E:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO03.LOG' to 'D:\APP\ORADATA\ORCL\REDO03.LOG';
ALTER DATABASE RENAME FILE 'E:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO04.LOG' to 'D:\APP\ORADATA\ORCL\REDO04.LOG';
ALTER DATABASE RENAME FILE 'E:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO05.LOG' to 'D:\APP\ORADATA\ORCL\REDO05.LOG';
ALTER DATABASE RENAME FILE 'E:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO01B.LOG' to 'D:\APP\ORADATA\ORCL\REDO01B.LOG';
ALTER DATABASE RENAME FILE 'E:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO02B.LOG' to 'D:\APP\ORADATA\ORCL\REDO02B.LOG';
ALTER DATABASE RENAME FILE 'E:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO03B.LOG' to 'D:\APP\ORADATA\ORCL\REDO03B.LOG';
ALTER DATABASE RENAME FILE 'E:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO04B.LOG' to 'D:\APP\ORADATA\ORCL\REDO04B.LOG';
11、recover database (注册了几天的日志,就恢复几天的,时间视注册的日志个数)
RMAN>recover database;
........(稍漫长的等待)
12、根据上步执行结果 执行 下句(注意Sequence的更改)
RMAN>run{ set until sequence 366246 thread 1; recover database; }
executing command: SET until clause
Starting recover at 24-SEP-14 using channel ORA_DISK_1
starting media recovery media recovery complete, elapsed time: 00:00:03
Finished recover at 24-SEP-14
13、重置日志,打开数据库
RMAN> alter database open resetlogs;
database opened
14、关闭重新打开数据库,测试
RMAN> shutdown immediate;
database closed database dismounted Oracle instance shut down
RMAN> startup
connected to target database (not started) Oracle instance started database mounted database opened
Total System Global Area 16535285760 bytes
Fixed Size 2192176 bytes Variable Size 7113542864 bytes Database Buffers 9395240960 bytes Redo Buffers 24309760 bytes
RMAN>
(成功恢复)
Oracle 数据库异机恢复(归档模式)的更多相关文章
- Oracle数据库异机升级
环境: A机:RHEL5.5 + Oracle 10.2.0.4 B机:RHEL5.5 需求: A机10.2.0.4数据库,在B机升级到11.2.0.4,应用最新PSU补丁程序. 目录: 一. 确认是 ...
- Oracle 11g 异机恢复参考文档
原库 目标库 操作系统 CentOS 6.4 CentOS 6.4 主机名 sht-sgmhadoopnn-01 sht-sgmhadoopnn-02 IP 172.16.101.55 172.1 ...
- oracle rman异机恢复
Oracle源主机 Oracle目标主机 主机平台 CentOS6.2(final) CentOs6.2(FInal) 主机名 vick rman IP地址 192.168.1.11 192.16 ...
- KingbaseES R6 单节点数据库异机恢复案例
数据库运行硬件或系统环境如果发生了不可恢复的故障,这时只能采用异机恢复的方式恢复数据库.以下通过例子介绍异机恢复的过程. 一.硬件环境 192.168.237.101 数据库运行源主机 192.168 ...
- Oracle RMAN 异机恢复一例
背景介绍:本例需求是将NBU备份的oracle数据库恢复到另一主机上. NBU环境配置.异机上的Oracle软件安装配置忽略,下面只介绍OracleDB恢复的过程. ----------------- ...
- RMAN数据库异机迁移步骤
--RMAN数据库异机迁移步骤----------------------------2013/09/28 测试环境:AIX+ora11g 一. source数据库准备. 1.获取数据文件编号 ...
- 使用不同用户对Oracle数据库进行异机恢复,失败,错误:Backup file not found in NetBackup catalog
最近做某数据库恢复演练,数据库版本是10.2.0.4,恢复控制文件一直报错,报错如下,经过反复折腾,原来恢复机上oracle用户不是oracle导致(我的是oraclev4),查看源库oracle用户 ...
- Oracle备份恢复之热备份恢复及异机恢复
原理: 数据库必须运行在归档模式下,否则备份没有意义.备份前冻结块头,使scn号不变化,然后cp物理文件,最后解冻块头.此过程dml语句可以正常执行,动作被写在日志文件里面,当解冻scn号后,日志文件 ...
- Hyper-V安装Oracle Linux6_4 Oracle db 12c并使用rman做异机恢复
本文记录在Windows Server 2012 R2上安装Oracle Enterprise Linux 6.4以及使用RMAN进行进行异机恢复的过程. Windows服务器增加Hyper-V功能 ...
随机推荐
- Android---16进制与字节数组
16进制字符串与字节数组进行转换 package string; import java.util.Arrays; /** * byte[]与16进制字符串相互转换 * * @date:2017年4月 ...
- [Maven]Codehaus的Maven Repository地址
In ~/.m2/settings.xml you can update the URL to be used for specific repositories. For example: < ...
- 【算法笔记】B1029 旧键盘
1029 旧键盘 (20 分) 旧键盘上坏了几个键,于是在敲一段文字的时候,对应的字符就不会出现.现在给出应该输入的一段文字.以及实际被输入的文字,请你列出肯定坏掉的那些键. 输入格式: 输入在 2 ...
- 蓝桥-青蛙跳杯子(bfs)
问题描述 X星球的流行宠物是青蛙,一般有两种颜色:白色和黑色. X星球的居民喜欢把它们放在一排茶杯里,这样可以观察它们跳来跳去. 如下图,有一排杯子,左边的一个是空着的,右边的杯子,每个里边有一只青蛙 ...
- Codeforces 1136D Nastya Is Buying Lunch (贪心)
题意: 给一个序列和一组交换序列(a,b),当且仅当a在b的前面(不允许有间隔),这两个数才能交换,问最后一个数最多能移动多少个位置. 分析: 这题是思路是十分的巧妙呀 , 用一个数组num[x] ...
- 补档 VS远程调试
先说概念 开发机:将编译好的程序部署到目标机器上执行.配置 VS 工程,建立与目标机的连接,开始远程调试. 目标机:负责执行目标程序.安装和运行远程工具 (Remote Debugger),等待来自开 ...
- UESTC - 1692 注意DP顺序
#include<iostream> #include<algorithm> #include<cstdio> #include<cstring> #i ...
- layer.open中content里面的元素追加click事件,触发不了
[注意] 事件要追加在触发弹出事件的点击事件里面 $('#feedback').click(function(){ layer.open({ content:'<div><div c ...
- Tomcat启动分析
[转自] http://docs.huihoo.com/apache/tomcat/heavyz/01-startup.html 1 - Tomcat Server的组成部分 1.1 - Server ...
- 采用MQTT协议实现android消息推送(1)MQTT 协议简介
1.资料 mqtt官网 http://mqtt.org/ 服务端程序列表 https://github.com/mqtt/mqtt.github.io/wiki/servers 客户端库列表 http ...