- 最后登录
- 2017-5-4
- 在线时间
- 81 小时
- 威望
- 999
- 金钱
- 2391
- 注册时间
- 2013-9-11
- 阅读权限
- 150
- 帖子
- 1124
- 精华
- 5
- 积分
- 999
- UID
- 1220
|
1#
发表于 2017-4-15 21:58:52
|
查看: 1469 |
回复: 0
rman>backup database;---全备数据库
创建表 tb_time,插入数据
21:18:29 SQL> update tb_time set name='hkny-002' where id=2;
21:18:47 SQL> commit;
21:19:07 SQL> drop table tb_time;
[oracle@oracle10g ~]$ export ORACLE_SID=wilson
[oracle@oracle10g ~]$ export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"
[oracle@oracle10g ~]$ export NLS_LANG="AMERICAN"
[oracle@oracle10g ~]$ rman target sys/oracle
RMAN> RUN{
2> shutdown abort;
3> startup mount;
4> SET UNTIL TIME='2011-03-11 21:18:47';
5> RESTORE DATABASE;
6> RECOVER DATABASE;
7> ALTER DATABASE OPEN RESETLOGS;}
。。。。。。。。。。。。。。。。
channel ORA_DISK_1: restored backup piece 29
piece handle=/u01/oracle/db_back/2am6vts4_29_1 tag=TAG20110311T210923
channel ORA_DISK_1: reading from backup piece /u01/oracle/db_back/2am6vts4_30_1
channel ORA_DISK_1: restored backup piece 30
piece handle=/u01/oracle/db_back/2am6vts4_30_1 tag=TAG20110311T210923
channel ORA_DISK_1: reading from backup piece /u01/oracle/db_back/2am6vts4_31_1
channel ORA_DISK_1: restored backup piece 31
piece handle=/u01/oracle/db_back/2am6vts4_31_1 tag=TAG20110311T210923
channel ORA_DISK_1: restore complete, elapsed time: 00:04:42
failover to previous backup
Finished restore at 2011-03-11 21:28:35
Starting recover at 2011-03-11 21:28:36
using channel ORA_DISK_1
starting media recovery
Oracle Error:
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01194: file 5 needs more recovery to be consistent
ORA-01110: data file 5: '/u01/oradata/wilson/example01.dbf'
media recovery complete, elapsed time: 00:00:06
Finished recover at 2011-03-11 21:28:47
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 03/11/2011 21:28:47
ORA-01194: file 5 needs more recovery to be consistent
ORA-01110: data file 5: '/u01/oradata/wilson/example01.dbf'
问题:1)restore成功了没有?failover to previous backup什么意思?如果有问题为什么还显示channel ORA_DISK_1: restore complete, elapsed time: 00:04:42,Finished restore at 2011-03-11 21:28:35
2)recovery到底成没成功?
3)出错显示ORA-01194: file 5 needs more recovery to be consistent是什么意思?怎样解决这个问题?
先谢谢各位高手了
restore database until time '2011-03-11 21:18:47' preview;
recover database;
alter database open;
把数据库起来了
请问,1)这个应该是不完全恢复啊,为什么用alter database open resetlog;不能打开数据库呢?
2)preview在你的语句里起什么作用啊,是不是可有可无啊?
3)数据库打开了,可是表tb_time没了,也就是说恢复失败,怎么才能成功?
还有就是它提示的出错显示ORA-01194: file 5 needs more recovery to be consistent,我的file 5是EXAMPLE表空间,在rman中是排出备份的,
CONFIGURE EXCLUDE FOR TABLESPACE 'EXAMPLE';
CONFIGURE EXCLUDE FOR TABLESPACE 'STAGING';
请问在做不完全恢复之前,做数据库全备时,是不是应该把EXAMPLE和STAGING两个表空间的排出备份取消,在做数据库全备时,把这两个表空间也都备份进去?然后在做基于时间的不完全恢复?
|
|