Which two statements are true about triggers? (Choose two.)
A.
All the triggers that are created on a table cannot be disabled simultaneously.
B.
Any user who has the alter privilege on a table can create atrigger using that table.
C.
Oracle provides a two-phase commit process whether a trigger updates tables in the local
database or remote tables in a distributed database.
D.
Triggers become invalid if a dependent object, such as 3 stored subprogram that is invoked
from the trigger body is modified, and have to be manually recompiled before the next invocation.
Tricky question
a suppose C and D is answer but:
A) Incorrect no doubts
B) Alter is insufficient privilige for creating trigger
There were told that ANY user can create trigger using that table, but it is wrong, Only user with “Create ANY trigger” can create ANY trigger + execute privilige to run it.
See the link http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/triggers.htm#LNPLS2003
I also tested this example and i couldn’t create trigger when i have only ALTER privige, only after granting Create trigger i did it…
C) One part of this answer is right another is wrong
http://docs.oracle.com/cd/B28359_01/server.111/b28310/ds_txns003.htm
true part : two phase commit uses in distributed transactions
false part : in local database ONE phase comit only
D) One part of this answer is right another is wrong
http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/triggers.htm#LNPLS20071
true part : after modifications of related sumbrogramms trigger became invalid
false part : we don’t need to recompile trigger manually, system will do this automatically on next trigger invocation and no exception will rise (i tested it by myself)
also this behavior listed in documentation:
So as a result we need to choose 2 answers, C and D is the most right ones but they are contain only HALF of truth…
This why i don’t like to prepare for exam without relevant dumps, because such questions exist…
LOL, that is so true Uladzimir. And I agree with you, having to choose 2 I would go for C and D.
C D
c d
Two-Phase Commit Mechanism
Unlike a transaction on a local database, a distributed transaction involves altering data on multiple databases. Consequently, distributed transaction processing is more complicated, because the database must coordinate the committing or rolling back of the changes in a transaction as a self-contained unit. In other words, the entire transaction commits, or the entire transaction rolls back.
The database ensures the integrity of data in a distributed transaction using the two-phase commit mechanism. In the prepare phase, the initiating node in the transaction asks the other participating nodes to promise to commit or roll back the transaction. During the commit phase, the initiating node asks all participating nodes to commit the transaction. If this outcome is not possible, then all nodes are asked to roll back.
D.
Dependencies for Triggers
Compiled triggers have dependencies. They become invalid if a depended-on object, such as a stored subprogram invoked from the trigger body, is modified. Triggers that are invalidated for dependency reasons are recompiled when next invoked. You can examine the ALL_DEPENDENCIES view to see the dependencies for a trigger.
Recompiling Triggers
Use the ALTER TRIGGER statement to recompile a trigger manually.
CD
A is false: To enable or disable all triggers created on a specific table, use this statement:
ALTER TABLE table_name { ENABLE | DISABLE } ALL TRIGGERS;
B is false: To create a trigger in your own schema on a table in your own schema or on your own schema (SCHEMA), you must have the CREATE TRIGGER system privilege.
So the correct answer must beC and D although I don’t agree.
C – Is only true if using an external reference (like a dblink)
D – It’s true it becomes invalid, but the database will try to compile it the next time it’s invoked if in a local database. If in a remote database it will invalidate the trigger the first time it is invoked and will try to compile it when it is invoked for the second time.
CD