1Z0-184-25 Question 31
Select 2Your team is implementing a new text-embedding feature for product reviews in your Oracle Autonomous Database environment. The existing table, PRODUCT_REVIEWS, has columns REVIEW_ID, REVIEW_TEXT, and RATING. You need to add a vector column named REVIEW_EMBEDDING with 768 dimensions and then create a vector search index on that column to optimize similarity queries. Which two steps are required to achieve this?
- A
A. ALTER TABLE product_reviews ADD (review_embedding VECTOR(768))
- B
B. CREATE INDEX rev_embed_idx ON product_reviews(review_embedding) INDEXTYPE IS CTXSYS.VSEARCH_INDEX PARAMETERS('DIMENSIONS=768 DISTANCE_METRIC=cosine')
- C
C. Run DBMS_VECTOR.MIGRATE_TABLE procedure before adding the vector column to ensure compatibility
- D
D. TRUNCATE product_reviews before adding the new column to prevent row locks
- E
E. Use ALTER TABLE product_reviews DROP review_embedding; then recreate the column as part of the CREATE INDEX statement
Show answer and explanation
Correct answers: A, B
Explanation
When performing DDL operations on a vector column in Oracle� Autonomous Database or Oracle Database 23c (and beyond), you typically follow two steps: (1) Add the vector column with the desired dimension using an ALTER TABLE statement, and (2) create a vector search index to enable efficient similarity queries. Oracle documentation details that the index creation uses INDEXTYPE IS CTXSYS.VSEARCH_INDEX with parameters specifying the vector dimension and other configuration details (for example, distance metric). No special table-level migration or data truncation is required solely to add and index a new vector column.
- A. Correct.
A. Correct. You must first add the vector column with the correct dimension. In Oracle Database that supports vector columns, using ALTER TABLE with VECTOR(768) defines a 768-dimensional vector column appropriate for storing embeddings.
- B. Correct.
B. Correct. Oracle supports creating a vector search index using INDEXTYPE IS CTXSYS.VSEARCH_INDEX with parameters specifying dimensions (and optionally a distance metric). This step optimizes similarity queries on the vector column.
- C. Incorrect.
C. Incorrect. There is no standard DBMS_VECTOR.MIGRATE_TABLE procedure required before adding a valid vector column. This is a common misconception, but no such migration step is needed in the documented workflow.
- D. Incorrect.
D. Incorrect. TRUNCATING the table is not mandatory just for adding a new column. You can alter the table to add columns without data loss, and row locks do not force a truncate operation.
- E. Incorrect.
E. Incorrect. You do not have to drop the new vector column and recreate it as part of the CREATE INDEX statement. The index is created separately after the column is added.