-
Notifications
You must be signed in to change notification settings - Fork 17
The "Compile with PL/Scope" action affects only the session user #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The and the The idea is to provide a PL/Scope quick start for the current schema. You compile the current schema with PL/Scope and then you are able to explore the additional metadata (e.g. under the PL/Scope node). If you decide to use PL/Scope on a regular basis in your development environment you should adjust your deployment process to ensure the deployed code is compiled with PL/Scope. It's certainly not the idea to compile the whole database with PL/Scope or several chosen schemas on a regular bases via this action. If you want to compile code by default with PL/Scope you can configure SQL Developer accordingly as the following screenshot shows: From that point on every compile operation issued from SQL Developer will include by default PL/Scope. In the editor or the oder in other actions such as Of course one could use Regarding the scope of the synonym recompilation in the action. It is limited to the current schema. For private synonyms with a predicate on To be clear. I do not plan to extend the scope of this extension to cover DBA functionalities or extend the scope to multiple schemas. The scope is just the current connect. Nothing more and nothing less. Therefore I flagged this enhancement request as "wontfix". |
The problem is, as of v1.0.0 the action is also made available on PL/Scope nodes of other schemas, by having it on
And:
And that is misleading, If the intent is to have the scope of the "Compile with PL/Scope" action limited to the schema of the session user 1, then it should not be available on Footnotes
|
You are right. Under the This was not my intention, I think. I see basically two options: a) Amend the extension to ensure it is not shown under the |
Enabling it for other users (except Oracle-maintained users, see issue #60) would be convenient for users working with DBA rights and tasked with maintaining multi-schemas applications. That's why I could never imagine that this was not the original intent. |
I think implementing b) would be sensible. |
If using an account with DBA privileges, I'd expect to be able to use the "Compile with PL/Scope" action in order to recompile any schema of my own choosing1. This is implied by the context menu entry being available on every PL/Scope node in the object tree2.
As of v1.0.0 that doesn't work, however, because the target of the action is—obviously, in the PL/SQL code—the value of the
user
function, which always equates to the session user.Solution: per the documentation (link) the target schema of an action is identified by the
#OBJECT_OWNER#
substitution value, so that's what should be used in place ofuser
, in order to enable the action to act on any schema, not just that of the session user.Additionally, the execute immediate statement in the body of the
<<synonyms>>
for-loop specifies the synonym to be recompiled without using a schema-qualified name, hence it implicitly targets a synonym in the current schema, whatever it may be—and in general it may be different from#OBJECT_OWNER#
.Solution: obvious.
Footnotes
With some safety restrictions, maybe, regarding SYS and other Oracle-maintained schemas. ↩
The action is enabled on all nodes of type
CONNECTION
andplscope-utils-root
. ↩The text was updated successfully, but these errors were encountered: