Create Physical Standby Database

In this post I go through the steps required for creating physical standby database.
There are series of steps that need to be performed in order for successful data guard configuration.

Lets get started!

I won’t go in details with installation of Oracle Database Software etc..

Oracle version: 11.2
Hosts: xsrv.seedport.ip, xsrv1.speedport.ip
Instances: prmy01, sby01

Primary site configuration:

As first we start with creating listener on primary site. You can use netca utility or you can do it manually, it’s up to you.
Configure listener static registration for the newly created instnace, also create one more with GLOBAL_DBNAME = db_unique_name_DGMGRL which is required for data guard broker configuration.

[oracle@xsrv admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = prmy01_DGMGRL)
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
      (SID_NAME = prmy01)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = prmy01)
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
      (SID_NAME = prmy01)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = xsrv.speedport.ip)(PORT = 1521))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

ADR_BASE_LISTENER = /u01/app/oracle

[oracle@xsrv admin]$

Configure tnsnames.ora to include configuration for standby database as follows.

[oracle@xsrv admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

PRMY01 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = xsrv.speedport.ip)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = prmy01)
    )
  )

SBY01 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = xsrv1.speedport.ip)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = sby01)
    )
  )

[oracle@xsrv admin]$

Activate archive log mode for primary database.

[oracle@xsrv oracle]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Fri Mar 1 20:52:06 2013

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area  417546240 bytes
Fixed Size                  2228944 bytes
Variable Size             276827440 bytes
Database Buffers          134217728 bytes
Redo Buffers                4272128 bytes
Database mounted.
SQL> archive log list
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     1
Current log sequence           3
SQL> alter database archivelog;

Database altered.

SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     1
Next log sequence to archive   3
Current log sequence           3
SQL>

While the database is still in mount state we can also enable database force logging.
We need force logging in order to keep track of all changes at database level.

SQL>
SQL> alter database force logging;

Database altered.

SQL>
SQL> alter database open;

Database altered.

SQL>

We will create standby redo logs at the primary site,  we need them in case if switchover or failover occurs.
Keep in mind that we need at least one more standby redo log group than redo log groups on the primary site.
The size of the standby redo logs should be at least as online redo logs size. Also when we execute duplicate command to create physical standby database standby redo logs will be automatically created on standby site if they are already configured on primary site.

SQL>
SQL> alter database add standby logfile '/u01/app/oracle/oradata/prmy01/stdrl01.log' size 50M;

Database altered.

SQL> alter database add standby logfile '/u01/app/oracle/oradata/prmy01/stdrl02.log' size 50M;

Database altered.

SQL> alter database add standby logfile '/u01/app/oracle/oradata/prmy01/stdrl03.log' size 50M;

Database altered.

SQL> alter database add standby logfile '/u01/app/oracle/oradata/prmy01/stdrl04.log' size 50M;

Database altered.

SQL>
SQL> column group# format 9
SQL> column type format a10
SQL> column member format a50
SQL> select group#,type,member from v$logfile;

GROUP# TYPE MEMBER
------ ---------- --------------------------------------------------
3 ONLINE /u01/app/oracle/oradata/prmy01/redo03.log
2 ONLINE /u01/app/oracle/oradata/prmy01/redo02.log
1 ONLINE /u01/app/oracle/oradata/prmy01/redo01.log
4 STANDBY /u01/app/oracle/oradata/prmy01/stdrl01.log
5 STANDBY /u01/app/oracle/oradata/prmy01/stdrl02.log
6 STANDBY /u01/app/oracle/oradata/prmy01/stdrl03.log
7 STANDBY /u01/app/oracle/oradata/prmy01/stdrl04.log

7 rows selected.

SQL>

We need to set LOG_ARCHIVE_CONFIG init parameter to specify db_unique_names involved in data guard configuration. This parameter enables sending/receiving of archive logs.

SQL>
SQL> alter system set log_archive_config='DG_CONFIG=(prmy01,sby01)';

System altered.

SQL> show parameter log_archive_config

NAME                                 TYPE       VALUE
------------------------------------ ---------- ------------------------------
log_archive_config                   string     DG_CONFIG=(prmy01,sby01)
SQL>

We need to define log archive destination for our standby database , we do this by setting log_archive_dest_n parameters, we can have up to 30 standby databases.

SQL>
SQL> alter system set log_archive_dest_2='SERVICE=sby01 VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=sby01';

System altered.

SQL>

Set standby_file_management to AUTO in order creation of new data files to propagate to the standby site.

SQL>
SQL> alter system set standby_file_management=auto;

System altered.

SQL>

When new files are added to the standby site from the primary site, database name need to be changed, db_file_name_convert and log_file_name_convert are used to change data file name on primary site to data file name on standby site. In order to set these parameters create pfile, add the parameters and then create spfile from the pfile.

