Вы находитесь на странице: 1из 9

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

REMAP_TABLESPACE=;music_tblspc'dumpfile='music_db.dmp'
B)Import the MUSIC_ITEM table to the QA database using the following command
impdp tcmuser/tcmpswd@tcdb TABLES=;music_item;
REMAP_TABLESPACE='music_tblspc':'tcmdflt_tblspc'
dumpfile='music_db.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.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.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.dmp'
4)DECLARE some_error EXCEPTION:
BEGIN
INSERT INTO tc_tmp_rec
SELECT tc_msg_id,tc_msg_text
FROM tc_perm_rec WHERE tc_id=100;
RAISE some_error;
<<lbl_ERROR_JUMP>>
DBMS_OUTPUT.PUT_LINE('EXCEPTION: INSERT Failed');
GOTO lbl_ERROR_JUMP;
END;
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,displaying both the strings one after another.
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;
ELSE
calculate_tax(tax_amount);
END IF;
Based on the sample code above,what is the purpose of the NULLstatement?
A)It sets the value in the tax_amountvariable to NULL
B)It resets all variables in the module to :NULLvalues
C)It passes the control to the next executable statement without performing any database
operations.
D)It causes the module to stop execution and return to the calling module

E)It assigns a value of NULLto the IF statements


7)You are using DBMS_OUTPUT in one of your procedures,and you are testing the procedure from
SQL*PLUS. You do not see any of the expected output from the DBMS_OUTPUT statements.
Based on the scenario above,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.DISABLE option has not been invoked
E)The DBMS_OUTPUT.ENABLE option has been invoked
8)The reason that you place an othersexception handler in the outermost block of a PL/SQL
program unit is because
A)When it is placed before explicitly-stated exception handlers,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.
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 ,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,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,data
warehouse administrator has decided to partition the table based on date
Based on the above scenario,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.ENABLE(buffer_size);
where buffer_size will be replaced with a positive integer value
Based on the scenario above,what is the maximum buffer size that can be set in bytes by replacing
buffer_size with an appropriate integer value?
A)2,000
B)4,000
C)10,000
D)100,000
E)1,000,000

13)

DECLARE
X NUMBER;
max_num NUMBER:=10;
number_error EXCEPTION;
FUNCTION get_number(anl NUMBER)RETURN NUMBER IS
y NUMBER;
BEGIN
y := anl *4'
IF y > max_num THEN
RAISE number_error;
END IF;
RETURN y;
END;
BEGIN
x := get_numbet(4);
DBMS_OUTPUT.PUT_LINE(NVL(x,'NULL'));
EXCEPTION
WHEN number_error THEN
DBMS_OUTPUT.PUT_LINE(Nebr Error');
WHEN Program_error THEN
DBMS_OUTPUT.PUT_LINE('Progarm Error');
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('Others error');
END;

Based on the sample code above ,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,
PGC_DIT NUMBER(S) NOT NULL,
PGS_DSC VARCHAR(64) NULL)
Data in the table TC_PGS_TBL,
ID
PGS_DIT
PGS_DSC

-----------------------1
11
2
2
12
99
3
13
1
Based on the table in the sample code above,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'

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.PUT_LINE(n);
END LOOP;
END;
Based on the sample code above and given that SERVEROUTPUT is set ON,which set of For
statementsprints the integers from 10 to 1 in descending order?
A)FOR n IN REVERSE 1..10 LOOP
B)FOR n IN 10..1 STEP -1 LOOP
C)FOR n IN 1..10 REVERSE LOOP
D)FOR n IN REVERSE 10..1 LOOP
E)FROR n IN 1..10 STEP -1 LOOP
16)Which statement causes an effort when you execute it?
A)ROLLBACK;
B)COMMIT WORK;
C)SET TRANSACTION NAME 'TRANS_01';
D)SAVEPOINT S01;
E)COMMIT UPDATE;
17)CRETAE OR REPLACE PACKAGE my_pkg AS
PROCEDURE List_Measurements(nYards NUMBER);
END my_pkg;
Given the package specification in the code above ,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,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;
CURSOR C1 IS SELECT ps.id,ps.container,ps.fframe,ps.lframe
FROM project_status ps

WHERE ps.container = : new.container;


c1rec c1%ROWTYPE;
BEGIN
IF UPDATING THEN
IF :new.case='TOWER'THEN
OPEN c1;
FETCH c1 INTO c1rec;
v_id:=c1res.id;
(etc.)
Given that the above sample code fragment is complete,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;
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,which SQL statement executes
successfully- assuming the current date is AUGUST 19,2010?
A)SELECT 'YES'FROM DUAL WHERE GETDATE() = '19.08.10';
B)SELECT 'YES'FROM DUAL WHERE GETDATE() = '19-AUG-10';
C)SELECT 'YES'FROM DUAL WHERE GETDATE() = '08.19.10';
D)SELECT 'YES'FROM DUAL WHERE GETDATE() = '08192010';
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

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.
CREATE TABLE product_tab(ID INT,DESC VARCHAR(50));
CREATE SEQUENCE product_seq;
DECLARE
seq NUMBER;
BEGIN
--Add code below to Assign the sq in the next line
DBMS_OUTPUT.PUT_LINE('Adding '||TO_CHAR(seq));
INSERT INTO product_tab VALUES(seq,'CHEESE');
END;
Based on the scenario above,which line do you add after the commented line to achieve your
objective?
A)seq := procedure_seq.NEXTVAL;
B)seq := procedure_seq.NEXTSEQ;
C)seq := procedure_seq.NEXT_SEQ;
D)seq := procedure_seq.NEXT_VALUE;
E)seq := procedure_seq.NEXT_SEQUENCE;
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.
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);
BEGIN
SELECT id INTO v_id FROM box_rcpt_tab WHERE id=105;

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