Oracle Scratchpad

OC Appendix

Addenda and Errata for Oracle Core Appendix

Back to Index

Addenda

 n/a Charles Hooper has given me a number of details to chase up in his recent review of the book, but there’s one point he made that’s worth a quick little addendum here in the Appendix. It relates to a throwaway comment I made about event 10120.One of the little jobs I do when a new release of Oracle comes out is to browse the list of trace events which. Historically, were carried with the error numbers 10,000 to 10,999, although recently many more have appeared scattered across the range 32,000 to 65,000. If you have a Unix-based version of Oracle you can read these error numbers and their meaning (plus other details) in the file $ORACLE_HOME/rdbms/mesg/oraus.msg. If you’re running Oracle on Windows, though, or if you want to start with a smaller summary, you can taken advantage of the pl/sql function sqlerrm().Here’s a little SQL script I use from time to time:
set linesize 180
set trimspool on
set serveroutput on size 1000000 format wrapped

declare
	m_ct		number(5) := 0;
	m_message	varchar2(511);
begin
	for i in 10000..10999 loop
--	for i in 1..65535 loop
		m_message := sqlerrm(-i);
		if m_message not like 'ORA-_____: Message _____ not found;%' then
--		if lower(m_message) like 'ora-%event%' then
			m_ct := m_ct + 1;
			dbms_output.put_line(m_message);
		end if;
	end loop;
	dbms_output.new_line;
	dbms_output.put_line('Messages reported: ' || m_ct);
end;
/

There are two strategies shown in the single piece of code. As it stands it reports any messages in the range 10000-10999 (if the number doesn’t appear in the oraus.msg file the value returned by sqlerrm(-nnnnn) reads: “ORA-NNNNN: Message NNNNN not found; product=RDBMS; facility=ORA”). If you switch the comment markers on the loop and test lines then it reports any messages containing the word “event”. I also use the second version of the code if I’m looking for events (or error messages) relating to a particular topic – there are, for example, about 135 messages relating to the word “materialize”.It’s not a method for getting perfect information about what’s in the file – but it’s a quick and easy starting check.

p.240 Section Log Files – the example is missing the semi-colon:
alter system dump logfile 'C:\ORACLE\ORADATA\D10G\REDO01.LOG';

Errata

Typos/Grammar/Style/Punctuation

Back to Index

Leave a Comment »

No comments yet.

RSS feed for comments on this post.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 966 other followers