SQL>
SQL> create pfile='/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initprmy01.ora' from spfile;

File created.

SQL>

Add the parameters.

db_file_name_convert='/oradata/sby01/','/oradata/prmy01/'
log_file_name_convert='/oradata/sby01/','/oradata/prmy01/'

After you’ve add the parameters, recreate the spfile from pfile and verify the parameters.

SQL>
SQL> create spfile from pfile='/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initprmy01.ora';

File created.

SQL>

Standby site configuration:

Configure listener static registration. We need this in order to connect to standby database when duplicate command is executed from primary site. Also configure db_unique_name_DGMGRL for standby database.

[oracle@xsrv1 admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome                  _1/network/admin/listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = sby01)
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
      (SID_NAME = sby01)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = sby01_DGMGRL)
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
      (SID_NAME = sby01)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = xsrv1.speedport.ip)(PORT = 1521))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

ADR_BASE_LISTENER = /u01/app/oracle

Configure tnsnames.ora to include configuration for primary/standby database as follows.

[oracle@xsrv1 admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

SBY01 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = xsrv1.speedport.ip)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = sby01)
    )
  )

PRMY01 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = xsrv.speedport.ip)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = prmy01)
    )
  )

[oracle@xsrv1 admin]$

Copy the password file from primary site to standby site.

[oracle@xsrv1 dbs]$
[oracle@xsrv1 dbs]$ scp oracle@xsrv:/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwprmy01 /u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwsby01
oracle@xsrv's password:
orapwprmy01                                                                       100% 1536     1.5KB/s   00:00
[oracle@xsrv1 dbs]$
[oracle@xsrv1 dbs]$ ll | grep orapwsby01
-rw-r----- 1 oracle oinstall  1536 Mar  1 23:23 orapwsby01
[oracle@xsrv1 dbs]$

Create init parameter file for standby database with only DB_NAME parameter.

DB_NAME=sby01

Create necessary directories.

[oracle@xsrv1 ~]$
[oracle@xsrv1 ~]$ mkdir -p /u01/app/oracle/admin/sby01/adump
[oracle@xsrv1 ~]$
[oracle@xsrv1 ~]$ mkdir /u01/app/oracle/oradata/sby01
[oracle@xsrv1 ~]$

Start the standby database in nomount mode.

SQL>
SQL> startup nomount
ORACLE instance started.

Total System Global Area  238034944 bytes
Fixed Size                  2227136 bytes
Variable Size             180356160 bytes
Database Buffers           50331648 bytes
Redo Buffers                5120000 bytes
SQL>

Finally, we will execute duplicate target database for standby via rman to create physical standby database.
Go to the primary site and log in to the target and auxiliary instance.

rman target sys@prmy01 auxiliary sys@sby01 log=/home/oracle/rmandg.log

Execute the following script.

run {
duplicate target database for standby from active database
spfile parameter_value_convert 'prmy01','sby01'
set control_files='/u01/app/oracle/oradata/sby01/control01.ctl'
set db_unique_name='sby01'
set db_file_name_convert='/prmy01/','/sby01/'
set log_file_name_convert='/prmy01/','/sby01/'
set log_archive_config='DG_CONFIG=(prmy01,sby01)'
set log_archive_dest_2='SERVICE=prmy01 VALID_FOR=(online_logfiles,primary_role) DB_UNIQUE_NAME=prmy01'
set standby_file_management='auto'
set fal_server='prmy01';
}

Output will be generated in /home/oracle/rmandg.log.

Recovery Manager: Release 11.2.0.3.0 - Production on Sat Mar 2 12:14:59 2013

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: PRMY01 (DBID=163296616)
connected to auxiliary database: SBY01 (not mounted)

RMAN> 
RMAN> 
RMAN> 
Starting Duplicate Db at 02-MAR-13
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=20 device type=DISK

contents of Memory Script:
{
   backup as copy reuse
   targetfile  '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwprmy01' auxiliary format 
 '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwsby01'   targetfile 
 '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileprmy01.ora' auxiliary format 
 '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfilesby01.ora'   ;
   sql clone "alter system set spfile= ''/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfilesby01.ora''";
}
executing Memory Script

Starting backup at 02-MAR-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=37 device type=DISK
Finished backup at 02-MAR-13

sql statement: alter system set spfile= ''/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfilesby01.ora''

