Links
Home
Oracle DBA Forum
Frequent Oracle Errors
TNS:could not resolve the connect identifier specified
Backtrace message unwound by exceptions
invalid identifier
PL/SQL compilation error
internal error
missing expression
table or view does not exist
end-of-file on communication channel
TNS:listener unknown in connect descriptor
insufficient privileges
PL/SQL: numeric or value error string
TNS:protocol adapter error
ORACLE not available
target host or object does not exist
invalid number
unable to allocate string bytes of shared memory
resource busy and acquire with NOWAIT specified
error occurred at recursive SQL level string
ORACLE initialization or shutdown in progress
archiver error. Connect internal only, until freed
snapshot too old
unable to extend temp segment by string in tablespace
Credential retrieval failed
missing or invalid option
invalid username/password; logon denied
unable to create INITIAL extent for segment
out of process memory when trying to allocate string bytes
shared memory realm does not exist
cannot insert NULL
TNS:unable to connect to destination
remote database not found'>ora-02019
exception encountered: core dump
inconsistent datatypes
no data found
TNS:operation timed out
PL/SQL: could not find program
existing state of packages has been discarded
maximum number of processes exceeded
error signaled in parallel query server
ORACLE instance terminated. Disconnection forced
TNS:packet writer failure
see ORA-12699
missing right parenthesis
name is already used by an existing object
cannot identify/lock data file
invalid file operation
quoted string not properly terminated
Debug DDL trigger

Debug DDL trigger

2005-08-23       - By Herring Dave - dherri

Reply:     1     2     3     4     5     6     7     8     9     10     >>  

ora_dict_obj_type is a system defined event attribute for DDL triggers,
escentially Oracle-defined variables.  In this case its the object type
for the object that caused the trigger to fire off.



I need this to be a DDL trigger, not a DML trigger, as I want to capture
the table and its contents before its dropped.  When created, it could
be done via CTAS or just CREATE, followed by various DML statements.  To
capture its final contents I'd be easiest for me to copy it right before
it gets dropped.  I guess I could generate a materialized view on it
when its created, so that all content would be automatically applied to
the copy, but I thought this would be easier.



Dave

-- ---- ---- ---- ---- ---- ---- ----

Dave Herring, DBA

Acxiom Corporation

3333 Finley

Downers Grove, IL 60515

wk: 630.944.4762

<mailto:dherri@(protected) <mailto:dherri@(protected)> >

-- ---- ---- ---- ---- ---- ---- ----

__ ____ ____ ____ ____ ____ ____

From: oracle-l-bounce@(protected)
[mailto:oracle-l-bounce@(protected)] On Behalf Of David Wendelken
Sent: Monday, August 22, 2005 4:40 PM
To: 'Oracle-L@(protected) Org (E-mail)'
Subject: RE: Debug DDL trigger





I'm guessing ora_dict_obj_type is a column in dherri.schema?



If so, you are using row-level data in a statement-level trigger.

You need to add the magic words that turn the trigger into a row level
trigger.

It's "for each row" or words to that effect.  You'll find the exact
syntax in the manual.





Here's the trigger's text:

 

  CREATE OR REPLACE TRIGGER sys.cp_tab_before_drop_btg

    BEFORE drop ON dherri.SCHEMA

       WHEN (    ora_dict_obj_type = 'TABLE'

             AND (   ora_dict_obj_name LIKE 'SCORE\_ACCT\_TB\_%'
ESCAPE '\'

                 )

            )

 

**************************************************************************
The information contained in this communication is confidential, is
intended only for the use of the recipient named above, and may be legally
privileged.

If the reader of this message is not the intended recipient, you are
hereby notified that any dissemination, distribution or copying of this
communication is strictly prohibited.

If you have received this communication in error, please resend this
communication to the sender and delete the original message or any copy
of it from your computer system.

