Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

164

积分

0

好友

16

主题
1#
发表于 2012-8-16 11:43:47 | 查看: 5516| 回复: 2
oel5.5+ora11.2.0.2下想实现8-12点的归档备份不删除原归档要怎么写?

backup archivelog from time="to_date(to_char('yyyy-mm-dd',sysdate)||' 08:00:00','yyyy-mm-dd hh24:mi:ss')" until time="to_date(to_char('yyyy-mm-dd',sysdate)||' 12:00:00','yyyy-mm-dd hh24:mi:ss')"  format '/backup/arch_%d_%T_%u.dat';

会报错,有没哪位大侠指点下,要怎么写?

[ 本帖最后由 lxhbww 于 2012-8-17 10:58 编辑 ]
2#
发表于 2012-8-16 20:08:12
标题起的毫无意义



backup archivelog from  time "to_date('2012-8-16 08:00:00','YYYY-MM-DD hh24:mi:ss')" until time "to_date('2012-8-16 12:00:00','YYYY-MM-DD hh24:mi:ss')";


这种问题 提问前先翻手册

回复 只看该作者 道具 举报

3#
发表于 2012-8-17 11:08:38
谢谢刘大,是我语法和里头函数位置写错了,现在可以了,谢谢!
但现在又有个问题了,就是有些会重复备份,是什么原因?
如下:我备昨天12-18点,和备18-0点的,在备18-0点时发现二个节点813 510都会又重复备一次,这是什么原因?
这个time是指v$archived_log中COMPLETION_TIME?还是RESETLOGS_TIME? FIRST_TIME  ?
RMAN> backup archivelog from time "to_date(to_char(sysdate-1,'yyyy-mm-dd')||' 12:00:00','yyyy-mm-dd hh24:mi:ss')" until time "to_date(to_char(sysdate-1,'yyyy-mm-dd')||' 17:59:59','yyyy-mm-dd hh24:mi:ss')"  format '/home/oracle/arch_%d_%T_%u.dat';

Starting backup at 17-AUG-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=813 RECID=1267 STAMP=791494187
input archived log thread=2 sequence=510 RECID=1268 STAMP=791497762
channel ORA_DISK_1: starting piece 1 at 17-AUG-12
channel ORA_DISK_1: finished piece 1 at 17-AUG-12
piece handle=/home/oracle/arch_CRDS3DB_20120817_e3nis4ec.dat tag=TAG20120817T103244 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 17-AUG-12

RMAN> backup archivelog from time "to_date(to_char(sysdate-1,'yyyy-mm-dd')||' 18:00:00','yyyy-mm-dd hh24:mi:ss')" until time "to_date(to_char(sysdate-1,'yyyy-mm-dd')||' 23:59:59','yyyy-mm-dd hh24:mi:ss')"  format '/home/oracle/arch_%d_%T_%u.dat';

Starting backup at 17-AUG-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=813 RECID=1267 STAMP=791494187
input archived log thread=2 sequence=510 RECID=1268 STAMP=791497762
input archived log thread=1 sequence=814 RECID=1269 STAMP=791503280
input archived log thread=2 sequence=511 RECID=1272 STAMP=791511127
input archived log thread=1 sequence=815 RECID=1270 STAMP=791511105
channel ORA_DISK_1: starting piece 1 at 17-AUG-12
channel ORA_DISK_1: finished piece 1 at 17-AUG-12
piece handle=/home/oracle/arch_CRDS3DB_20120817_e5nis4f8.dat tag=TAG20120817T103312 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
Finished backup at 17-AUG-12

SQL> select thread#,sequence#,to_char(completion_time,'yyyy-mm-dd hh24:mi:ss'),to_char(RESETLOGS_TIME,'yyyy-mm-dd hh24:mi:ss'),to_char(FIRST_TIME,'yyyy-mm-dd hh24:mi:ss') from v$archived_log where (thread#=1 and sequence#=813) or (thread#=2 and sequence#=510);

   THREAD#  SEQUENCE# TO_CHAR(COMPLETION_ TO_CHAR(RESETLOGS_T
---------- ---------- ------------------- -------------------TO_CHAR(FIRST_TIME,
-------------------
         1        813 2012-08-16 19:29:47  2012-03-21 11:18:26  2012-08-16 11:41:21
         2        510 2012-08-16 20:29:22  2012-03-21 11:18:26  2012-08-16 11:41:25

回复 只看该作者 道具 举报

您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-11-16 05:41 , Processed in 0.045302 second(s), 21 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569