{"id":5705,"date":"2021-07-06T23:08:07","date_gmt":"2021-07-06T23:08:07","guid":{"rendered":"https:\/\/swiv.com.br\/creating-application-pdbs-from-the-application-root\/"},"modified":"2026-05-27T20:02:30","modified_gmt":"2026-05-27T19:02:30","slug":"creating-application-pdbs-from-the-application-root","status":"publish","type":"post","link":"https:\/\/swiv.com.br\/index.php\/2021\/07\/06\/creating-application-pdbs-from-the-application-root\/","title":{"rendered":"Creating application PDBs from the application root"},"content":{"rendered":"\n<p>Neste artigo, vamos explorar a cria\u00e7\u00e3o de Applications PDBs a partir do Application Root gerado em nosso \u00faltimo post. <\/p>\n\n\n\n<p>Logando no Application 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 admin]$ sqlplus sys\/oracle@HR_AC as sysdba\n \nSQL*Plus: Release 18.0.0.0.0 - Production on Tue Jul 6 19:54:40 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; SHOW CON_ID CON_NAME;\n \nCON_ID\n------------------------------\n5\n \nCON_NAME\n------------------------------\nHR_AC\n<\/pre><\/div>\n\n\n<p>Agora vamos disparar a cria\u00e7\u00e3o de um PDB. Como estamos conectados em um Application Root, automaticamente teremos a cria\u00e7\u00e3o de um Application PDB (Container):<\/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; CREATE PLUGGABLE DATABASE hr_pdb1 admin user hr_pdb1adm identified by oracle;\n \nPluggable database created.\n<\/pre><\/div>\n\n\n<p>Abrindo o novo Application PDB e salvando o seu status:<\/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 hr_pdb1 OPEN;\n \nPluggable database altered.\n \nSQL&gt; ALTER PLUGGABLE DATABASE hr_pdb1 SAVE STATE;\n \nPluggable database altered.\n<\/pre><\/div>\n\n\n<p>Validando o status do Application PDB:<\/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; SELECT STATUS FROM DBA_PDBS WHERE PDB_NAME=&#039;HR_PDB1&#039;;\n \nSTATUS\n----------\nNORMAL\n<\/pre><\/div>\n\n\n<p>Nesse ponto, podemos realizar uma opera\u00e7\u00e3o importante: ap\u00f3s fazer o switch de conex\u00e3o para o PDB criado, podemos &#8220;sincroniz\u00e1-lo&#8221; com o Application Root:<\/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=hr_pdb1;\n \nSession altered.\n \nSQL&gt; ALTER PLUGGABLE DATABASE APPLICATION hr_app SYNC;\n \nPluggable database altered.\n<\/pre><\/div>\n\n\n<p>Conectando ao Application PDB e validando o conte\u00fado de alguns objetos:<\/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; conn hr\/oracle@\/\/quiasma:1521\/hr_pdb1.localdomain\nConnected.\nSQL&gt; SELECT TNAME FROM TAB ;\n \nTNAME\n--------------------------------------------------------------------------------\nCOUNTRIES\nDEPARTMENTS\nEMPLOYEES\nJOBS\nLOCATIONS\nREGIONS\n \n6 rows selected.\n \nSQL&gt; SELECT * FROM REGIONS ;\n \n REGION_ID REGION_NAME\n---------- -------------------------\n         1 Europe\n         2 Americas\n         3 Asia\n         4 Middle East and Africa\n \nSQL&gt; SELECT SEQUENCE_NAME FROM USER_SEQUENCES ;\n \nSEQUENCE_NAME\n--------------------------------------------------------------------------------\nDEPARTMENTS_SEQ\nEMPLOYEES_SEQ\nLOCATIONS_SEQ\n<\/pre><\/div>\n\n\n<p>Para nos permitir validar outros recursos em artigos posteriores, vamos criar um segundo Application PDB conforme 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; conn sys\/oracle@hr_ac as sysdba\nConnected.\nSQL&gt; CREATE PLUGGABLE DATABASE hr_pdb2 admin user hr_pdb2adm identified by oracle;\n \nPluggable database created.\n \nSQL&gt; ALTER PLUGGABLE DATABASE hr_pdb2 OPEN;\n \nPluggable database altered.\n \nSQL&gt; ALTER PLUGGABLE DATABASE hr_pdb2 SAVE STATE;\n \nPluggable database altered.\n \nSQL&gt; ALTER SESSION SET CONTAINER=hr_pdb2;\n \nSession altered.\n \nSQL&gt; ALTER PLUGGABLE DATABASE APPLICATION hr_app SYNC;\n \nPluggable database altered.\n \nSQL&gt; conn hr\/oracle@\/\/quiasma:1521\/hr_pdb2.localdomain\nConnected.\nSQL&gt; SELECT TNAME FROM TAB ;\n \nTNAME\n--------------------------------------------------------------------------------\nCOUNTRIES\nDEPARTMENTS\nEMPLOYEES\nJOBS\nLOCATIONS\nREGIONS\n \n6 rows selected.\n<\/pre><\/div>\n\n\n<p>Validando todos os PDBs criados:<\/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; conn sys\/oracle@HR_AC as sysdba\nConnected.\nSQL&gt; SHOW PDBS;\n \n    CON_ID CON_NAME                       OPEN MODE  RESTRICTED\n---------- ------------------------------ ---------- ----------\n         5 HR_AC                          READ WRITE NO\n         6 HR_PDB1                        READ WRITE NO\n         7 HR_PDB2                        READ WRITE NO\nSQL&gt; conn \/ as sysdba\nConnected.\nSQL&gt; SHOW PDBS;\n \n    CON_ID CON_NAME                       OPEN MODE  RESTRICTED\n---------- ------------------------------ ---------- ----------\n         2 PDB$SEED                       READ ONLY  NO\n         3 HIPOFISE2                      READ WRITE NO\n         4 HIPOFISE1                      READ WRITE NO\n         5 HR_AC                          READ WRITE NO\n         6 HR_PDB1                        READ WRITE NO\n         7 HR_PDB2                        READ WRITE NO\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, vamos explorar a cria\u00e7\u00e3o de Applications PDBs a partir do Application Root gerado em nosso \u00faltimo post. Logando no Application Root: Agora vamos disparar a cria\u00e7\u00e3o de um PDB. Como estamos conectados em um Application Root, automaticamente teremos a cria\u00e7\u00e3o de um Application PDB (Container): Abrindo o novo Application PDB e salvando o [&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-5705","post","type-post","status-publish","format-standard","hentry","category-multitenant"],"_links":{"self":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/5705","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=5705"}],"version-history":[{"count":1,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/5705\/revisions"}],"predecessor-version":[{"id":9085,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/5705\/revisions\/9085"}],"wp:attachment":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=5705"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=5705"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=5705"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}