Which statement is true about triggers on data definition language (DDL) statements?
A.
They can be used to track changes only to a table or Index.
B.
They can be defined by all users in the database or only by a specific user.
C.
They are fired only when the owner of the object Issues the DDL statement.
D.
They can be used to track changes to a table, table space, view, or synonym.
Explanation:
d
D
D is wrong because you cannot create trigger on tablespace
A,B is correct I made a mistak in a first attempt
How come A and B?
Ans should not be A because we can have DDL triggers on constraints as well.
It can be B because specific users can define DDL triggers.
Answer is B only. A is wrong becuase DDL triggers can fire on a schema object like as synonyms and sequence.
IF B is correct then C also correct because in schema level trigger can fire only through the schema owner.
D – you can create trigger on create for tablespace – http://www.techonthenet.com/oracle/tablespaces/create_tablespace.php
But you cannot define Schema level DDL trigger for tablespaces as they are not contained in a schema
Hence answer is B
IF B is correct then C also correct because in schema level trigger can fire only through the schema owner.
A seems wrong, for instances, ddl triggers also track changes of constraints….., not only tables and indexes
B is right you can create a ddl on schema on on database…
C may be right for a ddl trigger created on schema….but not for for a ddl trigger on a database
D may be right, any for indexes and constraint, but it’s not written ONLY….
i’m confused
i say B , D
http://www.dba-oracle.com/t_ddl_triggers.htm
i say B , D
https://www.safaribooksonline.com/library/view/oracle-plsql-programming/9780596805401/ch19s02.html
Oracle allows you to define triggers that will fire when DDL statements are executed. Simply put, DDL is any SQL statement used to create or modify a database object………
AND ……
DATABASE OBJECTS ARE :
http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/datatypes.htm#LNPLS348
Schema Objects
Clusters
Constraints
Database links
Database triggers
Dimensions
External procedure libraries
Index-organized tables
Indexes
Indextypes
Java classes, Java resources, Java sources
Materialized views
Materialized view logs
Object tables
Object types
Object views
Operators
Packages
Sequences
Stored functions, stored procedures
Synonyms
Tables
Views
Nonschema Objects
Other types of objects are also stored in the database and can be created and manipulated with SQL but are not contained in a schema:
Contexts
Directories
Parameter files (PFILEs) and server parameter files (SPFILEs)
Profiles
Roles
Rollback segments
Tablespaces
Users
B,D
create or replace trigger
DDLTrigger
AFTER DDL ON DATABASE
BEGIN
dbms_output.PUT_LINE(‘DDL ON DATABASE ora_login_user ‘ || ora_login_user ||
‘ sysdate ‘ || sysdate ||
‘ ora_sysevent ‘ || ora_sysevent ||
‘ ora_dict_obj_type, ‘ || ora_dict_obj_type ||
‘ ora_dict_obj_name ‘ || ora_dict_obj_name );
END;
CREATE TABLE TBTRDDL (ID NUMBER);
DDL ON DATABASE ora_login_user MCDONALD sysdate 09-FEB-15 ora_sysevent CREATE ora_dict_obj_type, TABLE ora_dict_obj_name TBTRDDL
CREATE VIEW VITRDDL AS SELECT * FROM TBTRDDL;
DDL ON DATABASE ora_login_user MCDONALD sysdate 09-FEB-15 ora_sysevent CREATE ora_dict_obj_type, VIEW ora_dict_obj_name VITRDDL
CREATE SYNONYM SYTRDDL for MCDONALD.TBTRDDL;
DDL ON DATABASE ora_login_user MCDONALD sysdate 09-FEB-15 ora_sysevent CREATE ora_dict_obj_type, SYNONYM ora_dict_obj_name SYTRDDL
D,B
Only D
For B users need special priviliges
d
Very nice blog post . I absolutely like this website. Thanks!
http://wwwcenturionwealth.com/
Answer is: D
IF B is correct then C also correct because in schema level trigger can fire only through the schema owner.