{"id":3418,"date":"2021-04-01T09:00:38","date_gmt":"2021-04-01T09:00:38","guid":{"rendered":"https:\/\/swiv.com.br\/dedicating-a-listener-to-a-pdb\/"},"modified":"2026-05-27T20:02:49","modified_gmt":"2026-05-27T19:02:49","slug":"dedicating-a-listener-to-a-pdb","status":"publish","type":"post","link":"https:\/\/swiv.com.br\/index.php\/2021\/04\/01\/dedicating-a-listener-to-a-pdb\/","title":{"rendered":"Dedicating a Listener to a PDB"},"content":{"rendered":"\n<p>Criando um PDB para os testes deste artigo:<\/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 Thu Apr 1 05:44:01 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; CREATE PLUGGABLE DATABASE HIPOFISE2\nADMIN USER BSS IDENTIFIED BY BSS\nDEFAULT TABLESPACE USERS;  2    3\n \nPluggable database created.\n<\/pre><\/div>\n\n\n<p>Criando um novo listener, editando o arquivo listener.ora:<\/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]$ pwd\n\/oracle\/18.0.0\/product\/network\/admin\n&#x5B;oracle@quiasma admin]$ cat listener.ora\n# listener.ora Network Configuration File: \/oracle\/18.0.0\/product\/network\/admin\/listener.ora\n# Generated by Oracle configuration tools.\n \nLISTENER =\n  (DESCRIPTION_LIST =\n    (DESCRIPTION =\n      (ADDRESS = (PROTOCOL = TCP)(HOST = quiasma.localdomain)(PORT = 1521))\n      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))\n    )\n  )\n \nLISTENER_HIPOFISE2 =\n  (DESCRIPTION_LIST =\n    (DESCRIPTION =\n      (ADDRESS = (PROTOCOL = TCP)(HOST = quiasma.localdomain)(PORT = 1525))\n      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1525))\n    )\n  )\n<\/pre><\/div>\n\n\n<p>Listener criado com sucesso:<\/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]$ ps -ef | grep lsnr\noracle    1834     1  0 03:54 ?        00:00:00 \/oracle\/18.0.0\/product\/bin\/tnslsnr LISTENER -inherit\noracle    5023  2849  0 05:46 pts\/0    00:00:00 grep --color=auto lsnr\n&#x5B;oracle@quiasma admin]$ lsnrctl start LISTENER_HIPOFISE2\n \nLSNRCTL for Linux: Version 18.0.0.0.0 - Production on 01-APR-2021 05:46:08\n \nCopyright (c) 1991, 2020, Oracle.  All rights reserved.\n \nStarting \/oracle\/18.0.0\/product\/bin\/tnslsnr: please wait...\n \nTNSLSNR for Linux: Version 18.0.0.0.0 - Production\nSystem parameter file is \/oracle\/18.0.0\/product\/network\/admin\/listener.ora\nLog messages written to \/oracle\/18.0.0\/base\/diag\/tnslsnr\/quiasma\/listener_hipofise2\/alert\/log.xml\nListening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=quiasma.localdomain)(PORT=1525)))\nListening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1525)))\n \nConnecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=quiasma.localdomain)(PORT=1525)))\nSTATUS of the LISTENER\n------------------------\nAlias                     LISTENER_HIPOFISE2\nVersion                   TNSLSNR for Linux: Version 18.0.0.0.0 - Production\nStart Date                01-APR-2021 05:46:08\nUptime                    0 days 0 hr. 0 min. 0 sec\nTrace Level               off\nSecurity                  ON: Local OS Authentication\nSNMP                      OFF\nListener Parameter File   \/oracle\/18.0.0\/product\/network\/admin\/listener.ora\nListener Log File         \/oracle\/18.0.0\/base\/diag\/tnslsnr\/quiasma\/listener_hipofise2\/alert\/log.xml\nListening Endpoints Summary...\n  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=quiasma.localdomain)(PORT=1525)))\n  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1525)))\nThe listener supports no services\nThe command completed successfully\n&#x5B;oracle@quiasma admin]$ ps -ef | grep lsnr\noracle    1834     1  0 03:54 ?        00:00:00 \/oracle\/18.0.0\/product\/bin\/tnslsnr LISTENER -inherit\noracle    5029     1  1 05:46 ?        00:00:00 \/oracle\/18.0.0\/product\/bin\/tnslsnr LISTENER_HIPOFISE2 -inherit\noracle    5042  2849  0 05:46 pts\/0    00:00:00 grep --color=auto lsnr\n<\/pre><\/div>\n\n\n<p>Adicionando o Net Alias no arquivo tnsnames.ora:<\/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]$ pwd\n\/oracle\/18.0.0\/product\/network\/admin\n&#x5B;oracle@quiasma admin]$ cat tnsnames.ora\n# tnsnames.ora Network Configuration File: \/oracle\/18.0.0\/product\/network\/admin\/tnsnames.ora\n# Generated by Oracle configuration tools.\n \nTALAMO =\n  (DESCRIPTION =\n    (ADDRESS = (PROTOCOL = TCP)(HOST = quiasma.localdomain)(PORT = 1521))\n    (CONNECT_DATA =\n      (SERVER = DEDICATED)\n      (SERVICE_NAME = TALAMO.localdomain)\n    )\n  )\n \nLISTENER_TALAMO =\n  (ADDRESS = (PROTOCOL = TCP)(HOST = quiasma.localdomain)(PORT = 1521))\n \nHIPOFISE2 =\n  (DESCRIPTION =\n    (ADDRESS_LIST =\n        (ADDRESS = (PROTOCOL = TCP)(HOST = quiasma.localdomain)(PORT = 1525))\n        )\n    (CONNECT_DATA =\n      (SERVER = DEDICATED)\n      (SERVICE_NAME = HIPOFISE2.localdomain)\n    )\n  )\n \nLISTENER_HIPOFISE2 =\n  (ADDRESS = (PROTOCOL = TCP)(HOST = quiasma.localdomain)(PORT = 1525))\n<\/pre><\/div>\n\n\n<p>Definindo o par\u00e2metro LISTENER_NETWORKS no n\u00edvel do 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; ALTER PLUGGABLE DATABASE HIPOFISE2 OPEN\n  2  ;\n \nPluggable database altered.\n \nSQL&gt; ALTER PLUGGABLE DATABASE HIPOFISE2 SAVE STATE;\n \nPluggable database altered.\n \nSQL&gt; ALTER SESSION SET CONTAINER=HIPOFISE2;\n \nSession altered.\n \nSQL&gt; ALTER SYSTEM SET LISTENER_NETWORKS=&#039;((NAME=PDB_NETWORK1) (LOCAL_LISTENER=LISTENER_HIPOFISE2))&#039; SCOPE=BOTH;\n \nSystem altered.\n<\/pre><\/div>\n\n\n<p>Checando o status do novo listener:<\/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; !lsnrctl status LISTENER_HIPOFISE2\n \nLSNRCTL for Linux: Version 18.0.0.0.0 - Production on 01-APR-2021 05:56:03\n \nCopyright (c) 1991, 2020, Oracle.  All rights reserved.\n \nConnecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=quiasma.localdomain)(PORT=1525)))\nSTATUS of the LISTENER\n------------------------\nAlias                     LISTENER_HIPOFISE2\nVersion                   TNSLSNR for Linux: Version 18.0.0.0.0 - Production\nStart Date                01-APR-2021 05:46:08\nUptime                    0 days 0 hr. 9 min. 54 sec\nTrace Level               off\nSecurity                  ON: Local OS Authentication\nSNMP                      OFF\nListener Parameter File   \/oracle\/18.0.0\/product\/network\/admin\/listener.ora\nListener Log File         \/oracle\/18.0.0\/base\/diag\/tnslsnr\/quiasma\/listener_hipofise2\/alert\/log.xml\nListening Endpoints Summary...\n  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=quiasma.localdomain)(PORT=1525)))\n  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1525)))\nServices Summary...\nService &quot;bee63bf16abf136de0536a00a8c07d35.localdomain&quot; has 1 instance(s).\n  Instance &quot;TALAMO&quot;, status READY, has 2 handler(s) for this service...\nService &quot;hipofise2.localdomain&quot; has 1 instance(s).\n  Instance &quot;TALAMO&quot;, status READY, has 2 handler(s) for this service...\nThe command completed successfully\n<\/pre><\/div>\n\n\n<p>Realizando conex\u00e3o ao PDB utilizando o servi\u00e7o via TNS:<\/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 BSS\/BSS@HIPOFISE2\n \nSQL*Plus: Release 18.0.0.0.0 - Production on Thu Apr 1 05:57:20 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;\n<\/pre><\/div>\n\n\n<p>Via easy connect:<\/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 BSS\/BSS@\/\/quiasma:1525\/hipofise2.localdomain\n \nSQL*Plus: Release 18.0.0.0.0 - Production on Thu Apr 1 05:58:16 2021\nVersion 18.13.0.0.0\n \nCopyright (c) 1982, 2018, Oracle.  All rights reserved.\n \nLast Successful login time: Thu Apr 01 2021 05:57:20 -03:00\n \nConnected to:\nOracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production\nVersion 18.13.0.0.0\n \nSQL&gt;\n<\/pre><\/div>\n\n\n<p>Removendo o PDB e listener, pois n\u00e3o os usarei mais:<\/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 Thu Apr 1 05:58:53 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 PLUGGABLE DATABASE HIPOFISE2 CLOSE IMMEDIATE;\n \nPluggable database altered.\n \nSQL&gt; DROP PLUGGABLE DATABASE HIPOFISE2 INCLUDING DATAFILES;\n \nPluggable database dropped.\n \nSQL&gt; exit\nDisconnected from Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production\nVersion 18.13.0.0.0\n&#x5B;oracle@quiasma admin]$ lsnrctl stop LISTENER_HIPOFISE2\n \nLSNRCTL for Linux: Version 18.0.0.0.0 - Production on 01-APR-2021 05:59:41\n \nCopyright (c) 1991, 2020, Oracle.  All rights reserved.\n \nConnecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=quiasma.localdomain)(PORT=1525)))\nThe command completed successfully\n&#x5B;oracle@quiasma admin]$\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>Criando um PDB para os testes deste artigo: Criando um novo listener, editando o arquivo listener.ora: Listener criado com sucesso: Adicionando o Net Alias no arquivo tnsnames.ora: Definindo o par\u00e2metro LISTENER_NETWORKS no n\u00edvel do PDB: Checando o status do novo listener: Realizando conex\u00e3o ao PDB utilizando o servi\u00e7o via TNS: Via easy connect: Removendo 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-3418","post","type-post","status-publish","format-standard","hentry","category-multitenant"],"_links":{"self":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/3418","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=3418"}],"version-history":[{"count":1,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/3418\/revisions"}],"predecessor-version":[{"id":9193,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/3418\/revisions\/9193"}],"wp:attachment":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=3418"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=3418"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=3418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}