Setting up 12c Data Guard - Community Wiki - SAP

31
Best Practice Document Version: 1.3– 2017-02-01 CUSTOMER Setting up 12c Data Guard Installation and Configuration Guide

Transcript of Setting up 12c Data Guard - Community Wiki - SAP

Best Practice

Document Version: 1.3– 2017-02-01

CUSTOMER

Setting up 12c Data Guard Installation and Configuration Guide

2

CUSTOMER

Error! Reference source not found.

Setting up 12c Data Guard

Document History

Document History

Version Date Change

1.0 2016-06-08 Document creation

1.1 2016-06-22 Added Points 11 and 12

1.2 2016-11-29 Amendments, added more points

1.3 2017-02-01 Supplementation with additional points

3

Table of Contents

1 GENERAL INFORMATION ....................................................................................... 5

2 REFERENCE ............................................................................................................ 6

3 BASIC SETUP AND SETTINGS ............................................................................... 7 3.1 Primary Host (dgnorth) ........................................................................................... 7 3.2 Standby Host (dgsouth) .......................................................................................... 8

4 SETUP ON PRIMARY (DGNORTH) .......................................................................... 9 4.1 Oracle Initialization Parameters to be added ......................................................... 9 4.2 SQL*Net Configuration .......................................................................................... 10 4.2.1 Listener Settings...................................................................................................... 10 4.2.2 Tnsnames Settings .................................................................................................. 11 4.2.3 Sqlnet Settings ........................................................................................................ 11

5 SETUP ON STANDBY (DGSOUTH) ....................................................................... 12 5.1 Oracle Initialization Parameters to be added ....................................................... 12 5.2 SQL*Net Configuration .......................................................................................... 13 5.2.1 Listener Settings...................................................................................................... 13 5.2.2 Tnsnames Settings .................................................................................................. 14 5.2.3 Sqlnet Settings ........................................................................................................ 14

6 TESTING THE CONNECTION BETWEEN THE 2 HOSTS ...................................... 15 6.1 On the Primary Side (dgnorth) .............................................................................. 15 6.2 On the Standby Side (dgsouth)............................................................................. 16

7 COPY PRIMARY DATABASE TO STANDBY SITE ................................................ 17 7.1 Begin Backup ........................................................................................................ 17 7.2 Copy Data Files and Redolog Files....................................................................... 17 7.3 Persistent Configuration ....................................................................................... 17 7.4 End Backup ........................................................................................................... 17

8 CREATING STANDBY CONTROL FILE ON PRIMARY HOST (DGNORTH) .......... 18 8.1 Mounting Database (dgnorth) ............................................................................... 18 8.2 Copy Standby Control File to Standby Host (dgnorth) ........................................ 18 8.3 Distributing Standby Control File on Standby Host (dgsouth)............................ 18 8.4 Distributing the Password file (dgnorth -> dgsouth) ........................................... 19 8.5 Mounting Standby Database (dgsouth) ................................................................ 19 8.6 Creating Standby Redolog Files (on dgnorth and dgsouth)................................ 19

9 CONFIGURING DATA GUARD BROKER .............................................................. 20 9.1 Starting up the Databases..................................................................................... 20 9.1.1 Mounting Standby Database (dgsouth) .................................................................... 20 9.1.2 Opening Primary Database (dgnorth)....................................................................... 20 9.2 Defining Protection Modes ................................................................................... 20 9.3 Creating the Configuration on Primary (dgnorth) ................................................ 21 9.4 Adding the physical Standby Database (on Primary, dgnorth) ........................... 21 9.5 Overview of Data Guard Broker Properties .......................................................... 22 9.5.1 Properties on dg1_north .......................................................................................... 22 9.5.2 Properties on dg1_south.......................................................................................... 24 9.6 Enable configuration ............................................................................................. 26 9.6.1 Monitoring on dgnorth (Alert Log) ............................................................................ 26 9.6.2 Monitoring on dgsouth (Alert Log) ............................................................................ 27 9.7 Check network between Primary and Standby .................................................... 28

10 TESTING THE SWITCHOVER ................................................................................ 29 10.1 From dg1_north to dg1_south .............................................................................. 29

Setting up 12c Data Guard

Document History

CUSTOMER

Error! Reference source not found. 4

