{"id":3318,"date":"2021-03-30T07:54:03","date_gmt":"2021-03-30T07:54:03","guid":{"rendered":"https:\/\/swiv.com.br\/applying-datapatch-to-pdbseed\/"},"modified":"2026-05-27T20:02:49","modified_gmt":"2026-05-27T19:02:49","slug":"applying-datapatch-to-pdbseed","status":"publish","type":"post","link":"https:\/\/swiv.com.br\/index.php\/2021\/03\/30\/applying-datapatch-to-pdbseed\/","title":{"rendered":"Applying Datapatch to PDB$SEED"},"content":{"rendered":"<p><a rel=\"\\&quot;noreferrer noopener\" noopener=\"\" href=\"https:\/\/swiv.com.br\/solved-issue-18-3-0-0-0-release_update-1806280943-is-installed-in-the-cdb-but-18-3-0-0-0-release_update-180628094-is-installed-in-the-pdb\/\" target=\"\\&quot;_blank\\&quot;\">Neste <\/a>artigo, eu havia aplicado o Datapatch em alguns PDBs do meu CDB$ROOT, por\u00e9m n\u00e3o tinha feito o processo do PDB$SEED. Ent\u00e3o farei o processo para deixar o meu laborat\u00f3rio coeso, utilizando como refer\u00eancia o Oracle Note &#8220;<strong>Datapatch precheck failed : Release update is BEING installed to PDB but is not installed in CDB$ROOT.This will cause a patch mismatch between this PDB and CDB$ROOT (Doc ID 2604940.1)<\/strong>&#8220;.<\/p>\n\n\n<p>Os PDBs do tipo SEED ficam apenas em modo leitura, conforme exemplo abaixo:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;oracle@quiasma admin]$ sqlplus \/ as sysdba\n \nSQL*Plus: Release 18.0.0.0.0 - Production on Tue Mar 30 04:27:47 2021\nVersion 18.13.0.0.0\n \nCopyright (c) 1982, 2018, Oracle.  All rights reserved.\n \n \nConnected to:\nOracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production\nVersion 18.13.0.0.0\n \nSQL&gt; SELECT INSTANCE_NAME,STATUS FROM V$INSTANCE;\n \nINSTANCE_NAME    STATUS\n---------------- ------------\nTALAMO           OPEN\n \nSQL&gt; SELECT NAME,OPEN_MODE FROM V$PDBS WHERE NAME LIKE &#039;%SEED%&#039;;\n \nNAME\n--------------------------------------------------------------------------------\nOPEN_MODE\n----------\nPDB$SEED\nREAD ONLY\n<\/pre><\/div>\n\n\n<p>Entretanto, para aplicaros o Datapatch, \u00e9 necess\u00e1rio que o mesmo esteja aberto. Desse modo, a Oracle sugere a altera\u00e7\u00e3o de um par\u00e2metro para permitir que isso seja feito:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSQL&gt; alter session set container=PDB$SEED;\n \nSession altered.\n \nSQL&gt; alter session set &quot;_oracle_script&quot;=TRUE;\n \nSession altered.\n \nSQL&gt; alter pluggable database pdb$seed close immediate instances=all;\n \nPluggable database altered.\n \nSQL&gt; alter pluggable database pdb$seed OPEN READ WRITE;\n \nPluggable database altered.\n \nSQL&gt; select open_mode from v$database;\n \nOPEN_MODE\n--------------------\nREAD WRITE\n<\/pre><\/div>\n\n\n<p>Aplicando o datapatch, por\u00e9m \u00e9 reportado uma mensagem de erro:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;oracle@quiasma admin]$ cd $ORACLE_HOME\/OPatch\n&#x5B;oracle@quiasma OPatch]$ .\/datapatch -verbose -pdbs PDB\\$SEED\nSQL Patching tool version 18.0.0.0.0 Production on Tue Mar 30 04:33:06 2021\nCopyright (c) 2012, 2020, Oracle.  All rights reserved.\n \nLog file for this invocation: \/oracle\/18.0.0\/base\/cfgtoollogs\/sqlpatch\/sqlpatch_16615_2021_03_30_04_33_06\/sqlpatch_invocation.log\n \nConnecting to database...OK\nGathering database info...done\n \nNote:  Datapatch will only apply or rollback SQL fixes for PDBs\n       that are in an open state, no patches will be applied to closed PDBs.\n       Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation\n       (Doc ID 1585822.1)\n \nBootstrapping registry and package to current versions...\nError: prereq checks failed!\nCDB$ROOT is not in the PDBs to be processed but needs to be bootstrapped\nPrereq check failed, exiting without installing any patches.\n \nPlease refer to MOS Note 1609718.1 and\/or the invocation log\n\/oracle\/18.0.0\/base\/cfgtoollogs\/sqlpatch\/sqlpatch_16615_2021_03_30_04_33_06\/sqlpatch_invocation.log\nfor information on how to resolve the above errors.\n \nSQL Patching tool complete on Tue Mar 30 04:33:07 2021\n<\/pre><\/div>\n\n\n<p>Segundo o Oracle Note &#8220;<strong>datapatch execution for PDB results in Error- CDB$ROOT is not in the PDBs to be processed but needs to be bootstrapped (Doc ID 2538591.1)<\/strong>&#8220;, devemos aplicar o datapatch primeiramente no CDB$ROOT (apesar de eu j\u00e1 ter feito isso em outra oportunidade), para s\u00f3 ent\u00e3o aplicar em algum PDB. Realizando o processo no root:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;oracle@quiasma OPatch]$ cd $ORACLE_HOME\/OPatch\n&#x5B;oracle@quiasma OPatch]$ .\/datapatch -verbose -pdbs CDB\\$ROOT\nSQL Patching tool version 18.0.0.0.0 Production on Tue Mar 30 04:39:13 2021\nCopyright (c) 2012, 2020, Oracle.  All rights reserved.\n \nLog file for this invocation: \/oracle\/18.0.0\/base\/cfgtoollogs\/sqlpatch\/sqlpatch_17834_2021_03_30_04_39_13\/sqlpatch_invocation.log\n \nConnecting to database...OK\nGathering database info...done\n \nNote:  Datapatch will only apply or rollback SQL fixes for PDBs\n       that are in an open state, no patches will be applied to closed PDBs.\n       Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation\n       (Doc ID 1585822.1)\n \nBootstrapping registry and package to current versions...done\nDetermining current state...done\n \nCurrent state of interim SQL patches:\nInterim patch 27923415 (OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415)):\n  Binary registry: Installed\n  PDB CDB$ROOT: Applied successfully on 02-MAR-21 06.35.31.589073 AM\n \nCurrent state of release update SQL patches:\n  Binary registry:\n    18.13.0.0.0 Release_Update 2012231849: Installed\n  PDB CDB$ROOT:\n    Applied 18.3.0.0.0 Release_Update 1806280943 successfully on 02-MAR-21 06.35.31.581343 AM\n \nAdding patches to installation queue and performing prereq checks...done\nInstallation queue:\n  For the following PDBs: CDB$ROOT\n    No interim patches need to be rolled back\n    Patch 32204699 (Database Release Update : 18.13.0.0.210119 (32204699)):\n      Apply from 18.3.0.0.0 Release_Update 1806280943 to 18.13.0.0.0 Release_Update 2012231849\n    No interim patches need to be applied\n \nInstalling patches...\nPatch installation complete.  Total patches installed: 1\n \nValidating logfiles...done\nPatch 32204699 apply (pdb CDB$ROOT): SUCCESS\n  logfile: \/oracle\/18.0.0\/base\/cfgtoollogs\/sqlpatch\/32204699\/24011084\/32204699_apply_TALAMO_CDBROOT_2021Mar30_04_39_36.log (no errors)\nSQL Patching tool complete on Tue Mar 30 04:43:38 2021\n<\/pre><\/div>\n\n\n<p>Aplicando no PDB$SEED:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;oracle@quiasma OPatch]$ cd $ORACLE_HOME\/OPatch\n&#x5B;oracle@quiasma OPatch]$ .\/datapatch -verbose -pdbs PDB\\$SEED\nSQL Patching tool version 18.0.0.0.0 Production on Tue Mar 30 04:44:34 2021\nCopyright (c) 2012, 2020, Oracle.  All rights reserved.\n \nLog file for this invocation: \/oracle\/18.0.0\/base\/cfgtoollogs\/sqlpatch\/sqlpatch_19337_2021_03_30_04_44_34\/sqlpatch_invocation.log\n \nConnecting to database...OK\nGathering database info...done\n \nNote:  Datapatch will only apply or rollback SQL fixes for PDBs\n       that are in an open state, no patches will be applied to closed PDBs.\n       Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation\n       (Doc ID 1585822.1)\n \nBootstrapping registry and package to current versions...done\nDetermining current state...done\n \nCurrent state of interim SQL patches:\nInterim patch 27923415 (OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415)):\n  Binary registry: Installed\n  PDB PDB$SEED: Applied successfully on 02-MAR-21 06.44.54.948445 AM\n \nCurrent state of release update SQL patches:\n  Binary registry:\n    18.13.0.0.0 Release_Update 2012231849: Installed\n  PDB PDB$SEED:\n    Applied 18.3.0.0.0 Release_Update 1806280943 successfully on 02-MAR-21 06.44.54.938616 AM\n \nAdding patches to installation queue and performing prereq checks...done\nInstallation queue:\n  For the following PDBs: PDB$SEED\n    No interim patches need to be rolled back\n    Patch 32204699 (Database Release Update : 18.13.0.0.210119 (32204699)):\n      Apply from 18.3.0.0.0 Release_Update 1806280943 to 18.13.0.0.0 Release_Update 2012231849\n    No interim patches need to be applied\n \nInstalling patches...\nPatch installation complete.  Total patches installed: 1\n \nValidating logfiles...done\nPatch 32204699 apply (pdb PDB$SEED): SUCCESS\n  logfile: \/oracle\/18.0.0\/base\/cfgtoollogs\/sqlpatch\/32204699\/24011084\/32204699_apply_TALAMO_PDBSEED_2021Mar30_04_45_07.log (no errors)\nSQL Patching tool complete on Tue Mar 30 04:49:19 2021\n<\/pre><\/div>\n\n\n<p>Alterando par\u00e2metro e alterando o mode do seed para somente leitura:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;oracle@quiasma OPatch]$ sqlplus \/ as sysdba\n \nSQL*Plus: Release 18.0.0.0.0 - Production on Tue Mar 30 04:50:22 2021\nVersion 18.13.0.0.0\n \nCopyright (c) 1982, 2018, Oracle.  All rights reserved.\n \n \nConnected to:\nOracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production\nVersion 18.13.0.0.0\n \nSQL&gt; alter session set container=PDB$SEED;\n \nSession altered.\n \nSQL&gt; alter session set &quot;_oracle_script&quot;=FALSE;\n \nSession altered.\n \nSQL&gt; show pdbs\n \n    CON_ID CON_NAME                       OPEN MODE  RESTRICTED\n---------- ------------------------------ ---------- ----------\n         2 PDB$SEED                       READ WRITE NO\nSQL&gt; set linesize 150\nSQL&gt; col logfile for a90\nSQL&gt; select patch_id, action, logfile, status from registry$sqlpatch;\n \n  PATCH_ID ACTION          LOGFILE                                                                          STATUS\n---------- --------------- ------------------------------------------------------------------------------------------ -------------------------\n  28090523 APPLY           \/oracle\/18.0.0\/base\/cfgtoollogs\/sqlpatch\/28090523\/22329768\/28090523_apply_TALAMO_PDBSEED_2 SUCCESS\n                           021Mar02_06_42_50.log\n \n  27923415 APPLY           \/oracle\/18.0.0\/base\/cfgtoollogs\/sqlpatch\/27923415\/22239273\/27923415_apply_TALAMO_PDBSEED_2 SUCCESS\n                           021Mar02_06_44_28.log\n \n  32204699 APPLY           \/oracle\/18.0.0\/base\/cfgtoollogs\/sqlpatch\/32204699\/24011084\/32204699_apply_TALAMO_PDBSEED_2 SUCCESS\n                           021Mar30_04_45_07.log\n \n \nSQL&gt; alter pluggable database pdb$seed close immediate instances=all;\n \nPluggable database altered.\n \nSQL&gt; alter pluggable database pdb$seed OPEN READ ONLY;\n \nPluggable database altered.\n \nSQL&gt; SELECT NAME,OPEN_MODE FROM V$PDBS WHERE NAME LIKE &#039;%SEED%&#039;;\n \nNAME                                                                                                   OPEN_MODE\n-------------------------------------------------------------------------------------------------------------------------------- ----------\nPDB$SEED                                                                                               READ ONLY\n<\/pre><\/div>\n\n\n<p>Obs: Este procedimento foi criado pelo senhor Ahmed Baraka (www.ahmedbaraka.com) e foi apenas reproduzido por mim em um laborat\u00f3rio pessoal para fins de aprendizado.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Neste artigo, eu havia aplicado o Datapatch em alguns PDBs do meu CDB$ROOT, por\u00e9m n\u00e3o tinha feito o processo do PDB$SEED. Ent\u00e3o farei o processo para deixar o meu laborat\u00f3rio coeso, utilizando como refer\u00eancia o Oracle Note &#8220;Datapatch precheck failed : Release update is BEING installed to PDB but is not installed in CDB$ROOT.This will [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-3318","post","type-post","status-publish","format-standard","hentry","category-multitenant"],"_links":{"self":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/3318","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/comments?post=3318"}],"version-history":[{"count":1,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/3318\/revisions"}],"predecessor-version":[{"id":9197,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/3318\/revisions\/9197"}],"wp:attachment":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=3318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=3318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=3318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}