/
Create DR Database for Oracle Manually

Create DR Database for Oracle Manually

It is possible to use directly RMAN to create manually a standby database without shutting down the primary database. You can then use such standby database for synchronization with Dbvisit

General prerequisites must still be fulfilled: Prerequisites and you need to create your DDC as per expected standby database parameters: Create Configuration File (DDC)

1. Preliminary Steps

1. Create the same Oracle directory structure on the standby server as on the primary server.

2. Copy the database parameter (pfile/spfile) file for the production database on the production server to the standby server into $ORACLE_HOME/dbs

3. Copy the /etc/oratab file from the production server to the standby server, of make sure the entry for the database you want to create the standby database for is in the standby oratab file.

4. Copy the password file $ORACLE_HOME/dbs/orapw<$ORACLE_SID> from the production server to the standby server. 

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.

2. Create Primary database backup

perform following steps on primary server:

A. Set the Oracle environment

Do this on the production database (with the oraenv command in Linux/UNIX) - in the example the database is called "MEGA":

[oracle@czlin0211 oracle]$ . oraenv ORACLE_SID = [MEGA] ? The Oracle base has been set to /u01/app/oracle

B. Determine current archivelog sequence on primary and create pfile:

You need to find out current sequence number of your primary database via sqlplus

[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"

C. 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

Make sure to change the Sequence number (106) in the RMAN script corresponding to your archive sequence.

Using common sense, change "maxpiecesize" size as well - if you have slow network and few TB database, it's better to split the backup into more smaller files

 

[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; }

D. Copy all backup files

Copy all files located in /u02/app/oracle/dbvisit_backup to same location on standby server via scp:

3. Restore Primary database backup on Standby Server

A. Startup Standby database nomount

Set the environment for the standby database, then create spfile and start the standby database in nomount mode:

 

Now you have a chance to edit the standby database init parameters in pfile /u02/app/oracle/dbvisit_backup/initMEGA.ora - for example memory allocation, etc ...

 

B. Restore the backup you copied

Restore the backup on standby server via RMAN:

Very important is that the recovery part completes without any errors, like so:

RMAN has started the standby database in mount mode which is correct for Dbvisit Standby to continue.

C. 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.

Once created, DDC in the dashboard will look like so:

D. Backup & send archivelog to verify that standby database can be correctly recovered.

We need to perform this via command line. On primary run:

on standby run:

E. Final step is to enable the automated standby update.

On primary run:

Refreshing the dbvcontrol GUI will show automated standby enabled and there's now a gap time displayed

This step concludes the manual creation of DR database for Dbvisit Standby

Related content

Create DR Database for Oracle Manually
Create DR Database for Oracle Manually
More like this
Create DR Database for Oracle
Create DR Database for Oracle
More like this
Appendix C – Create a standby database manually - Linux/Unix
Appendix C – Create a standby database manually - Linux/Unix
More like this
Appendix C: Create Standby Database Manually - Linux
Appendix C: Create Standby Database Manually - Linux
More like this