10.2 From dg1_south to dg1_north .............................................................................. 29

11 CONFIGURING BRBACKUP (DGSOUTH) ............................................................. 30

Setting up 12c Data Guard

Document History

CUSTOMER

Error! Reference source not found. 5

1 GENERAL INFORMATION

Caution

There may be slight differences depending on your OS and DB version.

Note

This guide contains all steps to successfully install Data Guard on a 12c Database installation.

Note, this guide does not contain:

the IP address changes

setting up the OS on the nodes.

RDBMS Software Installation

RDBMS Bundle Patch Installation

Note, in Point 7 a fully manual approach is documented to copy the database. However, there are other

supported alternatives available which are not mentioned in this document.

OS Platform: Oracle Linux Server release 7.1

DB Release: 12.1.0.2

Setting up 12c Data Guard

Document History

CUSTOMER

Error! Reference source not found. 6

2 REFERENCE

"Setting up Oracle 11g Data Guard for SAP Customers" http://go.sap.com/documents/2016/08/e6c04a29-817c-0010-82c7-eda71af511fa.html "Setting up Oracle 12c Data Guard for SAP Customers" http://www.sap.com/documents/2016/12/a67bac51-9a7c-0010-82c7-eda71af511fa.html "Oracle Standby Database " http://go.sap.com/documents/2015/07/227abf80-5b7c-0010-82c7-eda71af511fa.html

Setting up 12c Data Guard

Document History

CUSTOMER

Error! Reference source not found. 7

3 BASIC SETUP AND SETTINGS

3.1 Primary Host (dgnorth)

hostname: dgnorth

[root@dgnorth ~]# hostnamectl

Static hostname: dgnorth

Icon name: computer-vm

Chassis: vm

Machine ID: 1d5c7157cbc54effb3fabc4e253e9f07

Boot ID: 3d4f3553bdbd4f6aabf3d58ce0dd91dc

Virtualization: vmware

Operating System: Oracle Linux Server 7.1

CPE OS Name: cpe:/o:oracle:linux:7:1

Kernel: Linux 3.8.13-55.1.6.el7uek.x86_64

Architecture: x86_64

[root@dgnorth network-scripts]# cat /etc/hosts

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4

::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.122.100 dgnorth.dataguard dgnorth

192.168.122.101 dgsouth.dataguard dgsouth

IP-addresses:

ens32: 10.55.189.211- DHCP

ens33: 192.168.122.100- local (permanent)

[root@dgnorth network-scripts]# ip addr show ens32 | grep net

inet 10.55.189.211/24 brd 10.55.189.255 scope global ens32

inet6 fe80::20c:29ff:fe26:c674/64 scope link

[root@dgnorth network-scripts]# ip addr show ens33 | grep net

inet 192.168.122.100/24 brd 192.168.122.255 scope global ens33

inet6 fe80::20c:29ff:fe26:c67e/64 scope link

db_name = 'dg1'

db_unique_name = 'dg1_north'

Setting up 12c Data Guard

Document History

CUSTOMER

Error! Reference source not found. 8

3.2 Standby Host (dgsouth)

hostname: dgsouth

[root@dgsouth ~]# hostnamectl

Static hostname: dgsouth

Icon name: computer-vm

Chassis: vm

Machine ID: 1d5c7157cbc54effb3fabc4e253e9f07

Boot ID: e88f3a1772d14fb4a8e6f8640f158fbd

Virtualization: vmware

Operating System: Oracle Linux Server 7.1

CPE OS Name: cpe:/o:oracle:linux:7:1

Kernel: Linux 3.8.13-55.1.6.el7uek.x86_64

Architecture: x86_64

[root@dgsouth ~]# cat /etc/hosts

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4

::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.122.100 dgnorth.dataguard dgnorth

192.168.122.101 dgsouth.dataguard dgsouth

IP-addresses:

ens32: 10.55.189.125- DHCP

ens33: 192.168.122.101- local (permanent)

[root@dgsouth ~]# ip addr show ens32 | grep inet

inet 10.55.189.125/24 brd 10.55.189.255 scope global ens32

inet6 fe80::20c:29ff:fe1a:295e/64 scope link

[root@dgsouth ~]# ip addr show ens33 | grep inet

