Download as pdf or txt
Download as pdf or txt
You are on page 1of 45

DBCS RAC Workshop

Lab Guide

Version 1
20 March 2016
DBCS RAC Workshop

TABLE OF CONTENTS

Introduction ............................................................................................................................................... 3

RAC Provisioning and Configuration ........................................................................................................... 4

RAC Connection Options .......................................................................................................................... 15

RACCLI Utility ........................................................................................................................................... 21

Copyright © 2016, Oracle and/or its affiliates. All rights reserved 2


DBCS RAC Workshop

INTRODUCTION

This material is designed to give an introduction into the RAC functionality available in the Oracle
Public Cloud. This functionality is part of the Database Cloud Service offering and is available with the
Enterprise Edition Extreme Performance option.
Oracle RAC enhances Oracle Database capabilities so that you can use multiple database
instances on different compute nodes in a Database as a Service instance concurrently. This allows you to
use horizontal scalability beyond the scope of one compute node, in case this compute node is insufficient
to run the desired workload. It also increases availability of the database and the data in case a database
instance or compute node fails. The remaining database instance can be used to continue operations while
the failed database instance or compute node is being restarted. Having more than one database instance
also allows you to perform rolling patch upgrades.

In the next sections we’ll cover:


 Instance Provisioning
 Network Configuration
 Monitoring Tools
 Connecting using external tools
 RACCLI Utility

Copyright © 2016, Oracle and/or its affiliates. All rights reserved 3


DBCS RAC Workshop

RAC Provisioning and Configuration


This section provides information about provisioning and configuration of a newly created Oracle
Database Cloud - Database as a Service instance that hosts an Oracle Real Application Clusters (Oracle
RAC) database.

When you create a service instance at the Oracle Database Cloud Service level and choose the RAC
Database option, Database as a Service creates a two-node cluster database using Oracle RAC. Each
node of the database is hosted on a compute node that Database as a Service creates using Oracle
Compute Cloud Service resources. In brief, Database as a Service:

 Creates two compute nodes that are alike in all respects except that each one has its own public IP
address.
 Installs Oracle Linux 6.6, Oracle Grid Infrastructure 12.1.0.2, Oracle Database 12.1.0.2 or 11.2.0.4
(depending on which version was selected), and cloud tooling software on each of the compute
nodes.
 Creates three Oracle Automatic Storage Management (ASM) disk groups to provide shared
storage for database data, the fast recovery area, and the redo logs, and mounts the disk groups
as shared file systems on the two compute nodes using Oracle ASM Cluster File System (ACFS).
 Creates Oracle Compute Cloud Service networking resources to provide access to the compute
nodes, setting all except SSH access on port 22 to a disabled status.
 Creates and starts a two-node Oracle RAC database on the compute nodes and starts the network
listeners for the nodes.

STEP 1: Provisioning of a DBCS RAC instance

 Log in to your cloud account and navigate to the Oracle Database Cloud Service home page.
To start the provisioning wizard, click Create Service.
DBCS RAC Workshop

 In the first step of the wizard keep the defaults and click Next.
DBCS RAC Workshop

 For the database version select Oracle Database 12c Release 1 and click Next.
DBCS RAC Workshop

 For the database edition select Enterprise Edition – Extreme Performance and click Next.

 On the Details page, provide the following configuration parameters and click Next:

Service Name: DBCS-RAC1


Shape: OC4 – 2 OCPU, 15 GB RAM
Timezone: keep the default value
SSH Public Key: upload the ssh public key file
Administration Password: Alpha2014_
Database Clustering with RAC: Checked
Backup Destination: None
DBCS RAC Workshop
DBCS RAC Workshop

 On the Confirmation page, review the selected options and click Create.

STEP 2: Network Configuration

 Once provisioning is complete, the new instance will be available in the service list.
DBCS RAC Workshop

 Click the instance name in order to see the details for the 2 nodes.
DBCS RAC Workshop

 To enable the network rules, navigate to Oracle Compute Cloud Service.

 On the Overview page are listed the two VMs that were created for the two nodes.
DBCS RAC Workshop

 Navigate to the Network tab and enable the rules below:


ora_p2_monitor_12c
ora_p2_scan_listener
DBCS RAC Workshop

