20 October, 2025

The "Retrieval" for RAG using Semantic Search

 Reusing the sample code from my previous demo, I build a table with 130 sentences describing AI Tools and then use SQL to run the sort of queries that you'd expect RAG to use against an "internal knowledge source".

Here's a preview of the sentences loaded :


SQL> select count(*) from my_data_source;

  COUNT(*)
----------
       130

SQL> select my_sentence from my_data_source fetch first 5 rows only;

MY_SENTENCE
----------------------------------------------------------------------------------------------------------------------------------------------------
        Adobe Firefly: A family of generative AI models integrated into Adobe's Creative Cloud suite. It is used for professional image editing and graphic
 design

        AIVA (Artificial Intelligence Virtual Artist): An AI composer that generates music in various styles for content creators and brands
        Amazon CodeWhisperer: An AI coding assistant from Amazon Web Services that provides contextual code recommendations
        Canva Magic Media: An AI image generator integrated into the user friendly design platform. It is used for creating visuals for social media and pr
esentations

        ChatGPT: An AI chatbot from OpenAI. It can engage in human like conversations, write code, summarize text, and create content such as stories and e
ssays


SQL> select my_sentence from my_data_source where id > 126 ;

MY_SENTENCE
----------------------------------------------------------------------------------------------------------------------------------------------------
        Zubtitle.com   captions for video
        Cohere.ai   large language models
        Grok.com   personal AI assistant
        Claude.ai   advanced AI chatbot

SQL>


The embeddings are then computed and loaded into the target table using the same query (the HuggingFace model ALL_MINILM_L12_V2_AUGMENTED has already been loaded  with the ONNX RunTime engine with the same code as in the previous blog post) :


insert into my_data_vectors
select ds.id as id, my_sentence, to_vector(et.embed_vector) sentence_vector
from
    my_data_source ds,
    dbms_vector_chain.utl_to_embeddings(
       dbms_vector_chain.utl_to_chunks(dbms_vector_chain.utl_to_text(ds.my_sentence), json('{"normalize":"all"}')),
       json('{"provider":"database", "model":"ALL_MINILM_L12_V2_AUGMENTED"}')) t,
    JSON_TABLE(t.column_value, '$[*]' COLUMNS (embed_id NUMBER PATH '$.embed_id', embed_data VARCHAR2(4000) PATH '$.embed_data', embed_vector CLOB PATH '$.embed_vector')) et
/


I now test a few "Retrieval" queries thus :  (Note how the queries return different results with smaller VECTORE_DISTANCE as I refine them) 

SQL> ACCEPT text_input CHAR PROMPT 'Enter your query : '
Enter your query : Video
SQL> VARIABLE text_variable VARCHAR2(1000)
SQL> VARIABLE query_vector VECTOR
SQL> BEGIN
  2    :text_variable := '&text_input';
  3    SELECT vector_embedding(ALL_MINILM_L12_V2_AUGMENTED USING  :text_variable as data) into :query_vector;
  4  END;
  5  /
old   2:   :text_variable := '&text_input';
new   2:   :text_variable := 'Video';

PL/SQL procedure successfully completed.

SQL>
SQL>
SQL> SELECT my_sentence, vector_distance(sentence_vector , :query_vector, COSINE) as Calc_Vector_Distance
  2  FROM my_data_vectors
  3  ORDER BY 2
  4  FETCH FIRST 3 ROWS ONLY;

MY_SENTENCE
----------------------------------------------------------------------------------------------------------------------------------------------------
CALC_VECTOR_DISTANCE
--------------------
        Clipchamp.com   quick video creation
          4.635E-001

        Lumen5.com   AI powered social video
          5.277E-001

        Synths.video   convert blogs into videos
           5.39E-001


SQL>
----------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------



SQL> ACCEPT text_input CHAR PROMPT 'Enter your query : '
Enter your query : What AI Tool can I use to edit Videos ?
SQL> VARIABLE text_variable VARCHAR2(1000)
SQL> VARIABLE query_vector VECTOR
SQL> BEGIN
  2    :text_variable := '&text_input';
  3    SELECT vector_embedding(ALL_MINILM_L12_V2_AUGMENTED USING  :text_variable as data) into :query_vector;
  4  END;
  5  /
old   2:   :text_variable := '&text_input';
new   2:   :text_variable := 'What AI Tool can I use to edit Videos ?';

PL/SQL procedure successfully completed.

SQL>
SQL>
SQL> SELECT my_sentence, vector_distance(sentence_vector , :query_vector, COSINE) as Calc_Vector_Distance
  2  FROM my_data_vectors
  3  ORDER BY 2
  4  FETCH FIRST 3 ROWS ONLY;

MY_SENTENCE
----------------------------------------------------------------------------------------------------------------------------------------------------
CALC_VECTOR_DISTANCE
--------------------
        Wisecut.video   auto edit with AI
           2.62E-001

        Runwayml.com   AI video editing
          2.777E-001

        Gling.ai   YouTube video editor
          3.413E-001


SQL>
SQL>
----------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------



SQL> ACCEPT text_input CHAR PROMPT 'Enter your query : '
Enter your query : image
SQL> VARIABLE text_variable VARCHAR2(1000)
SQL> VARIABLE query_vector VECTOR
SQL> BEGIN
  2    :text_variable := '&text_input';
  3    SELECT vector_embedding(ALL_MINILM_L12_V2_AUGMENTED USING  :text_variable as data) into :query_vector;
  4  END;
  5  /
old   2:   :text_variable := '&text_input';
new   2:   :text_variable := 'image';

PL/SQL procedure successfully completed.

SQL>
SQL>
SQL> SELECT my_sentence, vector_distance(sentence_vector , :query_vector, COSINE) as Calc_Vector_Distance
  2  FROM my_data_vectors
  3  ORDER BY 2
  4  FETCH FIRST 3 ROWS ONLY;

MY_SENTENCE
----------------------------------------------------------------------------------------------------------------------------------------------------
CALC_VECTOR_DISTANCE
--------------------
        VanceAI.com   image enhancement
          5.268E-001

        Canva Magic Media: An AI image generator integrated into the user friendly design platform. It is used for creating visuals for social media and pr
esentations
          5.459E-001

        PicWish.com   photo editing
          5.696E-001


SQL>
SQL>
----------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------



SQL> ACCEPT text_input CHAR PROMPT 'Enter your query : '
Enter your query : How can I use AI to edit Images ?
SQL> VARIABLE text_variable VARCHAR2(1000)
SQL> VARIABLE query_vector VECTOR
SQL> BEGIN
  2    :text_variable := '&text_input';
  3    SELECT vector_embedding(ALL_MINILM_L12_V2_AUGMENTED USING  :text_variable as data) into :query_vector;
  4  END;
  5  /
old   2:   :text_variable := '&text_input';
new   2:   :text_variable := 'How can I use AI to edit Images ?';

PL/SQL procedure successfully completed.

SQL>
SQL>
SQL> SELECT my_sentence, vector_distance(sentence_vector , :query_vector, COSINE) as Calc_Vector_Distance
  2  FROM my_data_vectors
  3  ORDER BY 2
  4  FETCH FIRST 3 ROWS ONLY;

MY_SENTENCE
----------------------------------------------------------------------------------------------------------------------------------------------------
CALC_VECTOR_DISTANCE
--------------------
        Hotpot.ai   AI image editing
          2.805E-001

        Runwayml.com   AI video editing
          3.711E-001

        Wisecut.video   auto edit with AI
          3.921E-001


SQL>
SQL>
----------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------



SQL> ACCEPT text_input CHAR PROMPT 'Enter your query : '
Enter your query : Can I chat with an AI ?
SQL> VARIABLE text_variable VARCHAR2(1000)
SQL> VARIABLE query_vector VECTOR
SQL> BEGIN
  2    :text_variable := '&text_input';
  3    SELECT vector_embedding(ALL_MINILM_L12_V2_AUGMENTED USING  :text_variable as data) into :query_vector;
  4  END;
  5  /
old   2:   :text_variable := '&text_input';
new   2:   :text_variable := 'Can I chat with an AI ?';

PL/SQL procedure successfully completed.

SQL>
SQL>
SQL> SELECT my_sentence, vector_distance(sentence_vector , :query_vector, COSINE) as Calc_Vector_Distance
  2  FROM my_data_vectors
  3  ORDER BY 2
  4  FETCH FIRST 3 ROWS ONLY;

MY_SENTENCE
----------------------------------------------------------------------------------------------------------------------------------------------------
CALC_VECTOR_DISTANCE
--------------------
        Claude.ai   advanced AI chatbot
          2.989E-001

        Claude.ai   conversational assistant
          3.828E-001

        Grok.com   personal AI assistant
          4.025E-001


SQL>
SQL>
----------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------



SQL> ACCEPT text_input CHAR PROMPT 'Enter your query : '
Enter your query : coding
SQL> VARIABLE text_variable VARCHAR2(1000)
SQL> VARIABLE query_vector VECTOR
SQL> BEGIN
  2    :text_variable := '&text_input';
  3    SELECT vector_embedding(ALL_MINILM_L12_V2_AUGMENTED USING  :text_variable as data) into :query_vector;
  4  END;
  5  /
old   2:   :text_variable := '&text_input';
new   2:   :text_variable := 'coding';

PL/SQL procedure successfully completed.

SQL>
SQL>
SQL> SELECT my_sentence, vector_distance(sentence_vector , :query_vector, COSINE) as Calc_Vector_Distance
  2  FROM my_data_vectors
  3  ORDER BY 2
  4  FETCH FIRST 3 ROWS ONLY;

MY_SENTENCE
----------------------------------------------------------------------------------------------------------------------------------------------------
CALC_VECTOR_DISTANCE
--------------------
        Amazon CodeWhisperer: An AI coding assistant from Amazon Web Services that provides contextual code recommendations
          5.543E-001

        Replit.com   write and run code
          5.548E-001

        GitHub Copilot: An AI coding assistant that provides code suggestions and autocompletion within an IDE
          5.677E-001


SQL>
SQL>
----------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------


SQL> ACCEPT text_input CHAR PROMPT 'Enter your query : '
Enter your query : Tell me of a Coding Assistant
SQL> VARIABLE text_variable VARCHAR2(1000)
SQL> VARIABLE query_vector VECTOR
SQL> BEGIN
  2    :text_variable := '&text_input';
  3    SELECT vector_embedding(ALL_MINILM_L12_V2_AUGMENTED USING  :text_variable as data) into :query_vector;
  4  END;
  5  /
old   2:   :text_variable := '&text_input';
new   2:   :text_variable := 'Tell me of a Coding Assistant';

PL/SQL procedure successfully completed.

SQL>
SQL>
SQL> SELECT my_sentence, vector_distance(sentence_vector , :query_vector, COSINE) as Calc_Vector_Distance
  2  FROM my_data_vectors
  3  ORDER BY 2
  4  FETCH FIRST 3 ROWS ONLY;

MY_SENTENCE
----------------------------------------------------------------------------------------------------------------------------------------------------
CALC_VECTOR_DISTANCE
--------------------
        GitHub Copilot: An AI coding assistant that provides code suggestions and autocompletion within an IDE
          4.306E-001

        Amazon CodeWhisperer: An AI coding assistant from Amazon Web Services that provides contextual code recommendations
          4.702E-001

        Replit: An online IDE with an integrated AI assistant that helps with code generation, debugging, and project creation
          4.734E-001


SQL>
SQL>

Thus, in the first pair of examples, if I refine (aka "prompt engineering") my query from "Video" to "What AI Tool can I use to edit Videos ?", I get a better set of responses with  a smaller VECTOR_DISTANCE from my query.

In the second pair, I change my query from "image" to "How can I use AI to edit Images ?"  I get an improved set of responses (again with a smaller VECTOR_DISTANCE).

In the last pair, when I change  my query from "coding" to "Tell me of a Coding Assistant", I get responses with a better match to my query.

As noted in my previous blog post, the "LLM" is actually a "MinLM" called "all-MiniLM-L12-v2" from HuggingFace.

21 September, 2025

AI / LLM : Semantic Similarity Search using Hugging Face with Vectors in an Oracle 23ai Database

 As I have recently gone through a course on LLMs for Chatbots and RAG on OCI (Oracle Cloud Infrastructure), I thought about putting together a quick demo that uses 

A The Hugging Face all-MiniLM-L12-v2 model (with some augmentations done by Oracle for download)

B  The ONNX (Open Neural Network Exchange) Runtime Engine that runs in Oracle 23ai (and, yes, in the 23ai Free downloadable edition, not requiring the Oracle Cloud)

C  Vectors stored in an Oracle Database using the Vector Datatype

D  Use the Hugging Face model to generate Vectors for Similarity / Semantic Searches



but DOES NOT USE Oracle Cloud Infrastructure.  (To use OCI for Embedding -- generating "Vectors" from "Tokens", I have to book a  Dedicated AI Cluster to "Fine Tune" an existing model, so I am currently staying away from this expensive method)

