Oracle异常ORA-01861: literal does not match format string。

 

〖现象(Symptom)     

执行下面的脚本,提示日期格式不匹配。

RMAN> run

2> {

3> allocate channel c1 type disk;

4> SET UNTIL TIME '2006-11-2 142000';

5> release channel c1;

6> }

 

allocated channelc1

channel c1sid=158 devtype=DISK

executing commandSET until clause

。。。

RMAN-03002failure of set command at 11/02/2006 143352

ORA-01861literal does not match format string

 

〖原理(Cause  

   备份脚本中指定的日期格式不匹配。

 

〖方法(Action 

u      方法一:使用TO_DATE()函数。

把上面的脚本改成:

run

{

allocate channel c1 type disk;

SET UNTIL TIME "TO_DATE('2006-11-2 142000', 'YYYY-MM-DD HH24MISS')";

release channel c1;

}

 

u      方法二:设置会话(session)的日期格式。

把上面的脚本改成:

run

{

allocate channel c1 type disk;

sql 'alter session set nls_date_format="yyyy-mm-ddhh24miss"';

SET UNTIL TIME '2006-11-2 142000';

release channel c1;

}

在执行SET UNTIL TIME以前,首先使用alter session set nls_date_format命令设置日期的格式。SET UNTIL TIME指定的日期格式必须与nls_date_format指定的格式相匹配。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值