1Z0-149 practice question 5 of 15

Which two statements are true about using the OR REPLACE clause when creating named subprograms? (Choose two.)

Full set: 65 questions
Answer options
A: Function based indexes remain usable when replacing the function on which the index depends.
B: Object privileges to execute a replaced function must be regranted to those users who had the privilege.
C: This clause can be used only for procedures and functions.
D: A function definition can be modified without dropping and re-creating it. Correct answer
E: Object privileges to execute a replaced function are retained by those users who had the privileges. Correct answer
Correct Answer:
D. A function definition can be modified without dropping and re-creating it.; E. Object privileges to execute a replaced function are retained by those users who had the privileges.
Explanation

Using CREATE [OR REPLACE] allows you to redefine an existing standalone procedure or function without first dropping it. Because the object is replaced—not dropped—grants previously given on that object remain intact. Therefore, you can alter the source text while preserving privileges and without issuing DROP/CREATE.

Why Incorrect

A. Replacing a referenced function invalidates (and makes unusable) any function-based index until it is rebuilt.
B. OR REPLACE keeps, not removes, existing EXECUTE privileges.
C. OR REPLACE is also valid for views, packages, package bodies, triggers, etc., not only procedures/functions.

References

1. Oracle Database SQL Language Reference 19c, “CREATE FUNCTION”, clause OR REPLACE, p. 27-40 (“Replaces the definition… grants remain.”)

2. Same manual, “CREATE PROCEDURE”, p. 27-79.

3. Oracle Database Administrator’s Guide 19c, chap. 19 “Managing Indexes”, sec. “Function-Based Indexes become invalid when the function is modified”.

Scroll to Top