REVOKE/GRANT statement in system triggers

Hi,
I am creating DDL trigger and want to use DCL statement in trigger body. I wrote the below trigger bu it is giving error that invalid DDL operation s in trigger.
Could anyone suggest that how we can use the below DCL statement in trigger body.
CREATE OR REPLACE TRIGGER trg_after_ddl
AFTER DDL ON SCHEMA
BEGIN
IF ( ora_login_user = 'X' ) THEN
     IF (ora_database_name = 'XYZ.WORLD') THEN               
          EXECUTE IMMEDIATE 'REVOKE CREATE TABLE FROM X';
          EXECUTE IMMEDIATE 'REVOKE CREATE SEQUENCE FROM X';          
     END IF;
END IF;      
END;
Thanks.
Alok

Hi Forstmann,
You are correct that's why I am getting this error.
Could you suggest any other way to achieve this. My requirement is that provide create rights when user tries to create some object and after creation of object revoke the same.
Regards,
Alok

Similar Messages

  • ORA-30511: invalid DDL operation in system triggers

    Hi,
    I am calling a procedure in a Trigger.
    In that Procedure EXECUTE IMMEDIATE is used to CREATE a table.
    But when The Trigger is firing its giving Error as :ORA-30511: invalid DDL operation in system triggers
    Kindly any help will be needful for me

    user598986 wrote:
    Hi,
    I am calling a procedure in a Trigger.
    In that Procedure EXECUTE IMMEDIATE is used to CREATE a table.
    But when The Trigger is firing its giving Error as :ORA-30511: invalid DDL operation in system triggers[I thought I already explained it|http://forums.oracle.com/forums/message.jspa?messageID=3379456#3379683]. And again, granting privileges dynamically in a logon trigger is a very bad design. If you want to stick to it, you could schedule a job in trigger, as Timur suggested, however keep in mind, job runs asynchronously, so trigger will have to wait for the job to finish. Otherwise there might be a gap where session would not have privs granted yet.
    SY.

  • I;m no longer able to use the Penn State ANGEL system (I teach on line) for my email and intead get messages about "script" problems.

    Question
    I'm no longer able to use the Penn State ANGEL system (I teach on line) for my email and instead get messages about "script" problems

    I have asked a moderator to provide assistance, they will post an invite on this thread.
    They are the only BT employees on this forum, and are a UK based team of people, who take personal ownership of your problem.
    Once you get a reply, make sure that you are logged into the forum, then click on their name, you will see a screen like this. Click on the link as shown below.
    Please do not send them a personal message, as they may not be on duty for a long time, and your message will not be tracked properly.
    For your own security, do not post any personal details, on this forum. That includes any tracking number you are give.
    They will respond either by phone or e-mail within 5-6 working days.
    Please use the tracked e-mail, to reply, not via the forum. Thanks
    This is the form you should see when you click on the link. If you do not see this form, then you have selected the wrong link.
    When you submit the form, you will receive an enquiry number, so please keep a note of it
    There are some useful help pages here, for BT Broadband customers only, on my personal website.
    BT Broadband customers - help with broadband, WiFi, networking, e-mail and phones.

  • How to see all the system triggers in the database?

    and how to make the logon trigger to call a procedure?

    Not sure what you mean by system triggers. If it is database_event triggers, then:
    SELECT * FROM DBA_TRIGGERS WHERE  TRIM(TRIGGERING_EVENT) IN ('SHUTDOWN','STARTUP','LOGON','LOGOFF','SUSPEND','DB_ROLE_CHANGE')
    and how to make the logon trigger to call a procedure? same as averywhere else.
    SY.

  • How to disable system triggers?

    I'm in the process of applying patchset 8.1.7.4 and the documentation here says to disable system triggers by setting the systemtrig_enabled_ to false in the pfile. The problem is that I cannot find this parameter in the pfile!! Is this normal?

    put this line in the pfile and bounce the db and start it. If you dont get any errors while starting up db then you can go ahed with the process.

  • Granting any privilege system privilege....in Ora10g

    Hi,
    In order to be given to a user -Info_bi let's name him - the grant to select any table from user Info , This user (Info) must be given the system privilege "any privilege".... So :
    connect sys/....@.... as sysdba;
    Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
    Connected as SYS
    SQL> GRANT ANY PRIVILEGE TO "INFO";
    GRANT ANY PRIVILEGE TO "INFO"
    ORA-00990:Privilege is missing or invalidWhat error do i do...????
    Many thanks...
    Sim

    There is.......!!!!
    Read at :
    Oracle® Database SQL Reference
    10g Release 2 (10.2)
    Part Number B14200-02
    The Prerequisites section of the grant command....
    I pasted there an extract of it...
    To grant a system privilege, you must either have been granted the system privilege with the ADMIN OPTION or have been granted the GRANT ANY PRIVILEGE system privilege. Greetings,
    Sim

  • Unable to revoke "select any table" system priv

    I created a new user and unable to revoke select any table permissions. It appears that any new oracle user i create has the select any table permissions. I want to only alow this new user to select from 5 tables and not others. It seems as though there is a global setting on the database to allow select from any table. I can't change that if thats the case but i would like to create this restricted user.
    How can I modify permissions on my new oracle user to not allow select any table?
    Any help would be appreciated

    My thanks again to all that took the time to post!
    I ran those statements and the select that Aman had posted. The output surprised me and probably will lead to identifying the problem.
    As you can see below the SELECT ANY TABLE privilege is under the sessioni_privs. however im also confused why the "revoke select any table from ITEAMS;" didnt work. here is the output from the suggestions in your posts.
    SQL> connect iteams
    Enter password:
    Connected.
    SQL> show user
    USER is "ITEAMS"
    SQL> select * from dba_sys_privs where grantee = 'ITEAMS';
    GRANTEE PRIVILEGE ADM
    ITEAMS CREATE SESSION NO
    SQL> select * from session_privs;
    PRIVILEGE
    CREATE SESSION
    UNLIMITED TABLESPACE
    SELECT ANY TABLE
    SQL> connect sys as sysdba
    Enter password:
    Connected.
    SQL> show user
    USER is "SYS"
    SQL> revoke select any table from ITEAMS;
    revoke select any table from ITEAMS
    ERROR at line 1:
    ORA-01952: system privileges not granted to 'ITEAMS'
    SQL> select * from user_tab_privs_made where grantee='ITEAMS';
    no rows selected
    So if the SELECT ANY TABLE is within the session_privs as seen above. How can i reovke that priv?

  • Illustrator CS6 constantly crashing on Windows 7 system, triggered by the navigator. Anyone else??

    Hello,
    I have now been experiencing this problem for the past 7 months (since using a PC in my current position on a Windows 7 operating system). It is incredibly frustrating! I had previously used a Mac, and continue to do so at home and do not have this problem.
    Whenever I use the navigation tool in Illustrator CS6, and have done so for a sustained period of time (for example moving across 3+ artboards), Illustrator crashes without warning. I get a message window that says 'Illustrator has encountered a problem and needs to close.' Then when you press OK, it freezes and quite often I have to manually restart the PC by holding the power button down as CS6 is unresponsive in Task Manager, or I have to log out and back in again. I only realised the link with the Navigation tool after this repeatedly happened, up to 4 times a day on average and I kept a log to record what I was doing at that moment. I have only retained my sanity with the help of auto-save. Prior to this I would lose hours of work a day.
    I saw on a similar thread on this forum that said the bug could be triggered by the use of a Wacom tablet (I have an Intuos 3 with the latest drivers) so I tried working with a mouse for 2 weeks and although the problem happened slightly less frequently, it still happened. Therefore I wondered if perhaps the Wacom just increased the speed of the navigator and aggravated the problem. I also read it could be triggered by an Nvidia graphics card, so I installed a Radeon HD6570 but the problem remained.
    Now fast-forward 7 months and I have a whole new system, a brand new PC with 8GB RAM and 3 GHZ processor speed in a last chance attempt to rule out any hardware link. Unfortunately, it has just happened AGAIN. Now I have eliminated any link to hardware, it is clearly a software problem (Namely Windows 7/CS6 incompatibility). A similar problem has also been listed on the Adobe site in which it claimed it would be fixed with an update, but after downloading this the bug is still there.
    Has anyone else experienced this problem? And even though Adobe are aware of it...when can I expect an update that fixes the problem? I can't be the only one. Any advice appreciated. Thanks

    Hello,
    Why did you say nothing has changed? Does that mean it was working but now it's not?
    Do you have a folder called c:\temp? If so rename it to c:\myTemp. If you don't then search for your \Temp folders and delete any XML files, DO NOT DELETE ALL XML files.
    Make sure you are logged in as a local PC administrator, disconnect your network cable, disable your anti-virus and then do a  repair install on Crystal Reports
    Don

  • How to restart Java Application from state when system crash

    I want to know about the API that provide mechanism to save your program state peroidically or any specific task completed of application and if system crash and next time when application restart it should be started from previous state.
    I required solution urgently plz. replay as soon as possible

    write it yourself.
    Serializable Interface, FileOutputStream, ObjectOutputStream ... that'd be a start for you.

  • Production System triggers alerts in development environment

    Hi all.
    I've configured Alerts in XI development environment. I haven't configured them in any other environment yet but I'm getting alerts into the Alert Inbox of development environment, triggered by production XI system. How is this possible?
    Thanks a lot,
    Gari.

    Hi Rodrigo.
    I'm sure I haven't configured PRD system for alert triggering, and it shouldn't be happening. The alert triggered from PRD system has the same text description I configured in development ALRTCATDEF.
    It is as if the alerts were being caught by the development system through any other channel. Production SLD has the DEV system registered, but I don't think this could be a possible reason. It's very strange.
    Thanks a lot,
    Gari.

  • GRANT statements in EXEC SQL/ENDEXEC

    Hello, All!!
    Can someone please advise if this is possible in ABAP? Sample code is:
          exec sql.
            GRANT SELECT ON :tabname TO 'DB_ROLE'
          endexec.
    I am getting a ORA-00903 error, the trace file is showing "GRANT SELECT ON :A0  TO 'OWB_BI_READONLY';"
    Please advise ASAP; points guaranteed for helpful answers.
    Best Regards,
    Reenal

    Hi Reenal,
    Try using the below code:
      data: zsql type ref to CL_SQL_STATEMENT.
      CREATE OBJECT ZSQL.
      tabname = <i>tablename</i>.
      data: lv_state(200),
            lv_strstate type string.
      concatenate
            'GRANT SELECT ON'
            tabname
            'to OWB_BI_READONLY'
            into lv_state separated by space.
      lv_strstate = lv_state.
      translate lv_strstate to upper case.
      TRY.
          CALL METHOD ZSQL->EXECUTE_DDL
            EXPORTING
              STATEMENT = lv_strstate.
        catch CX_SQL_EXCEPTION INTO exc_ref.
          error_text = exc_ref->get_text( ).
          MESSAGE error_text TYPE 'I'.
      ENDTRY.

  • Error when trying to issue a grant statement for Scott's emp table

    I'm trying to complete a lab assignment in which we have to grant the select on Scott's emp table. Here is the statement I used. I'm wondering why did i receive the error that the table doesn't exist.
    SQL> GRANT SELECT ON SCOTT.EMP TO DEV;
    GRANT SELECT ON SCOTT.EMP TO DEV
    ERROR at line 1:
    ORA-00942: table or view does not exist
    Edited by: user566571 on Dec 4, 2009 8:19 AM

    Are you the owner of the emp table ? If not then
    Do the user(which you are using to grant the privilege) has GRANT ANY PRIVILEGE or GRANT ANY OBJECT PRIVILEGE privileges ?
    Do the user has been granted the appropriate privileges on the SCOTT.EMP WITH GRANT option ?
    To grant the privileges to the role, first your user should have those privileges and that with the option to grant to others using WITH GRANT.

  • How to identify the state of system cursor

    Hi All,
    My requirement is to identify the state of the system cursor and when it changes to normal mode from hour glass mode i have to do an action. Of all the things i had gone through it only dealt with the cursor that appears over a java component(setCursor() method etc).
    Can anyone please provide me the solution to identify the state of the system cursor.
    Since i am dealing with the mouse pointer that is not subclassed from JAVA's component class even sample coding to identify the system cursors state will help.
    In simple wordings,
    1)A non JAVA related process is running in the foreground which will change the mouse pointers state from hour glass to regular and vice versa.
    2)My JAVA program which is running in the background has to identify the systems cursor state change and trigger some events.
    Note: I had tried all of the possible methods in Component class and Cursor class which never worked out.
    Your solution will be of great use to me. Please help.

    Kaleeswaran15 wrote:
    ..I dont want the cursor in screenshot. What i wanted is to find the time when the mouse pointer changes its status to regular from Hourglass. .. Oh, I thought you meant to grab an image including the current cursor, and analyze the image for the presence of an arrow or hourglass. My bad.
    In any case, if the user is that keen to know via your Java application whether the mouse pointer of another program has changed to the wait state, there is always..
    int askTheUser = JOptionPane,showConfirmDialog(
        this,
        "Is XYZ app. busy?",
        "XYZ app. busy?",
        JOptionPane.YES_NO_OPTION);
    if (  askTheUser==JOptionPane.YES_OPTION ) {
        // XYZ app. is busy!
        // ...... untested.
    ..Thank you.You are welcome.

  • What if GRANTS statement are executed twice?

    What happens if GRANTS statments are executed twice?
    Will there be any error thrown at the time of second execution?
    And will we need to revert twice in case we need to remove the GRANTS?
    Does it matter which user can give GRANTS if the user has the ccess to pass on the GRANTS for a particular object?
    thanks,
    tik

    To add to what Sybrand said, as long as the username that runs the grant script has the necessary privilege then who issues the grants does not matter. However you cannot directly grant privileges for another users object to yourself even if you can grant them to another user so if the username who ran the script was intended to receive some of the grants then you definitely need to rerun the script.
    Rerunning the script as the intended user would not hurt anything. Only one revoke would be necessary to remove any granted privilege and it can be issued by any user with the privilege necessary to perform the revoke such as the object owner or a DBA.
    HTH -- Mark D Powlel --

  • Control Statement inside System.out.println

    I am printing something like this:
    System.out.println(parts1[0] + "|" + parts1[1]); Now, I want to keep a check i.e. if parts1[1] is say 3 I want to printout Hi and if parts1[1] is any other digit I printout Hello. [parts is obtained by using split method from data]
    Can I do it inside the print statement?

    Be judicious about this though. Unless the ternary expression and the overall argument to println are both very simple, you'll end up with an unreadable, unmaintainable mess. The only advantage to doing it all inside the println argument is compactness. If it gets unwieldy, break it up into separate statements, assign the end result to a variable, and print that.

Maybe you are looking for

  • Bad performance when iterating/updating the rows of a tree table

    Hello, we have a tree table based on a VO and EO (with transient attributes). One of the attribute is a flag. The VO is populated with a complex query having many thousands of rows. Now, when the user clicks on a parent node, all the children are upd

  • How can you change your security question?

    I have tried to change my security questions but it does not work the way the support website tells you to. Does anyone know how to so this without having numerous email accounts?

  • Use of APT objects in 64-bit LabVIEW

    I have created an APT motion control VI to control a translation stage using 32-bit LabVIEW. However, I have since had to move to 64-bit LabVIEW. I am trying to create a similar VI that will run on the 64-bit version. The problem is when I create my

  • How do I export my contact list from 10.3.9 to a 10.4 mac?

    I have an iPhone 3G.  I am unable to sync it with my emac 10.3.9.  I also have a imac 10.4, but it does not have my email contact list on it.  How do I export my contact list from the 10.3.9 to the 10.4, so I can sync it with my new iPhone 3G?

  • Mi ipod touch 16 GB iOs 1.1.5 no se conecta con iTunes

    mi ipod 16 GB iOs 1.1.5 no se puede conectar a iTunes Store, aunque el ordenador reconoce el iPod y el diagnostico es correcto