[Similarly, I cannot currently build a Generative AI as I have to setup a model and server resources]


The sequence is :

1. Setup an Oracle 23ai database (either in the Oracle Cloud OR on an Exadata machine  OR the Free edition for On-Premises testing)

2. Create a User to hold the source data and vectors

3. Import the augmented Hugging Face model

4. Load the Source Data as words or sentences or chunks -- here I use a few sentences

5. Compute Vectors for the target column

6.  Optional but recommended : Build Vector Index -- for this demo with very few rows I haven't built a Vector Index but if and/or when I do build a demo with a few hundred or thousand sentences or chunks of data, I will create an Index on the Vectors

7. Use Oracle's VECTOR_DISTANCE  Function for a Semantic Similarity Search


So here goes :


User and Grants :
Using the 23ai FREEPDB  downloadable VM, I created the user with these grants :

grant connect to vector_demo identified by password ;

alter user vector_demo default tablespace users ;

alter user vector_demo quota unlimited on users ;

grant DB_DEVELOPER_ROLE to vector_demo ;

grant CREATE MINING MODEL to vector_demo;

CREATE OR REPLACE DIRECTORY DM_DUMP as '/tmp/Load_Model';  -- on the Linux VM

GRANT READ ON DIRECTORY dm_dump TO vector_demo;

GRANT WRITE ON DIRECTORY dm_dump TO vector_demo;

Download and Import the Model :

Download the ZIP file from https://adwc4pm.objectstorage.us-ashburn-1.oci.customer-oci.com/p/VBRD9P8ZFWkKvnfhrWxkpPe8K03-JIoM5h_8EJyJcpE80c108fuUjg7R5L5O7mMZ/n/adwc4pm/b/OML-Resources/o/all_MiniLM_L12_v2_augmented.zip It also contains a README Place the extracted ONNX file on the Linux Server at /tmp/Load_Model SQL> !ls -l /tmp/Load_Model total 249932 -rw-r--r--. 1 oracle oinstall 122597346 Jul 15 2024 all_MiniLM_L12_v2_augmented.zip -rw-r--r--. 1 oracle oinstall 133322334 Jul 15 2024 all_MiniLM_L12_v2.onnx -rw-r--r--. 1 oracle oinstall 4232 Jul 15 2024 README-ALL_MINILM_L12_V2-augmented.txt SQL> If necessary, delete the previously imported model from the database (logged in to the SQL command line as vector_demo) : exec DBMS_VECTOR.DROP_ONNX_MODEL(model_name => 'ALL_MINILM_L12_V2_AUGMENTED', force => true); Import the model file : SQL> EXECUTE DBMS_VECTOR.LOAD_ONNX_MODEL(- directory=>'DM_DUMP',- file_name=>'all_MiniLM_L12_v2.onnx',- model_name=>'ALL_MINILM_L12_V2_AUGMENTED'- metadata => JSON('{"function" : "embedding", "embeddingOutput" : "embedding", "input": {"input": ["DATA"]}}')- ); The "model_name" is the User Defined Name (i.e. defined by the DBA). In many online demos and the online demo, I see the model name specified as "doc_model". I preferred to use the name "ALL_MINILM_L12_V2_AUGMENTED". You could use any meaningful name Verify the imported model with these queries : SQL> l 1 SELECT model_name, attribute_name, attribute_type, data_type, vector_info 2 FROM user_mining_model_attributes 3 WHERE model_name = 'ALL_MINILM_L12_V2_AUGMENTED' 4* ORDER BY ATTRIBUTE_NAME SQL> / MODEL_NAME ATTRIBUTE_NAME ATTRIBUTE_TY DATA_TYPE -------------------------------- ---------------- ------------ ---------------- VECTOR_INFO -------------------------------------------------------- ALL_MINILM_L12_V2_AUGMENTED DATA TEXT VARCHAR2 ALL_MINILM_L12_V2_AUGMENTED ORA$ONNXTARGET VECTOR VECTOR VECTOR(384,FLOAT32) SQL> SQL> l 1 SELECT MODEL_NAME, MINING_FUNCTION, ALGORITHM, 2 ALGORITHM_TYPE, MODEL_SIZE 3 FROM user_mining_models 4 WHERE model_name = 'ALL_MINILM_L12_V2_AUGMENTED' 5* ORDER BY MODEL_NAME SQL> / MODEL_NAME MINING_FUNCTION ALGORITHM ALGORITHM_ MODEL_SIZE -------------------------------- ------------------------------ ------------------------------ ---------- ---------- ALL_MINILM_L12_V2_AUGMENTED EMBEDDING ONNX NATIVE 133322334 SQL> SQL>SELECT * FROM DM$VMALL_MINILM_L12_V2_AUGMENTED ORDER BY NAME ; NAME VALUE ------------------ ------------------------------------------------ Graph Description Graph combining tokenizer and main_graph tokenizer main_graph Graph Name tokenizer_main_graph Input[0] input:string[?] Output[0] embedding:float32[?,384] Producer Name onnx.compose.merge_models Version 1 6 rows selected. SQL> SQL> SELECT * FROM DM$VPALL_MINILM_L12_V2_AUGMENTED ORDER BY NAME; NAME VALUE ------------------ ------------------------------------------------ embeddingOutput embedding function embedding SQL> SQL> SELECT * FROM DM$VJALL_MINILM_L12_V2_AUGMENTED; METADATA -------------------------------------------------------------------------------- {"function":"embedding","embeddingOutput":"embedding","input":{"input":["DATA"]} SQL>

Test generation of Embeddings with the Model :


SQL> SELECT VECTOR_EMBEDDING(ALL_MINILM_L12_V2_AUGMENTED USING 'The quick brown fox jumped' as DATA) AS embedding;

