Why the DR unit does not trigger schema when it is called remotely?

Hi all

I have a question about the triggers of oracle schema and I would be grateful if you could kindly give me a helping hand.

Oracle version: 11 GR 2 (11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit)

OS:                      Linux Fedora Core 17 (X86_64)

I was reading the online documentation on schema triggers where oracle says:

Assume that users user1 and user2 own schema triggers and user1 invokes a DR unit owned by user2. Inside the DR unit, User2 is the current user. Therefore, If the DR unit triggers the triggering event of a trigger schema that User2 owns, while the trigger is activated.

I wanted to see this behavior in practice, so I made the following test case:

-There are two schemas:

  • testuser where I create a procedure with AUTHID DEFINE (a unit of the Dr. therfore) named createTab. This procedure takes a table name as a parameter and if no table with this name exists already in the testuser schema, it will create a new table with the same name with a single column of type NUMBER (well, it's just an example to this issue, in practice I never create my tables this way)

  • training is therefore another scheme to which we grant the privilege EXECUTE on the above mentioned procedure createTab so that it may be possible to create tables on schema testuser by calling the remote procedure.

The idea behind the test is to create a schema for testusertrigger, so that whenever he is, for example, a creation of the table, a message is inserted into a table of newspaper (just an example to show proof that trigger the diagram has been drawn on the table creation event). Now assuming I admit the EXECUTE privilege on the procedure of createTab for the trainingscheme, then any creation of the remote table must trigger the schema trigger, because according to the documentation inside the unit of the DR, the user is not considered appellant user (= training) but actually the owner (= testuser) that created the trigger and procedure.

The problem is that I cannot see it in my test. Therefore I will write here my test case so that you can have a look at it and to indicate where I did wrong, and what I misunderstood in the documentation.

So here's what I created on the schema testuser

Code

SET SQLBLANKLINES

ALTER SESSION SET PLSQL_WARNINGS = ' ENABLE: ALL ';

SET SERVEROUTPUT ON;

-A table of newspaper in which the schema trigger inserts messages


-indicating that the schema trigger was triggered (as proof)

CREATE TABLE tablog (logMsg VARCHAR2 (100));

-Here is the procedure that updates the above defined log table (tablog)

-This procedure (autonomous transaction) is called by the schema trigger

CREATE OR REPLACE PROCEDURE updateLog (p_logMsg IN tablog.logMsg%TYPE)

DEFINE AUTHID

IS

PRAGMA AUTONOMOUS_TRANSACTION;

BEGIN

INSERT INTO tablog (logMsg) VALUES (p_logMsg);

COMMIT;

END updateLog;

/

DISPLAY ERRORS;

-This is the procedure we use to create tables (which will be called so

-remotely from another schema-> training)

-As stated above, the procedure takes a table
-name as a parameter and creates a table with a single column of type NUMBER

-that if no table with this name exists already

CREATE OR REPLACE PROCEDURE createTab

(

p_tabName IN user_tables.table_name%TYPE

)

AUTHID DEFINE - Therefore a unit DR that we explicitly specify AUTHID DEFINE

IS

BEGIN

< < bk > >

DECLARE

tabName user_tables.table_name%TYPE;

BEGIN

-Check to see if a table with the name p_tabName
-already exists

T1.table_name SELECT INTO bk.tabName

FROM user_tables t1

WHERE t1.table_name = upper (p_tabName);

EXCEPTION

-No table with this name exists, so we create now

WHEN NO_DATA_FOUND THEN

IMMEDIATELY RUN 'CREATE TABLE ' |

p_tabName | '(NUMÉRO n) ';

END;

END createTab;

/

DISPLAY ERRORS;

- And finally it is the schema for the schema 'testuser '.

-Any appeal of the above mentioned procedure createTab (if the procedure)
-creates a new table) fires the following trigger

CREATE OR REPLACE TRIGGER testuser_schema_tr

Before you CREATE on testuser.schema

BEGIN

-Just insert a message into the table of the newspaper showing the evidence
-that our schema trigger wiped of CREATE TABLE
-statements

updateLog

