不完全恢复:- resetlogs
- using backup controlfile - 告诉Oracle,使用的controlfile是旧的
查询一个table所属的tablespace:
SQL> select tablespace_name from tabs where table_name = 'T';
TABLESPACE_NAME
------------------------------------------------------------
SYSTEM
SQL> startup nomount
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE 例程已经启动。
Total System Global Area 2137886720 bytes
Fixed Size 2177456 bytes
Variable Size 1258292816 bytes
Database Buffers 872415232 bytes
Redo Buffers 5001216 bytes
SQL> alter database mount;
数据库已更改。
SQL> select file#, checkpoint_change# from v$datafile;
FILE# CHECKPOINT_CHANGE#
---------- ------------------
1 1249453
2 1249453
3 1249453
4 1249453
5 1249453
SQL> select file#, checkpoint_change# from v$datafile_header;
FILE# CHECKPOINT_CHANGE#
---------- ------------------
1 1249453
2 1249453
3 1249453
4 1249453
5 1249453
SQL> recover database;
ORA-00283: recovery session canceled due to errors
ORA-00264: no recovery required
SQL> recover database using backup controlfile;
ORA-00279: ?? 1249453 (? 10/17/2012 20:58:40 ??) ???? 1 ????
ORA-00289: ??:
D:\APP\ADMINISTRATOR\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2012_10_17\O1_MF_1_36_8
7XC8NM5_.ARC
ORA-00280: ?? 1249453 (???? 1) ??? #36 ?
指定日志: {<RET>=suggested | filename | AUTO | CANCEL}
ORA-00308: cannot open archived log
'D:\APP\ADMINISTRATOR\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2012_10_17\O1_MF_1_41_
%U_.ARC'
ORA-27041: unable to open file
OSD-04002: ????????????
O/S-Error: (OS 2) ??????????????????????
SQL> recover database using backup controlfile;
ORA-00279: ?? 1249853 (? 10/17/2012 21:06:30 ??) ???? 1 ????
ORA-00289: ??:
D:\APP\ADMINISTRATOR\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2012_10_17\O1_MF_1_41_%
U_.ARC
ORA-00280: ?? 1249853 (???? 1) ??? #41 ?
指定日志: {<RET>=suggested | filename | AUTO | CANCEL}
D:\app\Administrator\oradata\orcl\REDO02.log
已应用的日志。
完成介质恢复。
SQL> select file#, checkpoint_change# from v$datafile;
FILE# CHECKPOINT_CHANGE#
---------- ------------------
1 1250129
2 1250129
3 1250129
4 1250129
5 1250129
SQL> select file#, checkpoint_change# from v$datafile_header;
FILE# CHECKPOINT_CHANGE#
---------- ------------------
1 1250129
2 1250129
3 1250129
4 1250129
5 1250129 SQL> alter database open resetlogs;
数据库已更改。
恢复,永远都是恢复的数据文件:如果控制文件损坏了,但是数据文件没有损坏;则在恢复的时候,仅仅就是验证数据文件,不会更改checkpoint_change#.
备份:- 完全脱机备份 - shutdown - 现实环境中,shutdown危机无限
- 部分脱机备份 - offline - system 等datafile无法offline备份
- 部分联机备份 - online - 会产生很多的log file
都需要物理的copy,至于copy的file中有多少有用数据,备份不关心。
现实环境中,file可能GT级别,copy会占用很多时间。