EMBEDDING
------------------------------------------------------------------------------------------------------------------------------------
[1.65517051E-002,3.19098569E-002,-1.96293015E-002,-3.56926955E-002,

SQL>
SQL> SELECT VECTOR_DIMS(VECTOR_EMBEDDING(ALL_MINILM_L12_V2_AUGMENTED USING 'The quick brown fox jumped' as DATA)) as Dimensions_Count;

DIMENSIONS_COUNT
----------------
             384

SQL>

note : The output is actually a list of 384 dimensions, I copied the whole output from SQL Developer put it into a Python List and 
then did a LEN(list) to count the number of elements

Create the Table for the source data (sentences of text in my demo)  and load some data (sentences)


SQL> drop table my_data_source purge;

Table dropped.

SQL> create table my_data_source(id number primary key, my_sentence varchar2(4000));

Table created.

SQL> insert into my_data_source values (1,'The quick brown fox jumped over the lazy dog');

1 row created.

SQL> insert into my_data_source values (2,'she sells sea-shells at the seashore');

1 row created.

SQL> insert into my_data_source values (3,'the fox and dog are brown friends');

1 row created.

SQL> insert into my_data_source values (4,'the elephant knows the fox and dog');

1 row created.

SQL> insert into my_data_source values (5,'the fox, dog and elephant live together');

1 row created.

SQL> insert into my_data_source values (6,'aeroplanes fly in the sky');

1 row created.

SQL> commit;

Commit complete.

SQL>
SQL> select * from my_data_source;

        ID
----------
MY_SENTENCE
------------------------------------------------------------------------------------------------------------------------------------
         1
The quick brown fox jumped over the lazy dog

         2
she sells sea-shells at the seashore

         3
the fox and dog are brown friends

         4
the elephant knows the fox and dog

         5
the fox, dog and elephant live together

         6
aeroplanes fly in the sky


6 rows selected.

SQL>



Create the Table to hold the computed Vectors, using the model that has been loaded


SQL> drop table my_data_vectors;

Table dropped.

SQL> create table my_data_vectors (id number primary key, my_sentence varchar2(4000), sentence_vector vector);

Table created.

SQL> 
SQL> insert into my_data_vectors
select ds.id as id, my_sentence, to_vector(et.embed_vector) sentence_vector
from
    my_data_source ds,
    dbms_vector_chain.utl_to_embeddings(
       dbms_vector_chain.utl_to_chunks(dbms_vector_chain.utl_to_text(ds.my_sentence), json('{"normalize":"all"}')),
       json('{"provider":"database", "model":"ALL_MINILM_L12_V2_AUGMENTED"}')) t,
    JSON_TABLE(t.column_value, '$[*]' COLUMNS (embed_id NUMBER PATH '$.embed_id', embed_data VARCHAR2(4000) PATH '$.embed_data', embed_vector CLOB PATH '$.embed_vector')) et;
  2    3    4    5    6    7    8
6 rows created.

SQL>
SQL> commit
  2  /

Commit complete.

SQL> select * from my_data_vectors;

        ID
----------
MY_SENTENCE
------------------------------------------------------------------------------------------------------------------------------------
SENTENCE_VECTOR
------------------------------------------------------------------------------------------------------------------------------------
         1
The quick brown fox jumped over the lazy dog
[1.70537992E-003,5.95331714E-002,-2.32173726E-002,3.02353837E-002,

         2
she sells sea-shells at the seashore
[1.2790652E-002,5.97022101E-002,8.24511051E-002,3.93822305E-002,

         3
the fox and dog are brown friends
[7.67209902E-002,-7.82399923E-002,-2.40087509E-002,-2.37390138E-002,

         4
the elephant knows the fox and dog
[4.04452085E-002,-4.15055361E-003,-1.71641614E-002,2.63017584E-002,

         5
the fox, dog and elephant live together
[9.44276601E-002,-4.74944711E-002,2.31287945E-002,2.9055763E-002,

         6
aeroplanes fly in the sky
[1.1147093E-001,2.18752325E-002,-4.58196662E-002,-2.64751501E-002,


6 rows selected.

SQL>


Do a Semantic Similarity Search for certain phrases :

SQL> l
  1  SELECT VECTOR_DISTANCE(
  2  VECTOR_EMBEDDING(ALL_MINILM_L12_V2_AUGMENTED USING 'The quick brown fox jumped' as DATA),
  3  VECTOR_EMBEDDING(ALL_MINILM_L12_V2_AUGMENTED USING 'The quicker yellow fox jumped' as DATA),
  4* COSINE) as Vector_Distance
SQL> /

VECTOR_DISTANCE
---------------
   1.76127E-001

SQL>
SQL> l
  1  SELECT VECTOR_DISTANCE(
  2  VECTOR_EMBEDDING(ALL_MINILM_L12_V2_AUGMENTED USING 'The quick brown fox jumped' as DATA),
  3  VECTOR_EMBEDDING(ALL_MINILM_L12_V2_AUGMENTED USING 'seashells' as DATA),
  4* COSINE) as Vector_Distance
SQL> /

VECTOR_DISTANCE
---------------
   9.81778E-001

SQL>
SQL> l
  1  SELECT VECTOR_DISTANCE(
  2  VECTOR_EMBEDDING(ALL_MINILM_L12_V2_AUGMENTED USING 'The quick brown fox jumped' as DATA),
  3  VECTOR_EMBEDDING(ALL_MINILM_L12_V2_AUGMENTED USING 'moon elephants' as DATA),
  4* COSINE)as Vector_Distance
SQL> /

VECTOR_DISTANCE
---------------
   7.51297E-001

SQL>

--- "the quicker yellow fox jumped" is not very far away from "the quick brown fox jumped"
--- "moon elephants" is far away from the "the quick brown fox jumped".
--- "seashells" is much further away.
--- likely because the prebuilt model recognises tnat "fox" and "elephant" have some similarity being animals

SQL> l
  1  SELECT VECTOR_DISTANCE(
  2  VECTOR_EMBEDDING(ALL_MINILM_L12_V2_AUGMENTED USING 'The quick brown fox jumped' as DATA),
  3  VECTOR_EMBEDDING(ALL_MINILM_L12_V2_AUGMENTED USING 'houshold electricals' as DATA),
  4* COSINE)as Vector_Distance
SQL> /

VECTOR_DISTANCE
---------------
   9.97313E-001

SQL>
-- "household" electricals is further away


SQL> l
  1  SELECT id , my_sentence, vector_distance(sentence_vector , VECTOR_EMBEDDING(ALL_MINILM_L12_V2_AUGMENTED USING 'sea-shells' as DATA), COSINE) as Vector_Distance
  2  FROM my_data_vectors
  3  ORDER BY vector_distance(sentence_vector , VECTOR_EMBEDDING(ALL_MINILM_L12_V2_AUGMENTED USING 'sea-shells' as DATA), COSINE)
  4* FETCH FIRST 2 ROWS ONLY
SQL> /

          ID MY_SENTENCE                                      VECTOR_DISTANCE
------------ ------------------------------------------------ ---------------
           2 she sells sea-shells at the seashore                3.65937E-001
           6 aeroplanes fly in the sky                           8.43676E-001

SQL>
SQL> l
  1  SELECT id , my_sentence, vector_distance(sentence_vector , VECTOR_EMBEDDING(ALL_MINILM_L12_V2_AUGMENTED USING 'she sells seashells' as DATA), COSINE) as Vector_Distance
  2  FROM my_data_vectors
  3  ORDER BY vector_distance(sentence_vector , VECTOR_EMBEDDING(ALL_MINILM_L12_V2_AUGMENTED USING 'she sells seashells' as DATA), COSINE)
  4* FETCH FIRST 2 ROWS ONLY
SQL> /

          ID MY_SENTENCE                                      VECTOR_DISTANCE
------------ ------------------------------------------------ ---------------
           2 she sells sea-shells at the seashore                1.46406E-001
           6 aeroplanes fly in the sky                           9.26212E-001

SQL>
--- If I refine my query from "sea-shells" to "she sells seashells", I can get a better match, with the Vector Distance dropping from 3.6*10^-1  to 1.4*10^-1

SQL> l
  1  SELECT id , my_sentence, vector_distance(sentence_vector , VECTOR_EMBEDDING(ALL_MINILM_L12_V2_AUGMENTED USING 'quick fox' as DATA), COSINE) as Vector_Distance
  2  FROM my_data_vectors
  3  ORDER BY vector_distance(sentence_vector , VECTOR_EMBEDDING(ALL_MINILM_L12_V2_AUGMENTED USING 'quick fox' as DATA), COSINE)
  4* FETCH FIRST 2 ROWS ONLY
SQL> /

          ID MY_SENTENCE                                      VECTOR_DISTANCE
------------ ------------------------------------------------ ---------------
           1 The quick brown fox jumped over the lazy dog        3.22912E-001
           4 the elephant knows the fox and dog                  5.21092E-001

SQL>
--- "quick fox" has a better similarity with sentence 1 than sentence 4


What LLMs do when "generating" the next word (known as "token") is to find the "token" that has a higher probability -- a lower COSINE Distance

COSINE Distance measures the Angle between the Vectors
There are other Methods such as DOT PRODUCT, EUCLIDEAN (L1/L2) etc


Some Useful References :

Oracle Docs and Examples :




Oracle Blog :



External Blog :



Hugging Face :



ONNX :


Oracle SQL Reference :


21 August, 2025

Cross-Instance Deadlock in RAC

 I've created a video demonstration of a Cross-Instance Deadlock in a 2-node RAC environment and how to read the trace file.

Note : Only the SQL that has been returned the "deadlock" error is failed, the session and transaction are still valid.


06 August, 2025

An introduction to Oracle Cloud Infrastructure

 A 1hour video


Description:

This session will cover the fundamentals of Oracle Cloud Infrastructure (OCI) including cloud concepts, OCI structures, and core OCI services. OCI service areas that will be discussed include Identity and Access Management (IAM), networking, compute, storage, and database. You will also learn about Users, Groups, and Policies, along with the core tenets of virtual network design that will help set the foundations for application deployment to OCI. We will also cover terms and definitions for each of the topic areas to establish a foundation for additional sessions.

17 July, 2025

Configuring a RAC Service tied to a PDB and specific Instance

 I have created a new Video demonstrating how you can add new Services to an existing database.  In RAC, you can choose to have the Service running on all or selected or a single node of the Cluster.  The service can be bound to a PDB.

This allows you to separate different applications / groups of users via Services and manage availability via Startup/Shutdown/Relocation/Failover of services.

The comand to configure a service to a single PDB and Instance is :

srvctl add service -db RACDB -service prdapps1 -preferred RACDB1 -available RACDB2 -tafpolicy BASIC -failovertype SELECT -clbgoal SHORT -pdb PDAPPTST


06 July, 2025

Converting a "NO Standby" to "YES Standby" database

 In my previous blog post and video, I had demonstrated creating a PDB (as a clone from an existing PDB) to be used for some testing/validation for a short period of time, without needing protection of a Standby database.

But what if you do decide to provide Standby protection ?

First, here's the status of the Pluggable Database at the Primary :


SQL> select con_id, pdb_name, creation_time, force_logging
  2  from cdb_pdbs
  3  where pdb_name = 'PRDAPPTST'
  4  /

    CON_ID PDB_NAME     CREATION_ FORCE_LOGGING
---------- ------------ --------- ---------------------------------------
         4 PRDAPPTST    29-JUN-25 NO

SQL>
SQL> select force_logging from v$database;

FORCE_LOGGING
---------------------------------------
YES

SQL>
SQL> alter pluggable database prdapptst enable force logging;

Pluggable database altered.

SQL>
SQL> select con_id, pdb_name, creation_time, force_logging
  2  from cdb_pdbs
  3  where pdb_name = 'PRDAPPTST'
  4  /

    CON_ID PDB_NAME     CREATION_ FORCE_LOGGING
---------- ------------ --------- ---------------------------------------
         4 PRDAPPTST    29-JUN-25 YES

SQL>


Note :In this case, the "ENABLE FORCE LOGGING" was strictly not required because the CDB-wide FORCE LOGGING was already enforced (query on V$DATABASE at the CDB$ROOT).


Here's the status at the Standby :

SQL> l
  1  select con_id, name, open_mode, recovery_status
  2  from v$pdbs
  3* where name ='PRDAPPTST'
SQL> /

    CON_ID NAME         OPEN_MODE  RECOVERY
---------- ------------ ---------- --------
         4 PRDAPPTST    MOUNTED    DISABLED

SQL>
SQL> l
  1  select con_id, file#, status, plugged_in, name
  2  from v$datafile
  3  where con_id=4
  4* order by file#
SQL> /

    CON_ID      FILE# STATUS  PLUGGED_IN NAME
---------- ---------- ------- ---------- --------------------------------
         4         60 SYSOFF           0 /u01/app/oracle/product/19.0.0/d
                                         bhome_1/dbs/UNNAMED00060

         4         61 RECOVER          0 /u01/app/oracle/product/19.0.0/d
                                         bhome_1/dbs/UNNAMED00061

         4         62 RECOVER          0 /u01/app/oracle/product/19.0.0/d
                                         bhome_1/dbs/UNNAMED00062

         4         63 RECOVER          0 /u01/app/oracle/product/19.0.0/d
                                         bhome_1/dbs/UNNAMED00063

         4         64 RECOVER          0 /u01/app/oracle/product/19.0.0/d
                                         bhome_1/dbs/UNNAMED00064


SQL>


Meaning that although the Standby is "aware" of the PDB, not datafiles are present so it is not being recovered.  If you recall from the Video demonstration, the alert log at the Standby presented these entries when the PDB was created at the Primary with STANDBYS=NONE :

Recovery created pluggable database PRDAPPTST
PRDAPPTST(4):Tablespace-SYSTEM during PDB create skipped since source is in              r/w mode or this is a refresh clone
PRDAPPTST(4):File #60 added to control file as 'UNNAMED00060'. Originally created as:
PRDAPPTST(4):'+DATA/RACDB/38AE431466FE1FDBE0635A38A8C085D8/DATAFILE/system.299.1205032267'
PRDAPPTST(4):because the pluggable database was created with nostandby
PRDAPPTST(4):or the tablespace belonging to the pluggable database is
PRDAPPTST(4):offline.
PRDAPPTST(4):Tablespace-SYSAUX during PDB create skipped since source is in              r/w mode or this is a refresh clone
PRDAPPTST(4):File #61 added to control file as 'UNNAMED00061'. Originally created as:
PRDAPPTST(4):'+DATA/RACDB/38AE431466FE1FDBE0635A38A8C085D8/DATAFILE/sysaux.280.1205032267'
PRDAPPTST(4):because the pluggable database was created with nostandby
PRDAPPTST(4):or the tablespace belonging to the pluggable database is
PRDAPPTST(4):offline.
PRDAPPTST(4):Tablespace-UNDOTBS1 during PDB create skipped since source is in              r/w mode or this is a refresh clone
PRDAPPTST(4):File #62 added to control file as 'UNNAMED00062'. Originally created as:
PRDAPPTST(4):'+DATA/RACDB/38AE431466FE1FDBE0635A38A8C085D8/DATAFILE/undotbs1.285.1205032267'
PRDAPPTST(4):because the pluggable database was created with nostandby
PRDAPPTST(4):or the tablespace belonging to the pluggable database is
PRDAPPTST(4):offline.
PRDAPPTST(4):Tablespace-TEMP during PDB create skipped since source is in              r/w mode or this is a refresh clone
PRDAPPTST(4):Tablespace-UNDO_2 during PDB create skipped since source is in              r/w mode or this is a refresh clone
PRDAPPTST(4):File #63 added to control file as 'UNNAMED00063'. Originally created as:
PRDAPPTST(4):'+DATA/RACDB/38AE431466FE1FDBE0635A38A8C085D8/DATAFILE/undo_2.284.1205032267'
PRDAPPTST(4):because the pluggable database was created with nostandby
PRDAPPTST(4):or the tablespace belonging to the pluggable database is
PRDAPPTST(4):offline.
PRDAPPTST(4):Tablespace-USERS during PDB create skipped since source is in              r/w mode or this is a refresh clone
PRDAPPTST(4):File #64 added to control file as 'UNNAMED00064'. Originally created as:
PRDAPPTST(4):'+DATA/RACDB/38AE431466FE1FDBE0635A38A8C085D8/DATAFILE/users.279.1205032267'
PRDAPPTST(4):because the pluggable database was created with nostandby
PRDAPPTST(4):or the tablespace belonging to the pluggable database is
PRDAPPTST(4):offline.


So, the current status is that the PDB *is* registered at the Standby but, in the absence of datafiles, no Redo Apply is being done at the Standby.

For the purposes of today's test, I created a few more rows in my target table in that PDB :

SQL> connect hemant/hemant@newtestpdb
Connected.
SQL> @INS_QRY

1 row created.

SQL> l
  1* insert into my_txn_table select systimestamp, substr(p.name,1,12), substr(i.host_name,1,12), 'XXX' from v$pdbs p, v$instance i
SQL> set pages600 linesize 132
SQL> select * from my_txn_table;

TXN_TIMESTAMP                                                               TARGET_PDB_NAME TARGET_HOST_NAM TXN_DETAILS
--------------------------------------------------------------------------- --------------- --------------- ---------------
29-JUN-25 03.06.43.264562 AM                                                PDB1            srv2            XXX
29-JUN-25 03.15.26.694170 AM                                                PRDAPPTST       srv1            XXX
06-JUL-25 08.31.33.903344 AM                                                PRDAPPTST       srv2            XXX
29-JUN-25 03.27.26.855776 AM                                                PRDAPPTST       srv2            XXX

SQL> select * from my_txn_table order by txn_timestamp;

TXN_TIMESTAMP                                                               TARGET_PDB_NAME TARGET_HOST_NAM TXN_DETAILS
--------------------------------------------------------------------------- --------------- --------------- ---------------
29-JUN-25 03.06.43.264562 AM                                                PDB1            srv2            XXX
29-JUN-25 03.15.26.694170 AM                                                PRDAPPTST       srv1            XXX
29-JUN-25 03.27.26.855776 AM                                                PRDAPPTST       srv2            XXX
06-JUL-25 08.31.33.903344 AM                                                PRDAPPTST       srv2            XXX

SQL> commit;

Commit complete.

SQL>  connect hemant/hemant@newtestpdb
Connected.
SQL> @INS_QRY

1 row created.

SQL> commit;

Commit complete.

SQL> connect hemant/hemant@newtestpdb
Connected.
SQL> @INS_QRY

1 row created.

SQL> commit;

Commit complete.

SQL> select * from my_txn_table order by txn_timestamp;

TXN_TIMESTAMP                                                               TARGET_PDB_NAME TARGET_HOST_NAM TXN_DETAILS
--------------------------------------------------------------------------- --------------- --------------- ---------------
29-JUN-25 03.06.43.264562 AM                                                PDB1            srv2            XXX
29-JUN-25 03.15.26.694170 AM                                                PRDAPPTST       srv1            XXX
29-JUN-25 03.27.26.855776 AM                                                PRDAPPTST       srv2            XXX
06-JUL-25 08.31.33.903344 AM                                                PRDAPPTST       srv2            XXX
06-JUL-25 08.32.29.154557 AM                                                PRDAPPTST       srv1            XXX
06-JUL-25 08.32.41.404084 AM                                                PRDAPPTST       srv2            XXX

6 rows selected.

SQL>


So, today, 06-Jul-25, I have created 3 new rows, with connections to both instances.
(To understand "newtestpdb" as the connect-string or service name for the PDB PRDAPPTST see the previous Blog Post or Video)

Now, I run a backup of this PDB at the Primary and will then copy it and restore it to the Standby.


[oracle@srv1 ~]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Sun Jul 6 08:35:56 2025
Version 19.25.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database: RACDB (DBID=1162136313)

RMAN> backup as compressed backupset
backup as compressed backupset
2> pluggable database PRDAPPTST
pluggable database PRDAPPTST
3> format '/tmp/PRDAPPTST_DB_%U.bak';


And restore it at the Standby (after copying the backup pieces)

[oracle@stdby tmp]$ ls -ltr *bak
-rw-r-----. 1 oracle oinstall 849739776 Jul  6 08:38 PRDAPPTST_DB_ch3tsbcj_401_1_1.bak
[oracle@stdby tmp]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Sun Jul 6 08:39:12 2025
Version 19.25.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database: RACDB (DBID=1162136313, not open)

RMAN> catalog start with '/tmp';
catalog start with '/tmp';
using target database control file instead of recovery catalog
searching for all files that match the pattern /tmp

List of Files Unknown to the Database
=====================================
File Name: /tmp/PRDAPPTST_DB_ch3tsbcj_401_1_1.bak

Do you really want to catalog the above files (enter YES or NO)? YES
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /tmp/PRDAPPTST_DB_ch3tsbcj_401_1_1.bak


RMAN>
RMAN> list backup of pluggable database PRDAPPTST;
list backup of pluggable database PRDAPPTST;

List of Backup Sets
===================


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
319     Full    810.37M    DISK        00:00:43     06-JUL-25
        BP Key: 319   Status: AVAILABLE  Compressed: YES  Tag: TAG20250706T083635
        Piece Name: /tmp/PRDAPPTST_DB_ch3tsbcj_401_1_1.bak
  List of Datafiles in backup set 319
  Container ID: 4, PDB Name: PRDAPPTST
  File LV Type Ckp SCN    Ckp Time  Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- --------- ----------- ------ ----
  60      Full 12491346   06-JUL-25              NO    /u01/app/oracle/product/19.0.0/dbhome_1/dbs/UNNAMED00060
  61      Full 12491346   06-JUL-25              NO    /u01/app/oracle/product/19.0.0/dbhome_1/dbs/UNNAMED00061
  62      Full 12491346   06-JUL-25              NO    /u01/app/oracle/product/19.0.0/dbhome_1/dbs/UNNAMED00062
  63      Full 12491346   06-JUL-25              NO    /u01/app/oracle/product/19.0.0/dbhome_1/dbs/UNNAMED00063
  64      Full 12491346   06-JUL-25              NO    /u01/app/oracle/product/19.0.0/dbhome_1/dbs/UNNAMED00064


RMAN>
RMAN> run
run
2> {
{
3> set newname for pluggable database PRDAPPTST to '/Standby_DB/oradata/STDBY/PRDAPPTST/%U.dbf';
set newname for pluggable database PRDAPPTST to '/Standby_DB/oradata/STDBY/PRDAPPTST/%U.dbf';
4> restore pluggable database PRDAPPTST;
restore pluggable database PRDAPPTST;
5> switch datafile all;
switch datafile all;
6> }

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00060 to /Standby_DB/oradata/STDBY/PRDAPPTST/data_D-RACDB_TS-SYSTEM_FNO-60.dbf
channel ORA_DISK_1: restoring datafile 00061 to /Standby_DB/oradata/STDBY/PRDAPPTST/data_D-RACDB_TS-SYSAUX_FNO-61.dbf
channel ORA_DISK_1: restoring datafile 00062 to /Standby_DB/oradata/STDBY/PRDAPPTST/data_D-RACDB_TS-UNDOTBS1_FNO-62.dbf
channel ORA_DISK_1: restoring datafile 00063 to /Standby_DB/oradata/STDBY/PRDAPPTST/data_D-RACDB_TS-UNDO_2_FNO-63.dbf
channel ORA_DISK_1: restoring datafile 00064 to /Standby_DB/oradata/STDBY/PRDAPPTST/data_D-RACDB_TS-USERS_FNO-64.dbf
channel ORA_DISK_1: reading from backup piece /tmp/PRDAPPTST_DB_ch3tsbcj_401_1_1.bak
channel ORA_DISK_1: piece handle=/tmp/PRDAPPTST_DB_ch3tsbcj_401_1_1.bak tag=TAG20250706T083635
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:45
Finished restore at 06-JUL-25

datafile 60 switched to datafile copy
input datafile copy RECID=54 STAMP=1205746519 file name=/Standby_DB/oradata/STDBY/PRDAPPTST/data_D-RACDB_TS-SYSTEM_FNO-60.dbf
datafile 61 switched to datafile copy
input datafile copy RECID=55 STAMP=1205746519 file name=/Standby_DB/oradata/STDBY/PRDAPPTST/data_D-RACDB_TS-SYSAUX_FNO-61.dbf
datafile 62 switched to datafile copy
input datafile copy RECID=56 STAMP=1205746519 file name=/Standby_DB/oradata/STDBY/PRDAPPTST/data_D-RACDB_TS-UNDOTBS1_FNO-62.dbf
datafile 63 switched to datafile copy
input datafile copy RECID=57 STAMP=1205746519 file name=/Standby_DB/oradata/STDBY/PRDAPPTST/data_D-RACDB_TS-UNDO_2_FNO-63.dbf
datafile 64 switched to datafile copy
input datafile copy RECID=58 STAMP=1205746519 file name=/Standby_DB/oradata/STDBY/PRDAPPTST/data_D-RACDB_TS-USERS_FNO-64.dbf


RMAN>




Note :If you see my previous blog posts and videos on RAC, you can see that I have demonstrated that 
1.  A RAC Primary can have a Non-RAC (Single Instance) Standby  and vice-versa as well in my video demonstrations of DataGuard Switchover
2.  A Primary on ASM can have a Standby on Filesystem and vice-versa

Now that I have restored the database to the Standby, I must ENABLE RECOVERY for this PDB 


[oracle@srv1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Jul 6 10:32:27 2025
Version 19.25.0.0.0

Copyright (c) 1982, 2024, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.25.0.0.0

SQL> alter pluggable database prdapptst enable recovery;
alter pluggable database prdapptst enable recovery
*
ERROR at line 1:
ORA-65046: operation not allowed from outside a pluggable database


SQL> alter session set container=PRDAPPTST;

Session altered.

SQL> alter pluggable database prdapptst enable recovery;

Pluggable database altered.

SQL> connect hemant/hemant@newtestpdb
Connected.
SQL> @INS_QRY

1 row created.

SQL> set pages600 linesize 132
SQL> commit;

Commit complete.

SQL> select * from my_txn_table order by 1;

TXN_TIMESTAMP                                                               TARGET_PDB_NAME TARGET_HOST_NAM TXN_DETAILS
--------------------------------------------------------------------------- --------------- --------------- ---------------
29-JUN-25 03.06.43.264562 AM                                                PDB1            srv2            XXX
29-JUN-25 03.15.26.694170 AM                                                PRDAPPTST       srv1            XXX
29-JUN-25 03.27.26.855776 AM                                                PRDAPPTST       srv2            XXX
06-JUL-25 08.31.33.903344 AM                                                PRDAPPTST       srv2            XXX
06-JUL-25 08.32.29.154557 AM                                                PRDAPPTST       srv1            XXX
06-JUL-25 08.32.41.404084 AM                                                PRDAPPTST       srv2            XXX
06-JUL-25 09.53.06.164510 AM                                                PRDAPPTST       srv1            XXX
06-JUL-25 10.33.28.132217 AM                                                PRDAPPTST       srv2            XXX

8 rows selected.

SQL>
SQL> connect / as sysdba
Connected.
SQL> alter system archive log current;

System altered.

SQL>


I can now go to the Standby, Bring Datafiles Online, Resume Recovery and query the PDB

[oracle@stdby trace]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Jul 6 10:39:50 2025
Version 19.25.0.0.0

Copyright (c) 1982, 2024, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.25.0.0.0

SQL> alter database recover managed standby database cancel;

Database altered.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area 2147480256 bytes
Fixed Size                  9179840 bytes
Variable Size             486539264 bytes
Database Buffers         1644167168 bytes
Redo Buffers                7593984 bytes
Database mounted.
SQL> alter session set container=PRDAPPTST;

Session altered.

SQL> alter database datafile '/Standby_DB/oradata/STDBY/PRDAPPTST/data_D-RACDB_TS-SYSTEM_FNO-60.dbf' online;
alter database datafile '/Standby_DB/oradata/STDBY/PRDAPPTST/data_D-RACDB_TS-SYSTEM_FNO-60.dbf' online
*
ERROR at line 1:
ORA-01156: recovery or flashback in progress may need access to files


SQL> alter database datafile '/Standby_DB/oradata/STDBY/PRDAPPTST/data_D-RACDB_TS-SYSAUX_FNO-61.dbf' online;
alter database datafile '/Standby_DB/oradata/STDBY/PRDAPPTST/data_D-RACDB_TS-SYSAUX_FNO-61.dbf' online
*
ERROR at line 1:
ORA-01156: recovery or flashback in progress may need access to files


SQL> alter database datafile '/Standby_DB/oradata/STDBY/PRDAPPTST/data_D-RACDB_TS-UNDOTBS1_FNO-62.dbf' online;
alter database datafile '/Standby_DB/oradata/STDBY/PRDAPPTST/data_D-RACDB_TS-UNDOTBS1_FNO-62.dbf' online
*
ERROR at line 1:
ORA-01156: recovery or flashback in progress may need access to files


SQL> alter database datafile '/Standby_DB/oradata/STDBY/PRDAPPTST/data_D-RACDB_TS-UNDO_2_FNO-63.dbf' online;
alter database datafile '/Standby_DB/oradata/STDBY/PRDAPPTST/data_D-RACDB_TS-UNDO_2_FNO-63.dbf' online
*
ERROR at line 1:
ORA-01156: recovery or flashback in progress may need access to files


SQL> alter database datafile '/Standby_DB/oradata/STDBY/PRDAPPTST/data_D-RACDB_TS-USERS_FNO-64.dbf' online;
alter database datafile '/Standby_DB/oradata/STDBY/PRDAPPTST/data_D-RACDB_TS-USERS_FNO-64.dbf' online
*
ERROR at line 1:
ORA-01156: recovery or flashback in progress may need access to files


SQL>
SQL> connect / as sysdba
Connected.
SQL> shutdown immediate;
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area 2147480256 bytes
Fixed Size                  9179840 bytes
Variable Size             486539264 bytes
Database Buffers         1644167168 bytes
Redo Buffers                7593984 bytes
Database mounted.
SQL> alter session set container=PRDAPPTST;

Session altered.

SQL> alter pluggable database enable recovery;
alter pluggable database enable recovery
*
ERROR at line 1:
ORA-01156: recovery or flashback in progress may need access to files


SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.25.0.0.0
[oracle@stdby trace]$ dgmgrl
DGMGRL for Linux: Release 19.0.0.0.0 - Production on Sun Jul 6 11:05:42 2025
Version 19.25.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

Welcome to DGMGRL, type "help" for information.
DGMGRL> connect / as sysdba
Connected to "STDBY"
Connected as SYSDBA.
DGMGRL> edit database STDBY set state='apply-off';
Succeeded.
DGMGRL> exit
[oracle@stdby trace]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Jul 6 11:06:48 2025
Version 19.25.0.0.0

Copyright (c) 1982, 2024, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.25.0.0.0

SQL> alter session set container=PRDAPPTST;

Session altered.

SQL> alter pluggable database enable recovery;

Pluggable database altered.

SQL>
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.25.0.0.0
[oracle@stdby trace]$ dgmgrl
DGMGRL for Linux: Release 19.0.0.0.0 - Production on Sun Jul 6 11:07:32 2025
Version 19.25.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

Welcome to DGMGRL, type "help" for information.
DGMGRL> connect / as sysdba
Connected to "STDBY"
Connected as SYSDBA.
DGMGRL> edit database stdby set state='apply-on';
Succeeded.
DGMGRL> exit
[oracle@stdby trace]$
[oracle@stdby trace]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Jul 6 11:08:09 2025
Version 19.25.0.0.0

Copyright (c) 1982, 2024, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.25.0.0.0

SQL> select name, open_mode from v$pdbs;

NAME
--------------------------------------------------------------------------------
OPEN_MODE
----------
PDB$SEED
MOUNTED

PDB1
MOUNTED

PRDAPPTST
MOUNTED


SQL> alter database open read only;

Database altered.

SQL> alter pluggable database prdapptst open read only;

Pluggable database altered.

SQL>
SQL> alter session set container=PRDAPPTST;

Session altered.

SQL> set pages600 linesize 132
SQL> select * from hemant.my_txn_table order by 1;

TXN_TIMESTAMP                                                               TARGET_PDB_NAME TARGET_HOST_NAM TXN_DETAILS
--------------------------------------------------------------------------- --------------- --------------- ---------------
29-JUN-25 03.06.43.264562 AM                                                PDB1            srv2            XXX
29-JUN-25 03.15.26.694170 AM                                                PRDAPPTST       srv1            XXX
29-JUN-25 03.27.26.855776 AM                                                PRDAPPTST       srv2            XXX
06-JUL-25 08.31.33.903344 AM                                                PRDAPPTST       srv2            XXX
06-JUL-25 08.32.29.154557 AM                                                PRDAPPTST       srv1            XXX
06-JUL-25 08.32.41.404084 AM                                                PRDAPPTST       srv2            XXX
06-JUL-25 09.53.06.164510 AM                                                PRDAPPTST       srv1            XXX
06-JUL-25 10.33.28.132217 AM                                                PRDAPPTST       srv2            XXX

8 rows selected.

SQL>


Now that the database is restored and recovery resumed, data is available in PRDAPPTST at the Standby as well !


29 June, 2025

Creating a new PDB in RAC without Standby Protection

 I've published a new Video demonstration when you need to create a new PDB (even as a clone of an existing one) without requiring a Standby copy of the PDB.

(Use cases : Test environment for a day or two, it would take too long to create a new Test Server and clone the database, it would take too long to change Firewall rules to allow Applications to connect to the Test Server)

This in RAC with DataGuard Useful commands : Create new PDB :

CREATE PLUGGABLE DATABASE PRDAPPTST FROM PDB1  STANDBYS=NONE
Create Service :
srvctl add service -db RACDB  -service newtestpdb -preferred RACDB1,RACDB2 -tafpolicy BASIC -failovertype SELECT -clbgoal SHORT -pdb PRDAPPTST
Start Service :
srvctl enable service -db RACDB -service newtestpdb
srvctl status service -db RACDB -service newtestpdb
srvctl start service -db RACDB -service newtestpdb
srvctl status service -db RACDB -service newtestpdb

Always use custom Service Names instead of the default name derived from the PDB Name.


UPDATE  02-July : In response to a question on x.com : "One question: what if we want to create standby in future. Do we have to change standby parameter using any command or we can directly create standby normally"

My reply is :
The STANDBYS=NONE applies only to this PDB (PRDAPPTST). Any new PDB would still default to STANDBYS=ALL.

Although PRDAPPTST is intended to be dropped in a day or two, if you want it to be protected by Standby for longer or permanently, you can restore it to the Standby CDB (as it is in the controlfile and datadictionary) and resume recovery with ENABLE RECOVERY

See this next Blog Post where the Standby for PRDAPPTST is also setup.


Also see this series of posts on Refreshable Clone PDBs that I published a few years ago.

18 June, 2025

Backup a Backup that is in ASM

 In RAC or Single Instance environments with ASM, it is possible to run database backups to ASM  (typically the FRA diskgroup).

However, you would need the ability to copy the backup *out of ASM*  -- e.g. using non-Oracle methods to copy to backup storage / offsite storage / tape drive.

Note : Timestamps are in UTC in the listings below

First, I run a Fresh Backup that, by default, goes to the designated FRA

[oracle@srv1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Jun 18 14:34:21 2025
Version 19.25.0.0.0

Copyright (c) 1982, 2024, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.25.0.0.0

SQL> show parameter db_recover

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      +FRA
db_recovery_file_dest_size           big integer 13332M
SQL>
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.25.0.0.0
[oracle@srv1 ~]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Wed Jun 18 14:34:49 2025
Version 19.25.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database: RACDB (DBID=1162136313)

RMAN> backup as compressed backupset database plus archivelog delete input;
backup as compressed backupset database plus archivelog delete input;

Starting backup at 18-JUN-25
current log archived
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=246 instance=RACDB1 device type=DISK
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=381 RECID=1257 STAMP=1199502152
input archived log thread=2 sequence=334 RECID=1258 STAMP=1199502185
input archived log thread=1 sequence=382 RECID=1260 STAMP=1199502404
...
...
...
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=+DATA/RACDB/DATAFILE/system.257.1164519439
input datafile file number=00003 name=+DATA/RACDB/DATAFILE/sysaux.258.1164519463
input datafile file number=00004 name=+DATA/RACDB/DATAFILE/undotbs1.259.1164519479
input datafile file number=00009 name=+DATA/RACDB/DATAFILE/undotbs2.269.1164519893
input datafile file number=00007 name=+DATA/RACDB/DATAFILE/users.260.1164519479
channel ORA_DISK_1: starting piece 1 at 18-JUN-25
channel ORA_DISK_1: finished piece 1 at 18-JUN-25
piece handle=+FRA/RACDB/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.442.1204122947 tag=TAG20250618T143546 comment=NONE
...
...
...
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00010 name=+DATA/RACDB/1476C653214704CFE0635A38A8C08494/DATAFILE/system.274.1164520333
input datafile file number=00011 name=+DATA/RACDB/1476C653214704CFE0635A38A8C08494/DATAFILE/sysaux.275.1164520333
input datafile file number=00012 name=+DATA/RACDB/1476C653214704CFE0635A38A8C08494/DATAFILE/undotbs1.273.1164520333
input datafile file number=00013 name=+DATA/RACDB/1476C653214704CFE0635A38A8C08494/DATAFILE/undo_2.277.1164520345
input datafile file number=00015 name=+DATA/RACDB/1476C653214704CFE0635A38A8C08494/DATAFILE/users2.279.1167388913
input datafile file number=00016 name=+DATA/RACDB/1476C653214704CFE0635A38A8C08494/DATAFILE/users3.280.1167388955
input datafile file number=00014 name=+DATA/RACDB/1476C653214704CFE0635A38A8C08494/DATAFILE/users.278.1164520353
channel ORA_DISK_1: starting piece 1 at 18-JUN-25
channel ORA_DISK_1: finished piece 1 at 18-JUN-25
piece handle=+FRA/RACDB/1476C653214704CFE0635A38A8C08494/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.453.1204123013 tag=TAG20250618T143546 comment=NONE
...
...
...
RMAN-08120: warning: archived log not deleted, not yet applied by standby
archived log file name=+FRA/RACDB/ARCHIVELOG/2025_06_18/thread_1_seq_403.402.1204123149 thread=1 sequence=403
RMAN-08120: warning: archived log not deleted, not yet applied by standby
archived log file name=+FRA/RACDB/ARCHIVELOG/2025_06_18/thread_2_seq_348.515.1204123149 thread=2 sequence=348
Finished backup at 18-JUN-25

Starting Control File and SPFILE Autobackup at 18-JUN-25
piece handle=+FRA/RACDB/AUTOBACKUP/2025_06_18/s_1204123150.388.1204123151 comment=NONE
Finished Control File and SPFILE Autobackup at 18-JUN-25


RMAN>
RMAN> list backupset completed after "trunc(sysdate)";
list backupset completed after "trunc(sysdate)";

List of Backup Sets
===================


BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
337     57.35M     DISK        00:00:03     18-JUN-25
        BP Key: 337   Status: AVAILABLE  Compressed: YES  Tag: TAG20250618T143542
        Piece Name: +FRA/RACDB/BACKUPSET/2025_06_18/annnf0_tag20250618t143542_0.473.1204122943

  List of Archived Logs in backup set 337
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
 ...
 ...
 ...
  1    401     11161346   01-MAY-25 11165463   18-JUN-25
  1    402     11165463   18-JUN-25 11177493   18-JUN-25
...
...
...
  2    346     11161357   01-MAY-25 11161847   18-JUN-25
  2    347     11161847   18-JUN-25 11177499   18-JUN-25

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
338     Full    1.07G      DISK        00:00:57     18-JUN-25
        BP Key: 338   Status: AVAILABLE  Compressed: YES  Tag: TAG20250618T143546
        Piece Name: +FRA/RACDB/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.442.1204122947
  List of Datafiles in backup set 338
  File LV Type Ckp SCN    Ckp Time  Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- --------- ----------- ------ ----
  1       Full 11177541   18-JUN-25              NO    +DATA/RACDB/DATAFILE/system.257.1164519439
  3       Full 11177541   18-JUN-25              NO    +DATA/RACDB/DATAFILE/sysaux.258.1164519463
  4       Full 11177541   18-JUN-25              NO    +DATA/RACDB/DATAFILE/undotbs1.259.1164519479
  7       Full 11177541   18-JUN-25              NO    +DATA/RACDB/DATAFILE/users.260.1164519479
  9       Full 11177541   18-JUN-25              NO    +DATA/RACDB/DATAFILE/undotbs2.269.1164519893

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
339     Full    775.09M    DISK        00:00:42     18-JUN-25
        BP Key: 339   Status: AVAILABLE  Compressed: YES  Tag: TAG20250618T143546
        Piece Name: +FRA/RACDB/1476C653214704CFE0635A38A8C08494/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.453.1204123013
  List of Datafiles in backup set 339
  Container ID: 3, PDB Name: PDB1
  File LV Type Ckp SCN    Ckp Time  Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- --------- ----------- ------ ----
  10      Full 11177736   18-JUN-25              NO    +DATA/RACDB/1476C653214704CFE0635A38A8C08494/DATAFILE/system.274.1164520333
  11      Full 11177736   18-JUN-25              NO    +DATA/RACDB/1476C653214704CFE0635A38A8C08494/DATAFILE/sysaux.275.1164520333
  12      Full 11177736   18-JUN-25              NO    +DATA/RACDB/1476C653214704CFE0635A38A8C08494/DATAFILE/undotbs1.273.1164520333
  13      Full 11177736   18-JUN-25              NO    +DATA/RACDB/1476C653214704CFE0635A38A8C08494/DATAFILE/undo_2.277.1164520345
  14      Full 11177736   18-JUN-25              NO    +DATA/RACDB/1476C653214704CFE0635A38A8C08494/DATAFILE/users.278.1164520353
  15      Full 11177736   18-JUN-25              NO    +DATA/RACDB/1476C653214704CFE0635A38A8C08494/DATAFILE/users2.279.1167388913
  16      Full 11177736   18-JUN-25              NO    +DATA/RACDB/1476C653214704CFE0635A38A8C08494/DATAFILE/users3.280.1167388955

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
340     Full    812.50M    DISK        00:00:42     18-JUN-25
        BP Key: 340   Status: AVAILABLE  Compressed: YES  Tag: TAG20250618T143546
        Piece Name: +FRA/RACDB/339BC12E8011538DE0635A38A8C0C92A/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.460.1204123057
  List of Datafiles in backup set 340
  Container ID: 5, PDB Name: TSTPDB
  File LV Type Ckp SCN    Ckp Time  Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- --------- ----------- ------ ----
  25      Full 11083998   25-APR-25              NO    +DATA/RACDB/339BC12E8011538DE0635A38A8C0C92A/DATAFILE/system.281.1199369077
  26      Full 11083998   25-APR-25              NO    +DATA/RACDB/339BC12E8011538DE0635A38A8C0C92A/DATAFILE/sysaux.283.1199369077
  27      Full 11083998   25-APR-25              NO    +DATA/RACDB/339BC12E8011538DE0635A38A8C0C92A/DATAFILE/undotbs1.282.1199369077
  28      Full 11083998   25-APR-25              NO    +DATA/RACDB/339BC12E8011538DE0635A38A8C0C92A/DATAFILE/undo_2.285.1199369085

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
341     Full    812.46M    DISK        00:00:42     18-JUN-25
        BP Key: 341   Status: AVAILABLE  Compressed: YES  Tag: TAG20250618T143546
        Piece Name: +FRA/RACDB/14769E258FBB5FD8E0635A38A8C09D43/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.349.1204123103
  List of Datafiles in backup set 341
  Container ID: 2, PDB Name: PDB$SEED
  File LV Type Ckp SCN    Ckp Time  Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- --------- ----------- ------ ----
  5       Full 9669002    26-NOV-24              NO    +DATA/RACDB/86B637B62FE07A65E053F706E80A27CA/DATAFILE/system.265.1164519659
  6       Full 9669002    26-NOV-24              NO    +DATA/RACDB/86B637B62FE07A65E053F706E80A27CA/DATAFILE/sysaux.266.1164519659
  8       Full 9669002    26-NOV-24              NO    +DATA/RACDB/86B637B62FE07A65E053F706E80A27CA/DATAFILE/undotbs1.267.1164519659

BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
342     674.00K    DISK        00:00:00     18-JUN-25
        BP Key: 342   Status: AVAILABLE  Compressed: YES  Tag: TAG20250618T143909
        Piece Name: +FRA/RACDB/BACKUPSET/2025_06_18/annnf0_tag20250618t143909_0.492.1204123149

  List of Archived Logs in backup set 342
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
  1    403     11177493   18-JUN-25 11179239   18-JUN-25
  2    348     11177499   18-JUN-25 11179236   18-JUN-25

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
343     Full    19.17M     DISK        00:00:00     18-JUN-25
        BP Key: 343   Status: AVAILABLE  Compressed: NO  Tag: TAG20250618T143910
        Piece Name: +FRA/RACDB/AUTOBACKUP/2025_06_18/s_1204123150.388.1204123151
  SPFILE Included: Modification time: 18-JUN-25
  SPFILE db_unique_name: RACDB
  Control File Included: Ckp SCN: 11179258     Ckp time: 18-JUN-25


RMAN>





So I have run a backup from the first node of the RAC Cluster "srv1".  These are Backup Sets 337 to 343.  Since I didn't provide a TAG name in the BACKUP command, they have default TAG names based on Date and Time (TAG20250618T143542, TAG20250618T143546, TAG20250618T143546, TAG20250618T143546, TAG20250618T143546, TAG20250618T143909, TAG20250618T143910)

Next  I want to copy (i.e. backup) this backup to filesystem on "srv2" being the second node of the RAC Cluster As they are on the (shared) ASM DiskGroup, I can crosscheck them from srv2 first before I backup to filesystem.


[oracle@srv2 ~]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Wed Jun 18 14:45:19 2025
Version 19.25.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database: RACDB (DBID=1162136313)

RMAN> crosscheck backup completed after "trunc(sysdate)";
crosscheck backup completed after "trunc(sysdate)";
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=229 instance=RACDB2 device type=DISK
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/BACKUPSET/2025_06_18/annnf0_tag20250618t143542_0.473.1204122943 RECID=337 STAMP=1204122943
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.442.1204122947 RECID=338 STAMP=1204122946
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/1476C653214704CFE0635A38A8C08494/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.453.1204123013 RECID=339 STAMP=1204123012
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/339BC12E8011538DE0635A38A8C0C92A/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.460.1204123057 RECID=340 STAMP=1204123057
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/14769E258FBB5FD8E0635A38A8C09D43/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.349.1204123103 RECID=341 STAMP=1204123102
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/BACKUPSET/2025_06_18/annnf0_tag20250618t143909_0.492.1204123149 RECID=342 STAMP=1204123149
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/AUTOBACKUP/2025_06_18/s_1204123150.388.1204123151 RECID=343 STAMP=1204123150
Crosschecked 7 objects



RMAN>
RMAN> backup device type disk format '/u02/RMAN_To_Disk/%U' backupset completed after "trunc(sysdate)";
backup device type disk format '/u02/RMAN_To_Disk/%U' backupset completed after "trunc(sysdate)";
Starting backup at 18-JUN-25
using channel ORA_DISK_1
channel ORA_DISK_1: input backup set: count=380, stamp=1204122942, piece=1
channel ORA_DISK_1: starting piece 1 at 18-JUN-25
channel ORA_DISK_1: backup piece +FRA/RACDB/BACKUPSET/2025_06_18/annnf0_tag20250618t143542_0.473.1204122943
piece handle=/u02/RMAN_To_Disk/bs3sat9u_380_1_2 comment=NONE
channel ORA_DISK_1: finished piece 1 at 18-JUN-25
channel ORA_DISK_1: backup piece complete, elapsed time: 00:00:01
channel ORA_DISK_1: input backup set: count=381, stamp=1204122946, piece=1
channel ORA_DISK_1: starting piece 1 at 18-JUN-25
channel ORA_DISK_1: backup piece +FRA/RACDB/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.442.1204122947
piece handle=/u02/RMAN_To_Disk/bt3sata2_381_1_2 comment=NONE
channel ORA_DISK_1: finished piece 1 at 18-JUN-25
channel ORA_DISK_1: backup piece complete, elapsed time: 00:00:01
channel ORA_DISK_1: input backup set: count=382, stamp=1204123011, piece=1
channel ORA_DISK_1: starting piece 1 at 18-JUN-25
channel ORA_DISK_1: backup piece +FRA/RACDB/1476C653214704CFE0635A38A8C08494/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.453.1204123013
piece handle=/u02/RMAN_To_Disk/bu3satc3_382_1_2 comment=NONE
channel ORA_DISK_1: finished piece 1 at 18-JUN-25
channel ORA_DISK_1: backup piece complete, elapsed time: 00:00:01
channel ORA_DISK_1: input backup set: count=383, stamp=1204123057, piece=1
channel ORA_DISK_1: starting piece 1 at 18-JUN-25
channel ORA_DISK_1: backup piece +FRA/RACDB/339BC12E8011538DE0635A38A8C0C92A/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.460.1204123057
piece handle=/u02/RMAN_To_Disk/bv3satdh_383_1_2 comment=NONE
channel ORA_DISK_1: finished piece 1 at 18-JUN-25
channel ORA_DISK_1: backup piece complete, elapsed time: 00:00:01
channel ORA_DISK_1: input backup set: count=384, stamp=1204123102, piece=1
channel ORA_DISK_1: starting piece 1 at 18-JUN-25
channel ORA_DISK_1: backup piece +FRA/RACDB/14769E258FBB5FD8E0635A38A8C09D43/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.349.1204123103
piece handle=/u02/RMAN_To_Disk/c03sateu_384_1_2 comment=NONE
channel ORA_DISK_1: finished piece 1 at 18-JUN-25
channel ORA_DISK_1: backup piece complete, elapsed time: 00:00:01
channel ORA_DISK_1: input backup set: count=385, stamp=1204123149, piece=1
channel ORA_DISK_1: starting piece 1 at 18-JUN-25
channel ORA_DISK_1: backup piece +FRA/RACDB/BACKUPSET/2025_06_18/annnf0_tag20250618t143909_0.492.1204123149
piece handle=/u02/RMAN_To_Disk/c13satgd_385_1_2 comment=NONE
channel ORA_DISK_1: finished piece 1 at 18-JUN-25
channel ORA_DISK_1: backup piece complete, elapsed time: 00:00:01
channel ORA_DISK_1: input backup set: count=386, stamp=1204123150, piece=1
channel ORA_DISK_1: starting piece 1 at 18-JUN-25
channel ORA_DISK_1: backup piece +FRA/RACDB/AUTOBACKUP/2025_06_18/s_1204123150.388.1204123151
piece handle=/u02/RMAN_To_Disk/c23satge_386_1_2 comment=NONE
channel ORA_DISK_1: finished piece 1 at 18-JUN-25
channel ORA_DISK_1: backup piece complete, elapsed time: 00:00:01
Finished backup at 18-JUN-25

Starting Control File and SPFILE Autobackup at 18-JUN-25
piece handle=+FRA/RACDB/AUTOBACKUP/2025_06_18/s_1204123831.443.1204123831 comment=NONE
Finished Control File and SPFILE Autobackup at 18-JUN-25


RMAN>
RMAN> crosscheck backup completed after "trunc(sysdate)";
crosscheck backup completed after "trunc(sysdate)";
using channel ORA_DISK_1
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/BACKUPSET/2025_06_18/annnf0_tag20250618t143542_0.473.1204122943 RECID=337 STAMP=1204122943
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u02/RMAN_To_Disk/bs3sat9u_380_1_2 RECID=344 STAMP=1204123823
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.442.1204122947 RECID=338 STAMP=1204122946
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u02/RMAN_To_Disk/bt3sata2_381_1_2 RECID=345 STAMP=1204123825
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/1476C653214704CFE0635A38A8C08494/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.453.1204123013 RECID=339 STAMP=1204123012
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u02/RMAN_To_Disk/bu3satc3_382_1_2 RECID=346 STAMP=1204123826
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/339BC12E8011538DE0635A38A8C0C92A/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.460.1204123057 RECID=340 STAMP=1204123057
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u02/RMAN_To_Disk/bv3satdh_383_1_2 RECID=347 STAMP=1204123827
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/14769E258FBB5FD8E0635A38A8C09D43/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.349.1204123103 RECID=341 STAMP=1204123102
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u02/RMAN_To_Disk/c03sateu_384_1_2 RECID=348 STAMP=1204123828
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/BACKUPSET/2025_06_18/annnf0_tag20250618t143909_0.492.1204123149 RECID=342 STAMP=1204123149
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u02/RMAN_To_Disk/c13satgd_385_1_2 RECID=349 STAMP=1204123829
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/AUTOBACKUP/2025_06_18/s_1204123150.388.1204123151 RECID=343 STAMP=1204123150
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u02/RMAN_To_Disk/c23satge_386_1_2 RECID=350 STAMP=1204123830
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/AUTOBACKUP/2025_06_18/s_1204123831.443.1204123831 RECID=351 STAMP=1204123831
Crosschecked 15 objects



RMAN>RMAN> list backup summary completed after "trunc(sysdate)";
list backup summary completed after "trunc(sysdate)";

List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
337     B  A  A DISK        18-JUN-25       1       2       YES        TAG20250618T143542
338     B  F  A DISK        18-JUN-25       1       2       YES        TAG20250618T143546
339     B  F  A DISK        18-JUN-25       1       2       YES        TAG20250618T143546
340     B  F  A DISK        18-JUN-25       1       2       YES        TAG20250618T143546
341     B  F  A DISK        18-JUN-25       1       2       YES        TAG20250618T143546
342     B  A  A DISK        18-JUN-25       1       2       YES        TAG20250618T143909
343     B  F  A DISK        18-JUN-25       1       2       NO         TAG20250618T143910
344     B  F  A DISK        18-JUN-25       1       1       NO         TAG20250618T145031


RMAN>
RMAN> list backupset completed after "trunc(sysdate)";
list backupset completed after "trunc(sysdate)";
using target database control file instead of recovery catalog

List of Backup Sets
===================


BS Key  Size
------- ----------
337     57.35M

  List of Archived Logs in backup set 337
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
 ...
 ...
 ...
  1    401     11161346   01-MAY-25 11165463   18-JUN-25
  1    402     11165463   18-JUN-25 11177493   18-JUN-25
...
...
...
  2    346     11161357   01-MAY-25 11161847   18-JUN-25
  2    347     11161847   18-JUN-25 11177499   18-JUN-25

  Backup Set Copy #1 of backup set 337
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:03     18-JUN-25       YES        TAG20250618T143542

    List of Backup Pieces for backup set 337 Copy #1   ### Shown as Copy #1 for Backupset 337
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    337     1   AVAILABLE   +FRA/RACDB/BACKUPSET/2025_06_18/annnf0_tag20250618t143542_0.473.1204122943

  Backup Set Copy #2 of backup set 337
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:03     18-JUN-25       YES        TAG20250618T143542

    List of Backup Pieces for backup set 337 Copy #2   ### Shown as Copy #2 for Backupset 337
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    344     1   AVAILABLE   /u02/RMAN_To_Disk/bs3sat9u_380_1_2

BS Key  Type LV Size
------- ---- -- ----------
338     Full    1.07G
  List of Datafiles in backup set 338
  File LV Type Ckp SCN    Ckp Time  Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- --------- ----------- ------ ----
  1       Full 11177541   18-JUN-25              NO    +DATA/RACDB/DATAFILE/system.257.1164519439
  3       Full 11177541   18-JUN-25              NO    +DATA/RACDB/DATAFILE/sysaux.258.1164519463
  4       Full 11177541   18-JUN-25              NO    +DATA/RACDB/DATAFILE/undotbs1.259.1164519479
  7       Full 11177541   18-JUN-25              NO    +DATA/RACDB/DATAFILE/users.260.1164519479
  9       Full 11177541   18-JUN-25              NO    +DATA/RACDB/DATAFILE/undotbs2.269.1164519893

  Backup Set Copy #1 of backup set 338
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:57     18-JUN-25       YES        TAG20250618T143546

    List of Backup Pieces for backup set 338 Copy #1   ### Shown as Copy #1 for Backupset 338
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    338     1   AVAILABLE   +FRA/RACDB/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.442.1204122947

  Backup Set Copy #2 of backup set 338
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:57     18-JUN-25       YES        TAG20250618T143546

    List of Backup Pieces for backup set 338 Copy #2   ### Shown as Copy #2 for Backupset 338
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    345     1   AVAILABLE   /u02/RMAN_To_Disk/bt3sata2_381_1_2

BS Key  Type LV Size
------- ---- -- ----------
339     Full    775.09M
  List of Datafiles in backup set 339
  Container ID: 3, PDB Name: PDB1
  File LV Type Ckp SCN    Ckp Time  Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- --------- ----------- ------ ----
  10      Full 11177736   18-JUN-25              NO    +DATA/RACDB/1476C653214704CFE0635A38A8C08494/DATAFILE/system.274.1164520333
  11      Full 11177736   18-JUN-25              NO    +DATA/RACDB/1476C653214704CFE0635A38A8C08494/DATAFILE/sysaux.275.1164520333
  12      Full 11177736   18-JUN-25              NO    +DATA/RACDB/1476C653214704CFE0635A38A8C08494/DATAFILE/undotbs1.273.1164520333
  13      Full 11177736   18-JUN-25              NO    +DATA/RACDB/1476C653214704CFE0635A38A8C08494/DATAFILE/undo_2.277.1164520345
  14      Full 11177736   18-JUN-25              NO    +DATA/RACDB/1476C653214704CFE0635A38A8C08494/DATAFILE/users.278.1164520353
  15      Full 11177736   18-JUN-25              NO    +DATA/RACDB/1476C653214704CFE0635A38A8C08494/DATAFILE/users2.279.1167388913
  16      Full 11177736   18-JUN-25              NO    +DATA/RACDB/1476C653214704CFE0635A38A8C08494/DATAFILE/users3.280.1167388955

  Backup Set Copy #1 of backup set 339
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:42     18-JUN-25       YES        TAG20250618T143546

    List of Backup Pieces for backup set 339 Copy #1   ### Shown as Copy #1 for Backupset 339
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    339     1   AVAILABLE   +FRA/RACDB/1476C653214704CFE0635A38A8C08494/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.453.1204123013

  Backup Set Copy #2 of backup set 339
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:42     18-JUN-25       YES        TAG20250618T143546

    List of Backup Pieces for backup set 339 Copy #2    ### Shown as Copy #2 for Backupset 339
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    346     1   AVAILABLE   /u02/RMAN_To_Disk/bu3satc3_382_1_2

BS Key  Type LV Size
------- ---- -- ----------
340     Full    812.50M
  List of Datafiles in backup set 340
  Container ID: 5, PDB Name: TSTPDB
  File LV Type Ckp SCN    Ckp Time  Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- --------- ----------- ------ ----
  25      Full 11083998   25-APR-25              NO    +DATA/RACDB/339BC12E8011538DE0635A38A8C0C92A/DATAFILE/system.281.1199369077
  26      Full 11083998   25-APR-25              NO    +DATA/RACDB/339BC12E8011538DE0635A38A8C0C92A/DATAFILE/sysaux.283.1199369077
  27      Full 11083998   25-APR-25              NO    +DATA/RACDB/339BC12E8011538DE0635A38A8C0C92A/DATAFILE/undotbs1.282.1199369077
  28      Full 11083998   25-APR-25              NO    +DATA/RACDB/339BC12E8011538DE0635A38A8C0C92A/DATAFILE/undo_2.285.1199369085

  Backup Set Copy #1 of backup set 340
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:42     18-JUN-25       YES        TAG20250618T143546

    List of Backup Pieces for backup set 340 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    340     1   AVAILABLE   +FRA/RACDB/339BC12E8011538DE0635A38A8C0C92A/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.460.1204123057

  Backup Set Copy #2 of backup set 340
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:42     18-JUN-25       YES        TAG20250618T143546

    List of Backup Pieces for backup set 340 Copy #2
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    347     1   AVAILABLE   /u02/RMAN_To_Disk/bv3satdh_383_1_2

BS Key  Type LV Size
------- ---- -- ----------
341     Full    812.46M
  List of Datafiles in backup set 341
  Container ID: 2, PDB Name: PDB$SEED
  File LV Type Ckp SCN    Ckp Time  Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- --------- ----------- ------ ----
  5       Full 9669002    26-NOV-24              NO    +DATA/RACDB/86B637B62FE07A65E053F706E80A27CA/DATAFILE/system.265.1164519659
  6       Full 9669002    26-NOV-24              NO    +DATA/RACDB/86B637B62FE07A65E053F706E80A27CA/DATAFILE/sysaux.266.1164519659
  8       Full 9669002    26-NOV-24              NO    +DATA/RACDB/86B637B62FE07A65E053F706E80A27CA/DATAFILE/undotbs1.267.1164519659

  Backup Set Copy #1 of backup set 341
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:42     18-JUN-25       YES        TAG20250618T143546

    List of Backup Pieces for backup set 341 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    341     1   AVAILABLE   +FRA/RACDB/14769E258FBB5FD8E0635A38A8C09D43/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.349.1204123103

  Backup Set Copy #2 of backup set 341
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:42     18-JUN-25       YES        TAG20250618T143546

    List of Backup Pieces for backup set 341 Copy #2
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    348     1   AVAILABLE   /u02/RMAN_To_Disk/c03sateu_384_1_2

BS Key  Size
------- ----------
342     674.00K

  List of Archived Logs in backup set 342
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
  1    403     11177493   18-JUN-25 11179239   18-JUN-25
  2    348     11177499   18-JUN-25 11179236   18-JUN-25

  Backup Set Copy #1 of backup set 342
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:00     18-JUN-25       YES        TAG20250618T143909

    List of Backup Pieces for backup set 342 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    342     1   AVAILABLE   +FRA/RACDB/BACKUPSET/2025_06_18/annnf0_tag20250618t143909_0.492.1204123149

  Backup Set Copy #2 of backup set 342
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:00     18-JUN-25       YES        TAG20250618T143909

    List of Backup Pieces for backup set 342 Copy #2
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    349     1   AVAILABLE   /u02/RMAN_To_Disk/c13satgd_385_1_2

BS Key  Type LV Size
------- ---- -- ----------
343     Full    19.17M
  SPFILE Included: Modification time: 18-JUN-25
  SPFILE db_unique_name: RACDB
  Control File Included: Ckp SCN: 11179258     Ckp time: 18-JUN-25

  Backup Set Copy #1 of backup set 343
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:00     18-JUN-25       NO         TAG20250618T143910

    List of Backup Pieces for backup set 343 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    343     1   AVAILABLE   +FRA/RACDB/AUTOBACKUP/2025_06_18/s_1204123150.388.1204123151

  Backup Set Copy #2 of backup set 343
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:00     18-JUN-25       NO         TAG20250618T143910

    List of Backup Pieces for backup set 343 Copy #2
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    350     1   AVAILABLE   /u02/RMAN_To_Disk/c23satge_386_1_2

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
344     Full    19.17M     DISK        00:00:00     18-JUN-25
        BP Key: 351   Status: AVAILABLE  Compressed: NO  Tag: TAG20250618T145031
        Piece Name: +FRA/RACDB/AUTOBACKUP/2025_06_18/s_1204123831.443.1204123831
  SPFILE Included: Modification time: 18-JUN-25
  SPFILE db_unique_name: RACDB
  Control File Included: Ckp SCN: 11185112     Ckp time: 18-JUN-25


RMAN>

[oracle@srv2 ~]$ cd /u02/RMAN_To_Disk
[oracle@srv2 RMAN_To_Disk]$ ls -l
total 3656024
-rw-r-----. 1 oracle oinstall   60140032 Jun 18 14:50 bs3sat9u_380_1_2
-rw-r-----. 1 oracle oinstall 1146150912 Jun 18 14:50 bt3sata2_381_1_2
-rw-r-----. 1 oracle oinstall  812752896 Jun 18 14:50 bu3satc3_382_1_2
-rw-r-----. 1 oracle oinstall  851976192 Jun 18 14:50 bv3satdh_383_1_2
-rw-r-----. 1 oracle oinstall  851935232 Jun 18 14:50 c03sateu_384_1_2
-rw-r-----. 1 oracle oinstall     690688 Jun 18 14:50 c13satgd_385_1_2
-rw-r-----. 1 oracle oinstall   20119552 Jun 18 14:50 c23satge_386_1_2
[oracle@srv2 RMAN_To_Disk]$


Thus, RMAN on Server "srv2" sees 2 copies of each backupset (337 to 343) (while 344 is the new BackupsSet for the Controlfile + SPFILE Autobackp created on FRA)


However srv1 will not "see" the additional BackupSet Copies ("Copy  #2") created on FileSystem on srv2 -- although they will appear in the controlfile, a CROSSCHECK executed from srv1 will fail to find them.



[oracle@srv1 ~]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Wed Jun 18 15:05:16 2025
Version 19.25.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database: RACDB (DBID=1162136313)

RMAN> list backup completed after "trunc(sysdate)";
list backup completed after "trunc(sysdate)";
using target database control file instead of recovery catalog

List of Backup Sets
===================


BS Key  Size
------- ----------
337     57.35M

  List of Archived Logs in backup set 337
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
 ...
 ...
 ...
  1    401     11161346   01-MAY-25 11165463   18-JUN-25
  1    402     11165463   18-JUN-25 11177493   18-JUN-25
...
...
...
  2    346     11161357   01-MAY-25 11161847   18-JUN-25
  2    347     11161847   18-JUN-25 11177499   18-JUN-25

  Backup Set Copy #1 of backup set 337
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:03     18-JUN-25       YES        TAG20250618T143542

    List of Backup Pieces for backup set 337 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    337     1   AVAILABLE   +FRA/RACDB/BACKUPSET/2025_06_18/annnf0_tag20250618t143542_0.473.1204122943

  Backup Set Copy #2 of backup set 337
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:03     18-JUN-25       YES        TAG20250618T143542

    List of Backup Pieces for backup set 337 Copy #2
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    344     1   AVAILABLE   /u02/RMAN_To_Disk/bs3sat9u_380_1_2

BS Key  Type LV Size
------- ---- -- ----------
338     Full    1.07G
  List of Datafiles in backup set 338
  File LV Type Ckp SCN    Ckp Time  Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- --------- ----------- ------ ----
  1       Full 11177541   18-JUN-25              NO    +DATA/RACDB/DATAFILE/system.257.1164519439
  3       Full 11177541   18-JUN-25              NO    +DATA/RACDB/DATAFILE/sysaux.258.1164519463
  4       Full 11177541   18-JUN-25              NO    +DATA/RACDB/DATAFILE/undotbs1.259.1164519479
  7       Full 11177541   18-JUN-25              NO    +DATA/RACDB/DATAFILE/users.260.1164519479
  9       Full 11177541   18-JUN-25              NO    +DATA/RACDB/DATAFILE/undotbs2.269.1164519893

  Backup Set Copy #1 of backup set 338
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:57     18-JUN-25       YES        TAG20250618T143546

    List of Backup Pieces for backup set 338 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    338     1   AVAILABLE   +FRA/RACDB/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.442.1204122947

  Backup Set Copy #2 of backup set 338
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:57     18-JUN-25       YES        TAG20250618T143546

    List of Backup Pieces for backup set 338 Copy #2
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    345     1   AVAILABLE   /u02/RMAN_To_Disk/bt3sata2_381_1_2

BS Key  Type LV Size
------- ---- -- ----------
339     Full    775.09M
  List of Datafiles in backup set 339
  Container ID: 3, PDB Name: PDB1
  File LV Type Ckp SCN    Ckp Time  Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- --------- ----------- ------ ----
  10      Full 11177736   18-JUN-25              NO    +DATA/RACDB/1476C653214704CFE0635A38A8C08494/DATAFILE/system.274.1164520333
  11      Full 11177736   18-JUN-25              NO    +DATA/RACDB/1476C653214704CFE0635A38A8C08494/DATAFILE/sysaux.275.1164520333
  12      Full 11177736   18-JUN-25              NO    +DATA/RACDB/1476C653214704CFE0635A38A8C08494/DATAFILE/undotbs1.273.1164520333
  13      Full 11177736   18-JUN-25              NO    +DATA/RACDB/1476C653214704CFE0635A38A8C08494/DATAFILE/undo_2.277.1164520345
  14      Full 11177736   18-JUN-25              NO    +DATA/RACDB/1476C653214704CFE0635A38A8C08494/DATAFILE/users.278.1164520353
  15      Full 11177736   18-JUN-25              NO    +DATA/RACDB/1476C653214704CFE0635A38A8C08494/DATAFILE/users2.279.1167388913
  16      Full 11177736   18-JUN-25              NO    +DATA/RACDB/1476C653214704CFE0635A38A8C08494/DATAFILE/users3.280.1167388955

  Backup Set Copy #1 of backup set 339
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:42     18-JUN-25       YES        TAG20250618T143546

    List of Backup Pieces for backup set 339 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    339     1   AVAILABLE   +FRA/RACDB/1476C653214704CFE0635A38A8C08494/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.453.1204123013

  Backup Set Copy #2 of backup set 339
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:42     18-JUN-25       YES        TAG20250618T143546

    List of Backup Pieces for backup set 339 Copy #2
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    346     1   AVAILABLE   /u02/RMAN_To_Disk/bu3satc3_382_1_2

BS Key  Type LV Size
------- ---- -- ----------
340     Full    812.50M
  List of Datafiles in backup set 340
  Container ID: 5, PDB Name: TSTPDB
  File LV Type Ckp SCN    Ckp Time  Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- --------- ----------- ------ ----
  25      Full 11083998   25-APR-25              NO    +DATA/RACDB/339BC12E8011538DE0635A38A8C0C92A/DATAFILE/system.281.1199369077
  26      Full 11083998   25-APR-25              NO    +DATA/RACDB/339BC12E8011538DE0635A38A8C0C92A/DATAFILE/sysaux.283.1199369077
  27      Full 11083998   25-APR-25              NO    +DATA/RACDB/339BC12E8011538DE0635A38A8C0C92A/DATAFILE/undotbs1.282.1199369077
  28      Full 11083998   25-APR-25              NO    +DATA/RACDB/339BC12E8011538DE0635A38A8C0C92A/DATAFILE/undo_2.285.1199369085

  Backup Set Copy #1 of backup set 340
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:42     18-JUN-25       YES        TAG20250618T143546

    List of Backup Pieces for backup set 340 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    340     1   AVAILABLE   +FRA/RACDB/339BC12E8011538DE0635A38A8C0C92A/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.460.1204123057

  Backup Set Copy #2 of backup set 340
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:42     18-JUN-25       YES        TAG20250618T143546

    List of Backup Pieces for backup set 340 Copy #2
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    347     1   AVAILABLE   /u02/RMAN_To_Disk/bv3satdh_383_1_2

BS Key  Type LV Size
------- ---- -- ----------
341     Full    812.46M
  List of Datafiles in backup set 341
  Container ID: 2, PDB Name: PDB$SEED
  File LV Type Ckp SCN    Ckp Time  Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- --------- ----------- ------ ----
  5       Full 9669002    26-NOV-24              NO    +DATA/RACDB/86B637B62FE07A65E053F706E80A27CA/DATAFILE/system.265.1164519659
  6       Full 9669002    26-NOV-24              NO    +DATA/RACDB/86B637B62FE07A65E053F706E80A27CA/DATAFILE/sysaux.266.1164519659
  8       Full 9669002    26-NOV-24              NO    +DATA/RACDB/86B637B62FE07A65E053F706E80A27CA/DATAFILE/undotbs1.267.1164519659

  Backup Set Copy #1 of backup set 341
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:42     18-JUN-25       YES        TAG20250618T143546

    List of Backup Pieces for backup set 341 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    341     1   AVAILABLE   +FRA/RACDB/14769E258FBB5FD8E0635A38A8C09D43/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.349.1204123103

  Backup Set Copy #2 of backup set 341
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:42     18-JUN-25       YES        TAG20250618T143546

    List of Backup Pieces for backup set 341 Copy #2
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    348     1   AVAILABLE   /u02/RMAN_To_Disk/c03sateu_384_1_2

BS Key  Size
------- ----------
342     674.00K

  List of Archived Logs in backup set 342
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
  1    403     11177493   18-JUN-25 11179239   18-JUN-25
  2    348     11177499   18-JUN-25 11179236   18-JUN-25

  Backup Set Copy #1 of backup set 342
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:00     18-JUN-25       YES        TAG20250618T143909

    List of Backup Pieces for backup set 342 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    342     1   AVAILABLE   +FRA/RACDB/BACKUPSET/2025_06_18/annnf0_tag20250618t143909_0.492.1204123149

  Backup Set Copy #2 of backup set 342
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:00     18-JUN-25       YES        TAG20250618T143909

    List of Backup Pieces for backup set 342 Copy #2
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    349     1   AVAILABLE   /u02/RMAN_To_Disk/c13satgd_385_1_2

BS Key  Type LV Size
------- ---- -- ----------
343     Full    19.17M
  SPFILE Included: Modification time: 18-JUN-25
  SPFILE db_unique_name: RACDB
  Control File Included: Ckp SCN: 11179258     Ckp time: 18-JUN-25

  Backup Set Copy #1 of backup set 343
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:00     18-JUN-25       NO         TAG20250618T143910

    List of Backup Pieces for backup set 343 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    343     1   AVAILABLE   +FRA/RACDB/AUTOBACKUP/2025_06_18/s_1204123150.388.1204123151

  Backup Set Copy #2 of backup set 343
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:00     18-JUN-25       NO         TAG20250618T143910

    List of Backup Pieces for backup set 343 Copy #2
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    350     1   AVAILABLE   /u02/RMAN_To_Disk/c23satge_386_1_2

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
344     Full    19.17M     DISK        00:00:00     18-JUN-25
        BP Key: 351   Status: AVAILABLE  Compressed: NO  Tag: TAG20250618T145031
        Piece Name: +FRA/RACDB/AUTOBACKUP/2025_06_18/s_1204123831.443.1204123831
  SPFILE Included: Modification time: 18-JUN-25
  SPFILE db_unique_name: RACDB
  Control File Included: Ckp SCN: 11185112     Ckp time: 18-JUN-25


RMAN>
RMAN> crosscheck backup completed  after "trunc(sysdate)";
crosscheck backup completed  after "trunc(sysdate)";
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=245 instance=RACDB1 device type=DISK
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/BACKUPSET/2025_06_18/annnf0_tag20250618t143542_0.473.1204122943 RECID=337 STAMP=1204122943
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u02/RMAN_To_Disk/bs3sat9u_380_1_2 RECID=344 STAMP=1204123823
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.442.1204122947 RECID=338 STAMP=1204122946
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u02/RMAN_To_Disk/bt3sata2_381_1_2 RECID=345 STAMP=1204123825
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/1476C653214704CFE0635A38A8C08494/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.453.1204123013 RECID=339 STAMP=1204123012
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u02/RMAN_To_Disk/bu3satc3_382_1_2 RECID=346 STAMP=1204123826
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/339BC12E8011538DE0635A38A8C0C92A/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.460.1204123057 RECID=340 STAMP=1204123057
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u02/RMAN_To_Disk/bv3satdh_383_1_2 RECID=347 STAMP=1204123827
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/14769E258FBB5FD8E0635A38A8C09D43/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.349.1204123103 RECID=341 STAMP=1204123102
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u02/RMAN_To_Disk/c03sateu_384_1_2 RECID=348 STAMP=1204123828
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/BACKUPSET/2025_06_18/annnf0_tag20250618t143909_0.492.1204123149 RECID=342 STAMP=1204123149
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u02/RMAN_To_Disk/c13satgd_385_1_2 RECID=349 STAMP=1204123829
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/AUTOBACKUP/2025_06_18/s_1204123150.388.1204123151 RECID=343 STAMP=1204123150
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u02/RMAN_To_Disk/c23satge_386_1_2 RECID=350 STAMP=1204123830
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/AUTOBACKUP/2025_06_18/s_1204123831.443.1204123831 RECID=351 STAMP=1204123831
Crosschecked 15 objects



RMAN>
RMAN> delete noprompt expired backup;
delete noprompt expired backup;
using channel ORA_DISK_1

List of Backup Pieces
BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
344     337     1   2   EXPIRED     DISK        /u02/RMAN_To_Disk/bs3sat9u_380_1_2
345     338     1   2   EXPIRED     DISK        /u02/RMAN_To_Disk/bt3sata2_381_1_2
346     339     1   2   EXPIRED     DISK        /u02/RMAN_To_Disk/bu3satc3_382_1_2
347     340     1   2   EXPIRED     DISK        /u02/RMAN_To_Disk/bv3satdh_383_1_2
348     341     1   2   EXPIRED     DISK        /u02/RMAN_To_Disk/c03sateu_384_1_2
349     342     1   2   EXPIRED     DISK        /u02/RMAN_To_Disk/c13satgd_385_1_2
350     343     1   2   EXPIRED     DISK        /u02/RMAN_To_Disk/c23satge_386_1_2
deleted backup piece
backup piece handle=/u02/RMAN_To_Disk/bs3sat9u_380_1_2 RECID=344 STAMP=1204123823
deleted backup piece
backup piece handle=/u02/RMAN_To_Disk/bt3sata2_381_1_2 RECID=345 STAMP=1204123825
deleted backup piece
backup piece handle=/u02/RMAN_To_Disk/bu3satc3_382_1_2 RECID=346 STAMP=1204123826
deleted backup piece
backup piece handle=/u02/RMAN_To_Disk/bv3satdh_383_1_2 RECID=347 STAMP=1204123827
deleted backup piece
backup piece handle=/u02/RMAN_To_Disk/c03sateu_384_1_2 RECID=348 STAMP=1204123828
deleted backup piece
backup piece handle=/u02/RMAN_To_Disk/c13satgd_385_1_2 RECID=349 STAMP=1204123829
deleted backup piece
backup piece handle=/u02/RMAN_To_Disk/c23satge_386_1_2 RECID=350 STAMP=1204123830
Deleted 7 EXPIRED objects



RMAN>



RMAN's  LIST BACKUP command on srv1 does list the Copy #2 backups to filesystem /u02/RMAN_To_Disk that exist only on srv2.
However, the CROSSCHECK BACKUP  command marks them as "EXPIRED" as it cannot "see" (i.e find) the Backup Pieces on srv1.

I can "reCatalog" them from srv2.


[oracle@srv2 RMAN_To_Disk]$ pwd
/u02/RMAN_To_Disk
[oracle@srv2 RMAN_To_Disk]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Wed Jun 18 15:12:33 2025
Version 19.25.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database: RACDB (DBID=1162136313)

RMAN> crosscheck backup completed after "trunc(sysdate)";
crosscheck backup completed after "trunc(sysdate)";
using channel ORA_DISK_1
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/BACKUPSET/2025_06_18/annnf0_tag20250618t143542_0.473.1204122943 RECID=337 STAMP=1204122943
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.442.1204122947 RECID=338 STAMP=1204122946
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/1476C653214704CFE0635A38A8C08494/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.453.1204123013 RECID=339 STAMP=1204123012
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/339BC12E8011538DE0635A38A8C0C92A/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.460.1204123057 RECID=340 STAMP=1204123057
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/14769E258FBB5FD8E0635A38A8C09D43/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.349.1204123103 RECID=341 STAMP=1204123102
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/BACKUPSET/2025_06_18/annnf0_tag20250618t143909_0.492.1204123149 RECID=342 STAMP=1204123149
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/AUTOBACKUP/2025_06_18/s_1204123150.388.1204123151 RECID=343 STAMP=1204123150
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/AUTOBACKUP/2025_06_18/s_1204123831.443.1204123831 RECID=351 STAMP=1204123831
Crosschecked 8 objects



RMAN>

RMAN> catalog start with '/u02/RMAN_To_Disk';
catalog start with '/u02/RMAN_To_Disk';
searching for all files that match the pattern /u02/RMAN_To_Disk

List of Files Unknown to the Database
=====================================
File Name: /u02/RMAN_To_Disk/bs3sat9u_380_1_2
File Name: /u02/RMAN_To_Disk/bt3sata2_381_1_2
File Name: /u02/RMAN_To_Disk/bu3satc3_382_1_2
File Name: /u02/RMAN_To_Disk/bv3satdh_383_1_2
File Name: /u02/RMAN_To_Disk/c03sateu_384_1_2
File Name: /u02/RMAN_To_Disk/c13satgd_385_1_2
File Name: /u02/RMAN_To_Disk/c23satge_386_1_2

Do you really want to catalog the above files (enter YES or NO)? YES
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /u02/RMAN_To_Disk/bs3sat9u_380_1_2
File Name: /u02/RMAN_To_Disk/bt3sata2_381_1_2
File Name: /u02/RMAN_To_Disk/bu3satc3_382_1_2
File Name: /u02/RMAN_To_Disk/bv3satdh_383_1_2
File Name: /u02/RMAN_To_Disk/c03sateu_384_1_2
File Name: /u02/RMAN_To_Disk/c13satgd_385_1_2
File Name: /u02/RMAN_To_Disk/c23satge_386_1_2


RMAN>
RMAN> crosscheck backup completed after "trunc(sysdate)";
crosscheck backup completed after "trunc(sysdate)";
using channel ORA_DISK_1
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/BACKUPSET/2025_06_18/annnf0_tag20250618t143542_0.473.1204122943 RECID=337 STAMP=1204122943
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u02/RMAN_To_Disk/bs3sat9u_380_1_2 RECID=352 STAMP=1204125222
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.442.1204122947 RECID=338 STAMP=1204122946
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u02/RMAN_To_Disk/bt3sata2_381_1_2 RECID=353 STAMP=1204125222
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/1476C653214704CFE0635A38A8C08494/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.453.1204123013 RECID=339 STAMP=1204123012
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u02/RMAN_To_Disk/bu3satc3_382_1_2 RECID=354 STAMP=1204125222
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/339BC12E8011538DE0635A38A8C0C92A/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.460.1204123057 RECID=340 STAMP=1204123057
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u02/RMAN_To_Disk/bv3satdh_383_1_2 RECID=355 STAMP=1204125222
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/14769E258FBB5FD8E0635A38A8C09D43/BACKUPSET/2025_06_18/nnndf0_tag20250618t143546_0.349.1204123103 RECID=341 STAMP=1204123102
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u02/RMAN_To_Disk/c03sateu_384_1_2 RECID=356 STAMP=1204125222
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/BACKUPSET/2025_06_18/annnf0_tag20250618t143909_0.492.1204123149 RECID=342 STAMP=1204123149
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u02/RMAN_To_Disk/c13satgd_385_1_2 RECID=357 STAMP=1204125222
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/AUTOBACKUP/2025_06_18/s_1204123150.388.1204123151 RECID=343 STAMP=1204123150
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u02/RMAN_To_Disk/c23satge_386_1_2 RECID=358 STAMP=1204125222
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+FRA/RACDB/AUTOBACKUP/2025_06_18/s_1204123831.443.1204123831 RECID=351 STAMP=1204123831
Crosschecked 15 objects



RMAN>


Thus even though I executed a "DELETE" from srv1, I can re-Catalog them because the BackupPieces of these Copy #2 Backups still exist on filesystem /u02/RMAN_To_Disk on srv2.