1Z0-184-25 Question 134
Single answerYou have an Oracle Autonomous Database containing a table of technical documentation snippets that you want to use for a Retrieval-Augmented Generation (RAG) application. You plan to write PL/SQL procedures to fetch the most relevant snippets based on a user� query and return them to a large language model for final response generation. Which approach ensures you can efficiently retrieve snippets while maintaining a clear, reusable PL/SQL interface for your RAG workflow?
- A
Create an Oracle Text index on the documentation table and implement a PL/SQL stored procedure for context retrieval, then expose it via Oracle REST Data Services (ORDS).
- B
Use only database triggers to capture user queries and dynamically build a WHERE clause for snippet retrieval in real time.
- C
Store all snippets in external files in Object Storage and load them for each request using the DBMS_CLOUD package directly in your PL/SQL logic.
- D
Implement a PL/SQL job in DBMS_SCHEDULER that periodically relocates snippet data to a temporary table for faster search operations.
Show answer and explanation
Correct answer: A
Explanation
To build a PL/SQL-based RAG solution, it� best practice to leverage Oracle Text for efficient searching across document snippets and to encapsulate business logic within PL/SQL stored procedures. Oracle REST Data Services (ORDS) can then be used to expose these procedures securely as REST endpoints for consumption by an external AI model. For more details, refer to Oracle Text documentation (docs.oracle.com/en/database/oracle/oracle-database/19/ccref/Oracle-Text-Reference) and the ORDS documentation for REST-enabling PL/SQL procedures.
- A. Correct.
Correct. Using Oracle Text indexes provides efficient full-text search capabilities, and a PL/SQL stored procedure allows you to encapsulate all query logic in one place. Exposing it via ORDS makes the retrieval endpoints accessible for external applications like a large language model integration.
- B. Incorrect.
Incorrect. Triggers are not designed for general-purpose query processing. They respond to DML events (INSERT, UPDATE, DELETE) rather than retrieval requests, making them unsuitable for implementing a robust search interface.
- C. Incorrect.
Incorrect. While DBMS_CLOUD can load external data from Object Storage, continuously loading files on each request is inefficient and does not leverage Oracle� indexing capabilities for quick lookups of existing data.
- D. Incorrect.
Incorrect. Scheduling jobs with DBMS_SCHEDULER is useful for background tasks (e.g., data cleanup), but it does not inherently provide a better search mechanism. Periodic relocation of data to a temporary table also adds unnecessary complexity and maintenance overhead.