STEP 3: Administration Console

 In order to access the monitoring console associated with the RAC instance, navigate back to the
Database Cloud Service home page, click the hamburger menu and select Open EM Console.

 If you get a security warning, expand I Understand the Risks and click Add Exception. Then
click Confirm Security Exception to accept the exception.
DBCS RAC Workshop

 On the login page of EM Console, use the following credentials:


User Name: sys
Password: Alpha2014_

 On the Database Home page it’s highlighted the fact that we have a 2 nodes RAC instance.
DBCS RAC Workshop

RAC Connection Options

This section describes various connection options for accessing the two nodes using standard
protocols like SSH or SQL*Net.

 First create two putty connections to the opc account for each node of the RAC, by providing the
Public IP of the cloud VM and the private SSH key associated with the RAC instance.

 In order to view the listener status, login to one of the nodes using putty, switch the user to oracle
and run the check:

[opc@dbcs-rac12 ~]$ sudo -s


[root@dbcs-rac12 opc]# su oracle
[oracle@dbcs-rac12 opc]$ lsnrctl status
DBCS RAC Workshop

 Use this information to build the TNS string that will be added to your local tnsnames.ora file.
DBCS_RAC = (DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=Node1_IP)(PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=Node2_IP)(PORT=1521))
(LOAD_BALANCE=ON)
(FAILOVER=ON)
)
(CONNECT_DATA=(SERVICE_NAME=orcl.gse00000465.oraclecloud.internal))
)
DBCS RAC Workshop

 In the next step, a new connection to the cloud instance will be defined using the TNS entry that
was just created above. Open SQL Developer and initiate a new connection using the following
details:
Connection Name: DBCS_RAC1
Username: sys
Password: Alpha2014_
Connection Type: TNS
Role: SYSDBA
Network Alias: DBCS_RAC

 Connect to the cloud instance and issue the following SQL statement:
select distinct inst_id from gv$session;
DBCS RAC Workshop

Note: The screenshot above illustrates the fact that there are sessions associated with both of the nodes.

 Now, let’s stop the first node from the UI interface.


DBCS RAC Workshop

 The node is put in Maintenance mode and a message is displayed at the top of the page.

 Return to SQL Developer and rerun the SQL statement. Notice that there are no more sessions
associated with node 1. This illustrates the load balancing capabilities of the Oracle RAC
infrastructure.
DBCS RAC Workshop

 Return to the EM Console. Notice that an error message is displayed stating that the connection
with the database was lost. This is due to the fact that the console was running on the node 1 VM,
as you can see from the IP in the link.

 Now, all you need to do is to replace the IP in the link with the IP of the second node:
https://140.86.2.74:5500/em

 In the end, return to the UI and Start node 1.


DBCS RAC Workshop

RACCLI Utility
The raccli utility is provided on Oracle Database Cloud - Database as a Service instances that use
Oracle Real Application Clusters (RAC) to perform a variety of life-cycle and administration operations.
DBCS RAC Workshop

Using the raccli utility, you can perform operations like:

o Backing up the database


o Recovering the database from a backup
o Changing configuration of automatic backups
o Patching the Oracle Database, Grid Infrastructure and cloud tooling software
o Changing the configuration of security features
o Tracking the progress and completion of long-running operations performed as asynchronous jobs

The next section will explore the various tasks that can be performed with the RACCLI utility and the
different options that can be used with each command.

STEP 1: Backup Configuration

 Login to the opc user using putty.

 Run the describe system subcommand of the raccli utility in order to get information about
the installation of Grid Infrastructure, Oracle Database, and the RDK cloud.

[opc@dbcs-rac12 ~]$ raccli describe system

"serviceName" : "dbcs-rac1",

"nodeComponents" : [ {

"nodeName" : "dbcs-rac11",

"components" : [ {

"componentType" : "GridHome",

"componentName" : "OraGrid12102",

"componentVersion" : "12.1.0.2.0(21984159, 21359761)"

}, {

"componentType" : "DatabaseHome",

"componentName" : "OraDB12102_home1",

"componentVersion" : "12.1.0.2.13 (21694919)"

}, {

"componentType" : "RDK",
DBCS RAC Workshop

"componentName" : "RDK",

"componentVersion" : "16.1.3.0.0"

} ]

}, {

"nodeName" : "dbcs-rac12",

"components" : [ {

"componentType" : "GridHome",

"componentName" : "OraGrid12102",

"componentVersion" : "12.1.0.2.0(21984159, 21359761)"

}, {

"componentType" : "DatabaseHome",

"componentName" : "OraDB12102_home1",

"componentVersion" : "12.1.0.2.13 (21694919)"

}, {

"componentType" : "RDK",

"componentName" : "RDK",

"componentVersion" : "16.1.3.0.0"

} ]

} ],

