<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MemoSoup &#187; alert log</title>
	<atom:link href="http://www.memosoup.com/tag/alert-log/feed" rel="self" type="application/rss+xml" />
	<link>http://www.memosoup.com</link>
	<description>Mix of the things I always forget</description>
	<lastBuildDate>Thu, 09 Feb 2012 12:24:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Oracle: read the entries from alert log</title>
		<link>http://www.memosoup.com/20090921/oracle-read-the-entries-from-alert-log.html</link>
		<comments>http://www.memosoup.com/20090921/oracle-read-the-entries-from-alert-log.html#comments</comments>
		<pubDate>Mon, 21 Sep 2009 12:08:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[alert log]]></category>

		<guid isPermaLink="false">http://www.memosoup.com/?p=158</guid>
		<description><![CDATA[<p>Sometimes it&#8217;s necessary to read the information from the alert log together with the timestamp of the error.</p> <p>The very simple Unix-shell script helps to do this:</p> echo echo 'Enter # of lines:' read NUM tail -$NUM alert_${ORACLE_SID}.log &#124; awk ' &#160;BEGIN {prev=&#34;&#34; ; ret=1 } &#160;/^(...-&#124;Error)/ { if ( prev !~ /^(...-&#124;Error)/ ) { [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes it&#8217;s necessary to read the information from the alert log together with the timestamp of the error.</p>
<p>The very simple Unix-shell script helps to do this:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">echo</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'Enter # of lines:'</span><br />
<span style="color: #c20cb9; font-weight: bold;">read</span> NUM<br />
<span style="color: #c20cb9; font-weight: bold;">tail</span> -<span style="color: #007800;">$NUM</span> alert_<span style="color: #800000;">${ORACLE_SID}</span>.log <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'<br />
&nbsp;BEGIN {prev=&quot;&quot; ; ret=1 } <br />
&nbsp;/^(...-|Error)/ { if ( prev !~ /^(...-|Error)/ ) { print &quot;&quot; ; print prev;} print $0;ret=0} <br />
&nbsp;{prev=$0} <br />
&nbsp;END { exit ret } '</span></div></div>
<p>This code could be assigned to some hotkey in Your favorite telnet application, so You just need to press something like &#8220;Alt+A&#8221; to see the quick review of the recent Oracle errors.</p>
<p><strong>Example:</strong><br />
<em><br />
Enter # of lines:<br />
1000</p>
<p>Sep 01 19:42:03 2009<br />
Errors in fileARC0: Archiving not possible: error count exceeded</p>
<p>Sep 01 19:42:06 2009<br />
Errors in file testsrv_arc0_23486.trc:<br />
ORA-16038: log 1 sequence# 112 cannot be archived<br />
ORA-19502: write error on file &#8220;&#8221;, blockno  (blocksize=)<br />
ORA-00312: online log 1 thread 1: &#8216;redo_g1_m1.log&#8217;<br />
</em></p>
<div style="height:33px; padding-top:2px; padding-bottom:2px; clear:both;" class="zare366"><div style="float:left; width:100px; " class="zare366_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.memosoup.com%2F20090921%2Foracle-read-the-entries-from-alert-log.html&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="float:left; width:90px; padding-left:10px;" class="zare366_google1"> 
				<g:plusone size="medium" href="http://www.memosoup.com/20090921/oracle-read-the-entries-from-alert-log.html" ></g:plusone>
			</div><div style="float:left; width:110px; padding-left:10px;" class="zare366_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="Oracle: read the entries from alert log" data-url="http://www.memosoup.com/20090921/oracle-read-the-entries-from-alert-log.html">Tweet</a> 
			</div></div>
		<div style="display:none;"><a href="http://www.news365live.com">news and informations</a>&nbsp;<a href="http://news365online.com">automotive,business,crime,health,life,politics,science,technology,travel</a><a href="http://worldnews365online.com">automotive,business,crime,health,life,politics,science,technology,travel</a></div><div style="clear:both;"></div>]]></content:encoded>
			<wfw:commentRss>http://www.memosoup.com/20090921/oracle-read-the-entries-from-alert-log.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Write to the alert log from PL/SQL code</title>
		<link>http://www.memosoup.com/20090916/write-to-the-alert-log-from-plsql-code.html</link>
		<comments>http://www.memosoup.com/20090916/write-to-the-alert-log-from-plsql-code.html#comments</comments>
		<pubDate>Tue, 15 Sep 2009 22:02:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[alert log]]></category>
		<category><![CDATA[undocumented]]></category>

		<guid isPermaLink="false">http://www.memosoup.com/?p=114</guid>
		<description><![CDATA[<p>The following undocumented function could be used to write to the alert log:</p> EXECUTE sys.dbms_system.ksdwrt&#40;code, message&#41;; <p>Parameters:</p> <p>1 &#8211; Write to trace file. 2 &#8211; Write to alertlog. 3 &#8211; Write to both.</p> <p>Example:</p> EXECUTE sys.dbms_system.ksdwrt&#40;2,TO_CHAR&#40;SYSDATE, 'Dy Mon DD HH24:MI:SS YYYY'&#41;&#124;&#124;'Hello!' &#41;; CREATE OR REPLACE TRIGGER trg_delme BEFORE UPDATE ON frodo.delme REFERENCING NEW AS NEW OLD AS [...]]]></description>
			<content:encoded><![CDATA[<p>The following <strong>undocumented</strong> function could be used to write to the alert log:</p>
<div class="codecolorer-container oracle8 default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="oracle8 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold; text-transform: uppercase;">EXECUTE</span> sys.dbms_system.ksdwrt<span style="color: #66cc66;">&#40;</span>code<span style="color: #66cc66;">,</span> message<span style="color: #66cc66;">&#41;</span>;</div></div>
<p>Parameters:</p>
<p>1 &#8211; Write to trace file.<br />
2 &#8211; Write to alertlog.<br />
3 &#8211; Write to both.</p>
<p>Example:</p>
<div class="codecolorer-container oracle8 default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="oracle8 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold; text-transform: uppercase;">EXECUTE</span> sys.dbms_system.ksdwrt<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">,</span><span style="color: #993333; font-weight: bold; text-transform: uppercase;">TO_CHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold; text-transform: uppercase;">SYSDATE</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Dy Mon DD HH24:MI:SS YYYY'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">||</span><span style="color: #ff0000;">'Hello!'</span> <span style="color: #66cc66;">&#41;</span>;</div></div>
<div class="codecolorer-container oracle8 default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="oracle8 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold; text-transform: uppercase;">CREATE</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">OR</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">REPLACE</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">TRIGGER</span> trg_delme<br />
BEFORE <span style="color: #993333; font-weight: bold; text-transform: uppercase;">UPDATE</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">ON</span> frodo.delme<br />
REFERENCING <span style="color: #993333; font-weight: bold; text-transform: uppercase;">NEW</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">AS</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">NEW</span> OLD <span style="color: #993333; font-weight: bold; text-transform: uppercase;">AS</span> OLD<br />
<span style="color: #993333; font-weight: bold; text-transform: uppercase;">FOR</span> EACH <span style="color: #993333; font-weight: bold; text-transform: uppercase;">ROW</span><br />
<span style="color: #993333; font-weight: bold; text-transform: uppercase;">BEGIN</span><br />
sys.dbms_system.ksdwrt<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">,</span><span style="color: #993333; font-weight: bold; text-transform: uppercase;">TO_CHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold; text-transform: uppercase;">SYSDATE</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Dy Mon DD HH24:MI:SS YYYY'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #993333; font-weight: bold; text-transform: uppercase;">END</span>;</div></div>
<div style="height:33px; padding-top:2px; padding-bottom:2px; clear:both;" class="zare366"><div style="float:left; width:100px; " class="zare366_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.memosoup.com%2F20090916%2Fwrite-to-the-alert-log-from-plsql-code.html&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="float:left; width:90px; padding-left:10px;" class="zare366_google1"> 
				<g:plusone size="medium" href="http://www.memosoup.com/20090916/write-to-the-alert-log-from-plsql-code.html" ></g:plusone>
			</div><div style="float:left; width:110px; padding-left:10px;" class="zare366_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="Write to the alert log from PL/SQL code" data-url="http://www.memosoup.com/20090916/write-to-the-alert-log-from-plsql-code.html">Tweet</a> 
			</div></div>
		<div style="display:none;"><a href="http://www.news365live.com">news and informations</a>&nbsp;<a href="http://news365online.com">automotive,business,crime,health,life,politics,science,technology,travel</a><a href="http://worldnews365online.com">automotive,business,crime,health,life,politics,science,technology,travel</a></div><div style="clear:both;"></div>]]></content:encoded>
			<wfw:commentRss>http://www.memosoup.com/20090916/write-to-the-alert-log-from-plsql-code.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

