14-15-plsql

Upload: dino-jackson

Post on 04-Jun-2018

729 views

Category:

Documents


13 download

TRANSCRIPT

  • 8/13/2019 14-15-Plsql

    1/17

  • 8/13/2019 14-15-Plsql

    2/17

    3. Which data dictionary view shows information about references and dependencies? Mark for Review(1) Points

    DEPTREE

    USER_DEPENDENCIES (*)

    USER_REFERENCES

    USER_LOCAL_DEPENDENCIES

    Incorrect. Refer to Section 14 Lesson 1.

    4. User ALICE owns a procedure show_emps which referencestable employees. Which of the following will generate information that shows this dependency? Mark for Review(1) Points

    BEGIN deptree_fill('TABLE','EMPLOYEES');END;

    BEGIN deptree_fill('PROCEDURE','ALICE','SHOW_EMPS');

    END;

    BEGIN deptree_fill('ALICE','TABLE','EMPLOYEES');END;

    BEGIN deptree_fill('TABLE','ALICE','EMPLOYEES');END;(*)

    BEGIN deptree_fill('ALICE','PROCEDURE','SHOW_EMPS');END;

    Incorrect. Refer to Section 14 Lesson 1.

    5. A SELECT from DEPTREE produced the following output.>NESTED_LEVEL >TYPE >NAME>0 >TABLE >EMPLOYEES>1 >VIEW >EMP_VW

    >2 >PROCEDURE >ADD_EMP>1 >PROCEDURE >QUERY_EMPWhat dependencies does this show? (Choose three.)

  • 8/13/2019 14-15-Plsql

    3/17

    Mark for Review(1) Points

    (Choose all correct answers)

    QUERY_EMP is directly dependent on EMPLOYEES (*)

    ADD_EMP is directly dependent on EMPLOYEES

    ADD_EMP is directly depedent on EMP_VW (*)

    QUERY_EMP is directly dependent on ADD_EMP

    EMP_VW is directly dependent on EMPLOYEES (*)

    Incorrect. Refer to Section 14 Lesson 1.

    6. Which of the following database objects are created when the utldtree.sql script is run? (Choose three.) Mark for Review(1) Points

    (Choose all correct answers)

    The utldtree table

    The deptree_temptab table (*)

    The deptree and ideptree views (*)

    The deptree table

    The deptree_fill procedure (*)

    Incorrect. Refer to Section 14 Lesson 1.

    7. The IDEPTREE view shows dependencies by indenting the lines of output instead of by using a NESTED_LEVEL column. True or False?Mark for Review(1) Points

    True (*)

  • 8/13/2019 14-15-Plsql

    4/17

    False

    Incorrect. Refer to Section 14 Lesson 1.

    8. A procedure includes the following code:SELECT first_name, salary INTO v_first_name, v_salaryFROM employees WHERE employee_id = 100;

    Which of the following changes to the employees table will allow the procedure to be recompiled successfully ? (Choose two.)

    Mark for Review(1) Points

    (Choose all correct answers)

    The table is dropped but a public table exists with the same name and structure. (*)

    The table is dropped.

    A new column is added to the table. (*)

    The table name is changed to newemps.

    The first_name column is dropped from the table.

    Correct

    9. Which of the following will NOT help to minimize dependency failures? (Choose two.) Mark for Review(1) Points

    (Choose all correct answers)

    SELECTing a list of column names instead of using SELECT * (*)

    Declaring records using the %ROWTYPE attribute

    Including a column list with INSERT statements

    Declaring scalar variables with NOT NULL if the corresponding table column has a NOT NULL constraint (*)

  • 8/13/2019 14-15-Plsql

    5/17

    Declaring scalar variables using the %TYPE attribute

    Incorrect. Refer to Section 14 Lesson 1.

    10. Package emp_pack contains two public procedures: get_emps and upd_emps. A separate procedure emp_proc invokes emp.pack.get_emps. The upd_emps package body code is now altered, and the package body (but not the package specification) is recreated.emp_proc will be marked invalid and needs to be recompiled. True or False?

    Mark for Review(1) Points

    True

    False (*)

    Incorrect. Refer to Section 14 Lesson 1.

    11. A procedure show_emps contains the following declaration:CURSOR emp_curs IS SELECT last_name, salary FROM employees;What will happen to the procedure if a new column is added to the employees tabl

    e?

    Mark for Review(1) Points

    The procedure will still be valid and execute correctly because it doesnot reference the added column.

    The procedure will automatically be dropped and must be recreated.

    The procedure will be marked invalid and must be recompiled before it can be reexecuted. (*)

    Users' privileges to execute the procedure will automatically be revoked.

    Incorrect. Refer to Section 14 Lesson 1.

    12. View dept_view is based on a select from table departments. Procedure show_dept contains code which selects from dept_view. Which of the following statements are true? (Choose three.) Mark for Review

  • 8/13/2019 14-15-Plsql

    6/17

    (1) Points

    (Choose all correct answers)

    departments is indirectly dependent on show_dept

    show_dept is directly dependent on dept_view (*)

    dept_view is directly dependent on departments (*)

    show_dept is indirectly dependent on departments (*)

    emp_view is directly dependent on show_dept

    Incorrect. Refer to Section 14 Lesson 1.

    13. Which of the following statements will show whether procedure myproc is valid or invalid? Mark for Review(1) Points

    SELECT status FROM USER_OBJECTSWHERE object_type = 'PROCEDURE'AND object_name = 'MYPROC';

    (*)

    SELECT status FROM USER_PROCEDURESWHERE procedure_name = 'MYPROC';

    SELECT valid FROM USER_OBJECTSWHERE object_type = 'PROCEDURE'AND object_name = 'MYPROC';

    SELECT * FROM deptree;

    Incorrect. Refer to Section 14 Lesson 1.

    14. A single PL/SQL subprogram such as a procedure can be both a referenced object and a dependent object. True or False? Mark for Review(1) Points

    True (*)

  • 8/13/2019 14-15-Plsql

    7/17

  • 8/13/2019 14-15-Plsql

    8/17

    4. With remote dependencies, one master data dictionary that resides on one server identifies the status of all schema objects. True or False? Mark for Review(1) Points

    True

    False (*)

    Correct

    5. In Signature Mode, a procedure will not compile if the

    signatures of the remote dependencies do not match. True or False? Mark forReview(1) Points

    True (*)

    False

    Correct

    6. In Signature Mode, a compiled procedure is still validif its dependent procedure has a parameter data type change from NUMBER to INTEGER. Mark for Review(1) Points

    True (*)

    False

    Incorrect. Refer to Section 14 Lesson 2.

    7. A remote dependency is when a dependent object resideson a database on a separate node. True or False? Mark for Review(1) Points

    True (*)

    False

  • 8/13/2019 14-15-Plsql

    9/17

    Correct

    8. Which statement for setting a database parameter is thedefault for remote dependency checking? Mark for Review

    (1) Points

    ALTER SESSION SET REMOTE_DEPENDENCIES_MODE = TIMESTAMP (*)

    ALTER SESSION SET REMOTE_DEPENDENCIES_MODE = SIGNATURE

    ALTER SESSION REMOTE_DEPENDENCIES_MODE = TIMESTAMP

    ALTER SESSION REMOTE_DEPENDENCIES_MODE = SIGNATURE

    Correct1. When setting PLSQL_OPTIMIZE_LEVEL = 2, the compiled cod

    e will remove code and exceptions that can never be executed. True or False?Mark for Review(1) Points

    True (*)

    False

    Incorrect. Refer to Section 15 Lesson 1.

    2. What are the valid values for PLSQL_OPTIMIZE_LEVEL in the data dictionary? Mark for Review(1) Points

    0,1,2,3 (*)

    0,1,2,3,4

    1,2,3

    1,2,3,4

    Correct

  • 8/13/2019 14-15-Plsql

    10/17

  • 8/13/2019 14-15-Plsql

    11/17

    Modify source code to optimize frequently-used elements at the top. (*)

    Incorrect. Refer to Section 15 Lesson 1.

    6. Which data dictionary view allows you to see the setting for PLSQL_OPTIMIZE_LEVEL? Mark for Review(1) Points

    USER_PLSQL_OBJECTS

    USER_PLSQL_OPTIMIZE

    USER_PLSQL_OBJECT_SETTINGS (*)

    USER_OBJECT_SETTINGS

    USER_PLSQL_CODE_TYPE

    Incorrect. Refer to Section 15 Lesson 1.1. A warning in PL/SQL is the same as an error in PL/SQL,

    but can only be viewed through the USER_ERRORS data dictionary view. True or Fal

    se? Mark for Review(1) Points

    True

    False (*)

    Correct

    2. Which pair of DBMS_WARNING commands would allow you toobtain the current settings and change and restore those settings in a PL/SQL subprogram? (Choose two) Mark for Review(1) Points

    (Choose all correct answers)

    DBMS_WARNING.SET_WARNING_SETTING_STRING (*)

    DBMS_WARNING.ADD_WARNING_SETTING_CAT

  • 8/13/2019 14-15-Plsql

    12/17

    DBMS_WARNING.GET_WARNING_SETTING_STRING (*)

    DBMS_WARNING.GET_WARNING_STRING

    Incorrect. Refer to Section 15 Lesson 2.

    3. The informational warning level for PL/SQL compiled code identifies the code that may cause execution speed to be slow. True or False?Mark for Review(1) Points

    True

    False (*)

    Incorrect. Refer to Section 15 Lesson 2.

    4. The two statements below are equivalent. True or False?DBMS_WARNING.ADD_WARNING_SETTING_CAT ('INFORMATIONAL','ENABLE','SESSION');and

    ALTER SESSION

    SET PLSQL_WARNINGS = 'ENABLE:INFORMATIONAL';Mark for Review(1) Points

    True (*)

    False

    Correct

    5. Which PL/SQL warning message identifies code that can cause unexpected behavior or wrong results when executed? Mark for Review(1) Points

    INFORMATIONAL

    PERFORMANCE

    ALL

  • 8/13/2019 14-15-Plsql

    13/17

    SEVERE (*)

    ERROR

    Incorrect. Refer to Section 15 Lesson 2.

    6. An error in PL/SQL is when the compiler does not proceed successfully and an error message is displayed. True or False? Mark forReview(1) Points

    True (*)

    False

    Correct

    1. Inquiry directives are used to selectively include or exclude PL/SQL code based on values of pre-defined variables thatare set using the PLSQL_CCFLAGS parameter. True or False? Mark for Review(1) Points

    True

    False (*)

    Correct

    2. Identify the selection directives used in conditional compilation. Mark for Review(1) Points

    $IF $THEN $ELSE $END $CCFLAG

    $$IF $$THEN $$ELSE $$ELSIF $$END

    $IF $THEN $ELSE $ELSIF $ENDIF

    $IF $THEN $ELSE $ELSIF $END (*)

    $$IF $$THEN $$ELSE $$END $$DEBUG

  • 8/13/2019 14-15-Plsql

    14/17

  • 8/13/2019 14-15-Plsql

    15/17

    ion $END

    $IF DBMS_DB_VERSION.VER_LE_10_2 $THEN -- some messaage $ELSE -- some action $END;

    $IF DBMS_DB_VERSION.VER_LE_10_1 $THEN -- some messaage $ELSE -- some action $END (*)

    $IF DBMS_DB_VERSION.VER_LE_10_1 $THEN -- some messaage $ELSE -- some action $END;

    Correct1. For PL/SQL code larger than 32,767 characters, you must

    use the wrap utility. True or False? Mark for Review

    (1) Points

    True (*)

    False

    Correct

    2. To create obfuscated code using the wrapper utility, determine the order in which to execute the following steps.A Connect to the database and execute the wrapped text file as a script to compile the wrapped code into the Data Dictionary.B Log into the database server computer.C Create a text file containing your complete unwrapped source code.D Execute WRAP to create a second text file containing the wrapped code.

    Mark for Review(1) Points

    A,B,C,D

    B,C,D,A (*)

    C,D,A,B

    C,A,B,D

    B,D,C,A

  • 8/13/2019 14-15-Plsql

    16/17

    Incorrect. Refer to Section 15 Lesson 4.

    3. To obfuscate the procedure my_proc, what statement should be at Line A? BEGIN -- Line A ('CREATE OR REPLACE PROCEDURE mycleverproc (p_param1 IN NUMBER, p_param2 OUT NUMBER) IS BEGIN ... /* some clever but private code here */ END mycleverproc;'); END; Mark for Review

    (1) Points

    DBMS_DML.CREATE_WRAP

    DBMS_DDL.CREATE_WRAP

    DBMS_DDL.CREATE_WRAPPED (*)

    DBMS_DDL.WRAPPED

    DBMS_DDL.WRAP_CODE

    Incorrect. Refer to Section 15 Lesson 4.

    4. Obfuscation allows the owner to see the source code, but not the users to whom EXECUTE privileges have been granted. True or False?Mark for Review

    (1) Points

    True

    False (*)

    Incorrect. Refer to Section 15 Lesson 4.

    5. When wrapping subprograms, the entire PL/SQL code mustbe included as an IN argument with data type VARCHAR2 up to 32,767 characters. True or False? Mark for Review(1) Points

    True (*)

    False

    Incorrect. Refer to Section 15 Lesson 4.

  • 8/13/2019 14-15-Plsql

    17/17

    6. One benefit of obfuscation is to protect intellectual property written in PL/SQL. True or False? Mark for Review(1) Points

    True (*)

    False

    Correct