查看alter错误,grep -A,-B,-C的妙用
alert 日志记录了数据库的很多重要信息,要养成时常检查alert日志的习惯,但如果日志很大vi打开翻来覆去找着麻烦,怎么做的可以查错呢?
看我的测试
[oracle@ahjcyl-db bdump]$ tail -n 1000 alert_ahjcyl.log |grep ORA-
ORA-12012: error on auto execute of job 22
ORA-00054: resource busy and acquire with NOWAIT specified
ORA-06512: at "DOCTOR.SPL_SJPT_ARCHUSAGE", line 18
ORA-06512: at "DOCTOR.SPL_SJPT_DAYLY", line 34
ORA-06512: at line 1 ---能看到一错误信息,tail -n xx是最后的多少行通过管道符传给grep查看,但是看的摸不到头脑,要是能显示错误信息行再分别附带出错后下面的几行应该更好,再往下看 [oracle@ahjcyl-db bdump]$ tail -n 10000 alert_ahjcyl.log |grep -A 6 ORA- WARNING: inbound connection timed out (ORA-3136)
Fri Sep 9 18:01:34 2011
WARNING: inbound connection timed out (ORA-3136)
Fri Sep 9 18:05:29 2011
Thread 1 advanced to log sequence 2566 (LGWR switch)
Current log# 6 seq# 2566 mem# 0: /oracle/oradata/ahjcyl/redo06_02.log
Current log# 6 seq# 2566 mem# 1: /oradata/ahjcyl/redo06_01.log
Fri Sep 9 20:14:54 2011
Thread 1 advanced to log sequence 2567 (LGWR switch)
--
ORA-1652: unable to extend temp segment by 128 in tablespace TEMP
Fri Sep 9 22:18:55 2011
ORA-1652: unable to extend temp segment by 128 in tablespace TEMP
Fri Sep 9 22:42:39 2011
ORA-1652: unable to extend temp segment by 128 in tablespace TEMP
Sat Sep 10 01:03:00 2011
Starting control autobackup
Control autobackup written to DISK device
handle '/oracle/flash_recovery_area/AHJCYL/autobackup/2011_09_10/o1_mf_s_761446980_76nkp55y_.bkp'
Sat Sep 10 01:03:05 2011
ALTER SYSTEM ARCHIVE LOG
--
ORA-12012: error on auto execute of job 22
ORA-00054: resource busy and acquire with NOWAIT specified
ORA-06512: at "DOCTOR.SPL_SJPT_ARCHUSAGE", line 18
ORA-06512: at "DOCTOR.SPL_SJPT_DAYLY", line 34
ORA-06512: at line 1
Wed Sep 14 13:02:18 2011
Thread 1 advanced to log sequence 2711 (LGWR switch)
Current log# 6 seq# 2711 mem# 0: /oracle/oradata/ahjcyl/redo06_02.log
Current log# 6 seq# 2711 mem# 1: /oradata/ahjcyl/redo06_01.log
Wed Sep 14 13:13:49 2011
Thread 1 advanced to log sequence 2712 (LGWR switch) --是不是看的有点明确了,如果想要出错信息前的几行呢?再往下看
[oracle@ahjcyl-db bdump]$ tail -n 10000 alert_ahjcyl.log |grep -B 6 ORA- Current log# 1 seq# 2564 mem# 1: /oradata/ahjcyl/redo01_01.log
Fri Sep 9 18:00:14 2011
Thread 1 advanced to log sequence 2565 (LGWR switch)
Current log# 2 seq# 2565 mem# 0: /oracle/oradata/ahjcyl/redo02_02.log
Current log# 2 seq# 2565 mem# 1: /oradata/ahjcyl/redo02_01.log
Fri Sep 9 18:01:34 2011
WARNING: inbound connection timed out (ORA-3136)
Fri Sep 9 18:01:34 2011
WARNING: inbound connection timed out (ORA-3136)
--
Current log# 6 seq# 2566 mem# 1: /oradata/ahjcyl/redo06_01.log
Fri Sep 9 20:14:54 2011
Thread 1 advanced to log sequence 2567 (LGWR switch)
Current log# 4 seq# 2567 mem# 0: /oracle/oradata/ahjcyl/redo04_02.log
Current log# 4 seq# 2567 mem# 1: /oradata/ahjcyl/redo04_01.log
Fri Sep 9 22:18:55 2011
ORA-1652: unable to extend temp segment by 128 in tablespace TEMP
Fri Sep 9 22:18:55 2011
ORA-1652: unable to extend temp segment by 128 in tablespace TEMP
Fri Sep 9 22:42:39 2011
ORA-1652: unable to extend temp segment by 128 in tablespace TEMP --但如果要是看数据的前\后几行呢 a+b ,再往下看
[oracle@ahjcyl-db bdump]$ tail -n 10000 alert_ahjcyl.log |grep -C 6 ORA- Control autobackup written to DISK device
handle '/oracle/flash_recovery_area/AHJCYL/autobackup/2011_09_08/o1_mf_s_761322189_76jqtf7g_.bkp'
Completed: alter database add logfile group 2 ('/oracle/oradata/ahjcyl/redo02_02.log','/oradata/ahjcyl/redo02_01.log') size 200m
Thu Sep 8 14:24:03 2011
alter database drop logfile group 3
Thu Sep 8 14:24:03 2011
ORA-1624 signalled during: alter database drop logfile group 3...
Thu Sep 8 14:24:50 2011
alter database drop logfile group 3
Thu Sep 8 14:24:50 2011
Starting control autobackup
Control autobackup written to DISK device
handle '/oracle/flash_recovery_area/AHJCYL/autobackup/2011_09_08/o1_mf_s_761322290_76jqxljw_.bkp'
--
Current log# 1 seq# 2564 mem# 1: /oradata/ahjcyl/redo01_01.log
Fri Sep 9 18:00:14 2011
Thread 1 advanced to log sequence 2565 (LGWR switch)
Current log# 2 seq# 2565 mem# 0: /oracle/oradata/ahjcyl/redo02_02.log
Current log# 2 seq# 2565 mem# 1: /oradata/ahjcyl/redo02_01.log
Fri Sep 9 18:01:34 2011
WARNING: inbound connection timed out (ORA-3136)
Fri Sep 9 18:01:34 2011
WARNING: inbound connection timed out (ORA-3136)
Fri Sep 9 18:05:29 2011
Thread 1 advanced to log sequence 2566 (LGWR switch)
Current log# 6 seq# 2566 mem# 0: /oracle/oradata/ahjcyl/redo06_02.log
Current log# 6 seq# 2566 mem# 1: /oradata/ahjcyl/redo06_01.log
Fri Sep 9 20:14:54 2011
Thread 1 advanced to log sequence 2567 (LGWR switch)
Current log# 4 seq# 2567 mem# 0: /oracle/oradata/ahjcyl/redo04_02.log
Current log# 4 seq# 2567 mem# 1: /oradata/ahjcyl/redo04_01.log
Fri Sep 9 22:18:55 2011
ORA-1652: unable to extend temp segment by 128 in tablespace TEMP
Fri Sep 9 22:18:55 2011
ORA-1652: unable to extend temp segment by 128 in tablespace TEMP
Fri Sep 9 22:42:39 2011
ORA-1652: unable to extend temp segment by 128 in tablespace TEMP
Sat Sep 10 01:03:00 2011
Starting control autobackup
Control autobackup written to DISK device
handle '/oracle/flash_recovery_area/AHJCYL/autobackup/2011_09_10/o1_mf_s_761446980_76nkp55y_.bkp'
Sat Sep 10 01:03:05 2011
ALTER SYSTEM ARCHIVE LOG --没错就是grep -C 具体解释问男人吧,man grep
查看alter错误,grep -A,-B,-C的妙用的更多相关文章
- 文件 "c:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\ttt.mdf" 已压缩,但未驻留在只读数据库或文件组中。必须将此文件解压缩。 CREATE DATABASE 失败。无法创建列出的某些文件名。请查看相关错误。 (.Net SqlClient Data Provider)
问题: 文件 "c:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\ttt.mdf" 已压缩,但 ...
- oracle简单存储过程以及如何查看编译错误
oracle简单存储过程以及如何查看编译错误; CREATE OR REPLACE PROCEDURE procedure_test ISval VARCHAR2(200);BEGIN /* val ...
- linux 端口占用查看 netstat -tunpl | grep 6379
端口占用查看 netstat -tunpl | grep 6379 netstat -luntpu|grep fdfs
- 【手把手教你Elmah】如何在MVC.NET项目中在线查看【错误日志】
一. 在NuGet下载Elmah.MVC dll文件! 或者点击下载dll文件,并且引用客户端. 二.配置WebConfig <sectionGroup name="elmah& ...
- IIS- ASP站点布署时查看ASP错误信息
ASP使用的脚本是VBSCRIPT,布置的时候想显示他的错误信息,可以在INTERNET选项里把显示友好http错误信息的勾去掉 就能查看ASP布署时查看错误信息的勾去掉.
- Ubuntu启动、停止、重新启动MySQL,查看MySQL错误日志、中文编码错误
1)启动: sudo /etc/init.d/mysql start 2)停止: sudo /etc/init.d/mysql stop 3)重新启动: sudo /etc/init.d/mysql ...
- 117 FP页面无法查看 此错误是JDK8.0.0.0版本的一个BUG,会导致工单重复回写,
用户表示117 FP页面无法查看,提示如下错误: 跟进: 1.进入FP服务器可看到以下错误 这个错误的框就表示FP的一个进程报错,自动断掉了,需要重新跑一次EXIT,INIT,PLAN,EXPORT, ...
- Linux下查看mysql错误日志
1.进入 mysql 安装目录 进入 data 目录(该目录存储的是数据库的数据) cd /usr/local/mysql ll 进入 mysql 目录 ,发现 文件后缀 .err,即是mysql ...
- 查看IIS错误日志
部署在IIS中的程序,难免出现数据产生异常 在事件查看器中,可以看出来具体的错误信息,代码定位
随机推荐
- zabbix监控redis多实例(low level discovery)
对于多实例部署的tomcat.redis等应用,可以利用zabbix的low level discovery功能来实现监控,减少重复操作. 注:Zabbix版本: Zabbix 3.0.2 一.服务 ...
- GeoTools应用-DATA
转自:http://blog.csdn.net/cdl2008sky/article/details/7266785 一.Geotools The Open Source Java GIS Toolk ...
- [转]NHibernate之旅(6):探索NHibernate中的事务
本节内容 事务概述 1.新建对象 [测试成功提交] [测试失败回滚] 2.删除对象 3.更新对象 4.保存更新对象 结语 上一篇我们介绍了NHibernate中的Insert, Update, Del ...
- ORA-65096: invalid common user or role name
CREATE USER xx IDENTIFIED BY yy DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP PROFILE "DEF ...
- 主流智能手机屏幕材质介绍 及 LCD闪屏现象分析
TN TN(Twisted Nematic) 即扭曲向列型面板,属于有源矩阵液晶显示器中的一种.由于TFT是主动式矩阵LCD可让液晶的排列方式具有记忆性,不会在电流消失后马上恢复 ...
- 解决Ubuntu Server 12.04换了网卡MAC地址后 网络不可用的问题.
重装了系统,新建了一个ubuntu虚拟机,加载原来的镜像,结果启动后网络变得不正常了,提示信息 Waiting for network configuration...Waiting up to 60 ...
- ReactiveCocoa框架学习1
写block直接使用inline block的声明类型 在ARC中使用strong,如果不使用strong,则会被销毁 在非ARC中使用copy block在开发中的使用场景 把block保存到对象中 ...
- ASP.NET多线程下使用HttpContext.Current为null解决方案
多线程或者异步调用中如何访问HttpContext? 前面我还提到在APM模式下的异步完成回调时,访问HttpContext.Current也会返回null,那么此时该怎么办呢? 答案有二种:1. 在 ...
- 经典SQL语句大全之基本函数
SQL Server基本函数 1.字符串函数 长度与分析用 1,datalength(Char_expr) 返回字符串包含字符数,但不包含后面的空格2,substring(expression,sta ...
- TCP keepalive
2. TCP keepalive overview In order to understand what TCP keepalive (which we will just call keepa ...