Weekend Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 70percent

Oracle 1z0-148 Oracle Database 12c: Advanced Pl-SQL Exam Practice Test

Demo: 16 questions
Total 107 questions

Oracle Database 12c: Advanced Pl-SQL Questions and Answers

Question 1

The user MY_USER has been assigned the roles CONNECT, RESOURCE, and DBA.

Which statement generates the DDL for these privileges?

Options:

A.

SELECT DBMS_METADATA.GET_GRANTED_DDL ('SYSTEM_GRANT', 'my_user') FROM dual;

B.

SELECT DBMS_METADATA.GET_GRANTED_DDL ('ROLE_GRANT', 'my_user') FROM dual;

C.

SELECT DBMS_METADATA.GET_GRANTED_DDL ('OBJECT_GRANT', 'my_user') FROM dual;

D.

SELECT DBMS_METADATA.GET_DDL ('USER', 'my_user') FROM dual;

Question 2

Which two statements are true about conversion from DBMS_SQL to native dynamic SQL? (Choose two.)

Options:

A.

The DBMS_SQL.TO_REFCURSOR function should be used when the number of bind variables is known at compile time, but not the number of items to be selected.

B.

The DBMS_SQL.TO_REFCURSOR function converts a SQL cursor number to a weakly typed cursor variable

only after it has been opened, parsed, and executed via DBMS_SQL.

C.

DBMS_SQL operations can access the cursor only as the SQL cursor number, not as a REF CURSOR

variable.

D.

The DBMS_SQL.TO_REFCURSOR function allows a query result to be returned implicitly from a non PL/SQL environment to a stored PL/SQL program.

E.

The DBMS_SQL.IS_OPEN function is used to verify that a SQL cursor number is open after it has been converted to a REF CURSOR.

Question 3

Which statement is true about internal and external LOBs?

Options:

A.

An external LOB can be loaded into an internal LOB variable using the DBMS_LOB package.

B.

A NOEXIST_DIRECTORY exception can be raised when using internal and external LOBs.

C.

Internal and external LOBs can be written using DBMS_LOB.

D.

After an exception transfers program control outside a PL/SQL block, all references to open external LOBs are lost.

E.

When using DBMS_LOB.INSTR for internal and external LOBs, DBMS_LOB.OPEN should be called for each LOB.

Question 4

Which three commands can be used to set PL/SQL conditional compilation inquiry directive MODE?

Options:

A.

ALTER SESSION SET PLSQL_CCFLAGS = ‘mode: FALSE’;

B.

ALTER SESSION SET PLSQL_CCFLAGS= ‘mode: NULL’;

C.

ALTER SESSION SET PLSQL_CCFLAGS= ‘mode: Level 1’;

D.

ALTER SESSION SET PLSQL_CCFLAGS= ‘mode: Level1’;

E.

ALTER SESSION SET PLSQL_CCFLAGS= ‘mode: 1’

Question 5

Examine this code:

What will be the outcome with SERVEROUTPUT enabled?

Options:

A.

The PL/SQL block will fail with a runtime exception.

B.

LENGTH : 100.13 EXTRA_LEN : 15.25 TOTAL LENGTH : 115.38

C.

LENGTH : 100.1254 EXTRA_LEN : 15.247 TOTAL LENGTH : 115.37

D.

LENGTH : 100.1254 EXTRA_LEN : 15.25 TOTAL LENGTH : 115.38

E.

LENGTH : 100.1254 EXTRA_LEN : 15.25

TOTAL LENGTH : 115.3754

Question 6

Which two statements are true regarding edition-based redefinition (EBR)?

Options:

A.

There is no default edition defined in the database.

B.

EBR does not let you upgrade the database components of an application while in use.

C.

You never use EBR to copy the database objects and redefine the copied objects in isolation.

D.

Editions are non-schema objects.

E.

When you change an editioned object, all of its dependents remain valid.

F.

Tables are not editionable objects.

Question 7

Your company decided to update its employees’ contact information as a one-time event.

With thousands of employees’ records to be updated, the project manager hoped to achieve substantial performance gains using the DBMS_PARALLEL_EXECUTE package and identified these four actions to be executed.

1) dbms_parallel_execute.create_task

2) GRANT system privilege CREATE JOB to the user executing this task

3) dbms_parallel_execute.run_task

4) dbms_parallel_execute.create_chunks_by_rowid

Select the correct order of actions to implement the parallel execution of PL/SQL blocks.

Options:

A.

2, 1, 3 and 4

B.

1, 2, 4 and 3

C.

2, 1, 4 and 3

D.

1, 2, 3 and 4

E.

2, 4, 1 and 3

Question 8

Examine the code:

Which two blocks can be used to complete the executable section such that LIST2 is dense? (Choose two.)

Options:

A.

FOR idx IN list1.FIRST .. list1.LAST LOOP

IF list1.EXISTS(idx) THEN

list2(idx) := list1(idx);

END IF;

END LOOP;

B.

FOR idx IN list1.FIRST .. list1.LAST LOOP

list2(idx) := list1(idx);

END LOOP;

C.

idx:= list1.FIRST;

WHILE (idx IS NOT NULL) LOOP

list2(list2.COUNT + 1) := list1(idx);

idx := list1.NEXT(idx);

END LOOP;

D.

FORALL idx IN list1.FIRST ..list1.LAST LOOP

list2(list2.COUNT + 1) := list1(idx);

E.

idx:= list1.FIRST; LOOP

EXIT WHEN idx IS NULL;

list2(list2.COUNT + 1) := list1(idx);

idx := list1.NEXT(idx);

END LOOP;

Question 9

Consider a function totalEmp () which takes a number as an input parameter and returns the total number of employees who have a salary higher than that parameter.

