<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Unable to See Package Bodies in SQLDeveloper 2.1.1</title>
	<atom:link href="http://mikesmithers.wordpress.com/2010/08/06/unable-to-see-package-bodies-in-sqldeveloper-2-1-1/feed/" rel="self" type="application/rss+xml" />
	<link>http://mikesmithers.wordpress.com/2010/08/06/unable-to-see-package-bodies-in-sqldeveloper-2-1-1/</link>
	<description>Oracle - for when it was like that when you got there</description>
	<lastBuildDate>Wed, 01 May 2013 11:15:26 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: mikesmithers</title>
		<link>http://mikesmithers.wordpress.com/2010/08/06/unable-to-see-package-bodies-in-sqldeveloper-2-1-1/#comment-5769</link>
		<dc:creator><![CDATA[mikesmithers]]></dc:creator>
		<pubDate>Thu, 11 Aug 2011 16:16:34 +0000</pubDate>
		<guid isPermaLink="false">http://mikesmithers.wordpress.com/?p=546#comment-5769</guid>
		<description><![CDATA[At the time I wrote this post, SQLDeveloper 3.0 was still in beta and 2.1.1 was the latest production release. You are correct, this problem has indeed been resolved in version 3.0. Still prefer SQL*Plus though ;-)]]></description>
		<content:encoded><![CDATA[<p>At the time I wrote this post, SQLDeveloper 3.0 was still in beta and 2.1.1 was the latest production release. You are correct, this problem has indeed been resolved in version 3.0. Still prefer SQL*Plus though <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Fraser</title>
		<link>http://mikesmithers.wordpress.com/2010/08/06/unable-to-see-package-bodies-in-sqldeveloper-2-1-1/#comment-5748</link>
		<dc:creator><![CDATA[Andrew Fraser]]></dc:creator>
		<pubDate>Thu, 11 Aug 2011 13:00:41 +0000</pubDate>
		<guid isPermaLink="false">http://mikesmithers.wordpress.com/?p=546#comment-5748</guid>
		<description><![CDATA[Seems to be fixed now in SQL Developer version 3.]]></description>
		<content:encoded><![CDATA[<p>Seems to be fixed now in SQL Developer version 3.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oracle SQL Developer privileges for Other Users procedures and package bodies &#124; Andrew Fraser DBA</title>
		<link>http://mikesmithers.wordpress.com/2010/08/06/unable-to-see-package-bodies-in-sqldeveloper-2-1-1/#comment-5747</link>
		<dc:creator><![CDATA[Oracle SQL Developer privileges for Other Users procedures and package bodies &#124; Andrew Fraser DBA]]></dc:creator>
		<pubDate>Thu, 11 Aug 2011 12:59:51 +0000</pubDate>
		<guid isPermaLink="false">http://mikesmithers.wordpress.com/?p=546#comment-5747</guid>
		<description><![CDATA[[...] Smithers has a related posting on this SQL Developr issue &#8211; although his workaround is no longer required with SQL Developer [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Smithers has a related posting on this SQL Developr issue &#8211; although his workaround is no longer required with SQL Developer [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mikesmithers</title>
		<link>http://mikesmithers.wordpress.com/2010/08/06/unable-to-see-package-bodies-in-sqldeveloper-2-1-1/#comment-2219</link>
		<dc:creator><![CDATA[mikesmithers]]></dc:creator>
		<pubDate>Sun, 27 Feb 2011 16:24:12 +0000</pubDate>
		<guid isPermaLink="false">http://mikesmithers.wordpress.com/?p=546#comment-2219</guid>
		<description><![CDATA[T.J.
Thanks for the tip. 
It&#039;s another option for people to consider.
This is all still pretty relevant as Oracle haven&#039;t got around to a production release of SQLDeveloper 3 yet. Just hope they sort out the DBMS_OUTPUT glitches in the EA releases before they do !

Mike]]></description>
		<content:encoded><![CDATA[<p>T.J.<br />
Thanks for the tip.<br />
It&#8217;s another option for people to consider.<br />
This is all still pretty relevant as Oracle haven&#8217;t got around to a production release of SQLDeveloper 3 yet. Just hope they sort out the DBMS_OUTPUT glitches in the EA releases before they do !</p>
<p>Mike</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: T. J. Kiernan</title>
		<link>http://mikesmithers.wordpress.com/2010/08/06/unable-to-see-package-bodies-in-sqldeveloper-2-1-1/#comment-2205</link>
		<dc:creator><![CDATA[T. J. Kiernan]]></dc:creator>
		<pubDate>Fri, 25 Feb 2011 23:16:01 +0000</pubDate>
		<guid isPermaLink="false">http://mikesmithers.wordpress.com/?p=546#comment-2205</guid>
		<description><![CDATA[I realize I&#039;m quite late to this party, but I did find that granting debug any procedure, connect debug session will allow a user to view package body code without granting create any procedure (provided they&#039;re debugging at the time).  

I hope this helps!
-T. J.]]></description>
		<content:encoded><![CDATA[<p>I realize I&#8217;m quite late to this party, but I did find that granting debug any procedure, connect debug session will allow a user to view package body code without granting create any procedure (provided they&#8217;re debugging at the time).  </p>
<p>I hope this helps!<br />
-T. J.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mikesmithers</title>
		<link>http://mikesmithers.wordpress.com/2010/08/06/unable-to-see-package-bodies-in-sqldeveloper-2-1-1/#comment-1217</link>
		<dc:creator><![CDATA[mikesmithers]]></dc:creator>
		<pubDate>Wed, 03 Nov 2010 07:51:19 +0000</pubDate>
		<guid isPermaLink="false">http://mikesmithers.wordpress.com/?p=546#comment-1217</guid>
		<description><![CDATA[I&#039;ve not been able to replicate this, though obviously I&#039;m working on a much smaller system at home - less users, less grants to wade through etc.
Thanks for posting your updated code. First signs are that this bug is fixed in SQLDeveloper 3.0, so hopefully you won&#039;t have the same problem as and when you upgrade.]]></description>
		<content:encoded><![CDATA[<p>I&#8217;ve not been able to replicate this, though obviously I&#8217;m working on a much smaller system at home &#8211; less users, less grants to wade through etc.<br />
Thanks for posting your updated code. First signs are that this bug is fixed in SQLDeveloper 3.0, so hopefully you won&#8217;t have the same problem as and when you upgrade.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard Basile</title>
		<link>http://mikesmithers.wordpress.com/2010/08/06/unable-to-see-package-bodies-in-sqldeveloper-2-1-1/#comment-1169</link>
		<dc:creator><![CDATA[Richard Basile]]></dc:creator>
		<pubDate>Wed, 27 Oct 2010 18:10:13 +0000</pubDate>
		<guid isPermaLink="false">http://mikesmithers.wordpress.com/?p=546#comment-1169</guid>
		<description><![CDATA[I was experiencing a performance problem with the cursor. Outside of the trigger, the cursor worked perfectly but, inside the trigger, the cursor took nearly a minute to complete. I&#039;ve rewritten the trigger as follows:

create or replace
TRIGGER CHK_CREATE_PRIVS_TRG
  BEFORE CREATE ON DATABASE
DECLARE
  -- CREATE ROLE viewsource;
  -- GRANT CREATE ANY PROCEDURE TO viewsource;
  -- GRANT viewsource TO :user;
  e_no_priv EXCEPTION;
BEGIN
  --
  -- Note - bitter experience teaches us to always leave a back-door
  -- for SYS and SYSTEM in a trigger such as this - just in case
  -- it doesn&#039;t quite work as expected first time !
  --
  IF ( USER NOT IN (&#039;SYS&#039;, &#039;SYSTEM&#039;)
   AND ORA_DICT_OBJ_TYPE IN (&#039;FUNCTION&#039;, &#039;PROCEDURE&#039;, &#039;PACKAGE&#039;, &#039;PACKAGE BODY&#039;)
  ) THEN
    -- This query needs to check where the relevant privilege
    -- is inherited from ( or whether it&#039;s granted directly)
    --
    FOR r IN (
      SELECT 1
        FROM SYS.DBA_SYS_PRIVS
       WHERE PRIVILEGE IN (
             CASE ora_dict_obj_owner
               WHEN USER
               THEN &#039;CREATE PROCEDURE&#039;
               ELSE &#039;CREATE ANY PROCEDURE&#039;
             END, &#039;CREATE ANY PROCEDURE&#039;
             )
         AND ( GRANTEE = USER
            OR GRANTEE IN (
               SELECT GRANTED_ROLE
                 FROM SYS.DBA_ROLE_PRIVS
                WHERE GRANTED_ROLE != &#039;VIEWSOURCE&#039;
               START WITH GRANTEE = USER
               CONNECT BY PRIOR GRANTED_ROLE = GRANTEE
               )
             )
         AND rownum = 1
    )
    LOOP
      RETURN ;
    END LOOP;
  END IF ;
  RAISE e_no_priv;

EXCEPTION
WHEN e_no_priv THEN
  RAISE_APPLICATION_ERROR( -20001, &#039;You must have create privileges other than through VIEWSOURCE to do this.&#039;);
END;
/]]></description>
		<content:encoded><![CDATA[<p>I was experiencing a performance problem with the cursor. Outside of the trigger, the cursor worked perfectly but, inside the trigger, the cursor took nearly a minute to complete. I&#8217;ve rewritten the trigger as follows:</p>
<p>create or replace<br />
TRIGGER CHK_CREATE_PRIVS_TRG<br />
  BEFORE CREATE ON DATABASE<br />
DECLARE<br />
  &#8212; CREATE ROLE viewsource;<br />
  &#8212; GRANT CREATE ANY PROCEDURE TO viewsource;<br />
  &#8212; GRANT viewsource TO :user;<br />
  e_no_priv EXCEPTION;<br />
BEGIN<br />
  &#8211;<br />
  &#8212; Note &#8211; bitter experience teaches us to always leave a back-door<br />
  &#8212; for SYS and SYSTEM in a trigger such as this &#8211; just in case<br />
  &#8212; it doesn&#8217;t quite work as expected first time !<br />
  &#8211;<br />
  IF ( USER NOT IN (&#8216;SYS&#8217;, &#8216;SYSTEM&#8217;)<br />
   AND ORA_DICT_OBJ_TYPE IN (&#8216;FUNCTION&#8217;, &#8216;PROCEDURE&#8217;, &#8216;PACKAGE&#8217;, &#8216;PACKAGE BODY&#8217;)<br />
  ) THEN<br />
    &#8212; This query needs to check where the relevant privilege<br />
    &#8212; is inherited from ( or whether it&#8217;s granted directly)<br />
    &#8211;<br />
    FOR r IN (<br />
      SELECT 1<br />
        FROM SYS.DBA_SYS_PRIVS<br />
       WHERE PRIVILEGE IN (<br />
             CASE ora_dict_obj_owner<br />
               WHEN USER<br />
               THEN &#8216;CREATE PROCEDURE&#8217;<br />
               ELSE &#8216;CREATE ANY PROCEDURE&#8217;<br />
             END, &#8216;CREATE ANY PROCEDURE&#8217;<br />
             )<br />
         AND ( GRANTEE = USER<br />
            OR GRANTEE IN (<br />
               SELECT GRANTED_ROLE<br />
                 FROM SYS.DBA_ROLE_PRIVS<br />
                WHERE GRANTED_ROLE != &#8216;VIEWSOURCE&#8217;<br />
               START WITH GRANTEE = USER<br />
               CONNECT BY PRIOR GRANTED_ROLE = GRANTEE<br />
               )<br />
             )<br />
         AND rownum = 1<br />
    )<br />
    LOOP<br />
      RETURN ;<br />
    END LOOP;<br />
  END IF ;<br />
  RAISE e_no_priv;</p>
<p>EXCEPTION<br />
WHEN e_no_priv THEN<br />
  RAISE_APPLICATION_ERROR( -20001, &#8216;You must have create privileges other than through VIEWSOURCE to do this.&#8217;);<br />
END;<br />
/</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mikesmithers</title>
		<link>http://mikesmithers.wordpress.com/2010/08/06/unable-to-see-package-bodies-in-sqldeveloper-2-1-1/#comment-713</link>
		<dc:creator><![CDATA[mikesmithers]]></dc:creator>
		<pubDate>Fri, 20 Aug 2010 21:08:00 +0000</pubDate>
		<guid isPermaLink="false">http://mikesmithers.wordpress.com/?p=546#comment-713</guid>
		<description><![CDATA[I&#039;ve now updated the post with the &quot;improved&quot; version.]]></description>
		<content:encoded><![CDATA[<p>I&#8217;ve now updated the post with the &#8220;improved&#8221; version.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard Basile</title>
		<link>http://mikesmithers.wordpress.com/2010/08/06/unable-to-see-package-bodies-in-sqldeveloper-2-1-1/#comment-705</link>
		<dc:creator><![CDATA[Richard Basile]]></dc:creator>
		<pubDate>Wed, 18 Aug 2010 13:03:09 +0000</pubDate>
		<guid isPermaLink="false">http://mikesmithers.wordpress.com/?p=546#comment-705</guid>
		<description><![CDATA[I was considering a solution that would evaluate the schema where the object was being created but couldn&#039;t come up with &quot;ora_dict_obj_owner&quot;. This worked. Thank you!]]></description>
		<content:encoded><![CDATA[<p>I was considering a solution that would evaluate the schema where the object was being created but couldn&#8217;t come up with &#8220;ora_dict_obj_owner&#8221;. This worked. Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mikesmithers</title>
		<link>http://mikesmithers.wordpress.com/2010/08/06/unable-to-see-package-bodies-in-sqldeveloper-2-1-1/#comment-703</link>
		<dc:creator><![CDATA[mikesmithers]]></dc:creator>
		<pubDate>Tue, 17 Aug 2010 20:02:19 +0000</pubDate>
		<guid isPermaLink="false">http://mikesmithers.wordpress.com/?p=546#comment-703</guid>
		<description><![CDATA[Richard,

I was assuming that, as this was a controlled environment :

1) The supporter would not have any write privs ( as in the post)
2) SQLDeveloper would not be used as an end-user tool at-all.

A wise man once said &quot;Assumption is the mother of all cock-ups&quot;. Well, maybe he didn&#039;t, but he jolly well should have.

Anyhow, changing the where clause in the c_has_priv trigger as follows might help :
[sourcecode language=&quot;sql&quot;]
WHERE privilege IN
CASE ora_dict_obj_owner 
     WHEN USER THEN &#039;CREATE PROCEDURE&#039;
      ELSE &#039;CREATE ANY PROCEDURE&#039;
END, &#039;CREATE ANY PROCEDURE&#039;
[/sourcecode]
So, when a user is trying to create an object in their own schema the IN list should evaluate to &#039;CREATE PROCEDURE&#039;, &#039;CREATE ANY PROCEDURE&#039;. 
When the object is being created in another schema the IN list should evaluate to &#039;CREATE ANY PROCEDURE&#039;, &#039;CREATE ANY PROCEDURE&#039;.

Not the most elegant solution, I grant you, but it does seem to be quite effective.]]></description>
		<content:encoded><![CDATA[<p>Richard,</p>
<p>I was assuming that, as this was a controlled environment :</p>
<p>1) The supporter would not have any write privs ( as in the post)<br />
2) SQLDeveloper would not be used as an end-user tool at-all.</p>
<p>A wise man once said &#8220;Assumption is the mother of all cock-ups&#8221;. Well, maybe he didn&#8217;t, but he jolly well should have.</p>
<p>Anyhow, changing the where clause in the c_has_priv trigger as follows might help :</p>
<pre class="brush: sql; title: ; notranslate">
WHERE privilege IN
CASE ora_dict_obj_owner 
     WHEN USER THEN 'CREATE PROCEDURE'
      ELSE 'CREATE ANY PROCEDURE'
END, 'CREATE ANY PROCEDURE'
</pre>
<p>So, when a user is trying to create an object in their own schema the IN list should evaluate to &#8216;CREATE PROCEDURE&#8217;, &#8216;CREATE ANY PROCEDURE&#8217;.<br />
When the object is being created in another schema the IN list should evaluate to &#8216;CREATE ANY PROCEDURE&#8217;, &#8216;CREATE ANY PROCEDURE&#8217;.</p>
<p>Not the most elegant solution, I grant you, but it does seem to be quite effective.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
