...
5. Create a directory on the primary and standby server where the full backup of the database can be kept. In this example /u02/app/oracle/dbvisit_backup will be used.
On the primary server:
1. Set the Oracle environment
...
Do this on the production database (with the oraenv command in Linux/UNIX) - in the example the database is called "devdbMEGA":
Code Block |
---|
[oracle@czlin0211 oracle]$ . oraenv ORACLE_SID = [MEGA] ? The Oracle base has been set to /u01/app/oracle |
2. Determine current archivelog sequence on primary and create pfile:
You need to find out current sequence number of your primary database via sqlplus
Code Block |
---|
[oracle@czlin0211 oracle]$ sqlplus / as sysdba SQL> archive log list; Database log mode Archive Mode Automatic archival Enabled Archive destination /tmp Oldest online log sequence 103 Next log sequence to archive 106 Current log sequence 106 SQL> create pfile='/u02/app/oracle/dbvisit_backup/initMEGA.ora' from spfile; |
In our case we need to note and remember "106"2
3. Run the following RMAN commands to backup the primary database
...
Note that TAGs are used to make it easier to restore. For more detail on RMAN and using "tags" please see the Oracle documentation
...
Code Block |
---|
[oracle@czlin0211 oracle]$ rman target / run{ sql "alter system archive log current"; allocate channel ch1 type disk maxpiecesize 1024m; backup as compressed backupset database format '/u02/app/oracle/dbvisit_backup/db_%U' tag 'DBVCSD_BK'; backup current controlfile for standby format '/u02/app/oracle/dbvisit_backup/standby-ctl'; sql "alter system archive log current"; backup archivelog from sequence 106 format '/u02/app/oracle/dbvisit_backup/arc_%U' tag 'DBVCSD_ARC'; release channel ch1; } |
...
4.
...
Copy all backup files
Copy all files located in /u02/app/oracle/dbvisit_backup to same location on standby server via scp:
Code Block |
---|
[oracle@czlin0211 oracle]$ scp /u02/app/oracle/dbvisit_backup/* czlin0212:/u02/app/oracle/dbvisit_backup |
On the standby server:
1. Startup Standby database nomount
Set the environment for the standby database, then create spfile and start the standby database in nomount mode:
...
Code Block |
---|
[oracle@czlin0212 oracle]$ sqlplus / as sysdba SQL*Plus: Release 21.0.0.0.0 - Production on Tue Aug 29 12:31:46 2023 Version 21.3.0.0.0 Copyright (c) 1982, 2021, Oracle. All rights reserved. Connected to an idle instance. SQL> create spfile from pfile='/u02/app/oracle/dbvisit_backup/initMEGA.ora'; File created. SQL> startup nomount; ORACLE instance started. Total System Global Area 2147480480 bytes Fixed Size 9687968 bytes Variable Size 536870912 bytes Database Buffers 1593835520 bytes Redo Buffers 7086080 bytes SQL> |
2. Restore the backup you copied
Restore the backup on standby server via RMAN:
Code Block |
---|
[oracle@czlin0212 oracle]$ rman target / run{ restore standby controlfile from '/u02/app/oracle/dbvisit_backup/standby-ctl'; sql 'alter database mount'; restore database from tag 'DBVCSD_BK'; recover database from tag 'DBVCSD_ARC'; } |
...
Code Block |
---|
... ... Starting recover at 29-AUG-23 using channel ORA_DISK_1 starting media recovery media recovery complete, elapsed time: 00:00:00 Finished recover at 29-AUG-23 RMAN> |
3. Standby database creation is now complete
...
RMAN has started the standby database in mount standby mode which is correct for Dbvisit Standby to continue.
4. Create corresponding configuration in dbvcontrol GUI
Now you can create the DDC file in the dbvcontrol GUI (in detail described in: Create Oracle Configuration ):
...
Take special care, that SID and unique database name corresponds to the standby database you created manually.
5. Once created, DDC in the dashboard will look like so:
6. Next step is to manuallly backup
5. Backup & send archivelog to verify that standby database can be correctly recovered.
We need to perform this via command line. On primary run:
...
Code Block |
---|
[oracle@czlin0212 oracle]$ /usr/dbvisit/standbymp/oracle/dbvctl -d MEGA ============================================================= Dbvisit Standby Database Technology (11.4.0) (pid 928715) dbvctl started on czlin0212: Tue Aug 29 13:09:45 2023 ============================================================= >>> Applying Log file(s) from czlin0211 to MEGA on czlin0212: thread 1 sequence 116 (1_116_1145654994.arc)... done thread 1 sequence 117 (1_117_1145654994.arc)... done Last applied log(s): thread 1 sequence 117 Next SCN required for recovery 135844738 generated at 2023-08-29:12:26:30 +02:00. Next required log thread 1 sequence 118 ============================================================= dbvctl ended on czlin0212: Tue Aug 29 13:09:48 2023 ============================================================= |
7. Final step is to enable the automated standby update.
On primary run:
Code Block |
---|
[oracle@czlin0211 oracle]$ /usr/dbvisit/standbymp/bin/dbvagentmanager auto-update modify --enable --set-interval-seconds 300 --noconfirm |
...