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

Nixon Deploying Hybrid Data Guard on Oracle Cloud

The document outlines the deployment of Hybrid Data Guard on Oracle Cloud, focusing on disaster recovery strategies, environment prerequisites, and the deployment process. It covers configurations for both on-premises and cloud environments, including network setup, database configuration, and Data Guard Broker setup. The presentation emphasizes the importance of data protection, availability, and the use of standby databases for reporting and testing.

Uploaded by

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

Nixon Deploying Hybrid Data Guard on Oracle Cloud

The document outlines the deployment of Hybrid Data Guard on Oracle Cloud, focusing on disaster recovery strategies, environment prerequisites, and the deployment process. It covers configurations for both on-premises and cloud environments, including network setup, database configuration, and Data Guard Broker setup. The presentation emphasizes the importance of data protection, availability, and the use of standby databases for reporting and testing.

Uploaded by

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

Deploying Hybrid Data

Guard on Oracle Cloud


Speaker

Yossi Nixon

Chief Database Architect - Axxana

Oracle DBA since 1998

Speaker: IOUG, ILOUG, RMOUG, GLOC, KSCOPE, NYOUG

Specializes in Data Guard, RAC, performance tuning


@YossiNixon
www.linkedin.com/in/ynixon
oracledba.blogspot.com

www.axxana.com
© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
Agenda

Introduction

Disaster recovery on the Oracle Cloud

Environment Prerequisites

Deployment Process

Active Data Guard and Far Sync

Risk distance and a solution

Conclusion
© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
Introduction
Far Sync
Data Guard and Active Data Guard provides

Data protection - Recovery Point Objective (RPO)


Primary
Standby
Availability - Recovery time objectives (RTO)

Why to use Data on the cloud?


hybrid cloud
implementation.
Disaster recovery plan is costly

Existing production databases remain on-premises

Standby databases can be used for online reporting, test & development
© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
Hybrid DR to the Oracle Cloud
On-Premises (Production) Standby Databases on Public Cloud

Reporting Oracle Public Cloud

Clients Applications Databases


Sandbox Test/Dev
VPN in the cloud
Gateway
Active Data Guard
(encrypted)

Database Cloud
Service

Database Backup
© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud ServiceGreat Lakes Oracle Conference 2018
Environment Prerequisites

OS: Linux, Windows & Solaris X86, DB: EE 64Bit 11.2.0.4, 12.1.0.2, 12.2.0.1
RAC or non-RAC (Note 413484.1 for Data Guard cross-platform compatibility)

Same Oracle Database version for primary and standby databases

Data transfers from on-premises to Oracle Cloud:

Public network

High bandwidth option (Oracle FastConnect)

Oracle Network Cloud Service – Site to Site VPN or VPN as a Service (VPNaaS)
© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
Deployment Process – Create an Oracle Instance
Technical

© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
Database Configuration

© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
Database Cloud Configured

© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
Instance Overview

© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
Create Access Rules

© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
Access Rules List

© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
Adding new Access Rule

© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
On-Premises - Access & prompt-less SSH
Configure Access
Configure Name Resolution

prompt-less SSH:
Oracle Cloud: Generate the ssh key and copy the file to the On-Premises

$ ssh-keygen
$ scp ~/.ssh/id_rsa.pub oracle@<onpremisesIP>:~/.ssh/id_rsa.pub_cloud

On-Premises: Copy the generated key to the authorized_users file

$ cat ~/.ssh/id_rsa.pub_cloud >> ~/.ssh/authorized_users


$ chmod 700 ~/.ssh/authorized_users
© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
On-Premises – SSH login

Connect to the provisioned cloud instance:

$ ssh opc@<cloudip> [-i <key>]

Switch to root:

[opc@stby ~]$ sudo su -

© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
On-Premises - TCP Socket Buffer Size

Check the TCP socket sizes on Oracle Cloud & On-Premises:


