Plsql_bb Sample Qus

April 2, 2018 | Author: jayeshrane2107 | Category: Pl/Sql, Sql, Subroutine, Array Data Structure, Information Retrieval


Comments



Description

1)you have been brought in to a project to do an oracle upgrade from 9i to 11g.The current sql code has been working great and much effort has been put into tuning it using hints,and making sure the execution plans are performing well under the existing version's rule-based optimizer. you do not have permission to change any of the current sql code in this phase of the project. Based on the scenario above,which approach do you take to avoid the risk of the execution plans being changed by the upgrade? A)Migrate the execution plans along with sql using plan stability features. B)Use the rule-based optimizer in the upgraded 11g database C)Recompile the sql after the upgrade and re tune the sql to have the same execution plans as in the order version. D)Do not upgrade and then fix any poorly performing queries on a case-by-case basis E)Create a test database with the new 11g version and run the sql remotely on it before doing the upgrade --------------------------------------------------------------------------------------------------------------------------2)Assume serveroutput is ON. DECLARE TYPE months_array IS VARRAY(12) OF STRING(3 CHAR); month MONTHS_ARRAY:= months_array ('jan','feb','mar','apr','may','jun', 'jul','aug','sep','oct','nov','dec'); BEGIN <<LIST_MONTHS>> FOR MonthNo IN REVERSE 6..12 LOOP DBMS_OUTPUT.PUT_LINE(month(MonthNo)); CONTINUE LIST_MONTHS WHEN MonthNo<9; END LOOP; END; Based on the sample code above,what is the last line output when you execute the anonymous block? A)Jan B)Jun C)Aug D)Sep E)Dec --------------------------------------------------------------------------------------------------------------------------3)You need to import the MUSIC_ITEM table data from a production export dump into the QA database. 1)The table space that the MUSIC_ITEMS table is created in production(MUSIC_TBLSPC)does not exist in QA. And 2)The tcmuser's default table space in QA is TCMDFLT_TBLSPC Based on the scenario above,which script do you use to import the data into the QA database? A)Import the table space MUSIC_TBLSPC into the QA database using the following command impdp tcmuser/tcmpswd@tcdb dmp' C)Import objects from the MUSIC_TBLSPC tablespace to the QA database using the following command impdp tcmuser/tcmpswd@tcdb TABLESPACES='music_tblspc' dumpfile='music_db. ELSE calculate_tax(tax_amount). REMAP_TABLESPACE='music_tblspc':'tcmdflt_tblspc' dumpfile='music_db.tc_msg_text FROM tc_perm_rec WHERE tc_id=100. <<lbl_ERROR_JUMP>> DBMS_OUTPUT. D)It causes the module to stop execution and return to the calling module . what is the result when you execute the sample code above? A)The code gives a syntax error B)The string “Error Label:INSERT Failed!”is printed on the screen C)The string “EXCEPTION:INSERT Failed!” is printed on the screen D)The code gives a run time error E)The code goes into an interface loop.music_tblspc'dumpfile='music_db.music_item. GOTO lbl_ERROR_JUMP.what is the purpose of the “NULL”statement? A)It sets the value in the “tax_amount”variable to “NULL” B)It resets all variables in the module to :NULL”values C)It passes the control to the next executable statement without performing any database operations.dmp' network_link='tcdb_prod' E)Create the MUSIC_TBLSPC in the QA database and import using the following command impdb tcmuser/tcmpswd@tcdb TABLES='music_item' dumpfile='music_db. END.displaying both the strings one after another.PUT_LINE('EXCEPTION: INSERT Failed').REMAP_TABLESPACE=.dmp' B)Import the MUSIC_ITEM table to the QA database using the following command impdp tcmuser/tcmpswd@tcdb TABLES=.dmp' 4)DECLARE some_error EXCEPTION: BEGIN INSERT INTO tc_tmp_rec SELECT tc_msg_id. 5)Which cursor attribute do you reference to determine the number of records that were deleted by a DELETE Statement? A)SQL%NUMROWS B)SQL%DELETED_COUNT C)SQL%ROW_COUNT D)SQL%ROWCOUNT E)SQL%COUNT 6)IF tax_amount=0 THEN NULL. END IF. RAISE some_error.dmp' D)Import the tablespace MUSIC_TBLSPC into the QA database using the following command impdb tcmuser/tcmpswd@tcdb TRANSPORT_TABLESPACE='music_tblspc' dumpfile='music_db. Based on the sample code above. ENABLE option has been invoked 8)The reason that you place an “others”exception handler in the outermost block of a PL/SQL program unit is because A)When it is placed before explicitly-stated exception handlers.ENABLE(buffer_size).E)It assigns a value of “NULL”to the IF statements 7)You are using DBMS_OUTPUT in one of your procedures.000 C)10. Based on the scenario above.000 D)100. C)It is invoked by the oracle runtime engine last D)When used first it provides the least possible information about the exceptions trapped E)It can be placed in any order .000 .DISABLE option has not been invoked E)The DBMS_OUTPUT.but is most efficient when place last 9)What output text does SQLERRM contain when you execute a script which completes normally? A)ORA-0000:normal.what has caused the problem? A)The SERVEROUTPUT option has not been set B)The DBMS_OUTPUT>FLUSH statement has not been invoked C)The SERVEROUTPUT option has been set but without the size option D)The DBMS_OUTPUT.data warehouse administrator has decided to partition the table based on date Based on the above scenario.what is the maximum buffer size that can be set in bytes by replacing buffer_size with an appropriate integer value? A)2.000 E)1. You do not see any of the expected output from the DBMS_OUTPUT statements.successful completion B)Normal completion C)NULL D)Blank String E)ORA-0000:No exception 10)To enhance the access of a data warehouse fact table that contains data accessed by months.and you are testing the procedure from SQL*PLUS.000. where buffer_size will be replaced with a positive integer value Based on the scenario above.it will catch most exceptions and override the ability of the explicit handlers to execute B)It provides a method for catching all propagated unhandled exceptions from withinn the entire program unit.000 B)4.when table partitioning technique do you recommend? A)RBO PARTITION based on date B)LIST PARTITION based on date C)RANGE PARTITION based on date D)SERILIZED PARTITION based on date E)COMPOSITE PARTITION based on date 11)Which pair of collection types can both be created and stored in database tables? A)Nested Tables and Varrays B)Associative Arrays and Nested Tables C)Associative Arrays and complex Arrays D)Multidimensional Arrays and Nested Tables E)Associative Arrays and Varrays 12)You intend to add a statement in a code block to provide a buffer for use with the DBMS_OUTPUT statements The code will provide the buffer size in the following form: DBMS_OUTPUT. WHEN OTHERS THEN DBMS_OUTPUT. max_num NUMBER:=10. END IF. WHEN Program_error THEN DBMS_OUTPUT. DBMS_OUTPUT.PUT_LINE(“Nebr Error'). BEGIN y := anl *4' IF y > max_num THEN RAISE number_error. RETURN y.what is the result when you execute the code? A)The code does not compile B)16 is printed C)Program Error is printed D)Number Error is Printed E)Others Error is Printed 14)CRETE TABLE TC_PGS_TBL(ID NUMBER(S) NOT NULL.13) DECLARE X NUMBER. FUNCTION get_number(anl NUMBER)RETURN NUMBER IS y NUMBER. PGC_DIT NUMBER(S) NOT NULL. END.'NULL')).which SQL SELECT statement performs an implicit conversion? A)SELECT * FROM TC_PGS_TBL WHERE ID=1 AND PGS_DIT=1 B) SELECT * FROM TC_PGC_TBL WHERE PGS_DSC='1' . Based on the sample code above . PGS_DSC VARCHAR(64) NULL) Data in the table TC_PGS_TBL. number_error EXCEPTION.PUT_LINE('Progarm Error').PUT_LINE(NVL(x. EXCEPTION WHEN number_error THEN DBMS_OUTPUT.PUT_LINE('Others error'). ID PGS_DIT PGS_DSC – -----------------------1 11 2 2 12 99 3 13 1 Based on the table in the sample code above. BEGIN x := get_numbet(4). END. E)COMMIT UPDATE.ps..ps. B)COMMIT WORK.1 STEP -1 LOOP C)FOR n IN 1.1 LOOP E)FROR n IN 1.C)SELECT * FROM TC_PGS_TBL WHERE ID=1 D)SELECT * FROM TC_PGS_TBL WHERE PGS_DSC=1 E)SELECT * FROM TC_PGS_TBL WHERE PGS_DIT=1 15)BEGIN <FOR Statement> DBMS_OUTPUT. C)SET TRANSACTION NAME 'TRANS_01'.the PL/SQL Engine interacts with A)Database Server B)SQK Engine C)Procedural statement Executor D)Listener E)SQL Processor 19)Which text snipper of the EXPLAIN PLAN output for an SQL statement indicates that a SELECT DISTINCT is being done in the SQL being executed? A)SORT ORDER BY B)SORT GROUP BY C)SORT AGGREGATE D)SORT UNIQUE E)SORT JOIN 20)CRETE TRIGGER stage_trigger AFTER UPDATE ON container FOR EACH ROW DECLARE v_id NUMBER.10 STEP -1 LOOP 16)Which statement causes an effort when you execute it? A)ROLLBACK.which set of “For statements”prints the integers from 10 to 1 in descending order? A)FOR n IN REVERSE 1. 17)CRETAE OR REPLACE PACKAGE my_pkg AS PROCEDURE List_Measurements(nYards NUMBER)..fframe. D)SAVEPOINT S01.lframe FROM project_status ps .10 REVERSE LOOP D)FOR n IN REVERSE 10. END LOOP. Based on the sample code above and given that SERVEROUTPUT is set ON.ps..which argument type is nyards? A)It depends on the declaration of List_Measurements() in the package body B)IN OUT C)OUT D)IN E)OUT IN 18)When executing SQL from PL/SQL. CURSOR C1 IS SELECT ps. END. Given the package specification in the code above ..10 LOOP B)FOR n IN 10. END my_pkg.id.PUT_LINE(n)..container. 08.assuming the current date is AUGUST 19. E)SELECT 'YES'FROM DUAL WHERE GETDATE() = '19082010'. 23)Which command do you execute to enable SQL trace for the current session? A)ALTER SESSION ENABLE SQL_TRACE B)ALTER SESSION SET SQL_TRACE=SHOW C)ALTER SESSION SET SQL_TRACE=TRUE D)ALTER SESSION ENABLE SQL_TRACE ON E)ALTER SESSION SQL_TRACE=ON 24)Which is an example of a PL?SQL subprogram? A)PROCEDURE B)DBMS_SESSION C)MATERIALIZES VIEW D)DBMS_UTILITY E)ANONYMOUS BLOK 25)Which clause of the CRETAE FUNCTION statement indicates the function will always provide the same result when given the same set of parameters? A)DETERMINISTIC B)DETERMINE . FETCH c1 INTO c1rec. D)SELECT 'YES'FROM DUAL WHERE GETDATE() = '08192010'.19. BEGIN IF UPDATING THEN IF :new. v_id:=c1res. END. B)SELECT 'YES'FROM DUAL WHERE GETDATE() = '19-AUG-10'.which SQL statement executes successfully.WHERE ps. (etc.10'. C)SELECT 'YES'FROM DUAL WHERE GETDATE() = '08.) Given that the above sample code fragment is complete.id.container.case='TOWER'THEN OPEN c1. c1rec c1%ROWTYPE.10'. Based on the sample code above and assuming that the NLS_DATE_FORMAT is set the default date locale and NLS_TERRITORY locale is set to AMERICA.2010? A)SELECT 'YES'FROM DUAL WHERE GETDATE() = '19.container = : new.you describe the behavior of the code fragment as: A)an insert trigger that is invoked before the insert B)an instead of trigger that is invoked after the update C)row level trigger that is invoked after the update D)a complex trigger that is invoked after the update E)a row level trigger that is invoked before the update 21)What two options do you use with the ON COMMIT clause when creating a GLOBAL TEMPORARY TABLE? A)PRESERVER ROWS and DELETE ROWS B)KEEP ROWS and TRUNCATE ROWS C)PERSIST ROWS and TRUNCATE ROWS D)KEEP ROWS and PURGE ROWS E)PERSIST ROWS and DELETE ROWS 22)CRETAE OR REPLACE FUNCTION GETDATE RETURN VARCHAR2 AS BEGIN RETURN SYSDATE. END. INSERT INTO product_tab VALUES(seq. CREATE SEQUENCE product_seq. DECLARE seq NUMBER.NEXTSEQ.which line do you add after the commented line to achieve your objective? A)seq := procedure_seq. E)seq := procedure_seq.DESC VARCHAR(50)).NEXT_VALUE. CREATE TABLE product_tab(ID INT.NEXT_SEQ. D)seq := procedure_seq. BEGIN --Add code below to Assign the sq in the next line DBMS_OUTPUT. C)seq := procedure_seq.PUT_LINE('Adding '||TO_CHAR(seq)). BEGIN SELECT id INTO v_id FROM box_rcpt_tab WHERE id=105.C)KEEP D)PROPAGATE E)NONDETERMINISTIC 26)You wish to have the following code assign the next sequence value to seq for the ID to be added to table product_tab. Based on the scenario above. 27)The concept of overloading within a package includes having: A)More than one procedure defined with the same name and a different number or type of parameters B)multiple cursors defined in a single module C)more than one function defined with the same name and same parameters D)more than one procedure defined with the same number of parameters but different names E)more than one procedure defined with multiple cursors. B)seq := procedure_seq.NEXT_SEQUENCE.'CHEESE').NEXTVAL. . 28)Which cursor attribute provides you with the number of records affected by the last DML statement? A)SQL%ERROR B)SQL%FOUND C)SQL%NUM_ROWS D)SQL%ROWCOUNT E)SQL%COUNT 29)Values in BOX_RCPT_TAB ID --100 101 102 RECEIPT_DT --------------------09-JAN-98 08-JAN-98 09-JAN-98 DECLARE v_id Number(2). END. / Which exception is raised when you execute the code block in the scenario above? A)NO_DATA_FOUND B)VALUE_ERROR C)DUP_VAL_ON_INDEX D)INVALID_NUMBER E)STORAGE_ERROR .
Copyright © 2024 DOKUMEN.SITE Inc.