ORA-01861: literal does not match format string
在建立基線過程中遇到了這個錯誤:
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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 沒有設定oracle的環境變數.recover until time會報文字上出錯ORA-01861: literal does not match format stringOracle變數ORM
- Error format not a string literal and no format arguments解決方案ErrorORM
- PLS-00172: string literal too long
- signer information does not match問題解決ORM
- C# String.FormatC#ORM
- C# string Format示例C#ORM
- 求助:TypeError: unsupported format string passed to NoneType.__format__ErrorORMNone
- JAVA中String format的用法JavaORM
- DI String Match 增減字串匹配字串匹配
- ORA-01704: string literal too long 與CLOB
- 連結字串String.prototype.format字串ORM
- ElasticSearch 中 match、match_phrase、query_string 和 term 的區別Elasticsearch
- 問題解決:TypeError: unsupported format string passed to NoneType.__format__ErrorORMNone
- SyntaxError: EOL while scanning string literal錯誤解決ErrorWhile
- 千份位Javascript Thousand Separator / string formatJavaScriptORM
- JAVA String.format 方法使用介紹JavaORM
- C# String.Format格式說明C#ORM
- c#之string.format方法示例C#ORM
- '+CRS' in '/etc/oracle/ocr.loc' and '/dev/raw/raw1' does not matchOracledev
- String.format VS. StrSubstitutor VS. NamedParameterJdbcTemplateORMJDBC
- java 字串格式化String.format()使用Java字串格式化ORM
- Library source does not match the bytecode for class 最佳解決方案
- Python執行報錯IndentationError: unindent does not match any outer indentation levelPythonError
- JAVA字串格式化-String.format()的使用Java字串格式化ORM
- Java中String.format變得更快 - MilošJavaORM
- JavaScript & PHP模仿C#中string.format效果JavaScriptPHPC#ORM
- string.Format對C#字串格式化ORMC#字串格式化
- JDK1.5中的String.format的用法JDKORM
- 記錄GitHub使用過程中的 error: src refspec master does not match anyGithubErrorAST
- 如何處理Eclipse錯誤訊息 The declared package does not match the expected packageEclipsePackage
- ValueError: Length of values (141) does not match length of index (4278)問題的解決ErrorIndex
- fmt包String(),Error(),Format(),GoString()的介面實現ErrorORMGo
- .NET String.Format 方法 執行緒安全問題ORM執行緒
- C#中string.format格式轉化總結C#ORM
- centos 7.2執行yum -y install報錯Metadata file does not match checksumCentOS
- JAVA字串格式化-String.format()的使用 (轉載)Java字串格式化ORM
- golang的fmt包String(),Error(),Format(),GoString()的介面實現GolangErrorORM
- Java問題解決:Java compiler level does not match the version of the installed Java project facet.JavaCompileProject