{"id":2528,"date":"2021-03-09T08:26:09","date_gmt":"2021-03-09T08:26:09","guid":{"rendered":"https:\/\/swiv.com.br\/switching-oracle-current-container\/"},"modified":"2026-05-27T20:02:51","modified_gmt":"2026-05-27T19:02:51","slug":"switching-oracle-current-container","status":"publish","type":"post","link":"https:\/\/swiv.com.br\/index.php\/2021\/03\/09\/switching-oracle-current-container\/","title":{"rendered":"Switching Oracle current container"},"content":{"rendered":"\n<p>Para podermos confirmar em qual container estamos conectados, podemos utilizar os comandos 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@oel8 ~]$ sqlplus \/ as sysdba\n \nSQL*Plus: Release 18.0.0.0.0 - Production on Tue Mar 9 05:16:12 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; sho CON_ID CON_NAME\n \nCON_ID\n------------------------------\n1\n \nCON_NAME\n------------------------------\nCDB$ROOT\nSQL&gt;\n<\/pre><\/div>\n\n\n<p>Ou podemos utilizar o script SQL 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; SELECT SYS_CONTEXT(&#039;USERENV&#039;, &#039;CON_ID&#039;) CON_ID, SYS_CONTEXT(&#039;USERENV&#039;, &#039;CON_NAME&#039;) CON_NAME FROM DUAL;\n \nCON_ID\n--------------------------------------------------------------------------------\nCON_NAME\n--------------------------------------------------------------------------------\n1\nCDB$ROOT\n<\/pre><\/div>\n\n\n<p>Checando os PDBs existentes dentro do 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; col name format a15\nSQL&gt; SELECT CON_ID,NAME FROM V$PDBS;\n \n    CON_ID NAME\n---------- ---------------\n         2 PDB$SEED\n         3 HIPOFISE1\n         4 HIPOFISE2\n \nSQL&gt;\n<\/pre><\/div>\n\n\n<p>Para trocar o container, basta rodar o comando 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 SESSION SET CONTAINER=HIPOFISE1;\n \nSession altered.\n<\/pre><\/div>\n\n\n<p>Validando:<\/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; SHO CON_ID CON_NAME\n \nCON_ID\n------------------------------\n3\n \nCON_NAME\n------------------------------\nHIPOFISE1\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>Para podermos confirmar em qual container estamos conectados, podemos utilizar os comandos abaixo: Ou podemos utilizar o script SQL abaixo: Checando os PDBs existentes dentro do root: Para trocar o container, basta rodar o comando abaixo: Validando: Obs: Este procedimento foi criado pelo senhor Ahmed Baraka (www.ahmedbaraka.com) e foi apenas reproduzido por mim em um [&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-2528","post","type-post","status-publish","format-standard","hentry","category-multitenant"],"_links":{"self":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/2528","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=2528"}],"version-history":[{"count":1,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/2528\/revisions"}],"predecessor-version":[{"id":9243,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/2528\/revisions\/9243"}],"wp:attachment":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=2528"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=2528"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=2528"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}