(

TO_CHAR (sysdate, ' ' MON-DD-YYYY HH24:Mi:ss) |

' ': Schema for testuser trigger pulled.

);

END testuser_schema_tr;

/

DISPLAY ERRORS;

-I grant the privileges required for the formation of the user/schema
-may also be able to remotely run my procedure

GRANT EXECUTE ON createTab to training;

GRANT SELECT ON tablog to training;

First, I tested the procedure createTab locally (so be etre connecte connected as drawing testuser , in other words, the owner of the procedure and the relaxation). Everything worked pretty well and created table, that table the journal has been updated by the trigger which showed that in fact after each CREATE TABLE statement, the trigger was activated.

However, when I opened a new SQL * Plus term, this time in being connected as a training scheme, I have observed that, once again, it was possible to create tables on schema testuser remotely, but the log table has been updated no more, which means that the trigger has not wiped CREATE TABLE statements that were issued remotely (by remote createTab procedure call).

Code

SQL > EXECUTE testuser.createTab ('tmptab');

PL/SQL procedure successfully completed.

SQL > SELECT * FROM testuser.tablog;

no selected line

SQL > USER to see THE

The USER is 'TRAINING'


SQL >

Any idea? Why unity DR (createTab procedure) does not have the schema trigger, unlike what documents said, when it is called remotely?

Thanks in advance,

Dariyoosh

It works for me on Oracle 11.2.0.3

August 21, 2013 18:10:12: trigger pulled schema

But not on 11.2.0.1

It looks like a bug.

Tags: Database

