Creating an Oracle Database from the seed using DBCA

Exportando o DISPLAY e abrindo o DBCA:

[oracle@oel8 ~]$ export DISPLAY=192.168.0.103:0.0
[oracle@oel8 ~]$ dbca &
[1] 3568

Manage Puggable databases:

Create:

Escolhendo o CDB que abrigará o PDB e informando credenciais:

Escolhendo o SEED:

Definindo nome do PDB e seu usuário de adminitração:

Manter opção de criação de uma tablespace padrão:

Sumário:

Progresso:

Sucesso:

Validando ambiente. Como o PDB foi criado via DBCA, o mesmo está aberto (diferente se fosse com SQL *Plus, onde deveria ser aberto manualmente):

[oracle@oel8 ~]$ sqlplus / as sysdba
 
SQL*Plus: Release 18.0.0.0.0 - Production on Mon Mar 8 05:07:23 2021
Version 18.3.0.0.0
 
Copyright (c) 1982, 2018, Oracle.  All rights reserved.
 
 
Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.0.0.0
 
SQL> col name format a10
SQL> SELECT NAME, CON_ID, OPEN_MODE, GUID FROM V$PDBS ORDER BY 1;
 
NAME           CON_ID OPEN_MODE  GUID
---------- ---------- ---------- --------------------------------
HIPOFISE1           3 MOUNTED    BCF7B920CA5C126AE0536B00A8C0B4F1
HIPOFISE2           4 READ WRITE BD02D62DBD0C163FE0536B00A8C0EF43
PDB$SEED            2 READ ONLY  BC8B772AA6A82204E0536B00A8C0CF6B
 
SQL>

Checando se o novo PDB foi registrado no listener:

[oracle@oel8 ~]$ ps -ef | grep lsnr
oracle    1841     1  0 04:44 ?        00:00:00 /oracle/18.0.0/product/bin/tnslsnr LISTENER -inherit
oracle    9421  3024  0 05:13 pts/0    00:00:00 grep --color=auto lsnr
[oracle@oel8 ~]$ lsnrctl service
 
LSNRCTL for Linux: Version 18.0.0.0.0 - Production on 08-MAR-2021 05:14:02
 
Copyright (c) 1991, 2018, Oracle.  All rights reserved.
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oel8.localdomain)(PORT=1521)))
Services Summary...
Service "TALAMO.localdomain" has 1 instance(s).
  Instance "TALAMO", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0 state:ready
         LOCAL SERVER
Service "TALAMOXDB.localdomain" has 1 instance(s).
  Instance "TALAMO", status READY, has 1 handler(s) for this service...
    Handler(s):
      "D000" established:0 refused:0 current:0 max:1022 state:ready
         DISPATCHER <machine: oel8.localdomain, pid: 2597>
         (ADDRESS=(PROTOCOL=tcp)(HOST=oel8.localdomain)(PORT=18101))
Service "bcf7b920ca5c126ae0536b00a8c0b4f1.localdomain" has 1 instance(s).
  Instance "TALAMO", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0 state:ready
         LOCAL SERVER
Service "bd02d62dbd0c163fe0536b00a8c0ef43.localdomain" has 1 instance(s).
  Instance "TALAMO", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0 state:ready
         LOCAL SERVER
Service "hipofise1.localdomain" has 1 instance(s).
  Instance "TALAMO", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0 state:ready
         LOCAL SERVER
Service "hipofise2.localdomain" has 1 instance(s).
  Instance "TALAMO", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0 state:ready
         LOCAL SERVER
The command completed successfully
[oracle@oel8 ~]$

Realizando a configuração no Net Service Name usando a ferramenta gráfica NETCA:

[oracle@oel8 admin]$ netca &
[1] 10065

Definindo o service name:

Fazendo teste:

Sucesso:

Finalizado:

Podemos perceber que uma nova string de conexão foi adicionada ao tnsnames.ora:

[oracle@oel8 admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /oracle/18.0.0/product/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
 
CORTEX =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oel7.localdomain)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = cortex.localdomain)
    )
  )
 
TALAMO =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oel8.localdomain)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = TALAMO.localdomain)
    )
  )
 
HIPOFISE2 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = oel8)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = hipofise2.localdomain)
    )
  )
 
HIPOFISE1 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = oel8.localdomain)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = HIPOFISE1.localdomain)
    )
  )
 
LISTENER_TALAMO =
  (ADDRESS = (PROTOCOL = TCP)(HOST = oel8.localdomain)(PORT = 1521))
 
 
[oracle@oel8 admin]$

Validando conexão:

[oracle@oel8 admin]$ sqlplus system/oracle@HIPOFISE2
 
SQL*Plus: Release 18.0.0.0.0 - Production on Mon Mar 8 05:23:40 2021
Version 18.3.0.0.0
 
Copyright (c) 1982, 2018, Oracle.  All rights reserved.
 
Last Successful login time: Mon Mar 08 2021 05:20:19 -03:00
 
Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.0.0.0
 
SQL>

Obs: Este procedimento foi criado pelo senhor Ahmed Baraka (www.ahmedbaraka.com) e foi apenas reproduzido por mim em um laboratório pessoal para fins de aprendizado.

1 thought on “Creating an Oracle Database from the seed using DBCA”

  1. Pingback: ALL options for creating a PDB using Create Puggable Database command – Bruno Santos da Silva

Leave a Comment

Your email address will not be published.