You are on page 1of 9

Test: Semester 2 Final Exam 1.

To include selections of code for compilation based on user-defined val ues, use the PLSQL_CCFLAGS parameters. True or False? Mark for Review (1) Points True (*) False

Correct 2. In the following example, what statement belongs in Lin e A? ALTER SESSION SET PLSQL_CCFLAGS = 'debug:true'; CREATE OR REPLACE PROCEDURE testproc IS BEGIN ... $IF $$debug $THEN DBMS_OUTPUT.PUT_LINE('This code was executed'); -- Line A ... END testproc; ALTER SESSION SET PLSQL_CCFLAGS = 'debug:false'; Mark for Review (1) Points $ENDIF $$END; $END (*) $ELSIF $END;

Correct 3. How would you determine the current Oracle database ver sion? Mark for Review (1) Points DBMS_DB_VERSION.RELEASE

DBMS_DB_VERSION.VERSION (*) DBMS_DB_VERSION.VER_LE_10 DBMS_DB_VERSION.VER_LE_11

Correct 4. Obfuscation does not allow anyone to see the source cod e, including the owner. True or False? Mark for Review (1) Points True (*) False

Correct 5. You created a package named pkg1. The code is approxima tely 90,000 characters. What is the statement that you use to obfuscate this pac kage in the database? Mark for Review (1) Points DBMS_DML.CREATE_WRAPPED (pkg1); WRAP pkg1.sql DBMS_DML.CREATE_WRAPPED ('CREATE OR REPLACE PACKAGE BODY pkg1...); WRAP INAME=pkg1.sql (*) DBMS_DML.CREATE_WRAP (pkg1);

Correct 6. When wrapping subprograms, the entire PL/SQL code must be included as an IN argument with data type CLOB to allow for any size program. True or False? Mark for Review (1) Points

True False (*)

Correct 7. EVEL. (Choose three) (1) Points Identify examples of benefits of using PLSQL_OPTIMIZE_L Mark for Review (Choose all correct answers) Modify source code to optimize frequently-used elements at the top. Control what PL/SQL does with useless code. (*) Backward compatible with previous versions of the Oracle database. (*) Separating compiled code so that separate units may be repeated as neede d. Copy compiled code from one subprogram into another subprogram. (*)

Correct 8. To determine the current setting for PLSQL_OPTIMIZE_LEV EL, query the data dictionary view USER_PLSQL_OBJECTS_SETTING. True or False? Mark for Review (1) Points True False (*)

Correct 9. Native compilation always runs faster; therefore SQL st atements in PL/SQL will always run faster, also. True or False? Mark for Review (1) Points True

False (*)

Correct 10. In the USER_ERRORS data dictionary view, if an error is prefixed with "Warning," the command completes but has a side effect the user n eeds to know about. For all other errors, the command terminates abnormally. Tru e or False? Mark for Review (1) Points True (*) False

Correct 11. Select the three categories of PL/SQL compiler warning levels. Mark for Review (1) Points (Choose all correct answers) ENABLE DISABLE SEVERE (*) INFORMATIONAL (*) PERFORMANCE (*)

Correct 12. The informational warning level of the PL/SQL compiler identifies poor coding practices, for example, code that can never be executed. True or False? Mark for Review (1) Points True (*)

False

Correct

Section 14 (Answer all questions in this section) 13. Examine the following code: CREATE VIEW ed_view AS SELECT * FROM employees NATURAL JOIN departments; CREATE PROCEDURE ed_proc IS CURSOR ed_curs IS SELECT * FROM ed_view; Which of the following statements about dependencies are true? (Choose two.) Mark for Review (1) Points (Choose all correct answers) ED_PROC is indirectly dependent on DEPARTMENTS (*) EMPLOYEES is referenced by ED_VIEW (*) ED_CURS is directly dependent on ED_VIEW ED_PROC is referenced by ED_VIEW ED_PROC is directly dependent on EMPLOYEES

Correct 14. Which of the following will display the number of inval id package bodies in your schema? Mark for Review (1) Points SELECT COUNT(*) FROM user_objects WHERE object_type = 'PACKAGE BODY' AND status = 'INVALID'; (*)

SELECT COUNT(*) FROM user_dependencies WHERE type = 'PACKAGE BODY' AND status = 'INVALID';

SELECT COUNT(*) FROM user_packages WHERE status = 'INVALID'; SELECT COUNT(*) FROM user_objects WHERE object_type LIKE 'PACKAGE%' AND status = 'INVALID';

Correct 15. The PL/SQL variable V_LAST_NAME is used to store fetche d values of the LAST_NAME column of the EMPLOYEES table. To minimize dependency failures, the variable should be declared as: v_last_name VARCHAR2(25); True or False? Mark for Review (1) Points True False (*)

Correct 16. Which of the following will display dependency informat ion which has been generated by executing the DEPTREE_FILL procedure? (Choose tw o.) Mark for Review (1) Points (Choose all correct answers) The USER_DEPENDENCIES view The DEPTREE view (*) The UTLDTREE script The DISPLAY_DEPTREE view The IDEPTREE view (*)

Correct 17. When a table is dropped, all PL/SQL subprograms that re ference the table are automatically dropped. True or False? Mark for Review (1) Points True False (*)

Correct 18. A SELECT from the DEPTREE table displays table LOCATION S at nested level 0 and procedure LOCPROC at nested level 2. This shows that LOC PROC is directly dependent on LOCATIONS. True or False? Mark for Review (1) Points True False (*)

Correct 19. A single procedure can be both a referenced object and a dependent object. True or False? Mark for Review (1) Points True (*) False

Correct 20. Which of the following techniques will make it more lik ely that an invalidated PL/SQL subprogram will recompile successfully? (Choose t wo.) Mark for Review (1) Points (Choose all correct answers) Declaring record structures using %ROWTYPE (*)

Using a cursor FOR loop instead of opening and closing the cursor explic itly SELECTing a list of column-names instead of using SELECT * Including a column list with INSERT statements (*)

Incorrect. Refer to Section 14 Lesson 1. 21. If two related objects are in different databases, the dependency betwe en them is automatically recorded on the dependent object's data dictionary. Tru e or False? Mark for Review (1) Points True False (*)

Correct 22. Procedure B has the ZERO_DIVIDE pre-defined exception a dded to its EXCEPTION section. It is compiled successfully. In Timestamp Mode, P rocedure A, which is dependent on remote Procedure B, will compile and execute s uccessfully. True or False? Mark for Review (1) Points True False (*)

Correct 23. A change in a remote referenced subprogram is automatic ally recorded as invalid if its base object changes and that new status is relay ed to the dependent object's status and automatically marked as invalid. True or False? Mark for Review (1) Points True False (*)

Correct 24. Procedure B has its local variable emp_number o emp_name. The data type of emp_id is changed from number to integer. piled successfully. In Signature Mode, Procedure A, which is dependent Procedure B, will compile and execute successfully. True or False? Review (1) Points True (*) False changed t It is com on remote Mark for

Correct 25. Procedure B has a new IN OUT parameter added to it. It compiles successfully. In Signature mode, Procedure A, which is dependent on rem ote Procedure B, will fail. True or False? Mark for Review (1) Points True (*) False

Correct

You might also like