Thank You.
**************************************************************************

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft
-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn
:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<title>Message</title>
<style>
<!--
/* Font Definitions */
@(protected)
  {font-family:Tahoma;
  panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
  {margin:0in;
  margin-bottom:.0001pt;
  font-size:12.0pt;
  font-family:"Times New Roman";}
p.MsoBodyText, li.MsoBodyText, div.MsoBodyText
  {margin-top:0in;
  margin-right:0in;
  margin-bottom:6.0pt;
  margin-left:0in;
  font-size:12.0pt;
  font-family:"Times New Roman";}
a:link, span.MsoHyperlink
  {color:blue;
  text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
  {color:#606420;
  text-decoration:underline;}
p.StyleBodyTextItalic, li.StyleBodyTextItalic, div.StyleBodyTextItalic
  {margin-top:0in;
  margin-right:0in;
  margin-bottom:6.0pt;
  margin-left:.25in;
  font-size:10.0pt;
  font-family:"Times New Roman";
  font-style:italic;}
p.stylebodytextitalic0, li.stylebodytextitalic0, div.stylebodytextitalic0
  {margin-top:0in;
  margin-right:0in;
  margin-bottom:6.0pt;
  margin-left:.25in;
  font-size:10.0pt;
  font-family:"Times New Roman";
  font-style:italic;}
span.EmailStyle20
  {mso-style-type:personal;
  font-family:Arial;
  color:windowtext;}
span.EmailStyle21
  {mso-style-type:personal-reply;
  font-family:Arial;
  color:navy;}
@(protected) Section1
  {size:8.5in 11.0in;
  margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
  {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink="#606420">

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>ora_dict_obj_type is a system defined
event attribute for DDL triggers, escentially Oracle-defined variables. &nbsp;In
this case its the object type for the object that caused the trigger to fire
off.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I need this to be a DDL trigger, not a DML
trigger, as I want to capture the table and its contents before its dropped.
&nbsp;When
created, it could be done via CTAS or just CREATE, followed by various DML
statements. &nbsp;To capture its final contents I'd be easiest for me to copy it
right before it gets dropped. &nbsp;I guess I could generate a materialized
view on
it when its created, so that all content would be automatically applied to the
copy, but I thought this would be easier.<i><span style='font-style:italic'><o
:p></o:p></span></i></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Dave</span></font><font color=navy><span
style='color:navy'><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=teal face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:teal'>-- ---- ---- ---- ---- ---- ---- ----<
/span></font><font
color=navy><span style='color:navy'><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=teal face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:teal'>Dave Herring, DBA</span></font><font
color=navy><span style='color:navy'><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=teal face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:teal'>Acxiom Corporation</span></font><font
color=navy><span style='color:navy'><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=teal face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:teal'>3333 Finley</span></font><font color=navy>
<span
style='color:navy'><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=teal face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:teal'>Downers Grove, IL 60515</span></font><font
color=navy><span style='color:navy'><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=teal face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:teal'>wk: 630.944.4762</span></font><font
color=navy><span style='color:navy'><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=teal face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:teal'>&lt;</span></font><font color=navy
face=Arial><span style='font-family:Arial;color:navy'><a
href="mailto:dherri@(protected)"><font size=2 color=teal><span style='font-size:
10.0pt;color:teal'>mailto:dherri@(protected)</span></font></a></span></font><font
size=2 color=teal face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:teal'>&gt;</span></font><font color=navy><span style='color:navy'><o:p><
/o:p></span></font></p>

<p class=MsoNormal><font size=2 color=teal face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:teal'>-- ---- ---- ---- ---- ---- ---- ----<
/span></font><o:p></o:p></p>

</div>

<div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
oracle-l-bounce@(protected) [mailto:oracle-l-bounce@(protected)] <b><span
style='font-weight:bold'>On Behalf Of </span></b>David Wendelken<br>
<b><span style='font-weight:bold'>Sent:</span></b> Monday, August 22, 2005 4:40
PM<br>
<b><span style='font-weight:bold'>To:</span></b> 'Oracle-L@(protected) Org
(E-mail)'<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: Debug DDL trigger<
/span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>I'm guessing </span></font><font size=2
color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:black'>ora_dict_obj_type is a column in dherri.schema?</span></font><o:p>
</o:p></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>If so, you are using row-level data in a statement-level
trigger.</span></font><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>You need to add the magic words that turn
the trigger into a row level trigger.</span></font><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>It's &quot;for each row&quot; or words to
that effect.&nbsp; You'll find&nbsp;the exact syntax&nbsp;in the manual.</span>
</font><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Here's the trigger's text:<o:p></o:p></span></font></p>

</div>

<blockquote style='border:none;border-left:solid blue 1.0pt;padding:0in 0in 0in
2.0pt;
margin-left:2.2pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>CREATE OR REPLACE TRIGGER sys.cp_tab_before_drop_btg<o:p></o
:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;&nbsp; BEFORE drop ON dherri.SCHEMA<o:p></o:p></span><
/font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WHEN (&nbsp;&nbsp;&nbsp;
ora_dict_obj_type = 'TABLE'<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;
AND (&nbsp;&nbsp; ora_dict_obj_name LIKE 'SCORE\_ACCT\_TB\_%' ESCAPE '\'<o:p><
/o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
)<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
)<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</blockquote>

</div>

</div>

<pre>**************************************************************************
The information contained in this communication is confidential, is
intended only for the use of the recipient named above, and may be legally
privileged.

If the reader of this message is not the intended recipient, you are
hereby notified that any dissemination, distribution or copying of this
communication is strictly prohibited.

If you have received this communication in error, please resend this
communication to the sender and delete the original message or any copy
of it from your computer system.

Thank You.
**************************************************************************
</pre></body>

</html>