{"id":2545,"date":"2021-03-09T09:02:09","date_gmt":"2021-03-09T09:02:09","guid":{"rendered":"https:\/\/swiv.com.br\/changing-the-state-of-all-pdbs-and-saving-their-states\/"},"modified":"2026-05-27T20:02:51","modified_gmt":"2026-05-27T19:02:51","slug":"changing-the-state-of-all-pdbs-and-saving-their-states","status":"publish","type":"post","link":"https:\/\/swiv.com.br\/index.php\/2021\/03\/09\/changing-the-state-of-all-pdbs-and-saving-their-states\/","title":{"rendered":"Changing the state of all PDBs and saving their states"},"content":{"rendered":"\n<p>Consultando o status dos PDBs:<\/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@oel8 ~]$ sqlplus \/ as sysdba\n \nSQL*Plus: Release 18.0.0.0.0 - Production on Tue Mar 9 05:52:11 2021\nVersion 18.3.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.3.0.0.0\n \nSQL&gt; col name format a10\nSQL&gt; SELECT NAME, OPEN_MODE FROM V$PDBS ORDER BY 1;\n \nNAME       OPEN_MODE\n---------- ----------\nHIPOFISE1  READ WRITE\nHIPOFISE2  MOUNTED\nPDB$SEED   READ ONLY\n \nSQL&gt;\n<\/pre><\/div>\n\n\n<p>Alterando todos os PDBs:<\/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 PLUGGABLE DATABASE ALL CLOSE;\n \nPluggable database altered.\n \nSQL&gt; SELECT NAME, OPEN_MODE FROM V$PDBS ORDER BY 1;\n \nNAME       OPEN_MODE\n---------- ----------\nHIPOFISE1  MOUNTED\nHIPOFISE2  MOUNTED\nPDB$SEED   READ ONLY\n<\/pre><\/div>\n\n\n<p>Por padr\u00e3o, quando inicializamos um root container, os seus PDBs ficam no estado MOUNT. \u00c9 poss\u00edvel alterar isso mudando os PDBs 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=\"\">\nSQL&gt; ALTER PLUGGABLE DATABASE ALL OPEN;\n \nPluggable database altered.\n \nSQL&gt; ALTER PLUGGABLE DATABASE ALL SAVE STATE;\n \nPluggable database altered.\n \nSQL&gt; SELECT NAME, OPEN_MODE FROM V$PDBS ORDER BY 1;\n \nNAME       OPEN_MODE\n---------- ----------\nHIPOFISE1  READ WRITE\nHIPOFISE2  READ WRITE\nPDB$SEED   READ ONLY\n \nSQL&gt; col con_name format a10\nSQL&gt; SELECT CON_NAME, STATE FROM CDB_PDB_SAVED_STATES;\n \nCON_NAME   STATE\n---------- --------------\nHIPOFISE1  OPEN\nHIPOFISE2  OPEN\n \nSQL&gt;\n<\/pre><\/div>\n\n\n<p>Desse modo, ao fazer o restart do root container, os PDBs ser\u00e3o abertos automaticamente:<\/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; SHOW CON_ID CON_NAME;\n \nCON_ID\n------------------------------\n1\n \nCON_NAME\n------------------------------\nCDB$ROOT\nSQL&gt; SHU IMMEDIATE;\nDatabase closed.\nDatabase dismounted.\nORACLE instance shut down.\nSQL&gt; STARTUP;\nORACLE instance started.\n \nTotal System Global Area 2466249080 bytes\nFixed Size                  8898936 bytes\nVariable Size             671088640 bytes\nDatabase Buffers         1778384896 bytes\nRedo Buffers                7876608 bytes\nDatabase mounted.\nDatabase opened.\nSQL&gt; col name format a10\nSQL&gt; SELECT NAME, OPEN_MODE FROM V$PDBS ORDER BY 1;\n \nNAME       OPEN_MODE\n---------- ----------\nHIPOFISE1  READ WRITE\nHIPOFISE2  READ WRITE\nPDB$SEED   READ ONLY\n \nSQL&gt;\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>Consultando o status dos PDBs: Alterando todos os PDBs: Por padr\u00e3o, quando inicializamos um root container, os seus PDBs ficam no estado MOUNT. \u00c9 poss\u00edvel alterar isso mudando os PDBs conforme exemplo abaixo: Desse modo, ao fazer o restart do root container, os PDBs ser\u00e3o abertos automaticamente: Obs: Este procedimento foi criado pelo senhor Ahmed [&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-2545","post","type-post","status-publish","format-standard","hentry","category-multitenant"],"_links":{"self":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/2545","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=2545"}],"version-history":[{"count":1,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/2545\/revisions"}],"predecessor-version":[{"id":9241,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/2545\/revisions\/9241"}],"wp:attachment":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=2545"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=2545"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=2545"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}