0% found this document useful (0 votes)
6 views

step by step configure oracle data guard

The document outlines the step-by-step implementation of Oracle Data Guard on Oracle 19c, detailing configurations for both primary and standby databases. Key steps include changing archive log mode, adding standby redo log files, configuring network entries, and setting parameters for both databases. It concludes with instructions for starting the standby database and duplicating the target database for standby from the active database using RMAN.

Uploaded by

Rekesh Patel
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

step by step configure oracle data guard

The document outlines the step-by-step implementation of Oracle Data Guard on Oracle 19c, detailing configurations for both primary and standby databases. Key steps include changing archive log mode, adding standby redo log files, configuring network entries, and setting parameters for both databases. It concludes with instructions for starting the standby database and duplicating the target database for standby from the active database using RMAN.

Uploaded by

Rekesh Patel
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Implementation of Oracle data guard on Oracle 19c

Environment:

Primary: 192.168.100.54

Sid= orcl

Standby: 192.168.100.52

Sid=orcldr

Primary Server side Configurations:-

Step1:-Change Archivelog mode and force logging mode


$ export ORACLE_SID=orcl
$ sqlplus / as sysdba
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 – Production Version
19.4.1.0.0

SQL> startup mount


ORACLE instance started.
Total System Global Area 1048575776 bytes
Fixed Size 8904480 bytes
Variable Size 272629760 bytes
Database Buffers 763363328 bytes Redo
Buffers 3678208 bytes Database mounted.
SQL> alter database archivelog;

Database altered.

SQL> ALTER DATABASE FORCE LOGGING;

Database altered.

SQL> alter database open;


Database altered.

SQL> select FORCE_LOGGING,log_mode from v$database;

FORCE_LOGGING LOG_MODE
————————————— ————
YES ARCHIVELOG

Step2:-Adding Redologfile for standby database


SQL> alter database add standby logfile group 4
‘/u01/app/oracle/oradata/ORCL/redo04.log’ size 50m;

Database altered.

SQL> alter database add standby logfile group 5


‘/u01/app/oracle/oradata/ORCL/redo05.log’ size 50m;

Database altered.

SQL> alter database add standby logfile group 6


‘/u01/app/oracle/oradata/ORCL/redo06.log’ size 50m;

Database altered.

SQL> SELECT GROUP#,THREAD#,SEQUENCE#,ARCHIVED,STATUS FROM


V$STANDBY_LOG;

GROUP# THREAD# SEQUENCE# ARC STATUS


———- ———- ———- — ———-
4 0 0 YES UNASSIGNED
5 0 0 YES UNASSIGNED
6 0 0 YES UNASSIGNED

Step3:-Adding the network entry in primary and standby side(Both servers)


(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.54)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)

orcldr =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.52)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcldr)
)
)

Listener Entry:-
************
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME = /u01/app/oracle/product/19.0.0/ dbhome_1)
(SID_NAME = orcl)
)
(SID_DESC =
(GLOBAL_DBNAME = orcldr)
(ORACLE_HOME = /u01/app/oracle/product/19.0.0/dbhome_1)
(SID_NAME = orcldr)
)
)

Now check with ping that both nodes tns are connected or not
$ tnsping orcl
$ tnsping orcldr
Step5:-Copy password file from primary to standby
$ scp orapworcl oracle@orcldr:$ORACLE_HOME/dbs

Rename password file on standby:


$ cd $ORACLE_HOME/dbs
$ mv orapworcl orapworcl_dr

Step6:-Changing parameters in primary database


SQL> ALTER SYSTEM SET log_archive_config=’dg_config=(orcl,orcldr)’
SCOPE=both;
System altered.

SQL> ALTER SYSTEM SET


log_archive_dest_1=’location=use_db_recovery_file_dest
valid_for=(all_logfiles,all_roles) db_unique_name=orcl’ SCOPE=both;
System altered.

SQL> ALTER SYSTEM SET log_archive_dest_2=’service=orcldr async


valid_for=(online_logfiles,primary_role) db_unique_name=orcldr’ SCOPE=both;
System altered.

SQL> ALTER SYSTEM SET fal_server=’orcldr’ SCOPE=both;

System altered.

SQL> ALTER SYSTEM SET fal_client=’orcl’ SCOPE=both;

System altered.

SQL> ALTER SYSTEM SET standby_file_management=’AUTO’ SCOPE=both;


System altered.

Step7:- Changing parameters in standby database


In the $ORACLE_HOME/dbs directory of the standby system, create an
initialization parameter file named initorcldr.ora
Containing a single parameter: DB_NAME=orcl
$ cat initorcldr.ora db_name=orcl
$ pwd
/u01/app/oracle/product/19.0.0/dbhome_1/dbs

Step8:- Create directory Structure in Standby database


$ mkdir -p /u01/app/oracle/oradata/ORCL/datafile/
$ mkdir –p /u01/app/oracle/admin/orcl/adump

Step9:- start the standby database using pfile


$ cd $ORACLE_HOME/dbs
$ export ORACLE_SID=orcldr
$ sqlplus / as sysdba
Connected to an idle instance.

SQL> startup pfile=’orcldr.ora’ nomount


ORACLE instance started.
Total System Global Area 243268216 bytes
Fixed Size 8895096 bytes
Variable Size 180355072 bytes
Database Buffers 50331648 bytes
Redo Buffers 3686400 bytes

Step8:-Connect with RMAN on Primary database


Connect with rman from the standby database using the following commands
$ rman target sys/oracle@orcl auxiliary sys/oracle@orcldr

duplicate target database for standby from active database dorecover


nofilenamecheck;

DUPLICATE TARGET DATABASE FOR STANDBY FROM ACTIVE DATABASE


DORECOVER SPFILE SET db_unique_name=’orcld’ NOFILENAMECHECK;

DOCUMENT MADE BY: YASIR HUSSAIN


[email protected]

You might also like