Professional Documents
Culture Documents
DBCS RAC Workshop: Lab Guide
DBCS RAC Workshop: Lab Guide
Lab Guide
Version 1
20 March 2016
DBCS RAC Workshop
TABLE OF CONTENTS
Introduction ............................................................................................................................................... 3
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.
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.
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:
On the Confirmation page, review the selected options and click Create.
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
On the Overview page are listed the two VMs that were created for the two nodes.
DBCS RAC Workshop
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 Database Home page it’s highlighted the fact that we have a 2 nodes RAC instance.
DBCS RAC Workshop
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:
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.
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
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
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.
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.
"serviceName" : "dbcs-rac1",
"nodeComponents" : [ {
"nodeName" : "dbcs-rac11",
"components" : [ {
"componentType" : "GridHome",
"componentName" : "OraGrid12102",
}, {
"componentType" : "DatabaseHome",
"componentName" : "OraDB12102_home1",
}, {
"componentType" : "RDK",
DBCS RAC Workshop
"componentName" : "RDK",
"componentVersion" : "16.1.3.0.0"
} ]
}, {
"nodeName" : "dbcs-rac12",
"components" : [ {
"componentType" : "GridHome",
"componentName" : "OraGrid12102",
}, {
"componentType" : "DatabaseHome",
"componentName" : "OraDB12102_home1",
}, {
"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",
"volumeName" : "/dev/asm/data-54",
"diskGroup" : {
"redundancy" : "External",
DBCS RAC Workshop
"disks" : [ {
"name" : "/dev/xvdd1"
} ],
"name" : "data"
},
"name" : "data"
}, {
"mountPoint" : "/u03",
"volumeName" : "/dev/asm/fra-297",
"diskGroup" : {
"redundancy" : "External",
"disks" : [ {
"name" : "/dev/xvde1"
} ],
"name" : "fra"
},
"name" : "fra"
}, {
"mountPoint" : "/u04",
"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.
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.
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
cloudStorageServiceName: Storage
Rerun the list backupconfig command to see the new parameters being set.
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.
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.
[ {
"id" : 1457863708672,
"name" : "rdbaas_backup",
"description" : null,
"type" : "Backup",
"tagName" : "auto",
"endTime" : null,
"backupComponents" : [ {
"id" : 1457863718949,
"name" : null,
"description" : null,
"type" : null,
"component_name" : "GIConfig",
"backupLocations" : [ {
DBCS RAC Workshop
"id" : 1457863720295,
"name" : null,
"description" : null,
"type" : null,
"location" : "DISK",
}, {
"id" : 1457863721785,
"name" : null,
"description" : null,
"type" : null,
"location" : "OSS",
} ]
}, {
"id" : 1457863721958,
"name" : null,
"description" : null,
"type" : null,
"component_name" : "OSConfig",
"backupLocations" : [ {
"id" : 1457863723434,
"name" : null,
"description" : null,
"type" : null,
"location" : "DISK",
}, {
"id" : 1457863725470,
"name" : null,
"description" : null,
DBCS RAC Workshop
"type" : null,
"location" : "OSS",
} ]
}, {
"id" : 1457863727402,
"name" : null,
"description" : null,
"type" : null,
"component_name" : "DerbyDB",
"backupLocations" : [ {
"id" : 1457863728187,
"name" : null,
"description" : null,
"type" : null,
"location" : "DISK",
}, {
"id" : 1457863729025,
"name" : null,
"description" : null,
"type" : null,
"location" : "OSS",
} ]
}, {
"id" : 1457863732509,
"name" : null,
"description" : null,
"type" : null,
"component_name" : "DBConfig",
DBCS RAC Workshop
"backupLocations" : [ {
"id" : 1457863733627,
"name" : null,
"description" : null,
"type" : null,
"location" : "DISK",
}, {
"id" : 1457863735038,
"name" : null,
"description" : null,
"type" : null,
"location" : "OSS",
} ]
}, {
"id" : 1457863735159,
"name" : null,
"description" : null,
"type" : null,
"component_name" : "Database",
"backupLocations" : [ {
"id" : 1457864301935,
"name" : null,
"description" : null,
"type" : null,
"location" : "DISK",
}, {
"id" : 1457864426711,
"name" : null,
DBCS RAC Workshop
"description" : null,
"type" : null,
"location" : "OSS",
} ]
} ],
"jobId" : "3"
} ]
DBCS RAC Workshop
DBCS RAC Workshop
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
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
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.
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.
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.
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
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;