<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ExaCC - dbi Blog</title>
	<atom:link href="https://www.dbi-services.com/blog/category/exacc/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbi-services.com/blog/category/exacc/</link>
	<description></description>
	<lastBuildDate>Thu, 09 Oct 2025 06:46:47 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://www.dbi-services.com/blog/wp-content/uploads/sites/2/2025/05/cropped-favicon_512x512px-min-32x32.png</url>
	<title>ExaCC - dbi Blog</title>
	<link>https://www.dbi-services.com/blog/category/exacc/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Creating&#038;Refreshing a refreshable PDB (from a Standby Database)</title>
		<link>https://www.dbi-services.com/blog/creatingrefreshing-a-refreshable-pdb-from-a-standby-database/</link>
					<comments>https://www.dbi-services.com/blog/creatingrefreshing-a-refreshable-pdb-from-a-standby-database/#respond</comments>
		
		<dc:creator><![CDATA[Jérôme Witt]]></dc:creator>
		<pubDate>Mon, 18 Aug 2025 19:07:57 +0000</pubDate>
				<category><![CDATA[ExaCC]]></category>
		<category><![CDATA[OCI]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Data Guard]]></category>
		<category><![CDATA[multitenant]]></category>
		<category><![CDATA[PDB]]></category>
		<guid isPermaLink="false">https://www.dbi-services.com/blog/?p=40084</guid>

					<description><![CDATA[<p>I&#8217;m used to work with refreshable clones in several Oracle multitenant environments. However, due to the amount of Archived Redo Log generated we never really tried to offload the the &#8220;refresh&#8221; process on the Active Data Guard Standby database. Let&#8217;s quickly check what is required to achieve this together. What is required to create a [&#8230;]</p>
<p>L’article <a href="https://www.dbi-services.com/blog/creatingrefreshing-a-refreshable-pdb-from-a-standby-database/">Creating&amp;Refreshing a refreshable PDB (from a Standby Database)</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">I&#8217;m used to work with refreshable clones in several Oracle multitenant environments. However, due to the amount of Archived Redo Log generated we never really tried to offload the the &#8220;refresh&#8221; process on the Active Data Guard Standby database.</p>



<p class="wp-block-paragraph">Let&#8217;s quickly check what is required to achieve this together.</p>



<h2 class="wp-block-heading" id="h-what-is-required-to-create-a-refreshable">What is required to create a refreshable  ?</h2>



<p class="wp-block-paragraph">Well, to create a remote (refreshable) clone you need at least a database link (whatever you are cloning from a single instance, Oracle RAC and/or Oracle Data Guard standby database). ideally, created though an isolated database user with appropriate CREATE SESSION and CREATE PLUGGABLE DATABASE system privileges.</p>



<p class="wp-block-paragraph">To be more precise until Oracle RDBMS 19.27 a PUBLIC database link was even required because of</p>



<pre class="wp-block-verse">Bug 34723488&nbsp;&nbsp;PDB REFRESH USING A NON-PUBLIC DB LINK FAILING WITH ERROR "ORA-04054"<br></pre>



<p class="wp-block-paragraph">Before you, ask &#8230; Yes, the database link is required even if you clone locally within the same container (formerly called a loopback database link) but this is not the subject for today&#8217;s post 🙂</p>



<h2 class="wp-block-heading" id="h-how-to-provision-a-refreshable-clone-from-standby">How to provision a (refreshable) clone  from standby?</h2>



<p class="wp-block-paragraph">This post does not replace the Oracle manuals! But tries to summarize some challenges we faced over the past years with this Oracle features. <br>Please refer to <a href="https://www.dbi-services.com/blog/managing-refreshable-clone-pluggable-databases-with-oracle-21c/">https://www.dbi-services.com/blog/managing-refreshable-clone-pluggable-databases-with-oracle-21c/</a> for for conceptual details about the refreshable clone feature.<br><br>Provisioning (or refreshing) a refreshable clone from a single-instance, RAC works out-of-the-box as long as you run it from primary database. However, when started on a standby it fails:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: sql; title: ; notranslate">
CREATE PLUGGABLE DATABASE PDB_TMR_001P FROM PDB_APP_001P@&quot;CDB999_19e1298295ca4e68460d28d0cc00304a@CDB999_SITE2&quot;
KEYSTORE IDENTIFIED BY &quot;…#secret#...&quot; INCLUDING SHARED KEY
PARALLEL 8
SERVICE_NAME_CONVERT=(&#039;PDB_APP_001P&#039;,&#039;PDB_TMR_001P&#039;)
REFRESH MODE MANUAL
STANDBYS=NONE&quot;
 
PY-4011: the database or network closed the connection
ORA-00600: internal error code, arguments: &#x5B;kcffo_init_df_hdr:badfuzzysrcfile], &#x5B;262], &#x5B;6010], &#x5B;], &#x5B;], &#x5B;], &#x5B;], &#x5B;], &#x5B;], &#x5B;], &#x5B;], &#x5B;]
</pre></div>


<p class="wp-block-paragraph"><br>According, to Oracle support we are trying to clone while an &#8220;hot backup&#8221; is running as explained by following article:</p>



<pre class="wp-block-verse">ORA-00600 [kcffo_init_df_hdr:badfuzzysrcfile] On Create Pluggable Database (Doc ID 2878586.1)</pre>



<p class="wp-block-paragraph">As we are cloning from an Oracle Data Guard Active standby, with ongoing recovery process all our database files are &#8220;FUZZY&#8221; except PDB$SEED as of it&#8217;s &#8220;immutable&#8221; state which correlates with the ORA-00600 first argument.</p>



<p class="wp-block-paragraph">This can be verified through Oracle data dictionary dynamic performance view V$DATAFILE_HEADER:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: sql; title: ; notranslate">
SQL&gt; SELECT database_role, open_mode FROM v$database;

DATABASE_ROLE		             OPEN_MODE
------------------------------ ------------------------------
PHYSICAL STANDBY	             READ ONLY WITH APPLY

SQL&gt; SELECT con_id, fuzzy, checkpoint_change# FROM v$datafile_header;


    CON_ID FUZZY      CHECKPOINT_CHANGE#
---------- ---------- ------------------
         1 YES                   39212441
         1 YES                   39212441
         1 YES                   39212441
         1 YES                   39212441
         2 NO                    1683111
         2 NO                    1683111
         2 NO                    1683111
         3 YES                   39212441
         3 YES                   39212441
         3 YES                   39212441
         3 YES                   39212441
         3 YES                   39212441
         3 YES                   39212441

</pre></div>


<p class="wp-block-paragraph"><br>So. let&#8217;s try to cancel the recovery process using Data Groker command &#8220;SET STATE&#8221; </p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
EDIT DATABASE &#039;CDB999_SITE2&quot; SET STATE=&#039;APPLY-OFF&#039;
</pre></div>


<p class="wp-block-paragraph">Cancelling recovery process, leaves the database files in a consistent state  </p>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-code"><code>2025-08-18T09:20:46.148023+00:00
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL
2025-08-18T09:20:46.149836+00:00
PR00 (PID:90495): MRP0: Background Media Recovery cancelled with status 16037
2025-08-18T09:20:46.149938+00:00
Errors in file /u01/app/oracle/diag/rdbms/cdb999_site/CDB999/trace/CDB999_pr00_90495.trc:
ORA-16037: user requested cancel of managed recovery operation
PR00 (PID:90495): Managed Standby Recovery not using Real Time Apply
Recovery interrupted!
Recovered data files to a consistent state at change 39213769
Stopping change tracking
2025-08-18T09:20:46.290601+00:00
Errors in file /u01/app/oracle/diag/rdbms/cdb999_site/CDB999/trace/CDB999_pr00_90495.trc:
ORA-16037: user requested cancel of managed recovery operation
2025-08-18T09:20:47.406889+00:00
Background Media Recovery process shutdown (CDB999)
2025-08-18T09:20:48.151897+00:00
Managed Standby Recovery Canceled (CDB999)
Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL</code></pre>



<p class="wp-block-paragraph">From now on, the database files are consistent as visible in V$DATAFILE_HEADER</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
SQL&amp;gt; SELECT con_id, fuzzy, checkpoint_change# FROM v$datafile_header;

    CON_ID FUZZY      CHECKPOINT_CHANGE#
---------- ---------- ------------------
         1 NO                   39213769
         1 NO                   39213769
         1 NO                   39213769
         1 NO                   39213769
         2 NO                    1683111
         2 NO                    1683111
         2 NO                    1683111
         3 NO                   39213769
         3 NO                   39213769
         3 NO                   39213769
         3 NO                   39213769
         3 NO                   39213769
         3 NO                   39213769
</pre></div>


<p class="wp-block-paragraph">As per the attached evidences the database datafiles are consitent as of Oracle System Change Number 39213769 (alert*log &#8220;Recovered data files to a consistent state at change 39213769&#8221;) which matches (V$DATAFILE_HEADER.CHECKPOINT_CHANGE#)</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">From now on, any cloning tentative to provision a fresh clone from Oracle Data Guard Active standby database works. However, it requires comprehensive measures to disable and re-active recovery process.</p>



<p class="wp-block-paragraph">As alternative; Daniel Overby Hansen proposes to convert the standby database to a snapshot standby. but this may not work to start a refresh at later stage (not tested).</p>



<figure class="wp-block-embed is-type-wp-embed is-provider-databases-are-fun wp-block-embed-databases-are-fun"><div class="wp-block-embed__wrapper">
<blockquote class="wp-embedded-content" data-secret="QuxaG0QJeg"><a href="https://dohdatabase.com/2025/04/17/using-refreshable-clone-pdbs-from-a-standby-database/">Using Refreshable Clone PDBs from a Standby&nbsp;Database</a></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  title="&#8220;Using Refreshable Clone PDBs from a Standby&nbsp;Database&#8221; &#8212; Databases Are Fun" src="https://dohdatabase.com/2025/04/17/using-refreshable-clone-pdbs-from-a-standby-database/embed/#?secret=Gq8XM12svM#?secret=QuxaG0QJeg" data-secret="QuxaG0QJeg" width="500" height="282" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div></figure>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading" id="h-how-to-refresh-the-refreshable-clone">How to refresh the refreshable clone ? </h2>



<p class="wp-block-paragraph">Well, same story as for provision a clone from standby, except that the error message is a bit more silly</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: sql; title: ; notranslate">
ALTER PLUGGABLE DATABASE RCLON_TMR_002I REFRESH

ORA-65345: cannot refresh pluggable database
</pre></div>


<p class="wp-block-paragraph">Alert*log snipped records recovery attempt but not &#8220;real error&#8221; message to identify the root cause:</p>



<pre class="wp-block-code"><code>Pluggable database PDB_TMR_001P closed
2025-08-18T10:01:20.246104+00:00
Applying media recovery for pdb-4099 from SCN 39285930 to SCN 39286036
Remote log information: count-1
thr-1,seq-294,logfile-+RECO/CDB999_SITE2/ARCHIVELOG/2025_08_18/thread_1_seq_294.396.1209463231,los-39285484,nxs-39285931,maxblks-9107
PDB_TMR_001P(18):Media Recovery Start
2025-08-18T10:01:20.249993+00:00
PDB_TMR_001P(18):Serial Media Recovery started
PDB_TMR_001P(18):max_pdb is 27
2025-08-18T10:01:20.341597+00:00
PDB_TMR_001P(18):Media Recovery Log +RECO/CDB999_SITE2/ARCHIVELOG/2025_08_18/thread_1_seq_294.396.1209463231
2025-08-18T10:01:20.638622+00:00</code></pre>



<p class="wp-block-paragraph">Actually, it took me a while to understand that the requested recovery SCN 39286036 (line &#8220;Applying media recovery for pdb-4099 from SCN 39285930 to SCN&#8221; ) was not available on standby database.<br>Indeed, Oracle expects to get this transaction &#8220;already&#8221; on the standby archived redo log.</p>



<p class="wp-block-paragraph">This can be easily reproduced on a LAB by querying V$ARCHIVED_LOG on the as follows:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: sql; title: ; notranslate">
SELECT sequence#, first_change#, next_change# 
  FROM v$archived_log 
WHERE &amp;scn BETWEEN first_change# AND next_change#
     AND standby_dest=&#039;NO&#039;;
</pre></div>


<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">So, we can&#8217;t start an &#8220;ALTER PLUGGABLE DATABSE &lt;PDB_NAME&gt; REFRESH&#8221; from Oracle Active Data Guard standby database as of Oracle database piggy backing feature and lazzy checkpoints :=). <br>Indeed, Oracle has no feature to force a log switch on primary while being connected to standby site.<br><br><span style="text-decoration: underline">Workarround</span>: Force log switch on Oracle Active Data Guard primary database:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: sql; title: ; notranslate">
ALTER SYSTEM ARCHIVE LOG CURRENT

</pre></div>


<h2 class="wp-block-heading" id="h-wrap-up">Wrap-up</h2>



<p class="wp-block-paragraph">Well, after all Oracle documented the behavior 🙂 IMHO, this issue deserved more than 3 lines in a Oracle support article:</p>



<pre class="wp-block-verse">Force log switch to Avoid ORA-65345 When Refreshing PDB Sourced From Active Data Guard Standby (Doc ID 2765472.1)</pre>



<p class="wp-block-paragraph">Oracle is working on an enhancement request to &#8220;fix&#8221; that</p>



<pre class="wp-block-verse">"32709955 - NEED TO REFRESH THE REFRESHABLE PDB FROM THE PHYSICAL STANDBY"</pre>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Last one but not least, the current functionality with aforementioned workaround appplied is only viable as long as you do not require the &#8220;auto-refresh&#8221; feature. Indeed, who wants to disable Oracle Data Guard broker LogApply/recovery process, force a log switch on primary database and manage to get the monitoring in-line ?  </p>
<p>L’article <a href="https://www.dbi-services.com/blog/creatingrefreshing-a-refreshable-pdb-from-a-standby-database/">Creating&amp;Refreshing a refreshable PDB (from a Standby Database)</a> est apparu en premier sur <a href="https://www.dbi-services.com/blog">dbi Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbi-services.com/blog/creatingrefreshing-a-refreshable-pdb-from-a-standby-database/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Lazy Loading (feed)

Served from: www.dbi-services.com @ 2026-10-10 04:10:56 by W3 Total Cache
-->