viernes, 9 de mayo de 2025

Clonando un Contenedor de Base de datos en Oracle 19c utilizando DBCA en modo silencioso.

Necesitas clonar un contenedor de base de datos, desde otro contenedor en el mismo servidor, de la manera más simple posible.?

Tienes un CDB con el nombre CDB1 y deseas clonar todo el container database (o sea incluyendo todos los PDBs existentes) a CDB2 y no cuentas con ambiente gráfico para simplificar la tarea con DBCA.


Hazlo sencillo con el modo "-silent" desde tu terminal de ssh.

Vamos a crear el archivo duplicate_cdb_silent.sh con el siguiente contenido.


dbca -silent \
-createDuplicateDB \
-gdbName cdb2 \
-primaryDBConnectionString "localhost:1521/cdb1" \
-sid cdb2 \
-sysPassword oracle

Certificado con Oracle Database 19c E.E. 19.27 y todos los prerequisitos previos.

sh duplicate_cdb_silent.sh

[WARNING] [DBT-10331] Specified SID Name (cdb2) may have a potential conflict with an already existing database on the system.

CAUSE: The specified SID Name without the trailing numeric characters ({2}) may have a potential conflict with an already existing database on the system.

ACTION: Specify a different SID Name that does not conflict with existing databases on the system.

Prepare for db operation
22% complete
Listener config step
44% complete
Auxiliary instance creation
67% complete
RMAN duplicate
89% complete
Post duplicate database operations
100% complete

[oracle@taller-capacitacion-111797 scripts]$ lsnrctl status
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 10-MAY-2025 01:06:59
Copyright (c) 1991, 2025, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=taller-capacitacion-111797.)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 06-MAY-2025 00:42:52
Uptime 4 days 0 hr. 24 min. 7 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF

Listener Parameter File /opt/app/oracle/product/19c/network/admin/listener.ora
Listener Log File /opt/app/oracle/diag/tnslsnr/taller-capacitacion-111797/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=taller-capacitacion-111797.)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
...
Instance "cdb", status READY, has 1 handler(s) for this service...
Service "86b637b62fdf7a65e053f706e80a27ca." has 2 instance(s).
Instance "cdb", status READY, has 1 handler(s) for this service
...
Service "cdb2." has 1 instance(s).
Instance "cdb.", status READY, has 1 handler(s) for this service...
Service "cdbXDB." has 2 instance(s).
Instance "cdb", status READY, has 1 handler(s) for this service...
Instance "cdb2", status READY, has 1 handler(s) for this service...
....
Instance "cdb", status READY, has 1 handler(s) for this service...
The command completed successfully

No hay comentarios:

Publicar un comentario

Te agradezco tus comentarios. Te esperamos de vuelta.

Todos los Sábados a las 8:00PM