"storage" : {

"localFileSystem" : [ {

"disk" : "/dev/xvdc1",

"mountPoint" : "/u01",

"availableSize" : "44G",

"totalSize" : "69G",

"name" : "dbcs-rac11"

}, {

"disk" : "/dev/xvdc1",

"mountPoint" : "/u01",

"availableSize" : "44G",

"totalSize" : "69G",

"name" : "dbcs-rac12"

} ],

"sharedFileSystem" : [ {

"mountPoint" : "/u02",

"totalSize" : "25 GB",

"availableSize" : "19 GB",

"volumeName" : "/dev/asm/data-54",

"diskGroup" : {

"redundancy" : "External",
DBCS RAC Workshop

"disks" : [ {

"name" : "/dev/xvdd1"

} ],

"name" : "data"

},

"name" : "data"

}, {

"mountPoint" : "/u03",

"totalSize" : "18 GB",

"availableSize" : "13 GB",

"volumeName" : "/dev/asm/fra-297",

"diskGroup" : {

"redundancy" : "External",

"disks" : [ {

"name" : "/dev/xvde1"

} ],

"name" : "fra"

},

"name" : "fra"

}, {

"mountPoint" : "/u04",

"totalSize" : "19 GB",

"availableSize" : "10 GB",

"volumeName" : "/dev/asm/redo-126",

"diskGroup" : {

"redundancy" : "External",

"disks" : [ {

"name" : "/dev/xvdf1"

} ],

"name" : "redo"

},

"name" : "redo"

} ]

}
DBCS RAC Workshop
DBCS RAC Workshop

 Run the list backupconfig subcommand of the raccli utility for displaying the list of backup
configuration settings available on the RAC instance.

[opc@dbcs-rac12 ~]$ raccli list backupconfig

 Run the list backup command to display the list and status of all the backup jobs on a RAC
instance. At the moment there are no backups available for the DBCS-RAC1 instance, so the list
is empty.

[opc@dbcs-rac12 ~]$ raccli list backup


DBCS RAC Workshop

 Create a first backup by issuing the create backup command.

[opc@dbcs-rac12 ~]$ raccli create backup

Note: As the error states, the backup cannot be created as no backup option was selected during the
instance provisioning.

 In order to update the backup configuration, the update backupconfig command will be used
with the following parameters:
diskEnabled: true

ossEnabled: true

cloudStorageIdentityDomain: gse00000465

cloudStorageUser: cloud.admin

cloudStoragePwd: the password of the cloud.admin user

cloudStorageServiceName: Storage

CloudStoreContainer: CARAC01  existing storage container created by the cloud.admin user

[opc@dbcs-rac12 ~]$ raccli update backupconfig -params '{"diskEnabled" :


true, "ossEnabled" : true, "cloudStorageUser" : "cloud.admin",
"cloudStoragePwd" : "*********", "cloudStorageIdentityDomain" :
"gse00000465", "CloudStoreContainer" : "CARAC01",
"cloudStorageServiceName" : "Storage"}'
DBCS RAC Workshop

 Rerun the list backupconfig command to see the new parameters being set.

[opc@dbcs-rac11 ~]$ raccli list backupconfig

 Now that the backup configuration was updated, rerun the create backup command.

The create backup command creates a backup of the configuration files, inventory configuration
files, Grid Infrastructure and Oracle Database home, database, and tooling metadata of a RAC
instance
To check the progress of the scheduled task use the describe job command. The describe
job command provides information about the progress and status of a long-running operation.

[opc@dbcs-rac12 ~]$ raccli create backup


[opc@dbcs-rac12 ~]$ raccli describe job 3
DBCS RAC Workshop
DBCS RAC Workshop

 Rerun the describe job command until the operation is completed.


DBCS RAC Workshop