inet 192.168.122.101/24 brd 192.168.122.255 scope global ens33

inet6 fe80::20c:29ff:fe1a:2968/64 scope link

db_name = 'dg1'

db_unique_name = 'dg1_south'

Setting up 12c Data Guard

Document History

CUSTOMER

Error! Reference source not found. 9

4 SETUP ON PRIMARY (dgnorth)

4.1 Oracle Initialization Parameters to be added

*.db_unique_name='dg1_north' *.dg_broker_start=TRUE *.local_listener='(ADDRESS = (PROTOCOL=TCP)(HOST=dgnorth)(PORT=1521))' *.log_archive_dest_1='LOCATION=" /oracle/DG1/oraarch/DG1arch", valid_for=(ONLINE_LOGFILE,ALL_ROLES)' *.log_archive_dest_state_1='ENABLE' *.log_archive_format='%t_%s_%r.dbf' *.log_archive_max_processes=2 *.log_archive_min_succeed_dest=1 *.log_archive_trace=0 *.log_file_name_convert='DG1','DG1' *.standby_file_management='AUTO'

Setting up 12c Data Guard

Document History

CUSTOMER

Error! Reference source not found. 10

4.2 SQL*Net Configuration

4.2.1 Listener Settings

ADMIN_RESTRICTIONS_LISTENER = on LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = dgnorth)(PORT = 1521)) #(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) ) STARTUP_WAIT_TIME_LISTENER = 0 CONNECT_TIMEOUT_LISTENER = 10 TRACE_LEVEL_LISTENER = OFF SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = DG1) (GLOBAL_DBNAME=dg1north) (ORACLE_HOME = /oracle/DG1/121) ) (SID_DESC = (SID_NAME = DG1) (GLOBAL_DBNAME=dg1_north_DGMGRL) (ORACLE_HOME = /oracle/DG1/121) ) ) ADR_BASE_LISTENER = /oracle/DG1/diag

Setting up 12c Data Guard

Document History

CUSTOMER

Error! Reference source not found. 11

4.2.2 Tnsnames Settings

dg1north.WORLD= (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (COMMUNITY = SAP.WORLD) (PROTOCOL = TCP) (HOST = dgnorth) (PORT = 1521) ) ) (CONNECT_DATA = (SID = DG1) (GLOBAL_NAME = DG1) (SERVICE_NAME = dg1north) ) ) dg1south.WORLD= (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (COMMUNITY = SAP.WORLD) (PROTOCOL = TCP) (HOST = dgsouth) (PORT = 1521) ) ) (CONNECT_DATA = (SID = DG1) (SERVICE_NAME = dg1south) ) )

4.2.3 Sqlnet Settings

NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)

Setting up 12c Data Guard

Document History

CUSTOMER

Error! Reference source not found. 12

5 SETUP ON STANDBY (dgsouth)

5.1 Oracle Initialization Parameters to be added

*.db_unique_name='dg1_south' *.dg_broker_start=TRUE *.local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=dgsouth)(PORT=1521))' *.log_archive_dest_1='location="/oracle/DG1/oraarch/DG1arch" mandatory valid_for=(all_logfiles,all_roles)' *.log_archive_dest_state_1='ENABLE' *.log_archive_format='%t_%s_%r.dbf' *.log_archive_max_processes=2 *.log_archive_min_succeed_dest=1 *.log_archive_trace=0 *.log_file_name_convert='DG1','DG1' *.standby_file_management='AUTO'

Setting up 12c Data Guard

Document History

CUSTOMER

Error! Reference source not found. 13

5.2 SQL*Net Configuration

5.2.1 Listener Settings

ADMIN_RESTRICTIONS_LISTENER = on LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = dgsouth)(PORT = 1521)) # (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) ) STARTUP_WAIT_TIME_LISTENER = 0 CONNECT_TIMEOUT_LISTENER = 10 TRACE_LEVEL_LISTENER = OFF SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = DG1) (GLOBAL_DBNAME=dg1south) (ORACLE_HOME = /oracle/DG1/121) ) (SID_DESC = (SID_NAME = DG1) (GLOBAL_DBNAME=dg1_south_DGMGRL) (ORACLE_HOME = /oracle/DG1/121) ) ) ADR_BASE_LISTENER = /oracle/DG1/diag