run as root
# /sbin/sysctl -a | egrep net.core.[w,r]mem_max
net.core.wmem_max = 2097152
net.core.rmem_max = 4194304
# /sbin/sysctl -a | egrep net.core.[w,r]mem_max
net.core.wmem_max = 1048576
net.core.rmem_max = 4194304
If needed adjust sockets size maximums to 10MB on Oracle Cloud:
# sysctl -w net.core.rmem_max=10485760
# sysctl -w net.core.wmem_max=10485760

© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
On-Premises - Oracle Net

On-premises and cloud machines


sqlnet.ora

SQLNET.ENCRYPTION_SERVER = requested
SQLNET.CRYPTO_CHECKSUM_SERVER = requested
SQLNET.CRYPTO_CHECKSUM_TYPES_SERVER = (SHA1)
SQLNET.ENCRYPTION_TYPES_SERVER = (AES256, AES192, AES128)

SQLNET.ENCRYPTION_CLIENT = requested
SQLNET.CRYPTO_CHECKSUM_CLIENT = requested
SQLNET.ENCRYPTION_TYPES_CLIENT = (AES256, AES192, AES128)

© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
On-Premises - Oracle Home and Patches

Patch differences between databases software homes must be:


Standby-First compatible.
[oracle@stby
sqlnet.ora ~]$ $ORACLE_HOME/OPatch/opatch lspatches
26569225;
24701882;
Note 1265700.1 on Data Guard
26389300;
26272761;
Standby-First patch apply
24401351;
26635944;OJVM RELEASE UPDATE: 12.2.0.1.171017 (26635944)
26710464;Database Release Update : 12.2.0.1.171017 (26710464)

OPatch succeeded.
© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
On-Premises - Standby Redo Logs

SRLs – Standby Redo Logs


ORLs – Online Redo Logs

SRLs size = largest of ORLs (preferred to be uniform size)

Number of SRLs = number of ORLs + 1 for each thread (Per Instance)

SRLs should have same number of threads as ORLs

Best practice is that SRLs are not duplexed like ORLs

© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
On-Premises - Standby Redo Logs
alter system set DB_CREATE_ONLINE_LOG_DEST_1='&DISK_GROUP.'; SRLs are not duplexed
declare
log_num number;
log_size number;
log_num_standby number;
begin Number of Threads
for j in (select THREAD# i from gv$log group by THREAD#) loop
select count(*) into log_num from gv$log where THREAD#=j.i ; Logs Per Tread
select count(*) into log_num_standby from gv$standby_log where THREAD#=j.i ;
select max(BYTES) into log_size from gv$log where THREAD#=j.i ; Maximum Size of ORLs
for i in 1..(log_num+1-log_num_standby) loop
execute immediate 'ALTER DATABASE ADD STANDBY LOGFILE THREAD '||j.i ||' SIZE
'||log_size;
end loop; Bypass Already Created SRLs
end loop;
end;
/
© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
On-Premises: Grid Infrastructure, TDE & Archive mode

Grid infrastructure / Oracle Restart has become an integral part of the


application failover features for Oracle Data Guard

The installation software for Oracle Grid infrastructure is not present on the
cloud service

Enable Archive Log Mode

Convert Database to use Transparent Data Encryption

© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
Prepare the Cloud Environment

Verify Oracle Home and Patches

Database
Remove the Default Database

dbca -silent -deleteDatabase -sourceDB STBY -sysDBAUserName sys


-sysDBAPassword <passwd>

Network
Install the Grid Infrastructure (if not already installed)

Set TCP Socket Buffer Size

Cloud Oracle Net Encryption Configuration


© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
Setting tnsnames.ora

Configure TNS entries for redo transport – Primary/Standby

<primary/standby db_unique_name> =
(DESCRIPTION =
(SDU=65536)
(RECV_BUF_SIZE=10485760)
(SEND_BUF_SIZE=10485760)
(ADDRESS = (PROTOCOL = TCP)(HOST = <primary/standby IP address>)(PORT =
{<port#>}))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = <primary/standby db_unique_name>)
)
)

© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
Setting listener.ora

Configure static listeners on the Cloud

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = <Local Instance name>)_DGMGRL)
(ORACLE_HOME = <Local Oracle Home>)
(SID_NAME = <Local Instance Name>) On 11.2 - a static
) listener is required
)
for Data Guard
Broker
$ORACLE_HOME/bin/lsnrctl reload <listener name>

© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
Preparing Auxiliary Database

Create Audit Directory


mkdir -p /u01/app/oracle/admin/<STANDBY DBNAME>/adump

Create Auxiliary Database, Password File and init.ora


$ $ORACLE_HOME/bin/orapwd file='$ORACLE_HOME/dbs/orapw<INSTANCE_NAME>'
password=${passwd} force=y
$ echo “db_name=<primary db_name>” > /tmp/aux.pfile
$ echo “db_unique_name=<standby db_name>” >> /tmp/aux.pfile
$ echo “sga_target=800M” >> /tmp/aux.pfile

Start the Auxiliary Instance


$ export ORACLE_SID=<standby instance name (STBY)>
$ sqlplus “/ as sysdba”
SQL> startup nomount pfile='/tmp/aux.pfile'
ORACLE instance started.
© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
Duplicate Database from On-Premisses to Cloud

Distribute TDE wallets


Copy the TDE wallet files from on-premises to the cloud to
ENCRYPTION_WALLET_LOCATION directory (defined in sqlnet.ora file)
Instantiate, creating standby database using RMAN DUPLICATE
RMAN> ... duplicate target database for standby from active database
spfile
PARAMETER_VALUE_CONVERT= '<PREMISES DB NAME>', '<CLOUD DB NAME>'
set db_unique_name='<CLOUD DB NAME>’ …

Set these additional parameters


alter system set DB_FLASHBACK_RETENTION_TARGET=120 scope=both sid='*';
alter system set remote_login_passwordfile='exclusive' scope=spfile sid='*';
alter system set DB_BLOCK_CHECKSUM=FULL; (FULL for inmemory checksum, performance impact)
alter system set DB_BLOCK_CHECKING=MEDIUM; (FULL if performance allows it)
alter system set DB_LOST_WRITE_PROTECT=TYPICAL;
alter system set LOG_BUFFER=256M scope=spfile sid='*’;
© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
alter system set STANDBY_FILE_MANAGEMENT=AUTO;
Setting Grid Infrastructure + preparing for Broker

Register the standby database Oracle Restart

$ srvctl add database -d <standby db_unique_name> -c SINGLE <result of


hostname -s> -oh <oracle home> -r physical_standby -s <mount|open>
Configure client Failover
Clients can reconnect to the active primary database after a failure
Configure Data Guard Broker

SQL> alter system set dg_broker_start=FALSE;


SQL> alter system set dg_broker_config_file1=‘<PREMISES_FILE_LOC>/<CLOUD DB NAME>/dr1.dat';
SQL> alter system set dg_broker_config_file2=‘<PREMISES_RECOV_LOC>/<CLOUD DB NAME>/dr2.dat';
SQL> alter system set dg_broker_start=TRUE;
© All Rights Reserved. Axxana 2007-2018
Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
Configuring Data Guard Broker

Data Guard Broker Configuration

dgmgrl sys/<passwd>@<PREMISES>
create configuration 'DGconfig' as primary database is <PREMISES> connect identifier
is <PREMISES>;
add database <CLOUD> as connect identifier is <CLOUD>;
edit database <PREMISES> set property RedoRoutes='(LOCAL: <CLOUD> ASYNC)';
edit database <CLOUD> set property RedoRoutes='(LOCAL:<PREMISES> ASYNC)';
RedoRoutes - not relevant for 11g
EDIT CONFIGURATION SET PROTECTION MODE AS MaxPerformance;
enable configuration;

© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
Data Guard Health Check

Data Guard specific queries

