94961270 semester 2 final exam pl sql 2

Upload: bucur-alexandru

Post on 14-Oct-2015

114 views

Category:

Documents


1 download

TRANSCRIPT

  • 5/24/2018 94961270 Semester 2 Final Exam PL SQL 2

    1/11

    Test:..Semester..2..Final..Exam1... Native..compilation..always..runs..faster;..therefore..SQL..statements..in..PL/SQL..will..always..run..faster,..also...True..or..False?.. Mark..for..Review..(1)..PointsTrueFalse..(*)Correct Correct2... Identify..examples..of..benefits..of..using..PLSQL_OPTIMIZE_LEVEL...(Choose..three).. Mark..for..Review..(1)..Points

    (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..needed.Copy..compiled..code..from..one..subprogram..into..another..subprogram...(*)Correct Correct3... Native..machine..code..PL/SQL..will..always..execute..faster..than..bytecode..PL/SQL..because..it..need..not..be..interpreted..at..run..time...True..or..False?.. Mark..for..Review..

    (1)..PointsTrue..(*)FalseCorrect Correct

  • 5/24/2018 94961270 Semester 2 Final Exam PL SQL 2

    2/11

    4... Identify..some..benefits..of..using..conditional..compilation...(Choose..two).. Mark..for..Review..(1)..Points(Choose..all..correct..answers)Use..new..features..with..the..latest..database..release..and..disable..them..with..older..database..versions..(*)Speed..up..the..compilation..time..of..a..lengthy..PL/SQL..subprogram.Determine..initialization..values..during..start..up..of..a..database..session.Activate..debugging..or..tracing..statements..in..the..development..environment.

    .(*)Correct Correct5... In..the..following..example,..what..statement..belongs..in..Line..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;

  • 5/24/2018 94961270 Semester 2 Final Exam PL SQL 2

    3/11

    Correct Correct6... To..include..selections..of..code..for..compilation..based..on..user-defined..values,..use..the..PLSQL_CCFLAGS..parameters...True..or..False?.. Mark..for..Review..(1)..PointsTrue..(*)FalseCorrect Correct7... Obfuscation..does..not..allow..anyone..to..see..the..source..code

    ,..including..the..owner...True..or..False?.. Mark..for..Review..(1)..PointsTrue..(*)FalseCorrect Correct8... Which..is..NOT..a..benefit..of..obfuscation?.. Mark..for..Review..(1)..PointsSource..code..is..not..loaded..in..the..data..dictionary.Source..code..is..hidden..from..all..users.Source..code..is..visible..to..the..owner...(*)Protection..for..intellectual..property..is..provided.Correct Correct9... When..wrapping..subprograms,..the..entire..PL/SQL..code..must..b

    e..included..as..an..IN..argument..with..data..type..CLOB..to..allow..for..any..size..program...True..or..False?.. Mark..for..Review..(1)..Points

  • 5/24/2018 94961270 Semester 2 Final Exam PL SQL 2

    4/11

    TrueFalse..(*)Correct Correct10... What..does..the..following..statement..do?DBMS_WARNING.ADD_WARNING_SETTING_CAT('PERFORMANCE','ENABLE','SESSION');Mark..for..Review..(1)..PointsEnables..the..PERFORMANCE..warning..category,..setting..other..category..settings..to..disabled.

    Enables..the..PERFORMANCE..warning..category,..leaving..other..category..settings..unchanged.Add..the..PERFORMANCE..warning..category..into..a..PL/SQL..variable.Disables..all..warning..categories,..then..enables..the..PERFORMANCE..category.Enables..the..PERFORMANCE..warning..category,..leaving..other..category..settings..unchanged,..for..the..current..session...(*)Correct Correct11... In..the..USER_ERRORS..data..dictionary..view,..if..an..error..is..prefixed..with.."Warning,"..the..command..completes..but..has..a..side..effect..the..user..needs..to..know..abou

    t...For..all..other..errors,..the..command..terminates..abnormally...True..or..False?..Mark..for..Review..(1)..PointsTrue..(*)FalseCorrect Correct12... The..two..statements..below..are..equivalent...True..or..False?DBMS_WARNING.SET_WARNING_SETTING_STRING........('ENABLE:SEVERE','SESSION');

  • 5/24/2018 94961270 Semester 2 Final Exam PL SQL 2

    5/11

    and

    ALTER..SESSION ....SET..PLSQL_WARNINGS..=..'ENABLE:SEVERE';Mark..for..Review..(1)..Points

    True

    False..(*)

    Correct Correct

    Section..14(Answer..all..questions..in..this..section)

    13... In..this..scenario,..the..following..status..is..given..for..each

    ..procedure:

    ........Procedure..A..is..local..and..has..a..time..stamp..of..10..AM ........Procedure..B..is..remote..and..has..a..local..and..remote..time..stamp..of..10:30..AM..

    In..Timestamp..Mode,..Procedure..A,..which..is..dependent..on..Procedure..B,..will..execute..successfully..at..11..AM...True..or..False?

    Mark..for..Review..(1)..Points

    True..(*)

    False

    Correct Correct

    14... If..two..related..objects..are..in..different..databases,..the..dependency..between..them..is..automatically..recorded..on..the..dependent..object's..data..dictionary...True..or..False?.. Mark..for..Review..(1)..Points

    True

    False..(*)

    Correct Correct

  • 5/24/2018 94961270 Semester 2 Final Exam PL SQL 2

    6/11

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

    FalseCorrect Correct16... A..change..in..a..remote..referenced..subprogram..is..automatically..recorded..as..invalid..if..its..base..object..changes..and..that..new..status..is..relayed..to..the..dependent..object's..status..and..automatically..marked..as..invalid...True..or..False?.. Mark..for..Review..(1)..PointsTrueFalse..(*)Correct Correct17... Procedure..B..has..a..new..IN..OUT..parameter..added..to..it...It..c

    ompiles..successfully...In..Signature..mode,..Procedure..A,..which..is..dependent..on..remote..Procedure..B,..will..fail...True..or..False?.. Mark..for..Review..(1)..PointsTrue..(*)FalseIncorrect Incorrect...Refer..to..Section..14..Lesson..2.18... 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;

  • 5/24/2018 94961270 Semester 2 Final Exam PL SQL 2

    7/11

    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_VIEWED_PROC..is..referenced..by..ED_VIEWED_PROC..is..directly..dependent..on..EMPLOYEES

    Correct Correct19... User..BOB..wants..to..know..which..objects..reference..his..DEPARTMENTS..table...Which..of..the..following..must..he..execute..to..populate..the..DEPTREE_TEMPTAB..table?.. Mark..for..Review..(1)..PointsBEGIN........utldtree('DEPARTMENTS');END;BEGIN........deptree_fill('TABLE','BOB','DEPARTMENTS');END;(*)

    BEGIN........deptree_fill('TABLE','DEPARTMENTS');END;BEGIN........ideptree('TABLE','BOB','DEPARTMENTS');END;Correct Correct

  • 5/24/2018 94961270 Semester 2 Final Exam PL SQL 2

    8/11

    20... Which..of..the..following..is..NOT..created..when..the..utldtree.sql..script..is..run?.. Mark..for..Review..(1)..PointsThe..DEPTREE..viewThe..DEPTREE_FILL..procedureThe..USER_DEPENDENCIES..view..(*)The..DEPTREE_TEMPTAB..tableCorrect Correct21... A..single..procedure..can..be..both..a..referenced..object..and..a..dependent..objec

    t...True..or..False?.. Mark..for..Review..(1)..PointsTrue..(*)FalseCorrect Correct22... Function..FETCH_EMP..references..the..EMPLOYEES..table...The..table..is..modified..by:ALTER..TABLE..employees..ADD..(resume..CLOB);When..will..the..ORACLE..server..try..to..recompile..FETCH_EMP..automatically?Mark..for..Review..(1)..PointsWhen..the..command..ALTER..FUNCTION..fetch_emp..COMPILE;..is..executedThe..next..time..a..user..session..invokes..FETCH_EMP..(*)

    When..the..RESUME..column..is..dropped..from..the..EMPLOYEES..tableWhen..FETCH_EMP..is..dropped..and..recreatedCorrect Correct

  • 5/24/2018 94961270 Semester 2 Final Exam PL SQL 2

    9/11

    23... Examine..the..following..code:CREATE..FUNCTION..deptfuncRETURN..NUMBER..IS........v_count..NUMBER(6);BEGIN........SELECT..COUNT(*)..INTO..v_count..FROM..departments;........RETURN..v_count;END;Which..of..the..following..will..display..the..dependency..between..DEPTFUNC..and..DEPARTME

    NTS?Mark..for..Review..(1)..PointsSELECT..name,..typeFROM..user_dependenciesWHERE..name..IN..('DEPTFUNC','DEPARTMENTS');SELECT..name,..type,..referenced_name,..referenced_typeFROM..user_dependenciesWHERE..referenced_name..=..'DEPARTMENTS'AND..referenced_type..=..'TABLE';(*)SELECT..name,..type,..referenced_name,..referenced_typeFROM..user_dependencies

    WHERE..name..=..'DEPARTMENTS'AND..type..=..'TABLE';SELECT..object_name,..object_typeFROM..user_objectsWHERE..object_name..IN..('DEPARTMENTS','DEPTFUNC')AND..referenced..=..'YES';Correct Correct24... Package..EMPPACK..contains..a..public..procedure..GET_EMP,..which..contains..a..reference..to..the..EMPLOYEES..table...Procedure..CALL_EMP..invokes..EMPPACK.GET_EMP...The..following..SQL..statement..is..executed:ALTER..TABLE..employees..ADD..(gender..CHAR(1));Which..one..of..the..following..statements..is..true?

    Mark..for..Review..(1)..Points

  • 5/24/2018 94961270 Semester 2 Final Exam PL SQL 2

    10/11

    The..specification..and..body..of..EMPPACK..are..invalidated,..but..CALL_EMP..remains..valid.The..body..of..EMPPACK..is..invalidated,..but..the..specification..remains..valid...(*)EMPPACK.GET_EMP..is..invalidated,..but..other..procedures..in..EMPPACK..remain..valid.Nothing..is..invalidated..because..the..PL/SQL..code..does..not..reference..the.

    .GENDER..column.Correct Correct25... A..SELECT..from..the..DEPTREE..table..displays..table..LOCATIONS..at..nested..level..0..and..procedure..LOCPROC..at..nested..level..2...This..shows..that..LOCPROC..is..directly..dependent..on..LOCATIONS...True..or..False?.. Mark..for..Review..(1)..PointsTrueFalse..(*)Correct Correct..

  • 5/24/2018 94961270 Semester 2 Final Exam PL SQL 2

    11/11