123
返回列表 发新帖
楼主: woshiyiziyu

[讨论] 修改spfile和pfile能不能实现自动记录?

[复制链接]
论坛徽章:
23
2009日食纪念
日期:2009-07-22 09:30:00秀才
日期:2015-12-21 09:48:11秀才
日期:2015-12-21 09:53:46天枰座
日期:2015-12-23 11:00:06金牛座
日期:2015-12-25 11:38:39秀才
日期:2016-01-12 11:23:27秀才
日期:2016-01-25 14:55:31双子座
日期:2016-05-06 09:49:392017金鸡报晓
日期:2017-01-10 15:33:11乌索普
日期:2017-02-18 09:05:12
21#
 楼主| 发表于 2009-8-28 18:14 | 只看该作者
问题又来了,http://yong321.freeshell.org/computer/logfile.html,我在我的AIX 5.1上没有nawk和perl命令,只有awk,在我的redhat linux 4上只有gawk,perl命令倒是有,但是执行不成功,老是提示“can't find string terminator ' " ' anywhere before EOF at -e line 1.之前我编脚本的时候用的是awk,没有用过nawk和perl,您的脚本能不能使用awk编写呢?虽然你的文章中指出If you're more comfortable with awk than perl, replace perl with nawk or gawk (but probably not awk in case it has a broken system command)。我自己尝试着用awk 编写,但是总是不成功,tail -f alert_ORCL.log | nawk '/^ORA-00600/ {system("mailx -s 'ORCL error' youremail < /dev/null")}'以前从没见过可以直接调用system命令的。

[ 本帖最后由 woshiyiziyu 于 2009-8-28 18:19 编辑 ]

使用道具 举报

回复
论坛徽章:
23
2009日食纪念
日期:2009-07-22 09:30:00秀才
日期:2015-12-21 09:48:11秀才
日期:2015-12-21 09:53:46天枰座
日期:2015-12-23 11:00:06金牛座
日期:2015-12-25 11:38:39秀才
日期:2016-01-12 11:23:27秀才
日期:2016-01-25 14:55:31双子座
日期:2016-05-06 09:49:392017金鸡报晓
日期:2017-01-10 15:33:11乌索普
日期:2017-02-18 09:05:12
22#
 楼主| 发表于 2009-8-28 20:20 | 只看该作者
自己尝试写了个脚本
#!/bin/ksh
cd /oracle
a=`cat alert_orcl.log|grep 'alter'|wc -l`
b=`cat temp |wc -l`
if [ "$a" -ne "$b" ]
then
mailx -s "alter" oracle </dev/null
fi
cat alert_snpdb.log|grep 'alter' > temp
缺点是要安排在后台定时执行,不能实时查看。

使用道具 举报

回复
论坛徽章:
47
蒙奇·D·路飞
日期:2017-03-27 08:04:23马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11一汽
日期:2013-09-01 20:46:27复活蛋
日期:2013-03-13 07:55:232013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:322012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20
23#
发表于 2009-8-29 02:11 | 只看该作者
I strongly recommend you install Perl on the AIX box. Nowadays it's almost essential for system administration. On our AIX 5.3 server, our /usr/bin/perl comes from perl.rte Fileset or package.

I had an error in my note (which I just corrected). This string inside the "mail ..." command
'ORCL error'
should be changed to
\"ORCL error\"

I think that caused the error you got on your RHEL 4. If not, show me the exact command and error.

If you grep alert.log for a pattern, it completely defeats the purpose of using tail -f. Read the first paragraph of my note.

BTW, many people like to `cat somefile | grep pattern', not knowing `grep pattern somefile' is more efficient. Likewise, `grep -c pattern somefile' is much more efficient than `grep pattern somefile | wc -l'.

Yong Huang

[ 本帖最后由 Yong Huang 于 2009-8-28 12:26 编辑 ]

使用道具 举报

回复
论坛徽章:
23
2009日食纪念
日期:2009-07-22 09:30:00秀才
日期:2015-12-21 09:48:11秀才
日期:2015-12-21 09:53:46天枰座
日期:2015-12-23 11:00:06金牛座
日期:2015-12-25 11:38:39秀才
日期:2016-01-12 11:23:27秀才
日期:2016-01-25 14:55:31双子座
日期:2016-05-06 09:49:392017金鸡报晓
日期:2017-01-10 15:33:11乌索普
日期:2017-02-18 09:05:12
24#
 楼主| 发表于 2009-8-29 14:02 | 只看该作者
果然可以了,太感谢Yong Huang了!

使用道具 举报

回复
论坛徽章:
176
现任管理团队成员
日期:2011-05-07 01:45:08版主7段
日期:2012-07-05 02:21:03ITPUB长老会成员
日期:2015-05-07 15:11:10ITPUB年度最佳版主
日期:2011-04-08 18:37:09ITPUB年度最佳版主
日期:2011-12-28 15:24:18ITPUB牛人
日期:2010-10-25 12:41:322010数据库技术大会纪念徽章
日期:2015-04-23 10:33:192011数据库大会纪念章
日期:2015-04-23 10:33:192012数据库大会纪念章
日期:2015-04-23 10:33:192013数据库大会纪念章
日期:2015-04-23 10:33:19
25#
发表于 2009-9-1 15:30 | 只看该作者
both再查肯定是没问题的
原帖由 sukerrainer 于 2009-8-23 23:12 发表
SQL> alter system set undo_retention=1200 scope=spfile;

我这么修改后,在查看,为什么显示还是默认的900呢?

[ 本帖最后由 wangkxxe 于 2009-9-1 15:31 编辑 ]

使用道具 举报

回复
论坛徽章:
23
2009日食纪念
日期:2009-07-22 09:30:00秀才
日期:2015-12-21 09:48:11秀才
日期:2015-12-21 09:53:46天枰座
日期:2015-12-23 11:00:06金牛座
日期:2015-12-25 11:38:39秀才
日期:2016-01-12 11:23:27秀才
日期:2016-01-25 14:55:31双子座
日期:2016-05-06 09:49:392017金鸡报晓
日期:2017-01-10 15:33:11乌索普
日期:2017-02-18 09:05:12
26#
 楼主| 发表于 2009-9-11 15:52 | 只看该作者
在IXPUB上总结了一下:
http://www.ixpub.net/viewthread.php?tid=943942

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表