Which statement is true about triggers on data definition language (DDL) statements?

Which statement is true about triggers on data definition language (DDL) statements?

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:



Leave a Reply 20

Your email address will not be published. Required fields are marked *


samkelo siyabonga ngubo

samkelo siyabonga ngubo

D

Jesus Ferrer

Jesus Ferrer

D is wrong because you cannot create trigger on tablespace

samkelo siyabonga ngubo

samkelo siyabonga ngubo

A,B is correct I made a mistak in a first attempt

Saket

Saket

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.

Vladimir K

Vladimir K

Answer is B only. A is wrong becuase DDL triggers can fire on a schema object like as synonyms and sequence.

Ab Hin

Ab Hin

IF B is correct then C also correct because in schema level trigger can fire only through the schema owner.

Piero

Piero

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

Piero

Piero

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

Piero

Piero

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

Uladzimir

Uladzimir

Only D

For B users need special priviliges

Ab Hin

Ab Hin

Answer is: D

IF B is correct then C also correct because in schema level trigger can fire only through the schema owner.