Setting up 12c Data Guard

Document History

CUSTOMER

Error! Reference source not found. 14

5.2.2 Tnsnames Settings

dg1south.WORLD= (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (COMMUNITY = SAP.WORLD) (PROTOCOL = TCP) (HOST = dgsouth) (PORT = 1521) ) ) (CONNECT_DATA = (SID = DG1) (GLOBAL_NAME = DG1) (SERVICE_NAME = dg1south) ) ) dg1north.WORLD= (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (COMMUNITY = SAP.WORLD) (PROTOCOL = TCP) (HOST = dgnorth) (PORT = 1521) ) ) (CONNECT_DATA = (SID = DG1) (SERVICE_NAME = dg1north) ) )

5.2.3 Sqlnet Settings

NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)

Setting up 12c Data Guard

Document History

CUSTOMER

Error! Reference source not found. 15

6 TESTING THE CONNECTION BETWEEN THE 2 HOSTS

6.1 On the Primary Side (dgnorth)

After starting Listener (as oracle user)! Databases are not started yet!

sh-4.2$ tnsping dgsouth

TNS Ping Utility for Linux: Version 12.1.0.2.0 - Production on 08-JUN-2016 14:48:45 Copyright (c) 1997, 2014, Oracle. All rights reserved. Used parameter files: /oracle/DG1/121/network/admin/sqlnet.ora Used HOSTNAME adapter to resolve the alias Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.122.101)(PORT=1521))) OK (20 msec)

sh-4.2$ lsnrctl services LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 08-JUN-2016 14:49:45 Copyright (c) 1991, 2014, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dgnorth)(PORT=1521))) Services Summary... Service "dg1north" has 1 instance(s). Instance "DG1", status UNKNOWN, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:0 refused:0 LOCAL SERVER Service "dg1north_DGMGRL" has 1 instance(s). Instance "DG1", status UNKNOWN, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:0 refused:0 LOCAL SERVER The command completed successfully

Setting up 12c Data Guard

Document History

CUSTOMER

Error! Reference source not found. 16

6.2 On the Standby Side (dgsouth)

After starting Listener (as oracle user)! Databases are not started yet!

sh-4.2$ tnsping dgnorth TNS Ping Utility for Linux: Version 12.1.0.2.0 - Production on 08-JUN-2016 14:49:02 Copyright (c) 1997, 2014, Oracle. All rights reserved. Used parameter files: /oracle/DG1/121/network/admin/sqlnet.ora Used HOSTNAME adapter to resolve the alias Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.122.100)(PORT=1521))) OK (20 msec)

sh-4.2$ lsnrctl services LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 08-JUN-2016 14:50:18 Copyright (c) 1991, 2014, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dgsouth)(PORT=1521))) Services Summary... Service "dg1south_DGMGRL" has 1 instance(s). Instance "DG1", status UNKNOWN, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:0 refused:0 LOCAL SERVER Service "dg1south" has 1 instance(s). Instance "DG1", status UNKNOWN, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:0 refused:0 LOCAL SERVER The command completed successfully

Setting up 12c Data Guard

Document History

CUSTOMER

Error! Reference source not found. 17

7 COPY PRIMARY DATABASE TO STANDBY SITE

7.1 Begin Backup

SQL> alter database begin backup;

Database altered.

7.2 Copy Data Files and Redolog Files

scp -r /oracle/DG1/sapdata* oracle@dgsouth:/oracle/DG1/ scp /oracle/DG1/mirrlogA/log_g11m2.dbf oracle@dgsouth:/oracle/DG1/mirrlogA/log_g11m2.dbf scp /oracle/DG1/origlogA/log_g11m1.dbf oracle@dgsouth:/oracle/DG1/origlogA/log_g11m1.dbf scp /oracle/DG1/mirrlogA/log_g13m2.dbf oracle@dgsouth:/oracle/DG1/mirrlogA/log_g13m2.dbf scp /oracle/DG1/origlogA/log_g13m1.dbf oracle@dgsouth:/oracle/DG1/origlogA/log_g13m1.dbf scp /oracle/DG1/mirrlogB/log_g14m2.dbf oracle@dgsouth:/oracle/DG1/mirrlogB/log_g14m2.dbf scp /oracle/DG1/origlogB/log_g14m1.dbf oracle@dgsouth:/oracle/DG1/origlogB/log_g14m1.dbf scp /oracle/DG1/origlogB/log_g12m1.dbf oracle@dgsouth:/oracle/DG1/origlogB/log_g12m1.dbf scp /oracle/DG1/mirrlogB/log_g12m2.dbf oracle@dgsouth:/oracle/DG1/mirrlogB/log_g12m2.dbf

