By Joel Peréz ACED.gifSkant Gupta

This article is brought by en.enmotech.com

 

Full Index of Oracle Cloud Articles:

Sir.CloudDBaaSjoelperez

 

If you want to be updated with all our articles send us the Invitation or Follow us:

Joel Perez’s LinkedIn: www.linkedin.com/in/SirDBaaSJoelPerez

Skant Gupta's LinkedIn: www.linkedin.com/in/skantali/

or Join our LinkedIn group: Oracle Cloud DBaaS

 

Hi Readers, in this article you will go through the steps to create a disaster recovery configuration with Oracle Data Guard using the public Cloud Service "Oracle Database Cloud Service". Across a simple wizard you will see how easy is to create a configuration with Data Guard in Cloud-Cloud Deployment. So.. Let's start..

 

This you are reading is a series of 4 articles:

This the # 1 and the rest 3:

 

#2 Oracle Cloud (DBaaS): Switchover, Failover & Reinstate Operations on Oracle Data Guard using DBCS Console

#3 Oracle Cloud (DBaaS): Reinstating a Failed Primary Database using dbaascli utility ( Oracle Data Guard on Cloud )

#4 Oracle Cloud (DBaaS): Using dbaascli Utility for Switchover & Failover Operations on Oracle Data Guard

 

When creating an Oracle Database Cloud Service database deployment at the Oracle Database Cloud Service level, you can create an Oracle Data Guard configuration.

 

Since we will talk about Oracle Data Guard, let’s remember the concept:

 

Oracle Data Guard enables production Oracle databases to survive disasters and data corruptions by providing a comprehensive set of services that create, maintain, manage, and monitor a standby database. Oracle Data Guard maintains the standby database as a copy of the production database. If the production database becomes unavailable because of a planned or an unplanned outage, you can switch the standby database to the production role, minimizing the downtime associated with the outage.

 

To create an Oracle Data Guard configuration in Database Cloud Service, make the following choices in the Create Service wizard:

 

  • For Service Level, choose Oracle Database Cloud Service.
  • For Software Edition, choose Enterprise Edition, Enterprise Edition - High Performance, or Enterprise Edition - Extreme Performance.
  • For Database Type, choose Single Instance with Data Guard Standby.
  • For Standby Database Configuration (on the Service Details page), choose where you want the standby database placed in relation to the primary database:
    • o High Availability—The standby database is placed in a different availability domain from the primary database, thus providing isolation at the infrastructure level.
    • o Disaster Recovery—The standby database is placed in a different data center from the primary database, thus providing isolation at the infrastructure level and geographical separation to support availability despite catastrophic events.

 

When you make these choices, Database Cloud Service creates an Oracle Data Guard configuration with a primary database and a single standby database, hosting the databases on two independent compute nodes. It creates these compute nodes using computing, storage and networking resources provided by Oracle Compute Cloud service.

 

Create the Oracle Data Guard in Cloud Database Service

 

a) Login to your Oracle cloud services account, go to the "Oracle Database Cloud Service" page and create a new service.

  • For Service Name, select DATAGUARD.
  • From the Service Level list, select Oracle Database Cloud Service.
  • From the Metering Frequency list, select whatever frequency is appropriate for your environment.
  • From the Software Release list, select Oracle Database 11g Release2.
  • From the Software Edition list, select Enterprise Edition.
  • From the Database Type list, select Single Instance with Data Guard Standby.

 

Then click Next to continue.

1.JPG

Figure1. Creating a new service (DATAGUARD)

 

b) In the Service Details screen, do the following:

  • For DB Name (SID), enter ORCL.
  • Set an administrative password of your choice and confirm the password (this will be your sys password).
  • For Usable Database Storage (GB), enter 25.
  • From the Compute Shape list, select OC3 -1 OCPU, 7.5GB RAM (this is the bare minimum required).
  • For SSH Public Key, enter rsa-key-20170111.pub.
  • From the Standby Database Configuration, select Disaster Recovery.

 

Then click Next to continue.

2.JPG

Figure 2. Specifying the service details

 

c) Finally, review the configuration and click Create to create your cloud database.

3.JPG

Figure 3. Creating the cloud database instance

 

c) After a few minutes, the data guard in cloud database instance has been created successfully.

4.JPG

