ORA-01861: literal does not match format string。

上一篇 / 下一篇  2008-06-19 01:25:37 / 不允许评论 / 个人分类:《Oracle数据库精讲与疑难解析》

〖环境(Environment)〗

   OSsolaris 9

   DBoracle10G

 

〖现象(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指定的格式相匹配。

 


TAG:

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2008-10-08  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 6935
  • 日志数: 47
  • 文件数: 1
  • 建立时间: 2008-04-10
  • 更新时间: 2008-09-12

RSS订阅

Open Toolbar