SQL> select thread#,count(group#) from v$log group by thread#; SRL >= ORL per Thread

SQL> select distinct bytes from v$log; Same single value

SQL> select distinct bytes from v$standby_log; Same single value

SQL> select group#,count(member) from v$logfile where type='STANDBY' group by


one for all groups
group#;
SQL> select flashback_on from v$database; YES

SQL> select force_logging from v$database; YES

SQL> show parameter checking


SQL> show parameter log_archive_max_processes remote destinations + threads/instances
© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
Data Guard Health Check

Data Guard VALIDATE DATABASE

DGMGRL> validate database stby;

Database Role: Physical standby database


Protection Mode: MaxAvailability
Primary Database: pdb

Ready for Switchover: Yes


Ready for Failover: Yes (Primary Running)
© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
Active Data Guard with Far Sync

Alternate
Far Sync

Primary Standby

DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY;

RMAN> CONFIGURE ARCHIVELOG DELETION


© All Rights Reserved. Axxana 2007-2018
POLICY TO APPLIED ON Great
Deploying Hybrid Data Guard on Oracle Cloud
ALL STANDBY;
Lakes Oracle Conference 2018
Far Sync Syntax

SQL > ALTER DATABASE CREATE FAR SYNC INSTANCE


CONTROLFILE AS ‘/tmp/farsync.ctl’;
SQL > create pfile=‘/tmp/initfs.ora' from spfile;

SQL > ALTER DATABASE ADD STANDBY LOGFILE THREAD 2


SIZE 52428800;
SQL > create spfile from pfile=‘/tmp/initfs.ora';

DGMGRL> ADD FAR_SYNC fs AS CONNECT IDENTIFIER IS fs;


DGMGRL> EDIT DATABASE pdb SET PROPERTY RedoRoutes = '(LOCAL
: fs SYNC ALT =(sdb ASYNC FALLBACK))';

DGMGRL> EDIT DATABASE pdb SET PROPERTY RedoRoutes = '(LOCAL


: fs SYNC PRIORITY=1, sdb ASYNC PRIORITY=2 ) )';
© All Rights Reserved. Axxana 2007-2018 https://oracledba.blogspot.com/2017/08/creating-far-sync-instance-step-by-step.html
Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
Distance Risk

Distance Between Primary and Standby/Far Sync


Far Sync

Primary
Standby

© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
Axxana – Transparent Layered Protection

Physical
Protection Transparently
Managed Managed
Multiple Network
by the Connectivity by
User WAN, LAN, Wi-Fi, 4G Axxana
Battery
Powered

Data Safe

PhoenixOS
Smart DR

Far Sync
Virtual
Machine
© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
Active Data Guard Far Sync with Axxana

Zero
Distance
SYNC
Recovery over
Cellular/1GbE/10GbE
ASYNC over 10GbE

Far Sync/Multiplexed Redo


Protected By Axxana
Primary Remote Standby
© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
Short Video

Video : The Phoenix by Axxana - Multi Layered Extensive Protection


© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
Conclusion

Disaster Recovery on the Oracle Cloud

 Eliminates costs and complexity

Data Guard or Active Data Guard

 Eliminates downtime potential risk

Axxana’s Solution

 True zero data loss in the hybrid cloud

© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
References

Hybrid DR to Oracle Cloud https://www.oracle.com/assets/dr-to-oracle-cloud-

2615770.pdf

Oracle Data Guard – http://www.oracle.com/goto/dataguard

Maximum Availability Architecture (MAA) – http://www.oracle.com/goto/maa

MAA Blogs – http://blogs.oracle.com/maa

Oracle Cloud Infrastructure – getting started https://docs.us-phoenix-

1.oraclecloud.com/pdf/gsg/OCI_Getting_Started.pdf

© All Rights Reserved. Axxana 2007-2018 Deploying Hybrid Data Guard on Oracle Cloud Great Lakes Oracle Conference 2018
Questions?

You might also like