Figure 4. The cloud database has been created

 

d) Click the service name (DATAGUARD) to open the main page of the database.

5.JPG

Figure 5. Main page of the dataguard on cloud database

 

Connect the Cloud Database

 

1. Open the two instances of the PuTTY executable and connect to the machine using SSH public key.

6.jpg

Figure 6. Connecting to machines using PuTTY

 

Check the Status of Oracle Data Guard on Cloud

 

  1. On the Database Cloud Service compute node, invoke SQL*Plus and log in to the database as the SYS user on both machines.

 

On Primary Machine

[oracle@DATAGUARD-dg01 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Wed Jun 21 18:20:30 2017

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

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning and Real Application Testing options

SQL>

 

On Standby Machine

[oracle@DATAGUARD-dg02 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Wed Jun 21 18:20:30 2017

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

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning and Real Application Testing options

SQL>

 

   2.- Check the status of database role on both machines.

 

On Primary Machine

SQL> set lines 200

SQL> select name, db_unique_name, database_role, switchover_status, open_mode from v$database;

 

NAME      DB_UNIQUE_NAME                 DATABASE_ROLE    SWITCHOVER_STATUS    OPEN_MODE

--------- ------------------------------ ---------------- -------------------- --------------------

ORCL      ORCL_01                        PRIMARY          SESSIONS ACTIVE      READ WRITE

 

SQL>

 

On Standby Machine

SQL> set lines 200

SQL> select name, db_unique_name, database_role, switchover_status, open_mode from v$database;

NAME      DB_UNIQUE_NAME                 DATABASE_ROLE    SWITCHOVER_STATUS    OPEN_MODE

--------- ------------------------------ ---------------- -------------------- --------------------

ORCL      ORCL_02                        PHYSICAL STANDBY NOT ALLOWED          READ ONLY WITH APPLY

 

SQL>

 

Checking the Status of the Oracle Data Guard Configuration with dbaascli utility

You can use the dataguard status subcommand of the dbaascli utility to check the status of your Oracle Data Guard configuration.

Before performing certain operations, you may want to check the status of your Oracle Data Guard configuration.

To check the status of the Oracle Data Guard configuration by using the dataguard status subcommand:

 

  1. Connect to either compute node in the Data Guard configuration as the oracle user.

 

Using username "opc".

Authenticating with public key "rsa-key-20170425"

Passphrase for key "rsa-key-20170425":

[opc@DATAGUARD-dg01 ~]$ sudo su - oracle

[oracle@DATAGUARD-dg01 ~]$

 

    2. Check the status of the configuration

 

[oracle@DATAGUARD-dg01 ~]$ dbaascli dataguard status

DBAAS CLI version 1.0.0

Executing command dataguard status

SUCCESS : Dataguard is up and running

DETAILS:

Configuration - fsc

  Protection Mode: MaxPerformance

  Databases:

    ORCL_01 - Primary database

    ORCL_02 - Physical standby database

  Properties:

    FastStartFailoverThreshold      = '30'

    OperationTimeout                = '120'

    FastStartFailoverLagLimit       = '30'

    CommunicationTimeout            = '180'

    ObserverReconnect               = '0'

    FastStartFailoverAutoReinstate  = 'TRUE'

    FastStartFailoverPmyShutdown    = 'TRUE'

    BystandersFollowRoleChange      = 'ALL'

    ObserverOverride                = 'FALSE'

    ExternalDestination1            = ''

    ExternalDestination2            = ''

    PrimaryLostWriteAction          = 'CONTINUE'

Fast-Start Failover: DISABLED

Configuration Status:

SUCCESS

[oracle@DATAGUARD-dg01 ~]$

 

    3. Check the status of the configuration with detail subcommand

 

[oracle@DATAGUARD-dg01 ~]$ dbaascli dataguard status --details yes

DBAAS CLI version 1.0.0

Executing command dataguard status --details yes

SUCCESS: Dataguard is up and running

{

   "instances" : [

      {

         "DATABASE_TYPE" : "PRIMARY",

         "PROTECTION_MODE" : "MAXIMUM PERFORMANCE",

         "PROTECTION_LEVEL" : "MAXIMUM PERFORMANCE",

         "ADDITIONAL_MESSAGES" : "",

         "DATABASE_NAME" : "ORCL_01",

         "PENDING_APPLY_LOG_CNT" : 0,

         "ACTIVE_SESSIONS" : "3",

         "HOST_NAME" : "DATAGUARD-dg01",

         "OPEN_MODE" : "READ WRITE"

      },

      {

         "PROTECTION_LEVEL" : "MAXIMUM PERFORMANCE",

         "ADDITIONAL_MESSAGES" : "",

         "APPLY_LAG" : "00 days 00 hrs 00 min 00 sec",

         "DATABASE_NAME" : "ORCL_02",

         "APPROXIMATE_ROLE_TRANSITION_TIME" : "00 days 00 hrs 00 min 00 sec + 30 sec",

         "ACTIVE_SESSIONS" : "2",

         "HOST_NAME" : "DATAGUARD-dg02",

         "TRANSPORT_LAG" : "00 days 00 hrs 00 min 00 sec last computed 0 days 0 hrs 0 min 9 sec before",

         "PROTECTION_MODE" : "MAXIMUM PERFORMANCE",

         "DATABASE_TYPE" : "PHYSICAL STANDBY",

         "OPEN_MODE" : "MOUNTED"

      }

   ]

}

[oracle@DATAGUARD-dg01 ~]$

 

Conclusion

 

So now you know that it is very easy to create the Oracle Data Guard in Database Cloud Service.

This article will continue with two more parts where we will see the steps necessary to perform Switchover, Failover & Reinstate Operations with Console and then performing the same with dbaascli utility.

 

If you want to be updated with remarkable articles and information about Oracle Database Cloud,

Join our network, we will be please to have you there:

Joel Pérez: https://www.linkedin.com/in/sirdbaasjoelperez/

Skant Gupta: www.linkedin.com/in/skantali/

 

We invite you to read the following part of this article:

Oracle Cloud (DBaaS): Switchover, Failover & Reinstate Operations on Oracle Data Guard using DBCS Console

https://community.oracle.com/blogs/Sir.DBaaSJoelPerez/2017/09/01/oracle-cloud-dbaas-switchover-failover-reinstate-operations-on-oracle-data-guard-using-dbcs-console

 

And as a Cloud Topic related you can read here one of our hotest articles:

#10 Oracle 18c: “Oracle 18c and its impact on DBAs”

 

Author Bios:

 

Joel Pérez is an Expert DBA ( Oracle ACE Director, Maximum Availability OCM, OCM Cloud Admin. & OCM12c/11g ) with over 17 years of Real World Experience in Oracle Technology, specialised in design and implement solutions of: High Availability, Disaster Recovery, Upgrades, Replication, Cloud and all area related to Oracle Databases. International consultant with duties, conferences & activities in more than 50 countries and countless clients around the world. Habitual and one of leading writers of Technical Oracle articles for: OTN Spanish, Portuguese, English and more. Regular Speaker in worldwide Oracle events  like: OTN LAD (Latin America), OTN MENA (Middle East & Africa), OTN APAC ( Asian Pacific), DTCC China, Oracle Code.. . Joel has always been known for being a pioneer in Oracle technology since the early days of his career being the first Latin American awarded as “OTN Expert” at year 2003 by Oracle Corp., one of the first “Oracle ACE” globally in the Oracle ACE Program at year 2004. He was honoured as one of the first “OCM Database Cloud Administrator” & Maximum Availability OCM in the world. Currently Joel works as Senior Cloud Database Architect in “Yunhe Enmo (Beijing) Technology Co.,Ltd”., company located in Beijing, China En.enmotech.com

 

Skant Gupta is an Oracle Certified Cloud Professional in Oracle Database 12c, an Oracle Certified Expert in Oracle Real Application Clusters (Oracle RAC) in Oracle Database 11g and 12c, and an Oracle Exadata Certified and an Oracle Certified Professional in Oracle Database 10g, 11g, and 12c. He works at Vodafone Technology in the UK and formerly worked as a senior DBA at Etisalat in Dubai. He has six years of experience with various Oracle technologies, focusing mainly on Cloud, database, and high availability solutions, Oracle WebLogic Suite, Oracle Exadata and Oracle GoldenGate. He has presented at several Oracle user groups worldwide, most recently in the US, the United Arab Emirates, and the India. Skant website link: oracle-help.com