contents of Memory Script:
{
   sql clone "alter system set  audit_file_dest = 
 ''/u01/app/oracle/admin/sby01/adump'' comment=
 '''' scope=spfile";
   sql clone "alter system set  dispatchers = 
 ''(PROTOCOL=TCP) (SERVICE=sby01XDB)'' comment=
 '''' scope=spfile";
   sql clone "alter system set  control_files = 
 ''/u01/app/oracle/oradata/sby01/control01.ctl'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_unique_name = 
 ''sby01'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_file_name_convert = 
 ''/prmy01/'', ''/sby01/'' comment=
 '''' scope=spfile";
   sql clone "alter system set  log_file_name_convert = 
 ''/prmy01/'', ''/sby01/'' comment=
 '''' scope=spfile";
   sql clone "alter system set  log_archive_config = 
 ''DG_CONFIG=(prmy01,sby01)'' comment=
 '''' scope=spfile";
   sql clone "alter system set  log_archive_dest_2 = 
 ''SERVICE=prmy01 VALID_FOR=(online_logfiles,primary_role) DB_UNIQUE_NAME=prmy01'' comment=
 '''' scope=spfile";
   sql clone "alter system set  standby_file_management = 
 ''auto'' comment=
 '''' scope=spfile";
   sql clone "alter system set  fal_server = 
 ''prmy01'' comment=
 '''' scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

sql statement: alter system set  audit_file_dest =  ''/u01/app/oracle/admin/sby01/adump'' comment= '''' scope=spfile

sql statement: alter system set  dispatchers =  ''(PROTOCOL=TCP) (SERVICE=sby01XDB)'' comment= '''' scope=spfile

sql statement: alter system set  control_files =  ''/u01/app/oracle/oradata/sby01/control01.ctl'' comment= '''' scope=spfile

sql statement: alter system set  db_unique_name =  ''sby01'' comment= '''' scope=spfile

sql statement: alter system set  db_file_name_convert =  ''/prmy01/'', ''/sby01/'' comment= '''' scope=spfile

sql statement: alter system set  log_file_name_convert =  ''/prmy01/'', ''/sby01/'' comment= '''' scope=spfile

sql statement: alter system set  log_archive_config =  ''DG_CONFIG=(prmy01,sby01)'' comment= '''' scope=spfile

sql statement: alter system set  log_archive_dest_2 =  ''SERVICE=prmy01 VALID_FOR=(online_logfiles,primary_role) DB_UNIQUE_NAME=prmy01'' comment= '''' scope=spfile

sql statement: alter system set  standby_file_management =  ''auto'' comment= '''' scope=spfile

sql statement: alter system set  fal_server =  ''prmy01'' comment= '''' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     626327552 bytes

Fixed Size                     2230952 bytes
Variable Size                373294424 bytes
Database Buffers             247463936 bytes
Redo Buffers                   3338240 bytes

contents of Memory Script:
{
   backup as copy current controlfile for standby auxiliary format  '/u01/app/oracle/oradata/sby01/control01.ctl';
}
executing Memory Script

Starting backup at 02-MAR-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying standby control file
output file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_prmy01.f tag=TAG20130302T121536 RECID=2 STAMP=809007337
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 02-MAR-13

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 tempfile  1 to 
 "/u01/app/oracle/oradata/sby01/temp01.dbf";
   switch clone tempfile all;
   set newname for datafile  1 to 
 "/u01/app/oracle/oradata/sby01/system01.dbf";
   set newname for datafile  2 to 
 "/u01/app/oracle/oradata/sby01/sysaux01.dbf";
   set newname for datafile  3 to 
 "/u01/app/oracle/oradata/sby01/undotbs01.dbf";
   set newname for datafile  4 to 
 "/u01/app/oracle/oradata/sby01/users01.dbf";
   set newname for datafile  5 to 
 "/u01/app/oracle/oradata/sby01/example01.dbf";
   backup as copy reuse
   datafile  1 auxiliary format 
 "/u01/app/oracle/oradata/sby01/system01.dbf"   datafile 
 2 auxiliary format 
 "/u01/app/oracle/oradata/sby01/sysaux01.dbf"   datafile 
 3 auxiliary format 
 "/u01/app/oracle/oradata/sby01/undotbs01.dbf"   datafile 
 4 auxiliary format 
 "/u01/app/oracle/oradata/sby01/users01.dbf"   datafile 
 5 auxiliary format 
 "/u01/app/oracle/oradata/sby01/example01.dbf"   ;
   sql 'alter system archive log current';
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /u01/app/oracle/oradata/sby01/temp01.dbf in control file

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting backup at 02-MAR-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u01/app/oracle/oradata/prmy01/system01.dbf
output file name=/u01/app/oracle/oradata/sby01/system01.dbf tag=TAG20130302T121545
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/u01/app/oracle/oradata/prmy01/sysaux01.dbf
output file name=/u01/app/oracle/oradata/sby01/sysaux01.dbf tag=TAG20130302T121545
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=/u01/app/oracle/oradata/prmy01/example01.dbf
output file name=/u01/app/oracle/oradata/sby01/example01.dbf tag=TAG20130302T121545
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/u01/app/oracle/oradata/prmy01/undotbs01.dbf
output file name=/u01/app/oracle/oradata/sby01/undotbs01.dbf tag=TAG20130302T121545
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/u01/app/oracle/oradata/prmy01/users01.dbf
output file name=/u01/app/oracle/oradata/sby01/users01.dbf tag=TAG20130302T121545
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 02-MAR-13

sql statement: alter system archive log current

contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafile copy RECID=2 STAMP=809011060 file name=/u01/app/oracle/oradata/sby01/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=3 STAMP=809011060 file name=/u01/app/oracle/oradata/sby01/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=4 STAMP=809011060 file name=/u01/app/oracle/oradata/sby01/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=5 STAMP=809011060 file name=/u01/app/oracle/oradata/sby01/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=6 STAMP=809011060 file name=/u01/app/oracle/oradata/sby01/example01.dbf
Finished Duplicate Db at 02-MAR-13

RMAN> 
RMAN> 

Recovery Manager complete.

Log in to the standby database and verify the open_mode and database_role.

SQL>
SQL> select open_mode, database_role from v$database;

OPEN_MODE            DATABASE_ROLE
-------------------- ----------------
MOUNTED              PHYSICAL STANDBY

SQL>

Startup recovery.

SQL>
SQL> recover managed standby database disconnect;
Media recovery complete.
SQL>

Go to the primary database and display archived log information.

SQL>
SQL> select thread#, sequence#, applied from v$archived_log;

   THREAD#  SEQUENCE# APPLIED
---------- ---------- ---------
         1          3 NO
         1          4 NO
         1          5 NO
         1          6 NO
         1          7 NO
         1          8 NO
         1          9 NO
         1          8 YES
         1          9 YES

9 rows selected.

SQL>

Perform log switch and execute the previous query again.

SQL>
SQL> alter system switch logfile;

System altered.

SQL> select thread#, sequence#, applied from v$archived_log;

   THREAD#  SEQUENCE# APPLIED
---------- ---------- ---------
         1          3 NO
         1          4 NO
         1          5 NO
         1          6 NO
         1          7 NO
         1          8 NO
         1          9 NO
         1          8 YES
         1          9 YES
         1         10 NO
         1         10 NO

11 rows selected.

SQL>

Log in to the standby database and verify that the redo data is shipped and applied.

SQL> select thread#, sequence#, applied from v$archived_log;

   THREAD#  SEQUENCE# APPLIED
---------- ---------- ---------
         1          8 YES
         1          9 YES
         1         10 YES

SQL>

Data Guard Configuration

Before configuring data guard broker, we need to start the data guard broker process. We do this by setting init parameter dg_broker_start.
Set this parameter to both instances prmy01/sby01.

SQL> alter system set dg_broker_start=TRUE;

System altered.

SQL>

Now, we will log in to the dgmgrl and create the configuration.

[oracle@xsrv ~]$ dgmgrl
DGMGRL for Linux: Version 11.2.0.3.0 - 64bit Production

Copyright (c) 2000, 2009, Oracle. All rights reserved.

Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys@prmy01
Password:
Connected.
DGMGRL>
DGMGRL> create configuration dgconfig as
> primary database is prmy01
> connect identifier is prmy01;
Configuration "dgconfig" created with primary database "prmy01"
DGMGRL>
DGMGRL> show configuration

Configuration - dgconfig

  Protection Mode: MaxPerformance
  Databases:
    prmy01 - Primary database

Fast-Start Failover: DISABLED

Configuration Status:
DISABLED

As you can see the configuration is disabled by default, we will enable it and verify it’s status.

DGMGRL> enable configuration
Enabled.
DGMGRL>
DGMGRL> show configuration

Configuration - dgconfig

  Protection Mode: MaxPerformance
  Databases:
    prmy01 - Primary database

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS

DGMGRL>

Now, we are almost done, we also need to add the standby database to the configuration and enable it.

DGMGRL> add database sby01 as connect identifier is sby01;
Database "sby01" added
DGMGRL>
DGMGRL> enable database sby01;
Enabled.
DGMGRL>

Verify the configuration.

DGMGRL>
DGMGRL> show configuration

Configuration - dgconfig

  Protection Mode: MaxPerformance
  Databases:
    prmy01 - Primary database
    sby01  - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS

DGMGRL>

We are done with configuring physical standby database and data guard broker configuration.
Furthermore we can perform switchover to test that everything is working fine.

DGMGRL>
DGMGRL> switchover to sby01
Performing switchover NOW, please wait...
New primary database "sby01" is opening...
Operation requires shutdown of instance "prmy01" on database "prmy01"
Shutting down instance "prmy01"...
ORACLE instance shut down.
Operation requires startup of instance "prmy01" on database "prmy01"
Starting instance "prmy01"...
ORACLE instance started.
Database mounted.
Switchover succeeded, new primary is "sby01"
DGMGRL>

Leave a Reply