7.3 Persistent Configuration

Make sure all configuration files are present and contains correct data!

7.4 End Backup

SQL> alter database end backup;

Database altered.

Setting up 12c Data Guard

Document History

CUSTOMER

Error! Reference source not found. 18

8 CREATING STANDBY CONTROL FILE ON PRIMARY HOST (dgnorth)

8.1 Mounting Database (dgnorth)

SQL> create spfile from pfile; File created.

SQL> startup mount; ORACLE instance started. Total System Global Area 1157627904 bytes Fixed Size 2923632 bytes Variable Size 385876880 bytes Database Buffers 754974720 bytes Redo Buffers 13852672 bytes Database mounted.

SQL> alter database create standby controlfile as '/oracle/DG1/stdby_control.dbf' reuse; Database altered.

8.2 Copy Standby Control File to Standby Host (dgnorth)

sh-4.2$ scp -r /oracle/DG1/stdby_control.dbf oracle@dgsouth:/oracle/DG1/ oracle@dgsouth's password: stdby_control.dbf 100% 9808KB 9.6MB/s 00:00

8.3 Distributing Standby Control File on Standby Host (dgsouth)

The file is copied into the directories which are stated in the database parameter file using the CONTROLFILES= parameter.

sh-4.2$ pwd /oracle/DG1

-sh-4.1$ cp stdby_controlf.dbf /oracle/DG1/origlogA/cntrl/cntrlDG1.dbf -sh-4.1$ cp stdby_controlf.dbf /oracle/DG1/origlogB/cntrl/cntrlDG1.dbf -sh-4.1$ cp stdby_controlf.dbf /oracle/DG1/sapdata1/cntrl/cntrlDG1.dbf

Setting up 12c Data Guard

Document History

CUSTOMER

Error! Reference source not found. 19

8.4 Distributing the Password file (dgnorth -> dgsouth)

sh-4.2$ scp $ORACLE_HOME/dbs/orapwDG1 dgsouth:$ORACLE_HOME/dbs/orapwDG1 oracle@dgsouth's password: orapwDG1 100% 7680 7.5KB/s 00:00

8.5 Mounting Standby Database (dgsouth)

SQL> create spfile from pfile; File created.

SQL> startup mount; ORACLE instance started. Total System Global Area 1157627904 bytes Fixed Size 2923632 bytes Variable Size 385876880 bytes Database Buffers 754974720 bytes Redo Buffers 13852672 bytes Database mounted.

8.6 Creating Standby Redolog Files (on dgnorth and dgsouth)

NOTE: The Standby Redologs must have the same size just like the 'normal' Redologs!

-sh-4.1$ mkdir /oracle/DG1/standbylog SQL> alter database add standby logfile '/oracle/DG1/standbylog/srl1.dbf' size 209715200 reuse; SQL> alter database add standby logfile '/oracle/DG1/standbylog/srl2.dbf' size 209715200 reuse; SQL> alter database add standby logfile '/oracle/DG1/standbylog/srl3.dbf' size 209715200 reuse; SQL> alter database add standby logfile '/oracle/DG1/standbylog/srl4.dbf' size 209715200 reuse; SQL> alter database add standby logfile '/oracle/DG1/standbylog/srl5.dbf' size 209715200 reuse;

Setting up 12c Data Guard

Document History

CUSTOMER

Error! Reference source not found. 20

9 CONFIGURING DATA GUARD BROKER

9.1 Starting up the Databases

9.1.1 Mounting Standby Database (dgsouth)

SQL> startup mount; ORACLE instance started. Total System Global Area 1157627904 bytes Fixed Size 2923632 bytes Variable Size 385876880 bytes Database Buffers 754974720 bytes Redo Buffers 13852672 bytes Database mounted. .

9.1.2 Opening Primary Database (dgnorth)

SQL> alter database open; Database altered.

9.2 Defining Protection Modes