STEP 2: Management and Monitoring

 In order to see the full list of jobs that run on the instance, issue the list jobs command.
[opc@dbcs-rac12 ~]$ raccli list jobs

 For an overview of available backups use the list backup command of the raccli utility which
provides a list and status of all the backup jobs.

[opc@dbcs-rac12 ~]$ raccli list backup

[ {

"updatedTimestamp" : "2016-03-13, 10:20:26",

"id" : 1457863708672,

"name" : "rdbaas_backup",

"description" : null,

"createTimeStamp" : "2016-03-13, 10:08:28",

"type" : "Backup",

"tagName" : "auto",

"endTime" : null,

"backupComponents" : [ {

"updatedTimestamp" : "2016-03-13, 10:08:41",

"id" : 1457863718949,

"name" : null,

"description" : null,

"createTimeStamp" : "2016-03-13, 10:08:38",

"type" : null,

"component_name" : "GIConfig",

"backupLocations" : [ {
DBCS RAC Workshop

"updatedTimestamp" : "2016-03-13, 10:08:40",

"id" : 1457863720295,

"name" : null,

"description" : null,

"createTimeStamp" : "2016-03-13, 10:08:40",

"type" : null,

"location" : "DISK",

"info" : "Location /u03/app/oracle"

}, {

"updatedTimestamp" : "2016-03-13, 10:08:41",

"id" : 1457863721785,

"name" : null,

"description" : null,

"createTimeStamp" : "2016-03-13, 10:08:41",

"type" : null,

"location" : "OSS",

"info" : "Location https://gse00000465.storage.oraclecloud.com/"

} ]

}, {

"updatedTimestamp" : "2016-03-13, 10:08:47",

"id" : 1457863721958,

"name" : null,

"description" : null,

"createTimeStamp" : "2016-03-13, 10:08:41",

"type" : null,

"component_name" : "OSConfig",

"backupLocations" : [ {

"updatedTimestamp" : "2016-03-13, 10:08:43",

"id" : 1457863723434,

"name" : null,

"description" : null,

"createTimeStamp" : "2016-03-13, 10:08:43",

"type" : null,

"location" : "DISK",

"info" : "Location /u03/app/oracle"

}, {

"updatedTimestamp" : "2016-03-13, 10:08:45",

"id" : 1457863725470,

"name" : null,

"description" : null,
DBCS RAC Workshop

"createTimeStamp" : "2016-03-13, 10:08:45",

"type" : null,

"location" : "OSS",

"info" : "Location https://gse00000465.storage.oraclecloud.com/"

} ]

}, {

"updatedTimestamp" : "2016-03-13, 10:08:49",

"id" : 1457863727402,

"name" : null,

"description" : null,

"createTimeStamp" : "2016-03-13, 10:08:47",

"type" : null,

"component_name" : "DerbyDB",

"backupLocations" : [ {

"updatedTimestamp" : "2016-03-13, 10:08:48",

"id" : 1457863728187,

"name" : null,

"description" : null,

"createTimeStamp" : "2016-03-13, 10:08:48",

"type" : null,

"location" : "DISK",

"info" : "Location /u03/app/oracle"

}, {

"updatedTimestamp" : "2016-03-13, 10:08:49",

"id" : 1457863729025,

"name" : null,

"description" : null,

"createTimeStamp" : "2016-03-13, 10:08:49",

"type" : null,

"location" : "OSS",

"info" : "Location https://gse00000465.storage.oraclecloud.com/"

} ]

}, {

"updatedTimestamp" : "2016-03-13, 10:08:55",

"id" : 1457863732509,

"name" : null,

"description" : null,

"createTimeStamp" : "2016-03-13, 10:08:52",

"type" : null,

"component_name" : "DBConfig",
DBCS RAC Workshop

"backupLocations" : [ {

"updatedTimestamp" : "2016-03-13, 10:08:53",

"id" : 1457863733627,

"name" : null,

"description" : null,

"createTimeStamp" : "2016-03-13, 10:08:53",

"type" : null,

"location" : "DISK",

"info" : "Location /u03/app/oracle"

}, {

"updatedTimestamp" : "2016-03-13, 10:08:55",

"id" : 1457863735038,

"name" : null,

"description" : null,

"createTimeStamp" : "2016-03-13, 10:08:55",

"type" : null,

"location" : "OSS",

"info" : "Location https://gse00000465.storage.oraclecloud.com/"

} ]

}, {

"updatedTimestamp" : "2016-03-13, 10:20:26",

"id" : 1457863735159,

"name" : null,

"description" : null,

"createTimeStamp" : "2016-03-13, 10:08:55",

"type" : null,

"component_name" : "Database",

"backupLocations" : [ {

"updatedTimestamp" : "2016-03-13, 10:18:21",

"id" : 1457864301935,

"name" : null,

"description" : null,

"createTimeStamp" : "2016-03-13, 10:18:21",

"type" : null,

"location" : "DISK",

"info" : "Location /u03/app/oracle"

}, {

"updatedTimestamp" : "2016-03-13, 10:20:26",

"id" : 1457864426711,

"name" : null,
DBCS RAC Workshop

"description" : null,

"createTimeStamp" : "2016-03-13, 10:20:26",

"type" : null,

"location" : "OSS",

"info" : "Location https://gse00000465.storage.oraclecloud.com/"

} ]

} ],

"jobId" : "3"

} ]
DBCS RAC Workshop
DBCS RAC Workshop