Examine this PL/SQL package AS

Which two definitions of totalEmp () result in an implicit conversion by Oracle Database on executing this PL/SQL block?

Options:

A.

CREATE FUNCTION totalEmp (sal IN NUMBER) RETURN NUMBER IStotal NUMBER :=0;BEGIN…RETUNRN total;END;/

B.

CREATE FUNCTION totalEmp (sal IN NUMBER) RETURN NUMBER IStotal NUMBER :=0;BEGIN…RETUNRN total;END;/

C.

CREATE FUNCTION totalEmp (sal IN PLS_INTEGER) RETURN NUMBER IStotal NUMBER :=0;BEGIN…RETUNRN total;END;/

D.

CREATE FUNCTION totalEmp (sal IN BINARY_FLOAT) RETURN NUMBER IStotal NUMBER :=0;BEGIN…RETUNRN total;END;/

E.

CREATE FUNCTION totalEmp (sal IN POSITIVEN) RETURN NUMBER IStotal NUMBER :=0;BEGIN…RETUNRN total;END;/

Question 10

Which two blocks of code execute successfully?

Options:

A.

DECLARE

SUBTYPE new_one IS BINARY_INTERGER RANGE 0..9; my_val new_one; BEGIN my_val :=0; END;

B.

DECLARE

SUBTYPE new_string IS VARCHAR2 (5) NOT NULL; my_str_new_string; BEGIN my_str := ‘abc’;

END;

C.

DECLARE

SUBTYPE new_one IS NUMBER (2, 1); my_val new_one; BEGIN my_val :=12.5; END;

D.

DECLARE

SUBTYPE new_one IS INTEGER RANGE 1..10 NOT NULL; my_val new_one; BEGIN my_val :=2; END;

E.

DECLARE

SUBTYPE new_one IS NUMBER (1, 0); my_val new_one; BEGIN my_val := -1;

END;

Question 11

Examine this function body:

Which two headers will allow this function to compile successfully and take advantage of both invoker’s rights and function result caching?

Options:

A.

CREATE FUNCTION get_hire_date (emp_id NUMBER) RETURN VARCHAR2RESULT_CACHE RELIES_ON (departments)AUTHID CURRENT_USERISdate_hired DATE;

B.

CREATE FUNCTION get_hire_date (emp_id NUMBER) RETURN VARCHAR2RESULT_CACHEAUTHID CURRENT_USERISdate_hired DATE;

C.

CREATE FUNCTION get_hire_date (emp_id NUMBER) RETURN VARCHAR2RESULT_CACHEAUTHID DEFINERISdate_hired DATE;

D.

CREATE FUNCTION get_hire_date (emp_id NUMBER) RETURN VARCHAR2RESULT_CACHE RELIES_ON (employees)AUTHID CURRENT_USERISdate_hired DATE;

E.

CREATE FUNCTION get_hire_date (emp_id NUMBER) RETURN VARCHAR2AUTHID DEFINERISdate_hired DATE;

Question 12

Which two statements are true about PL/SQL AOIs for SecureFiles?

Options:

A.

DBMS_LOB can be used to compress SecureFiles columns.

B.

When using DBMS_DATAPUMP, if SecureFiles LOB data needs to be encrypted then ENCRYPTION=ALL must be specified.

C.

If a BasicFiles LOB locator is passed to DBMS_LOB.ISSECUREFILE, an exception will be raised.

D.

An online redefinition of SecureFiles by DBMS_REDEFINIITON can be performed with PDML (Parallel DML).

Question 13

Examine this code:

Which two corrections must be applied for this anonymous block to execute successfully?

Options:

A.

Change RETURN p_tab.LAST to RETURN p_tab.COUNT.

B.

Declare the collection type inside the function.

C.

Declare the collection type at the schema level instead of the package.

D.

Define the function as stand-alone instead of in a package body.

E.

Change the INDEX BY clause from VARCHAR2 to PLS_INTEGER.

F.

Modify the function return type to return a scalar, VARCHAR2.

Question 14

Examine the DBMS_LOB.LOADCLOBFROMFILE procedure:

Which statement is true about DBMS_LOB.LOADCLOBFROMFILE?

Options:

A.

The amount parameter can be set to NULL to indicate to load to the end of the BFILE.

B.

The amount parameter can be set to DBMS_LOB.LOBMAXSIZE to indicate to load to the end of the BFILE.

C.

If any error occurs when calling the procedure then it is written to the warning parameter and

DBMS_LOB.LOADCLOBFROMFILE finishes successfully.

D.

An exception will always be raised if amount plus src_offset exceeds the length of the BFILE.

Question 15

Which must be true in order to add RESULT_CACHE to a function header and have it compile successfully?

Options:

A.

The IN parameters must not include BLOB, CLOB, collection or record data types.

B.

The function must be created with invoker’s rights or in an anonymous block.

C.

The function must be declared as a pipelined table function.

D.

The function must have an OUT or an IN OUT parameter.

Question 16

A products TABLE exists with a PROD_ID column.

Examine this PL/SQL block:

Which statement is true?

Options:

A.

It executes successfully only if v_ref_cur := DBMS_SQL.TO_REFCURSOR (V_CUR); is added before the FETCH statement.

B.

It executes successfully.

C.

It executes successfully only if v_ref_cur: = DBMS_SQL.TO_CURSOR_NUMBER (v_cur); is added before the FETCH statement.

D.

It executes successfully only if the FETCH statement is replaced by DBMS_SQL.RETURN_RESULT (v_ref_cur);

E.

It executes successfully only if the FETCH statement is replaced by DBMS_SQL.FETCH_ROWS (v_cur);

Demo: 16 questions
Total 107 questions