- Login on docker with Oracle registry for pull the image
docker login container-registry.oracle.com2. Pull the enterprise image from the Oracle Registry site
docker pull container-registry.oracle.com/database/enterprise:latestexample:ubuntu01@ubuntu01-VirtualBox:~/Desktop$ docker pull container-registry.oracle.com/database/enterprise:latestlatest: Pulling from database/enterprised480f047babc: Pulling fs layer 41fec24cd635: Pulling fs layer 26914f5ddca6: Pulling fs layer ----------b153cc74d7e: Pull complete f1d3ae666fec: Pull complete 0914dfef6d23: Pull complete 989a99cbd1fd: Pull complete 0c1525f69360: Pull complete Digest: sha256:224c51ce1555ff7b75882a84b621c52b6d5ece00c96b0c5cd84e667333ad5cd7Status: Downloaded newer image for container-registry.oracle.com/database/enterprise:latestcontainer-registry.oracle.com/database/enterprise:latestAfter download the images of Oracle EE edition in Docker, I will create two container from which one is used as Primary database and second is Standby database.
- Container 1 → Primary DB
- Container 2 → Standby DB
- Same Docker host or different hosts with network access
Example:
| Role | Container | DB Name | Hostname |
|---|---|---|---|
| Primary | oracle-primary | ORCL | primary |
| Standby | oracle-standby | ORCL | standby |
Step 3: Create a docker network
Note: Both containers must communicate.#docker network create oracle-netExample:ubuntu01@ubuntu01-VirtualBox:~/Desktop$ docker network create oracle-net6521bbfd072f9b3e95f080c9ba79b02a82358ac594be36c826362f013c270457Step 4: Create docker volume used by Primary and Standby database
docker volume create primary_oradatadocker volume create standby_oradataExample:ubuntu01@ubuntu01-VirtualBox:~/Desktop$ docker volume create primary_oradataprimary_oradataubuntu01@ubuntu01-VirtualBox:~/Desktop$ docker volume create standby_oradatastandby_oradataStep 5: Verify the volumnes and network
ubuntu01@ubuntu01-VirtualBox:~/Desktop$ docker volume lsDRIVER VOLUME NAMElocal 1a28799731415b24072a5955b0547c727b3133aa82f717fd3b7205b22ecfeb9dlocal 9e80451532d8baa39ea981df5ae6804e20e146a464ae7a819290f8b61134aea8local 39b57a53196b8782f11769a27b6c83100a47994efc51a3184c44d8cd70f4ea99local 46e60a1173d0315167cc6f4ca2f99b33674ac84e8417cf0fe3220268e6633f7blocal 70ed0e47878140ec6d1d5d93c97a7362ff8124344890ae331f74b021f6d005e7local 35780d8b81fe3e283d2385e0cb0ea87c63b70b5f587c8b7da491dd93a94fcfdclocal ORACLE_DATAlocal primary_oradatalocal standby_oradataubuntu01@ubuntu01-VirtualBox:~/Desktop$ docker network lsNETWORK ID NAME DRIVER SCOPE1d0052991f64 bridge bridge local11f5361c20ae host host local4f350cd06c59 none null local6521bbfd072f oracle-net bridge localStep 6: Start the container with Volume and with following setting:
Explanation:
| Option | Purpose |
|---|---|
-v primary_oradata:/opt/oracle/oradata | Stores DB files in volume |
--network oracle-net | Enables container communication |
--hostname primary | Used in TNS configuration |
Command:docker run -d \--name oracle-primary \--hostname primary \--network oracle-net \-p 1521:1521 \-v primary_oradata:/opt/oracle/oradata \-e ORACLE_SID=ORCL \-e ORACLE_PDB=ORCLPDB1 \-e ORACLE_PWD=Oracle123 \-e ENABLE_ARCHIVELOG=true \container-registry.oracle.com/database/enterprise:latestExample:
ubuntu01@ubuntu01-VirtualBox:~/Desktop$ docker run -d \--name oracle-primary \--hostname primary \--network oracle-net \-p 1521:1521 \-v primary_oradata:/opt/oracle/oradata \-e ORACLE_SID=ORCL \-e ORACLE_PDB=ORCLPDB1 \-e ORACLE_PWD=Oracle123 \-e ENABLE_ARCHIVELOG=true \container-registry.oracle.com/database/enterprise:latest2bf9547103361dc36fb902683ef77e538d35f876b5340595c3ae2110d922982fStep 7: Run the Standby database container with volume
docker run -d \--name oracle-standby \--hostname standby \--network oracle-net \-p 1522:1521 \-v standby_oradata:/opt/oracle/oradata \-e ORACLE_SID=ORCL \-e ORACLE_PDB=ORCLPDB1 \-e ORACLE_PWD=Oracle123 \-e ENABLE_ARCHIVELOG=true \container-registry.oracle.com/database/enterprise:latestExample:
ubuntu01@ubuntu01-VirtualBox:~/Desktop$ docker run -d \--name oracle-standby \--hostname standby \--network oracle-net \-p 1522:1521 \-v standby_oradata:/opt/oracle/oradata \-e ORACLE_SID=ORCL \-e ORACLE_PDB=ORCLPDB1 \-e ORACLE_PWD=Oracle123 \-e ENABLE_ARCHIVELOG=true \container-registry.oracle.com/database/enterprise:latest07a7b7ee0072da48957f5a07143c484105360a9d9d265030622cfac87a9f349dStep 8: Verify that both container are creating or any error by logs command:
ubuntu01@ubuntu01-VirtualBox:~/Desktop$ docker logs oracle-primary[2026:03:16 05:41:50]: Acquiring lock .ORCL.create_lck with heartbeat 30 secs[2026:03:16 05:41:50]: Lock acquired[2026:03:16 05:41:50]: Starting heartbeat[2026:03:16 05:41:50]: Lock held .ORCL.create_lckORACLE EDITION: ENTERPRISEPrepare for db operation8% completeCopying database files------------#########################DATABASE IS READY TO USE!#########################The following output is now a tail of the alert.log:2026-03-16T05:58:05.075715+00:00ORCLPDB1(3):CREATE BIGFILE TABLESPACE "USERS" LOGGING DATAFILE SIZE 7M AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTOORCLPDB1(3):Tablespace created: USERS ts# 6ORCLPDB1(3):Completed: CREATE BIGFILE TABLESPACE "USERS" LOGGING DATAFILE SIZE 7M AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTOORCLPDB1(3):ALTER DATABASE DEFAULT TABLESPACE "USERS"ORCLPDB1(3):Completed: ALTER DATABASE DEFAULT TABLESPACE "USERS"2026-03-16T05:58:09.017017+00:00ALTER SYSTEM SET local_listener='' SCOPE=BOTH;ALTER PLUGGABLE DATABASE ORCLPDB1 SAVE STATECompleted: ALTER PLUGGABLE DATABASE ORCLPDB1 SAVE STATEubuntu01@ubuntu01-VirtualBox:~/Desktop$ docker logs oracle-standby[2026:03:16 05:45:12]: Acquiring lock .ORCL.create_lck with heartbeat 30 secs[2026:03:16 05:45:12]: Lock acquired[2026:03:16 05:45:12]: Starting heartbeat[2026:03:16 05:45:12]: Lock held .ORCL.create_lckORACLE EDITION: ENTERPRISENote: When you see in the log that database is ready to use then you can use continue with following steps:
Step 9: We need to wait until both database are come in open state:
-- Check the primary database first:ubuntu01@ubuntu01-VirtualBox:~/Desktop$ docker exec -it oracle-primary bashbash-4.4$ sqlplus / as sysdbaSQL*Plus: Release 23.26.1.0.0 - Production on Mon Mar 16 05:48:15 2026Version 23.26.1.0.0Copyright (c) 1982, 2025, Oracle. All rights reserved.Connected to:Oracle AI Database 26ai Enterprise Edition Release 23.26.1.0.0 - ProductionVersion 23.26.1.0.0SQL> select status from v$instance;STATUS------------OPENStep 10: Check the database in Archive mode
archive log list;ubuntu01@ubuntu01-VirtualBox:~/Desktop$ docker exec -it oracle-primary bashbash-4.4$ sqlplus / as sysdbaSQL*Plus: Release 23.26.1.0.0 - Production on Mon Mar 16 06:26:15 2026Version 23.26.1.0.0Copyright (c) 1982, 2025, Oracle. All rights reserved.Connected to:Oracle AI Database 26ai Enterprise Edition Release 23.26.1.0.0 - ProductionVersion 23.26.1.0.0SQL> archive log list;Database log mode Archive ModeAutomatic archival EnabledArchive destination /opt/oracle/oradata/ORCL/archive_logsOldest online log sequence 2Next log sequence to archive 2Current log sequence 1Step 11: Put the primary database container to force logging mode.
SQL> alter database force logging;Database altered.Step 12: Create standby redo log files in Primary database container:
-- Check the Redo Logs files present:set line 200 pages 200col file_name for a60SELECT a.GROUP#,(a.BYTES/1024/1024) AS SIZE_MB, b.MEMBER AS FILE_NAMEFROM v$log a JOIN v$logfile b ON a.Group#=b.Group#ORDER BY a.GROUP#;Example:SQL> set line 200 pages 200col file_name for a60SELECT a.GROUP#,(a.BYTES/1024/1024) AS SIZE_MB, b.MEMBER AS FILE_NAMEFROM v$log a JOIN v$logfile b ON a.Group#=b.Group#ORDER BY a.GROUP#;SQL> SQL> 2 3 GROUP# SIZE_MB FILE_NAME---------- ---------- ------------------------------------------------------------ 1 200 /opt/oracle/oradata/ORCL/onlinelog/o1_mf_1_nvh6dmgp_.log 2 200 /opt/oracle/oradata/ORCL/onlinelog/o1_mf_2_nvh6dmvb_.log 3 200 /opt/oracle/oradata/ORCL/onlinelog/o1_mf_3_nvh6dnxl_.logAdd the standby log files:
alter database add standby logfile group 4 ('/opt/oracle/oradata/ORCL/srl04.log') size 200M;alter database add standby logfile group 5 ('/opt/oracle/oradata/ORCL/srl05.log') size 200M;alter database add standby logfile group 6 ('/opt/oracle/oradata/ORCL/srl06.log') size 200M;alter database add standby logfile group 7 ('/opt/oracle/oradata/ORCL/srl07.log') size 200M;Verify the standby redo log files:SQL> SELECT GROUP#, THREAD#, SEQUENCE#, BYTES, ARCHIVED, STATUS FROM V$STANDBY_LOG ORDER BY THREAD#, GROUP#; GROUP# THREAD# SEQUENCE# BYTES ARC STATUS---------- ---------- ---------- ---------- --- ---------- 4 0 0 209715200 YES UNASSIGNED 5 0 0 209715200 YES UNASSIGNED 6 0 0 209715200 YES UNASSIGNED 7 0 0 209715200 YES UNASSIGNEDStep 13: Configure the TNSNAMES.ora file for both Primary and Standby entry
vi /opt/oracle/product/26ai/dbhome_1/network/admin/tnsnames.oraPRIMARY = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = primary)(PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = ORCL) ) )STANDBY = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = standby)(PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = ORCL) ) )Test the ping command:
bash-4.4$ tnsping standbyTNS Ping Utility for Linux: Version 23.26.1.0.0 - Production on 16-MAR-2026 07:13:59Copyright (c) 1997, 2026, Oracle. All rights reserved.Used parameter files:/opt/oracle/product/26ai/dbhome_1/network/admin/sqlnet.oraUsed TNSNAMES adapter to resolve the aliasAttempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = standby)(PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = ORCL)))OK (10 msec)bash-4.4$ tnsping primaryTNS Ping Utility for Linux: Version 23.26.1.0.0 - Production on 16-MAR-2026 07:14:48Copyright (c) 1997, 2026, Oracle. All rights reserved.Used parameter files:/opt/oracle/product/26ai/dbhome_1/network/admin/sqlnet.oraUsed TNSNAMES adapter to resolve the aliasAttempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = primary)(PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = ORCL)))OK (10 msec)Note: Both the machine run on docker at time of testing.
Step 14: Add the Dataguard parameter on the primary container:
alter system set db_unique_name=PRIMARY scope=spfile;-- After setting first parameter need to reboot the Primary container# Docker stop oracle-primary# Docker start oracle-primaryalter system set log_archive_config='DG_CONFIG=(PRIMARY,STANDBY)' scope=both;alter system set log_archive_dest_1='LOCATION=/opt/oracle/oradata/ORCL/archive_logs VALID_FOR=(ALL_LOGFILES,ALL_ROLES DB_UNIQUE_NAME=PRIMARY' scope=both;alter system set log_archive_dest_2='SERVICE=STANDBY ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=STANDBY' scope=both;alter system set standby_file_management=AUTO scope=both;alter system set fal_server=STANDBY scope=both;alter system set fal_client=PRIMARY scope=both;Prepare the Standby Database:
Step 15: Open the Standby database in nomount state:
ubuntu01@ubuntu01-VirtualBox:~/Desktop$ docker exec -it oracle-standby bashbash-4.4$ sqlplus / as sysdbaSQL*Plus: Release 23.26.1.0.0 - Production on Mon Mar 16 07:29:01 2026Version 23.26.1.0.0Copyright (c) 1982, 2025, Oracle. All rights reserved.Connected to:Oracle AI Database 26ai Enterprise Edition Release 23.26.1.0.0 - ProductionVersion 23.26.1.0.0SQL> shutdown immediate;Database closed.Database dismounted.ORACLE instance shut down.SQL> startup nomountORACLE instance started.Total System Global Area 1607700512 bytesFixed Size 5009440 bytesVariable Size 452984832 bytesDatabase Buffers 1140850688 bytesRedo Buffers 8855552 bytesSQL> Step 16: Configure the TNSNAMES.ORA for both entry in Standby Database Server or Container. Check the path of network folder from lsnrctl status command
vi /opt/oracle/product/26ai/dbhome_1/network/admin/tnsnames.oraEnter the following entries:PRIMARY = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = primary)(PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = ORCL) ) )STANDBY = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = standby)(PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = ORCL) ) )Verify the tnsping command for both
bash-4.4$ tnsping standbyTNS Ping Utility for Linux: Version 23.26.1.0.0 - Production on 16-MAR-2026 07:41:40Copyright (c) 1997, 2026, Oracle. All rights reserved.Used parameter files:/opt/oracle/product/26ai/dbhome_1/network/admin/sqlnet.oraUsed EZCONNECT adapter to resolve the aliasAttempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=tcp)(HOST=172.18.0.3)(PORT=1521)))OK (0 msec)bash-4.4$ tnsping primary TNS Ping Utility for Linux: Version 23.26.1.0.0 - Production on 16-MAR-2026 07:47:13Copyright (c) 1997, 2026, Oracle. All rights reserved.Used parameter files:/opt/oracle/product/26ai/dbhome_1/network/admin/sqlnet.oraUsed EZCONNECT adapter to resolve the aliasAttempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=tcp)(HOST=172.18.0.2)(PORT=1521)))OK (0 msec)Step 17: Empty the standby by ORCL folder
rm -rf /opt/oracle/oradata/ORCL/
Step 18: Run the RMAN backup for duplicate command to create a standby database as primary
rman target sys/Oracle123@PRIMARY auxiliary sys/Oracle123@STANDBYRMAN> duplicate target databasefor standbyfrom active databasedorecoverno filenamecheck;Example:
RMAN> duplicate target database
for standby
from active database
dorecover
no filenamecheck;duplicate target database
2> for standby
3> from active database
4> dorecover
;
;
Starting Duplicate Db at 16-MAR-26
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=146 device type=DISK
^C
user interrupt received
Oracle error from target database:
ORA-16038: log 3 sequence# 3 cannot be archived
ORA-01013: User requested cancel of current operation.
ORA-00312: online log 3 thread 1: '/opt/oracle/oradata/ORCL/onlinelog/o1_mf_3_nvh6dnxl_.log'
Help: https://docs.oracle.com/error-help/db/ora-16038/
contents of Memory Script:
{
backup as copy reuse
passwordfile auxiliary format '/opt/oracle/product/26ai/dbhome_1/dbs/orapwORCL' ;
}
executing Memory Script
Starting backup at 16-MAR-26
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=38 device type=DISK
Finished backup at 16-MAR-26
duplicating Online logs to Oracle Managed File (OMF) location
duplicating Datafiles to Oracle Managed File (OMF) location
contents of Memory Script:
{
sql clone "alter system set control_files =
''/opt/oracle/oradata/ORCL/controlfile/o1_mf_nvhcm95q_.ctl'' comment=
''Set by RMAN'' scope=spfile";
restore clone from service 'PRIMARY' standby controlfile;
}
executing Memory Script
sql statement: alter system set control_files = ''/opt/oracle/oradata/ORCL/controlfile/o1_mf_nvhcm95q_.ctl'' comment= ''Set by RMAN'' scope=spfile
Starting restore at 16-MAR-26
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service PRIMARY
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02
output file name=/opt/oracle/oradata/ORCL/controlfile/o1_mf_nvhcm95q_.ctl
Finished restore at 16-MAR-26
contents of Memory Script:
{
sql clone 'alter database mount standby database';
}
executing Memory Script
sql statement: alter database mount standby database
contents of Memory Script:
{
set newname for clone tempfile 1 to new;
set newname for clone tempfile 2 to new;
set newname for clone tempfile 3 to new;
switch clone tempfile all;
set newname for clone datafile 1 to new;
set newname for clone datafile 2 to new;
set newname for clone datafile 3 to new;
set newname for clone datafile 4 to new;
set newname for clone datafile 7 to new;
set newname for clone datafile 9 to new;
set newname for clone datafile 11 to new;
set newname for clone datafile 12 to new;
set newname for clone datafile 13 to new;
set newname for clone datafile 14 to new;
set newname for clone datafile 15 to new;
restore
from nonsparse from service
'PRIMARY' clone database
;
sql 'alter system archive log current';
}
executing Memory Script
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
renamed tempfile 1 to /opt/oracle/oradata/ORCL/datafile/o1_mf_temp_%u_.tmp in control file
renamed tempfile 2 to /opt/oracle/oradata/ORCL/48945B67D122C623E063399B5E6478E6/datafile/o1_mf_temp_%u_.tmp in control file
renamed tempfile 3 to /opt/oracle/oradata/ORCL/4D1EE33C748411B2E063020012AC5D89/datafile/o1_mf_temp_%u_.tmp in control file
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 16-MAR-26
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service PRIMARY
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /opt/oracle/oradata/ORCL/datafile/o1_mf_system_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:25
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service PRIMARY
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00002 to /opt/oracle/oradata/ORCL/48945B67D122C623E063399B5E6478E6/datafile/o1_mf_system_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service PRIMARY
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00003 to /opt/oracle/oradata/ORCL/datafile/o1_mf_sysaux_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service PRIMARY
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00004 to /opt/oracle/oradata/ORCL/48945B67D122C623E063399B5E6478E6/datafile/o1_mf_sysaux_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service PRIMARY
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00007 to /opt/oracle/oradata/ORCL/datafile/o1_mf_users_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service PRIMARY
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00009 to /opt/oracle/oradata/ORCL/48945B67D122C623E063399B5E6478E6/datafile/o1_mf_undotbs1_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service PRIMARY
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00011 to /opt/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service PRIMARY
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00012 to /opt/oracle/oradata/ORCL/4D1EE33C748411B2E063020012AC5D89/datafile/o1_mf_system_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service PRIMARY
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00013 to /opt/oracle/oradata/ORCL/4D1EE33C748411B2E063020012AC5D89/datafile/o1_mf_sysaux_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service PRIMARY
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00014 to /opt/oracle/oradata/ORCL/4D1EE33C748411B2E063020012AC5D89/datafile/o1_mf_undotbs1_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service PRIMARY
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00015 to /opt/oracle/oradata/ORCL/4D1EE33C748411B2E063020012AC5D89/datafile/o1_mf_users_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 16-MAR-26
sql statement: alter system archive log current
current log archived
contents of Memory Script:
{
restore clone force from service 'PRIMARY'
archivelog from scn 2086240;
switch clone datafile all;
}
executing Memory Script
Starting restore at 16-MAR-26
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service PRIMARY
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=3
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service PRIMARY
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=4
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service PRIMARY
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=5
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 16-MAR-26
datafile 1 switched to datafile copy
input datafile copy RECID=12 STAMP=1228044450 file name=/opt/oracle/oradata/ORCL/datafile/o1_mf_system_nvht6kkv_.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=13 STAMP=1228044450 file name=/opt/oracle/oradata/ORCL/48945B67D122C623E063399B5E6478E6/datafile/o1_mf_system_nvht7c4v_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=14 STAMP=1228044450 file name=/opt/oracle/oradata/ORCL/datafile/o1_mf_sysaux_nvht7lbt_.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=15 STAMP=1228044450 file name=/opt/oracle/oradata/ORCL/48945B67D122C623E063399B5E6478E6/datafile/o1_mf_sysaux_nvht81oc_.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=16 STAMP=1228044450 file name=/opt/oracle/oradata/ORCL/datafile/o1_mf_users_nvht88x8_.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=17 STAMP=1228044450 file name=/opt/oracle/oradata/ORCL/48945B67D122C623E063399B5E6478E6/datafile/o1_mf_undotbs1_nvht8b4h_.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=18 STAMP=1228044450 file name=/opt/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_nvht8cfv_.dbf
datafile 12 switched to datafile copy
input datafile copy RECID=19 STAMP=1228044450 file name=/opt/oracle/oradata/ORCL/4D1EE33C748411B2E063020012AC5D89/datafile/o1_mf_system_nvht8dp9_.dbf
datafile 13 switched to datafile copy
input datafile copy RECID=20 STAMP=1228044450 file name=/opt/oracle/oradata/ORCL/4D1EE33C748411B2E063020012AC5D89/datafile/o1_mf_sysaux_nvht8myn_.dbf
datafile 14 switched to datafile copy
input datafile copy RECID=21 STAMP=1228044450 file name=/opt/oracle/oradata/ORCL/4D1EE33C748411B2E063020012AC5D89/datafile/o1_mf_undotbs1_nvht8v7k_.dbf
datafile 15 switched to datafile copy
input datafile copy RECID=22 STAMP=1228044450 file name=/opt/oracle/oradata/ORCL/4D1EE33C748411B2E063020012AC5D89/datafile/o1_mf_users_nvht8wdz_.dbf
contents of Memory Script:
{
set until scn 2103559;
recover
standby
clone database
delete archivelog
;
}
executing Memory Script
executing command: SET until clause (SCN)
Starting recover at 16-MAR-26
using channel ORA_AUX_DISK_1
starting media recovery
archived log for thread 1 with sequence 4 is already on disk as file /opt/oracle/oradata/ORCL/archive_logs1_4_1228024083.dbf
archived log for thread 1 with sequence 5 is already on disk as file /opt/oracle/oradata/ORCL/archive_logs1_5_1228024083.dbf
recovery status time_needed 2026-03-16 11:25:57
archived log file name=/opt/oracle/oradata/ORCL/archive_logs1_4_1228024083.dbf thread=1 sequence=4
recovery status time_needed 2026-03-16 11:27:25
archived log file name=/opt/oracle/oradata/ORCL/archive_logs1_5_1228024083.dbf thread=1 sequence=5
media recovery complete, elapsed time: 00:00:01
Finished recover at 16-MAR-26
contents of Memory Script:
{
delete clone force archivelog all;
}
executing Memory Script
released channel: ORA_DISK_1
released channel: ORA_AUX_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=38 device type=DISK
deleted archived log
archived log file name=/opt/oracle/oradata/ORCL/archive_logs1_3_1228024083.dbf RECID=1 STAMP=1228044446
deleted archived log
archived log file name=/opt/oracle/oradata/ORCL/archive_logs1_4_1228024083.dbf RECID=2 STAMP=1228044447
deleted archived log
archived log file name=/opt/oracle/oradata/ORCL/archive_logs1_5_1228024083.dbf RECID=3 STAMP=1228044449
Deleted 3 objects
Finished Duplicate Db at 16-MAR-26
RMAN>
Set the parameter on Standby database:
alter system set db_file_name_convert='/opt/oracle/oradata/ORCL','/opt/oracle/oradata/ORCL'; alter system set log_file_name_convert='/opt/oracle/oradata/ORCL','/opt/oracle/oradata/ORCL'; alter system set log_archive_config='DG_CONFIG=(PRIMARY,STANDBY)' scope=both;alter system set log_archive_dest_1='LOCATION=/opt/oracle/oradata/ORCL/archive_logs VALID_FOR=(ALL_LOGFILES,ALL_ROLES DB_UNIQUE_NAME=STANDBY' scope=both;alter system set log_archive_dest_2='SERVICE=PRIMARY ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=PRIMARY' scope=both; alter system set fal_server=PRIMARY scope=both;alter system set fal_client=STANDBY scope=both;alter system set standby_file_management='AUTO' scope=both;Start the replication service of dataguard:
alter database recover managed standby database disconnect from session;Select name,open_mode,database_role from v$database;I am facing challegne in docker for passward files to copy paste and keep it same permission in the image here is the solution
-- Create a new password file with format specify on primary databaseorapwd file=/opt/oracle/product/26ai/dbhome_1/dbs/orapwORCL password=Someone#369 format=12-- Copy paste the password file to host machine where docker running then move to standby docker containerdocker cp oracle-primary:/opt/oracle/product/26ai/dbhome_1/dbs/orapwORCL .-- Copy from host machine to standby machinedocker cp orapwORCL oracle-standby:/opt/oracle/product/26ai/dbhome_1/dbs/-- now change the owner and group as it is presnet for old filesdocker exec -u root oracle-standby chown oracle:dba /opt/oracle/product/26ai/dbhome_1/dbs/orapwORCL-- now change the owner and group for primary docker exec -u root oracle-primary chown oracle:dba /opt/oracle/product/26ai/dbhome_1/dbs/orapwORCL-- Now down both the machinedocker stop oracle-standbydocker stop oracle-primarydocker start oracle-primarydocker start oracle-standby-- Start the recovery processes:ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;Example:
ubuntu01@ubuntu01-VirtualBox:~/Desktop$ docker run -d \--name oracle-standby \--hostname standby \--network oracle-net \-p 1522:1521 \-v standby_oradata:/opt/oracle/oradata \-e ORACLE_SID=ORCL \-e ORACLE_PDB=ORCLPDB1 \-e ORACLE_PWD=Oracle123 \-e ENABLE_ARCHIVELOG=true \container-registry.oracle.com/database/enterprise:latested6030c2145838f5902fd6dbccbcb7a0a450f2ff6bfe2f94d3c39b75101bac7cubuntu01@ubuntu01-VirtualBox:~/Desktop$Step 8: Verify the containers:
docker psExample:
ubuntu01@ubuntu01-VirtualBox:~/Desktop$ docker psCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMESed6030c21458 container-registry.oracle.com/database/enterprise:latest "/bin/sh -c 'exec $O…" About a minute ago Up About a minute (health: starting) 0.0.0.0:1522->1521/tcp, [::]:1522->1521/tcp oracle-standby57712a13a506 container-registry.oracle.com/database/enterprise:latest "/bin/sh -c 'exec $O…" 3 minutes ago Up 3 minutes (health: starting) 0.0.0.0:1521->1521/tcp, [::]:1521->1521/tcp oracle-primaryNote: Both containers are running the same version
Step 9: Enter the primary container
docker exec -it oracle-primary bashLogin with SQLPLUSsqlplus / as sysdbaStep 10: Enable the archive mode in Primary Container
shutdown immediate;startup mount;alter database archivelog;alter database open;Archive log list;