我正在使用ORA-xxxxx错误代码来处理许多与Oracle相关的错误的日志文件。所有日志条目都以时间戳开头(例如:2017-11-29 23:51:46,372)。一些日志条目是多行的 - 就像那些带有Java异常堆栈跟踪的日志条目,其中ORA-xxxxx代码深入到日志条目行下面的时间戳。
查找ORA-xxxxx代码的日志时间戳的正则表达式是什么?
一旦我得到上述正则表达式,接下来就是按日期对它们进行排序,以找出上次发生某个ORA-xxxxx错误的时间。
PS:grep或perl regex命令会做。
谢谢,
日志文件的示例
2017-11-29 23:51:46,013 (Foo.java:67) FATAL - foo.bar()-got exception
during load of zzz javax.persistence.PersistenceException:
org.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:76) . . .
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505) Caused by: org.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.loader.Loader.doList(Loader.java:2235)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129)
at org.hibernate.loader.Loader.list(Loader.java:2124)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1149)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:67)
... 16 more Caused by: java.sql.SQLException: [Mercury][Oracle JDBC Driver][Oracle]
ORA-04031: unable to allocate 3896 bytes of shared
memory ("shared pool","selec t licensekey0_.ID as ID...","sga
heap(1,0)","kglsim object batch")
ORA-xx
?