- 论坛徽章:
- 0
|
环境:AIX5+ORACLE10
思路:取oracle数据库alert日志当天的oracle错误行
alert_zhjf1.log 部分内容如下
*******
ORA-12012: error on auto execute of job 2335
ORA-06550: line 1, column 96:
PLS-00306: wrong number or types of arguments in call to 'XLT_QF_TJ'
ORA-06550: line 1, column 96:
PL/SQL: Statement ignored
Wed Apr 12 08:49:09 2006
Errors in file /oracle/app/oracle/admin/zhjf/bdump/zhjf1_j000_467086.trc:
ORA-12012: error on auto execute of job 2335
ORA-06550: line 1, column 96:
PLS-00306: wrong number or types of arguments in call to 'XLT_QF_TJ'
ORA-06550: line 1, column 96:
PL/SQL: Statement ignored
Wed Apr 12 08:57:09 2006
Errors in file /oracle/app/oracle/admin/zhjf/bdump/zhjf1_j000_467086.trc:
ORA-12012: error on auto execute of job 2335
ORA-06550: line 1, column 96:
PLS-00306: wrong number or types of arguments in call to 'XLT_QF_TJ'
ORA-06550: line 1, column 96:
PL/SQL: Statement ignored
Wed Apr 12 10:24:52 2006
Thread 1 advanced to log sequence 42519
Current log# 1 seq# 42519 mem# 0: /dev/rredo1_01.zhkf
Wed Apr 12 10:57:46 2006
Thread 1 advanced to log sequence 42520
Current log# 5 seq# 42520 mem# 0: /dev/rredo1_05.zhkf
Wed Apr 12 11:23:01 2006
Thread 1 advanced to log sequence 42521
Current log# 2 seq# 42521 mem# 0: /dev/rredo1_02.zhkf
Wed Apr 12 11:37:43 2006
Thread 1 advanced to log sequence 42522
Current log# 3 seq# 42522 mem# 0: /dev/rredo1_03.zhkf
Wed Apr 12 11:39:05 2006
Global Enqueue Services Deadlock detected. More info in file
/oracle/app/oracle/admin/zhjf/bdump/zhjf1_lmd0_1876390.trc.
Wed Apr 12 13:20:55 2006
Thread 1 advanced to log sequence 42523
Current log# 4 seq# 42523 mem# 0: /dev/rredo1_04.zhkf
Wed Apr 12 15:41:11 2006
Thread 1 advanced to log sequence 42524
Current log# 1 seq# 42524 mem# 0: /dev/rredo1_01.zhkf
实施:
当天时间 格式 date +"%a %h %d" 返回
Wed Apr 12
过滤错误行 awk '/Wed Apr 12/,/test/' alert_zhjf1.log|grep ORA- 返回
ORA-12012: error on auto execute of job 2335
ORA-06550: line 1, column 96:
ORA-06550: line 1, column 96:
ORA-12012: error on auto execute of job 2335
ORA-06550: line 1, column 96:
ORA-06550: line 1, column 96:
ORA-12012: error on auto execute of job 2335
ORA-06550: line 1, column 96:
ORA-06550: line 1, column 96:
ORA-12012: error on auto execute of job 2335
ORA-06550: line 1, column 96:
ORA-06550: line 1, column 96:
关键是awk 后面跟的时间是个变量也就是date +"%a %h %d" 怎么实现??谢了! |
|