Maximum Performance (default Setting) - using it as it is the recommended

Maximum Availability

Maximum Protection

Setting up 12c Data Guard

Document History

CUSTOMER

Error! Reference source not found. 21

9.3 Creating the Configuration on Primary (dgnorth)

Execute this as 'oracle' user!

sys users password is 'test1234'

-sh-4.1$ dgmgrl DGMGRL for Linux: Version 12.1.0.2.0 - 64bit Production Copyright (c) 2000, 2013, Oracle. All rights reserved. Welcome to DGMGRL, type "help" for information.

DGMGRL> connect sys Password: Connected as SYSDG.

DGMGRL> create configuration dg1 as primary database is dg1_north connect identifier is dg1north.WORLD; Configuration "dg1" created with primary database "dg1_north"

9.4 Adding the physical Standby Database (on Primary, dgnorth)

DGMGRL> add database dg1_south as connect identifier is dg1south.WORLD; Database "dg1_south" added

DGMGRL> show configuration Configuration - dg1 Protection Mode: MaxPerformance Members: dg1_north - Primary database dg1_south - Physical standby database Fast-Start Failover: DISABLED Configuration Status: DISABLED

Setting up 12c Data Guard

Document History

CUSTOMER

Error! Reference source not found. 22

9.5 Overview of Data Guard Broker Properties

9.5.1 Properties on dg1_north

DGMGRL> show database dg1_north Database - dg1_north Role: PRIMARY Intended State: OFFLINE Instance(s): DG1 Database Status: DISABLED

Setting up 12c Data Guard

Document History

CUSTOMER

Error! Reference source not found. 23

DGMGRL> show database verbose 'dg1_north'; Database - dg1_north Role: PRIMARY Intended State: OFFLINE Instance(s): DG1 Properties: DGConnectIdentifier = 'dg1north' ObserverConnectIdentifier = '' LogXptMode = 'ASYNC' RedoRoutes = '' DelayMins = '0' Binding = 'optional' MaxFailure = '0' MaxConnections = '1' ReopenSecs = '300' NetTimeout = '30' RedoCompression = 'DISABLE' LogShipping = 'ON' PreferredApplyInstance = '' ApplyInstanceTimeout = '0' ApplyLagThreshold = '0' TransportLagThreshold = '0' TransportDisconnectedThreshold = '30' ApplyParallel = 'AUTO' StandbyFileManagement = 'AUTO' ArchiveLagTarget = '0' LogArchiveMaxProcesses = '2' LogArchiveMinSucceedDest = '1' DbFileNameConvert = '' LogFileNameConvert = 'DG1, DG1' FastStartFailoverTarget = '' InconsistentProperties = '(monitor)' InconsistentLogXptProps = '(monitor)' SendQEntries = '(monitor)' LogXptStatus = '(monitor)' RecvQEntries = '(monitor)' StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dgnorth)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=dg1_north_DGMGRL)(INSTANCE_NAME=DG1)(SERVER=DEDICATED)))' StandbyArchiveLocation = '/oracle/DG1/oraarch/DG1arch' AlternateLocation = '' LogArchiveTrace = '0' LogArchiveFormat = '%t_%s_%r.dbf' TopWaitEvents = '(monitor)' Database Status: DISABLED

Setting up 12c Data Guard

Document History

CUSTOMER

Error! Reference source not found. 24

9.5.2 Properties on dg1_south

DGMGRL> show database dg1_south; Database - dg1_south Role: PHYSICAL STANDBY Intended State: OFFLINE Transport Lag: (unknown) Apply Lag: (unknown) Average Apply Rate: (unknown) Real Time Query: OFF Instance(s): DG1 Database Status: DISABLED

Setting up 12c Data Guard

Document History

CUSTOMER

Error! Reference source not found. 25

