Which two reports can be retrieved by using the various procedures in the DBMS_METADATA
PL/SQL package? (Choose two.)
A.
DDL report for all objects dependent on a table
B.
DDL report for all the objects stored in a tablespace
C.
DDL report for all the invalidated objects in a schema
D.
data definition language (DDL) report for all the tables in a schema
http://docs.oracle.com/database/121/ARPLS/d_metada.htm#ARPLS026
B , D
HAY GUYS, NOT ONLY OBJECTS TABLE AND DEPENDENT BY TABLE…….
select dbms_metadata.get_ddl(‘USER’,’SCOTT’)
2 from dual;
CREATE USER “SCOTT”
IDENTIFIED BY VALUES ‘F894844C34402B67’
DEFAULT TABLESPACE “USERS”
TEMPORARY TABLESPACE “TEMP”
you are right, user can be created as well. But the question is just “can”
A,B,D are correct.
But we must choose only two, so I would choose A,D
== A ==
GET_DEPENDENT_DDL()
== B ==
DECLARE
h NUMBER; — handle
th NUMBER; — handle for the transform
doc CLOB; — clob to hold the extracted ddl
BEGIN
h := DBMS_METADATA.OPEN(‘DATABASE_EXPORT’);
th := DBMS_METADATA.GET_TRANSFORM_PARAM(h, ‘DDL’);
LOOP
doc := DBMS_METADATA.FETCH_CLOB(h);
EXIT WHEN doc IS NULL;
INSERT INTO my_ddl VALUES doc:
END LOOP;
DBMS_METADATA.CLOSE(h);
END;
== C ==
No, DBMS_METADATA won’t help you.
select * from all_objects where status = ‘INVALID’ and owner = ‘YOUR_SCHEMA_NAME’
== D ==
The same way as in question #1.
Just use SCHEMA_EXPORT instead of DATABASE_EXPORT.
A.
Usage Notes
GET_DEPENDENT_xxx is used to fetch dependent objects (audits, object grants).
D.
Usage Notes
GET_xxx is used to fetch named objects, especially schema objects (tables, views).
http://docs.oracle.com/database/121/ARPLS/d_metada.htm#ARPLS026