STEP 3: CloudBerry Explorer for Backup Container

 Now, let’s browse the storage container using CloudBerry Explorer. The first step is to create the
connection to the container using the below parameters:
Display name: give a name at your choice

User name: Storage-<identity_domain>:username

Api key: the password of the cloud username(cloud.admin in our case)

Authentication Service: https:// <identity_domain>.storage.oraclecloud.com/auth/v1.0

Keystone version: Do not use

 Once connected, select the newly created connection in the Source pane. The list of associated
containers will display.
DBCS RAC Workshop

 The CARAC01 container holds the database backups. Browse through the content.

 The Backup_DBConfig container was automatically created and holds the backups of the
configuration files associated with the instance.
DBCS RAC Workshop

STEP 4: Instance Recovery

The next section covers the recovery functionality performed using the RACCLI Utility

 Open a new terminal window and connect to the oracle user. Then login to sqlplus and query the
list of existing tablespaces.

[opc@dbcs-rac12 ~]$ sudo -s


[root@dbcs-rac12 opc]# su oracle
[oracle@dbcs-rac12 opc]$ sqlplus / as sysdba
SQL> select tablespace_name from dba_tablespaces;

 Create a new tablespace, example, and rerun the previous query.


SQL> create tablespace example;
SQL> select tablespace_name from dba_tablespaces;
DBCS RAC Workshop

 Perform the same operation at PDB level.


SQL> alter session set container = PDB1;
SQL> select tablespace_name from dba_tablespaces;
SQL> create tablespace example;
DBCS RAC Workshop

 Now, let’s see how this translated at file system level.


SQL> select name from v$datafile;

 Since a new tablespace was created, let’s run another backup. Navigate back to the opc terminal
and run the below command:
[opc@dbcs-rac12 ~]$ raccli create backup
DBCS RAC Workshop
DBCS RAC Workshop

 In the next steps, we’ll illustrate the recovery process. First identify the data file associated with the
example tablespace and delete it. Connected as the oracle user, navigate to the datafile location
and remove the file.

[oracle@dbcs-rac12 opc]$ cd /u02/app/oracle/oradata/ORCL/datafile

 In order to see the effect of the missing file, let’s take the tablespace offline and then back online.
The operation will fail with an error stating that the data file cannot be identified.

SQL> alter tablespace example offline immediate;


SQL> alter tablespace example online;
DBCS RAC Workshop

 Considering that a data file was lost, the recovery of the database needs to be performed using the
latest backup.
[opc@dbcs-rac12 ~]$ raccli create recovery –tag recoverytask -latest

 Check the progress using the describe job command.


[opc@dbcs-rac12 ~]$ raccli describe job 5
DBCS RAC Workshop

 Now, let’s go back at file system level to see what happened. As you can observe, except the data
file associated with the temp tablespace, all other data files have been doubled. For each
tablespace a new recovered data file was created.

 Returning at database level, notice that it’s pointing to the new versions of the data files.

 And to finalize the recovery, bring back online the example tablespace.
SQL> alter tablespace example online;

You might also like