DGMGRL> show database verbose 'dg1_south'; Database - dg1_south Role: PHYSICAL STANDBY Intended State: OFFLINE Transport Lag: (unknown) Apply Lag: (unknown) Average Apply Rate: (unknown) Active Apply Rate: (unknown) Maximum Apply Rate: (unknown) Real Time Query: OFF Instance(s): DG1 Properties: DGConnectIdentifier = 'dg1south.world' ObserverConnectIdentifier = '' LogXptMode = 'ASYNC' RedoRoutes = '' DelayMins = '0' Binding = 'optional' MaxFailure = '0' MaxConnections = '1' ReopenSecs = '300' NetTimeout = '30' RedoCompression = 'DISABLE' LogShipping = 'ON' PreferredApplyInstance = '' ApplyInstanceTimeout = '0' ApplyLagThreshold = '0' TransportLagThreshold = '0' TransportDisconnectedThreshold = '30' ApplyParallel = 'AUTO' StandbyFileManagement = 'AUTO' ArchiveLagTarget = '0' LogArchiveMaxProcesses = '2' LogArchiveMinSucceedDest = '1' DbFileNameConvert = '' LogFileNameConvert = 'DG1, DG1' FastStartFailoverTarget = '' InconsistentProperties = '(monitor)' InconsistentLogXptProps = '(monitor)' SendQEntries = '(monitor)' LogXptStatus = '(monitor)' RecvQEntries = '(monitor)' StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dgsouth)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=dg1_south_DGMGRL)(INSTANCE_NAME=DG1)(SERVER=DEDICATED)))' StandbyArchiveLocation = '/oracle/DG1/oraarch/DG1arch' AlternateLocation = '' LogArchiveTrace = '0' LogArchiveFormat = '%t_%s_%r.dbf' TopWaitEvents = '(monitor)' Database Status: DISABLED

Setting up 12c Data Guard

Document History

CUSTOMER

Error! Reference source not found. 26

9.6 Enable configuration

DGMGRL> enable configuration;

Enabled.

9.6.1 Monitoring on dgnorth (Alert Log)

Wed Jun 22 14:18:31 2016 ALTER SYSTEM SET log_archive_dest_state_2='ENABLE' SCOPE=BOTH; Wed Jun 22 14:18:31 2016 ALTER SYSTEM SET log_archive_trace=0 SCOPE=BOTH SID='DG1'; Wed Jun 22 14:18:31 2016 ALTER SYSTEM SET log_archive_format='%t_%s_%r.dbf' SCOPE=SPFILE SID='DG1'; Wed Jun 22 14:18:31 2016 ALTER SYSTEM SET standby_file_management='AUTO' SCOPE=BOTH SID='*'; Wed Jun 22 14:18:31 2016 ALTER SYSTEM SET archive_lag_target=0 SCOPE=BOTH SID='*'; Wed Jun 22 14:18:31 2016 ALTER SYSTEM SET log_archive_max_processes=2 SCOPE=BOTH SID='*'; Wed Jun 22 14:18:31 2016 ALTER SYSTEM SET log_archive_min_succeed_dest=1 SCOPE=BOTH SID='*'; Wed Jun 22 14:18:31 2016 ALTER SYSTEM SET log_file_name_convert='DG1','DG1' SCOPE=SPFILE; Wed Jun 22 14:21:03 2016 Thread 1 advanced to log sequence 32 (LGWR switch) Current log# 4 seq# 32 mem# 0: /oracle/DG1/origlogB/log_g14m1.dbf Current log# 4 seq# 32 mem# 1: /oracle/DG1/mirrlogB/log_g14m2.dbf Wed Jun 22 14:21:05 2016 TT01: Standby redo logfile selected for thread 1 sequence 32 for destination LOG_ARCHIVE_DEST_2 Wed Jun 22 14:21:05 2016 Archived Log entry 51 added for thread 1 sequence 31 ID 0x70f640be dest 1:

Setting up 12c Data Guard

Document History

CUSTOMER

Error! Reference source not found. 27

9.6.2 Monitoring on dgsouth (Alert Log)

