Starting restore at 2019:04:14 23:39:42 using channel ORA_DISK_1 using channel ORA_DISK_2 using channel ORA_DISK_3
List of Backups =============== Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag ------- -- -- - ----------- ------------------- ------- ------- ---------- --- 644 B 0 A DISK 2019:04:14 23:36:43 1 1 YES TAG20190414T233619 652 B 1 A DISK 2019:04:14 23:37:36 1 1 YES TAG20190414T233735 645 B 0 A DISK 2019:04:14 23:36:56 1 1 YES TAG20190414T233619 653 B 1 A DISK 2019:04:14 23:37:36 1 1 YES TAG20190414T233735 641 B 0 A DISK 2019:04:14 23:36:24 1 1 YES TAG20190414T233619 655 B 1 A DISK 2019:04:14 23:37:40 1 1 YES TAG20190414T233735 640 B 0 A DISK 2019:04:14 23:36:21 1 1 YES TAG20190414T233619 654 B 1 A DISK 2019:04:14 23:37:36 1 1 YES TAG20190414T233735
archived logs generated after SCN 103084444 not found in repository Media recovery start SCN is 103084444 Recovery must be done beyond SCN 103084453 to clear datafile fuzziness Finished restore at 2019:04:14 23:39:42
3、完全恢复
1 2 3 4 5 6
startup force mount; run { restore database; recover database; alter database open; }
4、根据scn值进行不完整恢复
1 2 3 4 5 6
startup force mount; run { restore database until scn 103233673; recover database until scn 103233673; alter database open resetlogs; }
20:06:51 SYS@ boston> shutdown immediate; ORA-01116: error in opening database file 4 ORA-01110: data file 4: '/data/u01/app/oracle/oradata/boston/users01.dbf' ORA-27041: unable to open file Linux-x86_64 Error: 2: No such file or directory Additional information: 3 20:06:59 SYS@ boston> exit
5.3、使用rman的Data Recovery Advisor功能去修复:
列出信息list failure
1 2 3 4 5 6 7 8
RMAN> list failure; using target database control file instead of recovery catalog List of Database Failures =========================
Failure ID Priority Status Time Detected Summary ---------- -------- --------- ------------------- ------- 98722 HIGH OPEN 2019:04:18 20:07:00 One or more non-system datafiles are missing
List of Database Failures =========================
Failure ID Priority Status Time Detected Summary ---------- -------- --------- ------------------- ------- 98722 HIGH OPEN 2019:04:18 20:07:00 One or more non-system datafiles are missing
analyzing automatic repair options; this may take some time allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=590 device type=DISK allocated channel: ORA_DISK_2 channel ORA_DISK_2: SID=6 device type=DISK allocated channel: ORA_DISK_3 channel ORA_DISK_3: SID=201 device type=DISK analyzing automatic repair options complete
Mandatory Manual Actions ======================== no manual actions available
Optional Manual Actions ======================= 1. If file /data/u01/app/oracle/oradata/boston/users01.dbf was unintentionally renamed or moved, restore it
Automated Repair Options ======================== Option Repair Description ------ ------------------ 1 Restore and recover datafile 4 Strategy: The repair includes complete media recovery with no data loss Repair script: /data/u01/app/oracle/diag/rdbms/boston/boston/hm/reco_16185943.hm
Strategy: The repair includes complete media recovery with no data loss Repair script: /data/u01/app/oracle/diag/rdbms/boston/boston/hm/reco_16185943.hm
NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_recovery_file_dest string /data/u01/app/oracle/fast_reco very_area
6.1.4、数据库下的所有表空间闪回功能必须都开启,有一个没有开启闪回,无没有办法闪回数据库
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
03:10:58 SYS@ boston> select name,flashback_on from v$tablespace; NAME FLA ------------------------------ --- SYSTEM YES SYSAUX YES UNDOTBS1 YES USERS YES TEMP YES TEST YES TEST11 YES ZEVEN YES 8 rows selected. 如果某个表空间没有开启闪回,使用以下命令开启: altertablespaceusersflashbackon;(注意与alterdatabaseflashbackon的先后顺序,如果是tablespace的闪回开启在database的闪回之后,需要先关系database闪回alterdatabaseflashbackoff;在开启database 闪回alterdatabaseflashbackon; 否则闪回的时候会报错: ORA-38753: Cannot flashback data file 4; no flashback log data. ORA-01110: data file 4: '/data/u01/app/oracle/oradata/boston/users01.dbf'
创建还原点: CREATERESTORE POINT good_data; 查看还原点: 22:47:04 SYS@ boston> select * from v$restore_point; SCN DATABASE_INCARNATION# GUA STORAGE_SIZE TIME RESTORE_POINT_TIME PRE NAME ---------- --------------------- --- ------------ ---------------------------------------------- 103328091 19 NO 0 19-APR-19 10.47.04.000000000 PM NO GOOD_DATA
6.2.2.3 还原到某个时间点
1 2 3 4 5 6 7
FLASHBACK DATABASE TO TIMESTAMP TO_DATE('18-Apr-19 10:41:41','DD-MON-YYYY HH24:MI:SS');