- 最后登录
- 2017-5-4
- 在线时间
- 81 小时
- 威望
- 999
- 金钱
- 2391
- 注册时间
- 2013-9-11
- 阅读权限
- 150
- 帖子
- 1124
- 精华
- 5
- 积分
- 999
- UID
- 1220
|
1#
发表于 2017-4-15 10:00:53
|
查看: 1483 |
回复: 1
RMAN> resotre database;
RMAN> recover database;
Starting recover at 08-APR-13
using channel ORA_DISK_1
using channel ORA_DISK_2
starting media recovery
Oracle Error:
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: '/u01/oradata/orcl/system01.dbf'
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 04/08/2013 08:17:17
ORA-01013: user requested cancel of current operation
RMAN> alter database open resetlogs;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 04/08/2013 08:19:13
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: '/u01/oradata/orcl/system01.dbf'
[oracle@qht107 orcl]$ mv system01.dbf system01.dbf.bak
RMAN> restore datafile 1;
Starting restore at 08-APR-13
using channel ORA_DISK_1
using channel ORA_DISK_2
skipping datafile 1; already restored to file /u01/oradata/orcl/system01.dbf
restore not done; all files readonly, offline, or already restored
Finished restore at 08-APR-13
没有冷备份。
做一次restore database要9个小时,现在只想尽快打开数据库,丢失点数据也没有关系 。
RMAN> list incarnation;
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 1 ORCL 1186970342 PARENT 1 17-FEB-08
2 2 ORCL 1186970342 CURRENT 464631 04-JUL-08
是不是不应该用alter database open resetlogs?
SQL> select file#,TS#, RFILE#, STATUS ,NAME, CHECKPOINT_CHANGE# from v$datafile ;
FILE# TS# RFILE# STATUS NAME CHECKPOINT_CHANGE#
----- ---------- ---------- ------- -------------------------------------------------- ------------------
1 0 1 SYSTEM /u01/oradata/orcl/system01.dbf 3689127636
2 1 2 ONLINE /u01/oradata/orcl/undotbs01.dbf 3689119946
3 2 3 ONLINE /u01/oradata/orcl/sysaux01.dbf 3689127636
4 4 4 ONLINE /u01/oradata/orcl/users01.dbf 3689022893
5 49 5 ONLINE /u01/oradata/orcl/MP2009_01.dbf 3689048377
6 7 6 ONLINE /u01/oradata/orcl/B4SPACE_01.dbf 3689120572
7 8 7 ONLINE /u01/oradata/orcl/clt_stats01.dbf 3689040988
8 56 8 ONLINE /u01/oradata/orcl/mtrxspace01.dbf 3689124025
9 10 9 ONLINE /u01/oradata/orcl/L5MSPACE01.dbf 3689127636
10 20 10 ONLINE /u01/oradata/orcl/C203SPACE_01.dbf 3689022893
11 22 11 ONLINE /u01/oradata/orcl/D1SPACE_002.dbf 3689127636
FILE# TS# RFILE# STATUS NAME CHECKPOINT_CHANGE#
----- ---------- ---------- ------- -------------------------------------------------- ------------------
12 13 12 ONLINE /u01/oradata/orcl/PBRSPACE01.dbf 3689125518
13 13 13 ONLINE /u01/oradata/orcl/PBRSPACE02.dbf 3689124025
14 13 14 ONLINE /u01/oradata/orcl/PBRSPACE03.dbf 3689124025
15 56 15 ONLINE /u01/oradata/orcl/mtrxspace02.dbf 3689124025
16 45 16 ONLINE /u01/oradata/orcl/MP2008_03.dbf 3689121641
17 45 17 ONLINE /u01/oradata/orcl/MP2008_04.dbf 3689122622
18 45 18 ONLINE /u01/oradata/orcl/MP2008_05.dbf 3689124683
19 45 19 ONLINE /u01/oradata/orcl/MP2008_06.dbf 3689124683
20 56 20 ONLINE /u01/oradata/orcl/mtrxspace03.dbf 3689124025
21 56 21 ONLINE /u01/oradata/orcl/mtrxspace04.dbf 3689124025
22 56 22 ONLINE /u01/oradata/orcl/mtrxspace05.dbf 3689124025
...
FILE# TS# RFILE# STATUS NAME CHECKPOINT_CHANGE#
----- ---------- ---------- ------- -------------------------------------------------- ------------------
229 75 229 ONLINE /u02/oradata/orcl/fus2008_007.dbf_bk 3689140179
199 rows selected.
SQL> select file#,status, CHECKPOINT_CHANGE#,name from v$datafile_header;
FILE# STATUS CHECKPOINT_CHANGE# NAME
----- ------- ------------------ --------------------------------------------------
1 ONLINE 3689127636 /u01/oradata/orcl/system01.dbf
2 ONLINE 3689119946 /u01/oradata/orcl/undotbs01.dbf
3 ONLINE 3689127636 /u01/oradata/orcl/sysaux01.dbf
4 ONLINE 3689022893 /u01/oradata/orcl/users01.dbf
5 ONLINE 3689048377 /u01/oradata/orcl/MP2009_01.dbf
6 ONLINE 3689120572 /u01/oradata/orcl/B4SPACE_01.dbf
7 ONLINE 3689040988 /u01/oradata/orcl/clt_stats01.dbf
8 ONLINE 3689124025 /u01/oradata/orcl/mtrxspace01.dbf
9 ONLINE 3689127636 /u01/oradata/orcl/L5MSPACE01.dbf
10 ONLINE 3689022893 /u01/oradata/orcl/C203SPACE_01.dbf
11 ONLINE 3689127636 /u01/oradata/orcl/D1SPACE_002.dbf
。。。
FILE# STATUS CHECKPOINT_CHANGE# NAME
----- ------- ------------------ --------------------------------------------------
229 ONLINE 3689140179 /u02/oradata/orcl/fus2008_007.dbf_bk
199 rows selected.
SQL> alter database open read only;
alter database open read only
*
ERROR at line 1:
ORA-16004: backup database requires recovery
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: '/u01/oradata/orcl/system01.dbf'
这个库平时不开archive log的,我只需将这个0级rman备份集恢复过来。这段时间的数据丢失了我可以想办法 。
是0级的rman,备份的脚本在这:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u01/RMAN/%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO COMPRESSED BACKUPSET;
run {
crosscheck archivelog all;
delete expired archivelog all;
crosscheck backup;
delete expired backup;
allocate channel c1 type disk;
backup incremental level 0 database format '/u01/RMAN/db0%u_%s_%p.bak' filesperset 3 include current controlfile;
sql 'alter system archive log current';
backup filesperset 1 format '/u01/RMAN/arch%u_%s_%p.bak' archivelog all delete input;
release channel c1;
}
exit;
~
备份集在这:
[oracle@qht107 RMAN]$ ls
arch2io0s23h_82_1.bak db00bo0qm2n_11_1.bak db00po0r9q7_25_1.bak db017o0rl4k_39_1.bak db01lo0rr3c_53_1.bak db023o0rv22_67_1.bak
arch2jo0s259_83_1.bak db00co0qoaf_12_1.bak db00qo0ral9_26_1.bak db018o0rlop_40_1.bak db01mo0rrf3_54_1.bak db024o0rvf1_68_1.bak
c-1186970342-20130201-00 db00do0qpr2_13_1.bak db00ro0rbpm_27_1.bak db019o0rmcv_41_1.bak db01no0rrhf_55_1.bak db025o0rvp7_69_1.bak
c-1186970342-20130201-01 db00eo0qrqc_14_1.bak db00so0rd5k_28_1.bak db01ao0rmne_42_1.bak db01oo0rrlm_56_1.bak db026o0s040_70_1.bak
db001o0q4e8_1_1.bak db00fo0qtv9_15_1.bak db00to0reac_29_1.bak db01bo0rn1t_43_1.bak db01po0rs05_57_1.bak db027o0s0dr_71_1.bak
db002o0q6ha_2_1.bak db00go0qvu9_16_1.bak db00uo0rf1l_30_1.bak db01co0rngo_44_1.bak db01qo0rsch_58_1.bak db028o0s0tl_72_1.bak
db003o0qevt_3_1.bak db00ho0r19j_17_1.bak db00vo0rg7l_31_1.bak db01do0ro08_45_1.bak db01ro0rspq_59_1.bak db029o0s0vc_73_1.bak
db004o0qfvu_4_1.bak db00io0r2i2_18_1.bak db010o0rhfr_32_1.bak db01eo0rofn_46_1.bak db01so0rss5_60_1.bak db02ao0s113_74_1.bak
db005o0qhbs_5_1.bak db00jo0r3q8_19_1.bak db011o0rhqa_33_1.bak db01fo0rou8_47_1.bak db01to0rt6k_61_1.bak db02bo0s17g_75_1.bak
db006o0qivj_6_1.bak db00ko0r4qt_20_1.bak db012o0rigl_34_1.bak db01go0rpd4_48_1.bak db01uo0rtim_62_1.bak db02co0s1er_76_1.bak
db007o0qkm5_7_1.bak db00lo0r5fn_21_1.bak db013o0riju_35_1.bak db01ho0rppf_49_1.bak db01vo0rtlb_63_1.bak db02do0s1gj_77_1.bak
db008o0qlr7_8_1.bak db00mo0r6lc_22_1.bak db014o0rjde_36_1.bak db01io0rps4_50_1.bak db020o0rtv6_64_1.bak db02eo0s1mm_78_1.bak
db009o0qocu_9_1.bak db00no0r7sa_23_1.bak db015o0rjqd_37_1.bak db01jo0rq86_51_1.bak db021o0ruau_65_1.bak db02fo0s1sf_79_1.bak
db00ao0qk3d_10_1.bak db00oo0r937_24_1.bak db016o0rkdu_38_1.bak db01ko0rqkr_52_1.bak db022o0ruml_66_1.bak db02go0s228_80_1.bak
复制代码
|
|