Wed Jun 22 14:18:31 2016 ALTER SYSTEM SET log_archive_trace=0 SCOPE=BOTH SID='DG1'; Wed Jun 22 14:18:31 2016 ALTER SYSTEM SET log_archive_format='%t_%s_%r.dbf' SCOPE=SPFILE SID='DG1'; Wed Jun 22 14:18:31 2016 ALTER SYSTEM SET standby_file_management='AUTO' SCOPE=BOTH SID='*'; Wed Jun 22 14:18:31 2016 ALTER SYSTEM SET archive_lag_target=0 SCOPE=BOTH SID='*'; Wed Jun 22 14:18:31 2016 ALTER SYSTEM SET log_archive_max_processes=2 SCOPE=BOTH SID='*'; Wed Jun 22 14:18:31 2016 ALTER SYSTEM SET log_archive_min_succeed_dest=1 SCOPE=BOTH SID='*'; Wed Jun 22 14:18:31 2016 ALTER SYSTEM SET log_file_name_convert='DG1','DG1' SCOPE=SPFILE; Wed Jun 22 14:18:31 2016 ALTER SYSTEM SET fal_server='dg1north.world' SCOPE=BOTH; Wed Jun 22 14:21:05 2016 RFS[3]: Selected log 5 for thread 1 sequence 32 dbid 1895179966 branch 913812350 Wed Jun 22 14:21:05 2016 Media Recovery Waiting for thread 1 sequence 32 (in transit) Wed Jun 22 14:21:05 2016 Archived Log entry 17 added for thread 1 sequence 31 ID 0x70f640be dest 1: Wed Jun 22 14:21:06 2016 Recovery of Online Redo Log: Thread 1 Group 5 Seq 32 Reading mem 0 Mem# 0: /oracle/DG1/standbylog/srl1.dbf

Setting up 12c Data Guard

Document History

CUSTOMER

Error! Reference source not found. 28

9.7 Check network between Primary and Standby

In case there is an ORA-12154 happening during probing the network between the nodes, change the StaticConnectIdentifier property to the TNS_ALIAS. NOTE, if there is an active connection between the nodes, the property gets changed on both sides.

DGMGRL> edit database dg1_north set property StaticConnectIdentifier='dg1north.world'; Property "staticconnectidentifier" updated

DGMGRL> edit database dg1_south set property StaticConnectIdentifier='dg1south.world'; Property "staticconnectidentifier" updated

DGMGRL> connect sys/[email protected]; Connected as SYSDBA.

DGMGRL> connect sys/[email protected]; Connected as SYSDBA.

Setting up 12c Data Guard

Document History

CUSTOMER

Error! Reference source not found. 29

10 TESTING THE SWITCHOVER

10.1 From dg1_north to dg1_south

DGMGRL> switchover to dg1_south; Performing switchover NOW, please wait... Operation requires a connection to instance "DG1" on database "dg1_south" Connecting to instance "DG1"... Connected as SYSDBA. New primary database "dg1_south" is opening... Operation requires start up of instance "DG1" on database "dg1_north" Starting instance "DG1"... ORACLE instance started. Database mounted. Switchover succeeded, new primary is "dg1_south"

10.2 From dg1_south to dg1_north

DGMGRL> switchover to dg1_north; Performing switchover NOW, please wait... New primary database "dg1_north" is opening... Operation requires start up of instance "DG1" on database "dg1_south" Starting instance "DG1"... ORACLE instance started. Database mounted. Switchover succeeded, new primary is "dg1_north"

Setting up 12c Data Guard

Document History

CUSTOMER

Error! Reference source not found. 30

11 CONFIGURING BRBACKUP (dgsouth)

# Oracle connection string to the primary database # [primary_db = <conn_str> | LOCAL] # no default primary_db = <tns alias> where <tns alias> in tnsnames.ora points to the primary database ! Example: # Oracle connection string to the primary database # [primary_db = <conn_str> | LOCAL] # no default primary_db = dg1north.WORLD

© 2016 SAP SE or an SAP affiliate company. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an SAP affiliate company. SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE (or an SAP affiliate company) in Germany and other countries. Please see http://www.sap.com/corporate-en/legal/copyright/index.epx#trademark for additional trademark information and notices. Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors. National product specifications may vary. These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP SE or its affiliated companies shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP SE or SAP affiliate company products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty. In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related presentation, or to develop or release any functionality mentioned therein. This document, or any related presentation, and SAP SE’s or its affiliated companies’ strategy and possible future developments, products, and/or platform directions and functionality are all subject to change and may be changed by SAP SE or its affiliated companies at any time for any reason without notice. The information in this document is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. All forward-looking statements are subject to various risks and uncertainties that could cause actual results to differ materially from expectations. Readers are cautioned not to place undue reliance on these forward-looking statements, which speak only as of their dates, and they should not be relied upon in making purchasing decisions.

www.sap.com