在创建基线过程中遇到了这个错误:
SYS@db1> BEGIN
2 DBMS_WORKLOAD_REPOSITORY.CREATE_BASELINE (
3 start_time =>'2017-03-06 7:00:00' ,
4 end_time => '2017-03-06 8:00:00' ,
5 baseline_name => 'AWR_bs3',
6 expiration => NULL );
7 END;
8 /
BEGIN
*
ERROR at line 1:
ORA-01861: literal does not match format string
ORA-06512: at line 2
原因是日期需要用to_date从字符串转化成日期格式,改成如下格式即可:
BEGIN
DBMS_WORKLOAD_REPOSITORY.CREATE_BASELINE (
start_time => to_date('2017-03-06 7:00:00' , 'yyyy-mm-dd hh24:mi:ss'),
end_time => to_date('2017-03-06 8:00:00' , 'yyyy-mm-dd hh24:mi:ss'),
baseline_name => 'AWR_bs3',
expiration => NULL );
END;
SYS@db1> BEGIN
2 DBMS_WORKLOAD_REPOSITORY.CREATE_BASELINE (
3 start_time =>'2017-03-06 7:00:00' ,
4 end_time => '2017-03-06 8:00:00' ,
5 baseline_name => 'AWR_bs3',
6 expiration => NULL );
7 END;
8 /
BEGIN
*
ERROR at line 1:
ORA-01861: literal does not match format string
ORA-06512: at line 2
原因是日期需要用to_date从字符串转化成日期格式,改成如下格式即可:
BEGIN
DBMS_WORKLOAD_REPOSITORY.CREATE_BASELINE (
start_time => to_date('2017-03-06 7:00:00' , 'yyyy-mm-dd hh24:mi:ss'),
end_time => to_date('2017-03-06 8:00:00' , 'yyyy-mm-dd hh24:mi:ss'),
baseline_name => 'AWR_bs3',
expiration => NULL );
END;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29067253/viewspace-2134928/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29067253/viewspace-2134928/