Similar Questions

  • in the APEX by clicking on the link hyper does not trigger session timeout page

    Hi all
    I have a question about the application of APEX session time-out. I created a simple application of the APEX. In the region report SQL section, I have code like this:

    SELECT DOC_Name, DOC_URL,
    "" < a href = "" | DOC_URL | "target ="_blank"/" > download < /a > ' pdf_link
    FROM test_table
    where emp_number = 00010001

    When the user click on the hyper link, it will show the landing page for the user (for example if DOC_URL = 'http://forums.oracle.com', it displays the oracle forum page in a new browser).

    But the problem is that after the user session timeout (I set to 240 seconds through shared components > change the security attributes, I put max the session for example 240 seconds timeout) when I click on this hyperlink, it does not raise my session timeout page and it still shows the page (oracle forum page).

    Why in the APEX by clicking on the link hyper does not trigger page session timeout after the user session timeout?

    How implememt or fix to trigger the session timeout page after clicking on hyperlinks?

    (BTW, our version of the APEX is 3.2)

    Thank you!

    Hello

    rather than use your my_stored_procedure you could call a new APEX page where you have a page called P999_PDF_ID. On this new page you would have
    treat a front header PL/SQL with the same code you have in your "my_stored_procedure". The only change would be to add a

    apex_application.g_unrecoverable_error := TRUE;
    

    at the end of your code as well as APEX does not generate a standard page of APEX.

    That's all. If a user clicks on a link, APEX will check the session timeout and if everything is ok, download your PDF file.

    Concerning
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Why the MacBook Air does not recognize my Adobe ID?

    I have a paid Adobe ID.

    I would like to use to install the Adobe CC, I know to be available for a total of two computers.

    I am currently using, like many Mac pro.

    But there was a problem.

    I also have a Macbook air.

    MacBook air into account is not active.

    ID payment is complete and is active in the MacBook Pro.

    Not available for the MacBook Air why?

    The MacBook Air does not show the message log on another commitment signed in devices.

    Just again once this to tell me, 'make a payment '. But I already paid!

    Why the MacBook Air does not recognize my Adobe ID?

    Troubleshooting FAQ: What should I do if I have a subscription, but my application acts as if I had a trial?

  • Why the original image does not appear on my desktop and not Wo one?

    Why the original image does not appear on my desktop and not Wo one?

    I made adjustments to an image that shows himself such that adjusted with the symbols at the bottom right of the image.
    I tried to drag and drop and he transferred the original image.

    The adjusted picture can be transferred and what I need to do or I do something wrong?

    Thank you

    Greg,

    Claes has pretty much nailed. You will do well to spend time to learn how Lightroom works. He is not like most software that you've used before, and if you don't understand what it does and how it does, you stand a good chance of losing your images.

    Try googling 'Lightroom tutorials' or 'get started in Lightroom. It's not rocket science, but it's different.

    HAL

  • Why the CC lightroom does not recognize my users folder when you try to import?  I can not imaport images in the program.  It has worked well in the past

    Why the CC lightroom does not recognize my users folder when you try to import?  I can not imaport images in the program.  It has worked well in the past

    It is an Apple problem. They obviously fixed with a change to iTunes. Download the update on their part.

    HAL

  • Why the serial number does not appear after typing the code out of the card I bought?

    Why the serial number does not appear after typing the code out of the card I bought?

    See the following topics:

    Using redemption code

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

    http://helpx.Adobe.com/x-productkb/global/redemption-code-help.html

  • Why the object_not_found exception does not work?

    Posters,

    I have the following statement in a package.procedure:

    -- (...)
    Start

    Select dbms_metadata.get_dependent_ddl ('INDEX', 'OWNER', sTableName)
    in the cDDL - clob for index DDL
    of the double
    -- (...)

    exception
    When dbms_metadata.object_not_found then
    null;

    end;
    -- (...)

    Execution is stopped in the select, not enter the exception and the following message is displayed in PL/SQL Developer MicroHelp:

    + "ORA-31608: specified object type INDEX not found." + "

    I did it another way by adding the following clause:

    -- (...)
    Start

    Select dbms_metadata.get_dependent_ddl ('INDEX', 'OWNER', sTableName)
    in the cDDL - clob for index DDL
    of the double
    where exists (select 1+)
    of all_indexes+.
    where table_owner = 'OWNER'+.
    and table_name = sTableName); +
    -- (...)

    exception
    + When no_data_found then +.
    null;

    end;
    -- (...)

    It works, but: why the object_not_found exception does not work?

    Thanks in advance for everyone!
    Philips

    Oh I just noticed:

    What happens if instead of this:

    Select dbms_metadata.get_dependent_ddl ('INDEX', 'OWNER', sTableName)
    in the cDDL - clob for index DDL
    of the double

    you say:

    cDDL: = dbms_metadata.get_dependent_ddl ('INDEX', 'OWNER', sTableName);

    ?

  • to refine my question. The Lasso tool does not work.  When I select the content aware lasso shrinks and nothing changes.  Help please.

    to refine my question. The Lasso tool does not work.  When I select the content aware lasso shrinks and nothing changes.  Help please.

    A simple reset will often be the case if a tool becomes awkward. Go to this link, then select the lasso tool:

    Difficulty of tool

  • Why the STOP button does not stop this vi?

    Hello

    I took an example of Labview 2011 called "soul hollow period-Low Freq 1 Ctr.vi. This example vi measures one period, but, I want to measure the period over and over again, so I put it in a WHILE loop, but the STOP button does not stop at the vi.  Instead, I have to use ABORT to stop the vi...

    How can I stop this vi?

    Dave

    It does not replace the time-out.  The while loop is a separate beast from the meter reading.  You wouldn't want your loop due to always make you miss the error messages, would you?

    Usually just clear the error message of time-out on the counters.

    You get the message twice because the loop runs in fact twice.  The first time the stop button is read as false as soon as the loop begins.  Then you click on it.  At the same time that it takes 10 seconds for the timeout counter to occur - when he does it gives you the error.  Then, the loop runs again.  This time it reads the key stop as true, because you clicked on it during the timeout of 10 seconds of the last loop.

    A time loop allows everything inside to complete execution before the end, then you will have to wait for an another timeout of 10 seconds to occur which produces another error.

    Unless you need a measure of very, very low frequencies I set your time-out to a more reasonable number and simply erase the mistake if it matches 200474.

  • Why the mouse keys does not work?

    I would use MouseKeys in windows to use my keyboard as a mouse, but I was not able to get the function runs.

    I am able to activate the MouseKeys without any problem, but by pressing the keys on the numeric keypad does not move the pointer of the mouse at all.

    I can see the mouse keys icon in the notification area of the taskbar of windows 7 and I am able to switch between the left and right mouse buttons using the / and - keys on the keyboard, but that's all I can do.

    Anyone have any ideas on what I can do?

    Thank you

    Jason

    Hi, thanks for your response.

    I found the solution to my problem. Keys mouse was working, but I didn't know it because my mouse speed setting is set to minimum. Although it seemed that nothing was happening when I was pressing the keys on the numeric keypad, the mouse began in fact to move, but only very slowly.

    I adjusted my settings of the mouse, and the mouse keys now work properly.

    Thanks again

    Jason

  • My speakers stopped working suddenly. the message I get is good card can be used, but the volume control does not appear and when I go into sounds and devices, everything is gray.

    My speakers suddenly stopped working. I went to audio and I received a message sound card may be in use. The volume control does not appear atr from the bottom of the screen and when I go into properties, everything is gray.

    Hi BarbaraEvanchik,

    ·         What is the brand and model of the computer?

    ·         Did you do changes on the computer before the show?

    Follow the steps in the article.

    How to troubleshoot sound problems in Windows XP

    For reference: no sound in Windows

  • Why the story to does not work on onclick in Firefox?

    Why doesn't javascript:history.back() not working on onclick in Firefox? All the form fields are empty if recaptcha filled with evil and the page is reloaded. This works fine on chrome, but not Firefox. Please suggest how we can solve this problem. Make it work like chrome charge back that all fields should not be empty.

    The server sends "no-store" with the page, while Firefox does not store the form once you leave the page. (See attached screenshot).

  • Why the alt tag does not work in firefox to open a description of an image on mouseover

    In IE, when I ride my mosue over an image, it gives a description of the ToolTip of the image contained in the html alt tag. Why this does not work in Firefox?

  • Why the parent class does not report data for child in LVOOP class?

    Attached is a practical program that I wrote to learn about the legacy with LVOOP.

    I have the impression of OOP is a Parent class describes the type of object.  Then the children inherent description of the parent.  The child may also have additional qualities, but it still contains the description of the parent.  If a child does not have a VI bearing the same name as the parent and the parent VI will be loaded and executed.

    My questions:

    (1) why does the Parent.lvclass:Read.vi not report 'Child' in the channel indicator when the child write VI has been sent?

    2) matches the data of the child, do not at all seen by the parent company even when it has the same definition (that's the String)?  I understand that the Parent do not know anything about the unique child elements, but I think we should know about the common themes which inherited the child.

    Here is my sample code:

    These are two different sets of data. The parent class has a data set containing the string, the class of the child also has a data set containing the string, but both of these channels are separated.

    This can be made apparent, by changing the names of the channels based on their respective categories:

    What you want is for your children, class VI write to access the data of the parent class. You can do this with a simple data VI member access in VI of the child:

  • Why the text tool does not work?

    whenever I choose the text tool that doesn't work. It allows me to create the bar, but the curosor doesn't even blink. I type and its Blanck. I hit accept the test I typed shows on the layer, but not on the screen, I need help. I've even updated, reinstalled. I need help I am ready to throw my laptop. Please someone

    Is this a new problem with an old facility?

    Or a new facility and the Type of tool has never worked?

    What is the size of the image in pixels and resolution?  Something that sometimes happens is that people get the wrong units and I think they are pixel setting when it is in fact centimeters.  If you have a low resolution game, like the default 72 dpi, which can cause the tiny text, it might as well be invisible.  This is particularly problematic when the Type is set on Points.  To test simply do a new document with reasonable proportions.  that is 1000 x 1000 pixels, 300 dpi

    Another test is to select the text layer and use free transform, or zoom so you can see if you have a small bounding box.

    If this isn't the question and the text color is not the same as the background, then...

    First step is to reset the preferences.  (The relocation does not overwrite the preferences file).

    Also try resetting subject tools.

    Then uninstall Photoshop and use the cleaning tool before reinstalling.

Maybe you are looking for