Q1. Which two statements are true about associative arrays and nested tables? (Choose two.)
A. Only associative arrays can hold an arbitrary number of elements.
B. Only associative arrays can use numbers and strings for subscripts.
C. Both associative arrays and nested tables can hold an arbitrary number of elements.
D. Both associative arrays and nested tables can use numbers and strings for subscripts.
Answer: B,C
Q2. Examine the structure of the LOB_STORE table.
Name Null? Type
LOB_ID NUMBER VIDEO_CLIP BLOB You create a 'DATA_FILES' directory object that contains the 'IMAGE1.GIF'operating system (OS) file. View the Exhibit and examine the LOAD_LOB procedure code that you execute for reading data from the OS file into the BLOB column.
It is created with compilation errors. What is the reason?
A. V_BLOB should be initialized to EMPTY_BLOB().
B. The WRITE routine of DBMS_LOB should be used instead of LOADFROMFILE.
C. The return type of DBMS_LOB.FILEEXISTS is not compatible with the IF statement.
D. OPEN, CLOSE, and READONLY routines of DBMS_LOB should be used instead of FILEOPEN, FILECLOSE, and FILE_READONLY.
Answer: C
Q3. You created the SALES_ORDERS_CTX context to use the
OE.SALES_ORDERS_PKG package.
View Exhibit1 and examine the package that is used with the context.
View Exhibit2 to examine the policy defined and the logon trigger.
A user receives the following error when he or she executes a query:
ERROR at line 2:
ORA-28112: failed to execute policy function
What could be the reason for the error?
A. The user has insufficient privileges on the DBMS_SESSION package.
B. The subprograms inside the package have not been created with the invoker's right.
C. The THE_PREDICATE function has an insufficient number of parameters in the package.
D. The policy is created by using SALES_ORDERS_PKG.THE_PREDICATE without a parameter.
Answer: C
Q4. In which two situations is the body of a result-cached function executed? (Choose two.)
A. if the memory allocated for the result cache is increased
B. if a session on this database instance invokes the function with the same parameter values
C. if the first time a session on this database instance invokes the function with a parameter value
D. if a session executes a data manipulation language (DML) statement on a table or view that was specified in the RELIES_ON clause of a result-cached function
Answer: C,D
Q5. You created a PL/SQL subprogram that successfully invokes an external C procedure. After a while, the database administrator (DBA) drops the alias library schema object. The shared library exists in the system. Which statement is true in this scenario?
A. The corresponding shared library is also removed from the system.
B. PL/SQL subprograms can be used to invoke the external C procedure.
C. The existing extproc process is terminated and a new extproc is started.
D. The PL/SQL subprogram that depends on the external C program becomes invalid.
Answer: D
Q6. You designed a CardValidation.java Java source file. You also have the corresponding CardValidation.class file. As part of invoking a Java class method, you executed this command at the command prompt: loadjava -user oe/oe CardValidation.java Which statement is true about the command?
A. It loads the Java code into the database.
B. It publishes Java methods in CardValidation.java.
C. It loads the metadata related to the Java class file into the database.
D. It loads the Java class file into the Java pool in the database instance.
Answer: A
Q7. You created an application context successfully. The user OE was granted the EXECUTE privilege on the DBMS_SESSION package. The user receives this error while setting the value for an attribute within the context: SQL> EXECUTE DBMS_SESSION.SET_CONTEXT('SALES_ORDERS_CTX','ACCOUNT_MGR','OE'); BEGIN DBMS_SESSION.SET_CONTEXT('SALES_ORDERS_CTX','ACCOUNT_MGR','OE'); END; * ERROR at line 1: ORA-01031: insufficient privileges ORA-06512: at "SYS.DBMS_SESSION", line 94
ORA-06512: at line 1
What is the reason for this error?
A. The context was created with a package name in the USING clause.
B. The attribute can be set only in the package associated with the context.
C. The package associated with the context did not exist at the time of creation of the context.
D. The value for an attribute of a user-defined context can be set only by the ALTER SESSION command.
Answer: B
Q8. You executed the following command:
SQL> ALTER SESSION SET PLSCOPE_SETTINGS = 'IDENTIFIERS:ALL'
You create a new package called PACK1. View Exhibit1 to examine the PL/SQL code for the
PACK1 package specification and body.
You issue the following query to see all unique identifiers with a name, such as %1:
SQL> SELECT NAME, SIGNATURE, TYPE
FROM USER_IDENTIFIERS
WHERE NAME LIKE '%1' AND USAGE='DECLARATION'
ORDER BY OBJECT_TYPE, USAGE_ID;
View Exhibit2 to examine the output of the query. Which two statements are true about the output of the query? (Choose two.)
A. The SIGNATURE column has a unique value for an identifier except for identifiers with the same name.
B. The TYPE column has the value of packages, function or procedures, object types, PL/SQL types, triggers, or exceptions.
C. The query shows the output for only those identifiers for PL/SQL objects, which are created by the user and are compiled after the ALTER SESSION command.
D. The ALTER SESSION command automatically collects identifier data and the query shows the output for all the identifiers for PL/SQL objects, which are created by the user.
Answer: B,C
Q9. Which two conditions must be true for a PL/SQL function to be result cached? (Choose two.)
A. It must be part of a package.
B. It must be a pipelined table function.
C. It must not be defined in an anonymous block.
D. It must have at least one OUT or IN OUT parameter.
Answer: C,D
Q10. There is a Java class file in your system and you publish it using the following command:
CREATE OR REPLACE PROCEDURE ccformat
(x IN OUT VARCHAR2)
AS LANGUAGE JAVA
NAME 'FormatCreditCardNo.formatCard(java.lang.String[])'
However, you receive the following error when executing the CCFORMAT procedure:
ERROR at line 1:
ORA-29540: class FormatCreditCardNo does not exist
ORA-06512: at "SH.CCFORMAT", line 1
ORA-06512: at line 1
What would you do to execute the procedure successfully?
A. Change the listener configuration.
B. Create a directory object and link it to the Java class file.
C. Rebuild the Java class file when the database instance is running.
D. Use the loadjava utility to load the Java class file into the database.
Answer: D
Q11. View the Exhibit and examine the procedure to create a trigger name based on the table name supplied to the procedure.
Which three statements are appropriate for protecting the code in the procedure from SQL injection? (Choose three.)
A. Explicitly validate the identifier length limit.
B. Add AUTHID DEFINER to the definition of the procedure.
C. Use PRAGMA RESTRICT_REFERENCES in the procedure.
D. Filter out control characters in user-supplied identifier names.
E. Use the object ID of the table from the data dictionary to build the trigger name.
Answer: A,D,E
Q12. View Exhibit1 and examine the structure of the EMPLOYEES and DEPARTMENTS tables existing in your schema.
View Exhibit2 and examine the PL/SQL block that you execute to display the department-wise incremented salary for all the departments in your company.
The code generates an error on execution.
What correction should be done to ensure the code executes successfully?
A. The cursor variable parameter should be passed in IN OUT mode.
B. The cursor variable should be defined as a strong REF CURSOR type.
C. The cursor variable name passed as actual and formal parameters should be identical.
D. The %NOTFOUND cursor attribute cannot be used with the cursor variables and should be replaced with a user defined exception.
Answer: A
Q13. Identify the two types of PL/SQL programs for which you consider setting the compilation method to native mode. (Choose two.)
A. PL/SQL programs that are still in the debugging phase of development
B. PL/SQL programs that have computation-intensive procedural operations
C. A PL/SQL program, which is called with the same parameters by multiple sessions
D. PL/SQL programs that spend most of their execution time in executing SQL statements
Answer: B,C
Q14. Which three statements are true about hierarchical profiling? (Choose three.)
A. It provides function-level summaries.
B. It produces an aggregated report of the SQL and PL/SQL execution times.
C. It is useful for understanding the structure and control flow of complex programs.
D. It can be used to identify hotspots and tuning opportunities in PL/SQL applications.
E. It generates trace information for PL/SQL programs in the PLSQL_TRACE_EVENTS table.
Answer: A,C,D
Q15. You created a PL/SQL function with the RESULT_CACHE and RELIES_ON clauses. In which scenarios is the cached result bypassed? (Choose all that apply.)
A. when the size for the memory allocated for the result cache is increased
B. when the function is executed in a session frequently with the same parameter value
C. when the database administrator has disabled the use of the result cache during application patching
D. when a data manipulation language (DML) statement is executed in a session on a table or view that was specified in the RELIES_ON clause of a result-cached function
Answer: C,D
Q16. Identify two strategies against SQL injection. (Choose two.)
A. Using parameterized queries with bind arguments.
B. Use subprograms that are run with the definer's right.
C. Use RESTRICT_REFERENCE clauses in functions that use dynamic SQLs.
D. Validate user inputs to functions that use dynamic SQLs built with concatenated values.
Answer: A,D