Вы находитесь на странице: 1из 206

L

Oracle Database 11gR2/12c


Real Application Clusters

Lab Guide

Copyright 2013, Oracle and/or its affiliates. All rights reserved


Oracle Database 11gR2/12c Real Application Clusters

TABLE OF CONTENTS

The Workshop Environment ................................................................................................. 3


Hardware and Software ................................................................................................................... 3

Importing and Configuring the Virtual Machine ........................................................................... 6

Real Application Clusters..................................................................................................... 26


About Real Application Clusters .................................................................................................. 26

Overview of the Workshop............................................................................................................ 26

11gR2 Cluster Management with Enterprise Manager 11g Database Control ........................ 29

Swingbench Workload Execution on 11gR2 RAC ...................................................................... 65

Storage Management ..................................................................................................................... 92

Memory Management .................................................................................................................. 106

11gR2 Oracle Grid Infrastructure Upgrade to 12c .................................................................... 113

Oracle Database 12c Real Application Clusters Installation ................................................... 139

12c Cluster Management with Enterprise Manager 12c Database Express .......................... 164

Swingbench Workload Execution on 12c RAC ......................................................................... 190

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


Oracle Database 11gR2/12c Real Application Clusters

The Workshop Environment

Hardware and Software


The workshop environment consists of a cluster database with two nodes: RAC1 and RAC2 (active on both
nodes at the same time). The configuration uses VirtualBox Host-Only network for both public and private
connections with static IP addresses, which is completely virtual, connecting all virtual machines with the
host computer, but with no access outside or to Internet. Although, I added a third Bridged network card on
each node for Internet access, with dynamic IP address allocation. Automatic Storage Management (ASM)
uses VirtualBox shared virtual disks, which are fixed size, and can be accessed by both nodes at the same
time.
Before import, make sure you have at least one VirtualBox Host-Only Ethernet Adapter on your VirtualBox
installation. To check it, click File > Preferences in the main menu.

First check if Oracle VM VirtualBox Extension Pack is installed. If not, go to www.virtualbox.org,


download, and install it.

Next step is to check if you have a VirtualBox Host-Only Ethernet Adapter, and the configuration should
be similar to the one in my example: IPv4 address 192.168.56.1,and IPv4 Network Mask 255.255.255.0
(this is the default configuration).

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


Oracle Database 11gR2/12c Real Application Clusters

If you dont have one, click on Add icon on the right.

Once you add a VirtualBox Host-Only Ethernet Adapter, a virtual network interface is created on your
host machine, and on a Windows OS it should look like this.

Open Network Connections and see the Status of this adapter, click Details to see the IPv4 configuration
details.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 4


Oracle Database 11gR2/12c Real Application Clusters

PURPOSE USERNAME PASSWORD

OS oracle oracle
root oracle
Database sys oracle
system oracle

Both virtual machines have Oracle Grid Infrastructure 11gR2 and Oracle Database 11gR2 with Real
Applications Clusters installed and configured. For more information about installed products run Oracle

Copyright 2013, Oracle and/or its affiliates. All rights reserved 5


Oracle Database 11gR2/12c Real Application Clusters

Universal Installer existing in one of the Oracle Homes available (Grid Infrastructure installer is located in
/u01/app/11.2.0/grid/oui/bin/runInstaller.sh), and click Installed Products.

Importing and Configuring the Virtual Machine


This is what you should get after importing both virtual machines, RAC1_opt and RAC2_opt, in your Oracle
VM VirtualBox Manager. Refresh the MAC address for Network Adapter 1, and make sure it is Bridged to
your Internet connection physical interface, you will need it later to install linux packages directly from
Oracle Public YUM repositories. Dont perform any modification on Adapters 2 and 3.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 6


Oracle Database 11gR2/12c Real Application Clusters

VirtualBox Host-Only Ethernet adapter is called vboxnet0 in my VirtualBox installation on Linux, and the
Bridged adapter is connected to eth0 which is my Internet connection adapter. Add the shared disks one
by one to the SATA Controller, in the same order as in the following screenshots

Click Choose existing disk

Copyright 2013, Oracle and/or its affiliates. All rights reserved 7


Oracle Database 11gR2/12c Real Application Clusters

Select the disks from the folder where you extracted the SharedDisks.zip archive. Dont forget to make a
copy of these SharedDiskXX.vdi files before, if you want to save an original copy of the virtual machine
image.

This should be the final result for both virtual machines Storage Settings

Copyright 2013, Oracle and/or its affiliates. All rights reserved 8


Oracle Database 11gR2/12c Real Application Clusters

Note that all SharedDisks on virtual machine RAC1_opt are Shareable. This is mandatory before you can
add them to the RAC2_opt virtual machine, and start both of them.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 9


Oracle Database 11gR2/12c Real Application Clusters

Otherwise use the Virtual Media Manager and make them Shareable. Detach all SharedDisks from both
virtual machines before, in order to be able to modify them.

When finished, re-attach all SharedDisks to both virtual machines.


This is what you should see after both ova files were imported in Oracle VirtualBox. Please leave the
network adapters as they are: Adapter 1 Bridged, and Adapter 2 and 3 Host-Only.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 10


Oracle Database 11gR2/12c Real Application Clusters

You may reduce the memory (down to 1664MB in a very low configuration). This will come also with
performance loss. Please test the configuration before delivering any demo. With low physical memory
configurations is mandatory to decrease the memory allocated to the database instance on both nodes. We
will explain more in detail this topic in a future section of this workshop. With low memory, both nodes will
increase disk I/O, so the performance will depend also on the type of hard drive you have on the physical
machine.
This is what you should see when both machines are started. Depending on your VirtualBox configuration,
once you click inside of any of these consoles, it catches the mouse pointer, and to release it you have to
press the Right Ctrl key on your keyboard (also shown in the status bar lower right corner).

Copyright 2013, Oracle and/or its affiliates. All rights reserved 11


Oracle Database 11gR2/12c Real Application Clusters

I also got his message at startup: oracleoks: module license Proprietary taints kernel. Kernel tainting
is usually a way of indicating that a proprietary module has been loaded. I mean modules that are not
released under the General Public License "GPL" (or GPL compatible) license, and the source code for the
modules is not freely provided. The kernel developers cannot investigate any problems that are
encountered while the module is loaded, and the kernel is considered tainted.

In summary, ignore this message and continue with Oracle Real Application Clusters 12c discovery.
Click in the console, press Enter, and the login dialog appears: login as oracle/oracle on both machines. In
order to get access to GUI tools, we can connect to both machines using Putty and Xming Server. I will
explain how this works on the following slides.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 12


Oracle Database 11gR2/12c Real Application Clusters

The easiest way to launch graphical interface tools on the virtual machines is via SSH connection with X11
forwarding. If your host OS is Linux, use an ssh connection with X11 forwarding.
ssh -X <VM_public_IP_address>

I your host OS is Windows, download and install both Putty and Xming Server on your host computer.
Launch Putty and use the public IP address 192.168.56.21, Port 22, for the first node.

Click on the + next to SSH on the Category tree. Select Enable X11 forwarding, and go back to Session on
the Category tree. By enabling X11 forwarding we will be able to launch GUI interface tools on SSH
connections in Putty.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 13


Oracle Database 11gR2/12c Real Application Clusters

You can give it a name and save it for later use. Lets name this connection RAC1. Click Save, and then
launch Xming Server.

To make sure it is running, check the System Tray, and see if Xming icon is there. Now you may go back to
Putty Configuration window and click Open.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 14


Oracle Database 11gR2/12c Real Application Clusters

or
Login as oracle/oracle, and launch Mozilla Firefox.

It will appear in a new window, and to make sure it is running on the RAC1 virtual machine, you may
browse the /u01/app folder.

In my case I am using a third virtual machine, called ph_host0, running in the same VirtualBox environment
as my two RAC nodes. The password for user oracle is oracle.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 15


Oracle Database 11gR2/12c Real Application Clusters

Before installing other products, check the available space on the main disk, on both nodes, using the
command df -h. If necessary, increase the size of the main disk, for both machines.
In the original configuration, I set the values for most of the resources to minimum, but in many cases we
may need to increase some of those values, as the size of the main disks for example. This will allow us to
install more products in /u1/app folder, or add more files in Oracle home folder, for various purposes.
Select the virtual machine you want to modify first, and click Settings. I will perform all steps on RAC2_opt
virtual machine. On the other node the steps are identical.
We need to remove the main disk before editing its attributes. We may remove just the main disk, or all
disks, as I did in the example, and then re-add them keeping their original order in SATA Controller.

If the disk has a VMDK disk file type, we have to convert it to VDI, using Virtual Media Manager. The best
way is to make a copy.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 16


Oracle Database 11gR2/12c Real Application Clusters

Copyright 2013, Oracle and/or its affiliates. All rights reserved 17


Oracle Database 11gR2/12c Real Application Clusters

We should name it the same as the original disk to avoid confusion, just adding the .vdi extension at the
end.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 18


Oracle Database 11gR2/12c Real Application Clusters

When finished, we may remove the VMDK disk from Virtual Media Manager, including the file, to avoid any
confusion and redundant data on disk.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 19


Oracle Database 11gR2/12c Real Application Clusters

Now we edit the same virtual machine again, and add the new VDI disk copy as the main disk.

Click Choose existing disk.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 20


Oracle Database 11gR2/12c Real Application Clusters

Next step is to open a Terminal window, go to the folder where disk files are stored, and execute:
VBoxManage modifyhd RAC2_opt-disk1.dvi --resize 81920

On Windows machines, go to the folder where VirtualBox is installed, and run:


VBoxManage.exe modifyhd X:\pathToDiskFile\ RAC2_opt-disk1.dvi --resize 81920

The values for the new size are in MB. In my case, 81920 means 80GB.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 21


Oracle Database 11gR2/12c Real Application Clusters

You should see the new size of the disk, in Storage section. If new attributes do not refresh automatically,
restart VirtualBox console.

Use the same process to increase the virtual disk size for the second virtual machine. When finished
changing the virtual disks sizes in VirtualBox, add the rest of disks (shared disks), and start both machines.
Login on the machines directly, or via SSH (I use a SSH connection). I will perform all steps on RAC1_opt
machine first, and then repeat the entire process on the second node. First check the disk size and existing
partitions on the main disk.
fdisk l /dev/sda

Next step is to partition the space we just added.


fdisk /dev/sda
We create a new (n), primary (p) partition. Partition number is 3 because we already have sda1 and sda2.
Accept the default values First and Last cylinder.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 22


Oracle Database 11gR2/12c Real Application Clusters

Then we change our new partitions system id with the same value as sda2, 8e, the code for Linux LVM. In
the end we write the partition table to disk.

Now we may check the disk size and existing partitions on the main disk again. We need to reboot,
because the kernel is still using the old table (see the WARNING).

After reboot, we reconnect to the virtual machine and continue, creating a physical volume on /dev/sda3,
used later to extend the volume group.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 23


Oracle Database 11gR2/12c Real Application Clusters

We use the vgdisplay command to check the name of our volume group.

Next we add the newly created physical volume of /dev/sda3 to our volume group vg_rac1. With pvscan
command we can scan all physical volumes, and see our newly created physical volume /dev/sda3.

We use the lvdisplay command to check the name of our logical volume. Then, logical volume is then
extended using the lvextend command.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 24


Oracle Database 11gR2/12c Real Application Clusters

The last step is to resize the filesystem on-line with resize2fs, so that it can use the extra space we added,
and check the new values for free space on disk with df -h. For the other node, the procedure is identical.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 25


Oracle Database 11gR2/12c Real Application Clusters

REAL APPLICATION CLUSTERS

About Real Application Clusters


A cluster comprises multiple interconnected computers or servers that appear as if they are one server to
end users and applications. Oracle RAC enables you to cluster an Oracle database. Oracle RAC uses
Oracle Clusterware for the infrastructure to bind multiple servers so they operate as a single system.
All nodes in an Oracle RAC environment must connect to a Local Area Network (LAN) to enable users and
applications to access the database. Applications should use the Oracle Database services feature to
connect to an Oracle database. Services enable you to define rules and characteristics to control how
users and applications connect to database instances. These characteristics include a unique name,
workload balancing and failover options, and high availability characteristics. Oracle Net Services enable
the load balancing of application connections across all of the instances in an Oracle RAC database.
Oracle RAC database instances should be accessed through the Single Client Access Name (SCAN) for
the cluster. With SCAN, you are no longer required to modify your clients when changes occur to the
cluster configuration.
Automatic workload management enables you to manage the distribution of workloads to provide optimal
performance for users and applications. This includes providing the highest availability for database
connections, rapid failure recovery, and balancing workloads optimally across the active configuration.
Oracle Database with Oracle RAC includes many features that can enhance automatic workload
management, such as connection load balancing, fast connection failover, the load balancing advisory, and
runtime connection load balancing. Automatic workload management provides the greatest benefits to
Oracle RAC environments.

Overview of the Workshop


Use . oraenv to setup the environment. For grid, use +ASMx, where x is the node number. For example
+ASM2 will setup the environment for the Grid Infrastructure on RAC2. On this environment the ASM, the
Clusterware, and the listeners are running.

To check the environments and Oracle Homes available on each node you may look in /etc/oratab. On
RAC2 we have +ASM2 which is the Grid Infrastructure, and flavia, which is the Cluster Database. In one
Oracle Home more than one product may exist.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 26


Oracle Database 11gR2/12c Real Application Clusters

To manage cluster resources from the command line, we can use either Server Control (SRVCTL) or
Cluster Ready Services Control (CRSCTL). When the grid environment is set up, we may check the status
of all resources running in the Clusterware, with crsctl stat res -t. Here we can see that the ASM has
started and the disk groups are mounted on both nodes, the status of all listeners, including SCANs, is
ONLINE, and the nodes on which they are running.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 27


Oracle Database 11gR2/12c Real Application Clusters

Still, the Cluster Database is no open on both nodes. This may take a while, depending on the resources
available for the virtual machines. Repeat the command until the Clustered Database ora.flavia.db is
Open on both nodes.

After the database is started, is useful to check the memory utilization. Depending on the initial memory
configuration, a low value may be our enemy, once the OS will start create too much swap.
For low memory, below 2048 MB per node, check the Swap used. Once it gets close to the total available,
the disk may start running for long periods, and the cluster may crash. If this happens, you need more
memory per node. Do the same on the other node.

Another way to check the reliability of the memory configuration is by executing the iostat command. With
low memory configurations, the system will use more the hard disk, and this may generate an I/O
bottleneck.
Immediately after the cluster is started, until all processes are started and the information updated at
engine level, we may experience a high %iowait, over 30%, which is not positive for the performance.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 28


Oracle Database 11gR2/12c Real Application Clusters

Repeat the command to see how %iowait decreases once the cluster stabilizes. Ideally is to have an
%iowait below 30%.

11gR2 Cluster Management with Enterprise Manager 11g


Database Control
On RAC1 we change the environment to the Clustered Database flavia and launch Enterprise Manager
Database Control 11g. However, the one we are using is Real Applications Clusters aware, able to manage
the complete cluster including all the targets from which it comprises.

And it needs to be started on RAC2 too, as a monitoring agent.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 29


Oracle Database 11gR2/12c Real Application Clusters

Once it started on both nodes, it gives the URL to the management console using the hostname. Unless
we specify this hostname in our /etc/hosts file, we will use the public IP address of RAC1 to access the
console.

Launch the web browser on your computer and connect to Enterprise Manager 11g Database Control. The
URL is https://192.168.56.21:1158/em
In the screenshot Im using the third virtual machine (running on the same VirtualBox server as RAC1 and
RAC2), but you may use the browser on your physical computer, all connection details are the same.

We may use also the SCAN IP address for the Enterprise Manager URL, only those running on RAC1. To
be able to check it, we need to set the grid environment. In this case for example SCAN2 and SCAN3 are
running on RAC1.

Or SCAN3 IP. If the URL havent been used in the browser before, we get this page which alerts us on
connecting to some untrusted URL over https. Click I understand the Risks and confirm the security
exception.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 30


Oracle Database 11gR2/12c Real Application Clusters

Here we have the console accessed using SCAN2 IP address in the URL.

The user is sys, and the password oracle. The main component of this cluster is the Cluster Database
flavia.mlg.oracle.com. Well have a look at all the console tabs of this target.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 31


Oracle Database 11gR2/12c Real Application Clusters

Copyright 2013, Oracle and/or its affiliates. All rights reserved 32


Oracle Database 11gR2/12c Real Application Clusters

At the bottom of the Performance tab, there are other tabs where we can check the activity of each
instance of the Cluster Database.

Lets check the I/O to see what core functions are running.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 33


Oracle Database 11gR2/12c Real Application Clusters

We can see also what type of I/O activity we have.

To see more in detail the activity on the database, we will make a drill-down into Top Activity using the
Additional Monitoring Links.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 34


Oracle Database 11gR2/12c Real Application Clusters

Here we can see the top SQL sentences, and the top sessions currently running. Go back at the
Additional Monitoring Links and click SQL Monitoring.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 35


Oracle Database 11gR2/12c Real Application Clusters

This tool offers more details about every SQL sentence executed on the database.

Click on Cluster Database: flavia.mlg.oracle.com link in the breadcrumbs to go back to the main
console. Next tab is Availability. Lets check the Recovery Settings.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 36


Oracle Database 11gR2/12c Real Application Clusters

Copyright 2013, Oracle and/or its affiliates. All rights reserved 37


Oracle Database 11gR2/12c Real Application Clusters

Go up and click on Cluster Database: flavia.mlg.oracle.com link in the breadcrumbs to go back to the
main console. Next tab is Server. All performance data for this database is stored in Automatic Workload
Repository.

You may not have too many snapshots, depending on the uptime. Click on the link which specifies
Snapshots number.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 38


Oracle Database 11gR2/12c Real Application Clusters

Select one snapshot and View Report in Actions drop-down list, and click Go. Make sure there is another
snapshot following, taken one hour after this one, with no downtime in between.

Select the immediate following snapshot, taken after one hour from the snapshot selected in the previous
step, and click OK.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 39


Oracle Database 11gR2/12c Real Application Clusters

The AWR report is generated.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 40


Oracle Database 11gR2/12c Real Application Clusters

When finished analyzing the report, click on Cluster Database: flavia.mlg.oracle.com link in the
breadcrumbs to go back to the main console. Open the Server tab, and click on Datafiles under the
Storage section. These are the datafiles currently existing in our Cluster Database.

Click on Cluster Database: flavia.mlg.oracle.com link in the breadcrumbs to go back to the main
console. Open the Server tab, and click on Automated Maintenance Tasks under the Oracle Scheduler
section. Lets configure the Automated Maintenance Tasks.

More exactly the Automatic SQL Tuning.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 41


Oracle Database 11gR2/12c Real Application Clusters

We will enable Automatic Implementation of SQL Profiles. Click Apply in the end.

Click on Cluster Database: flavia.mlg.oracle.com link in the breadcrumbs to go back to the main
console. Open the Server tab, and click on Getting Started under the Resource Manager section.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 42


Oracle Database 11gR2/12c Real Application Clusters

Click on Cluster Database: flavia.mlg.oracle.com link in the breadcrumbs to go back to the main
console. Lets see how a new instance is added. Open the Server tab, and click on Add Instance under
the Change Database section.

This is the wizard that guides through the entire process - Cluster Credentials: oracle/oracle; ASM
Credentials: sys/oracle as sysdba.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 43


Oracle Database 11gR2/12c Real Application Clusters

Before adding a new database instance, we need another virtual machine in the cluster. Well add this
later, for now just click Cancel.

Click Schema tab and explore all features available here.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 44


Oracle Database 11gR2/12c Real Application Clusters

Click Data Movement tab and explore all features available here.

Click Software and Support tab and explore all features available here.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 45


Oracle Database 11gR2/12c Real Application Clusters

Click on Cluster tab in the very first set of tabs. Have a look at all the console tabs, in the second set.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 46


Oracle Database 11gR2/12c Real Application Clusters

Click on the Performance tab.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 47


Oracle Database 11gR2/12c Real Application Clusters

Click Targets tab. These are the targets which comprise this cluster. We will check each one of them
individually.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 48


Oracle Database 11gR2/12c Real Application Clusters

In the Administration tab we can access the cluster Resource Manager by clicking Manage Resources.

Cluster Host Credentials are oracle/oracle.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 49


Oracle Database 11gR2/12c Real Application Clusters

Click Show Oracle Resources to see the basic resources of the cluster.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 50


Oracle Database 11gR2/12c Real Application Clusters

Go up and click Cluster: mlg-rac link in the breadcrumbs of this page, and continue with the
Interconnects tab.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 51


Oracle Database 11gR2/12c Real Application Clusters

Click on the link rac1.mlg.oracle.com link in any of the tables on this page. This is one of the Host
components of this cluster. Well have a look at all the console tabs of this target.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 52


Oracle Database 11gR2/12c Real Application Clusters

Click on View By drop-down list and select Memory Utilization (%).


As you can see, Enterprise Manager 11g Database Control takes a considerable amount of memory,
314MB of RAM and 1.8GB of Virtual Memory. This is one reason we need more than 2GB of memory per
node in order to avoid bad performance issues.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 53


Oracle Database 11gR2/12c Real Application Clusters

In order to use the Administration tab we need to install YAST2 package on the operating system of our
nodes. Well do this in a later session.

These are the Targets running on this host.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 54


Oracle Database 11gR2/12c Real Application Clusters

In Configuration tab we have all the details about the hardware and Oracle software installed on this host.

Including all the packages installed on the operating system.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 55


Oracle Database 11gR2/12c Real Application Clusters

Go back to Cluster > Targets tab, and click on LISTENER_rac1.mlg.oracle.com link. This is one of the
Listener components of this cluster. Well have a look at all the console tabs of this target.

Open Performance tab.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 56


Oracle Database 11gR2/12c Real Application Clusters

Open Serviced Databases tab.

Click on Cluster in the very first set of tabs. Then open Targets in the second set of tabs, and click on
LISTENER_SCAN2_mlg_rac target. This is one of the SCAN Listener components of this cluster. Well
have a look at all the console tabs of this target.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 57


Oracle Database 11gR2/12c Real Application Clusters

Open Performance tab.

Open Serviced Databases tab.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 58


Oracle Database 11gR2/12c Real Application Clusters

Click on Cluster in the very first set of tabs. Then open Targets in the second set of tabs, and click on
+ASM_rac2.mlg.oracle.com target. This is the ASM instance running on node RAC2. Well have a look at
all the console tabs of this target.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 59


Oracle Database 11gR2/12c Real Application Clusters

Click on Performance tab.

Go to Disk Groups tab, and click on diskgroup DATA to open the console for the Disk Group target.
This is one of the Disk Groups we have on this cluster. Well have a look at all the console tabs of this
target.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 60


Oracle Database 11gR2/12c Real Application Clusters

This is one of the Disk Groups we have on this cluster. Well have a look at all the console tabs of this
target.

Click on the Performance tab.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 61


Oracle Database 11gR2/12c Real Application Clusters

Go to Templates tab.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 62


Oracle Database 11gR2/12c Real Application Clusters

Go to Files tab, and click on blue arrows to expand the folder structure until you see some of the files
stored on the Disk Group, and their attributes.

Click on Automatic Storage Management: +ASM_rac2.mlg.oracle.com breadcrumb link to go back to


the ASM instance console.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 63


Oracle Database 11gR2/12c Real Application Clusters

And continue with the Configuration tab.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 64


Oracle Database 11gR2/12c Real Application Clusters

The last tab is ASM Cluster File System. On this configuration we dont have any file system with these
characteristics.

Swingbench Workload Execution on 11gR2 RAC


In the following chapter we will execute a simulated workload on our Cluster Database. First step is to
prepare the storage.
Click on Database in the very first set of tabs. Then open Server in the second set of tabs.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 65


Oracle Database 11gR2/12c Real Application Clusters

Click on Tablespaces under Storage section.

We will create and empty tablespace for the SOE schema we will generate later. SOE schema is the
sample schema used by Swingbench, our workload generation tool.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 66


Oracle Database 11gR2/12c Real Application Clusters

Name: SOE. Click Add under Datafiles section.

DiskGroup: DATA
File Size: 100 MB
Validate Automatically extend datafile when full (AUTOEXTEND) check box.
Increment: 50 MB

Copyright 2013, Oracle and/or its affiliates. All rights reserved 67


Oracle Database 11gR2/12c Real Application Clusters

Maximum File Size: Value: 32767 MB


Click Continue.

Click OK.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 68


Oracle Database 11gR2/12c Real Application Clusters

Now we have to generate the sample data that Swingbench will use to run the workload.
For Linux: Go to the bin folder of your Swingbench application. Execute ./oewizard

For Windows: Go to the winbin folder of your Swingbench application. Execute oewizard.bat

Please use the same parameters I have in the following screenshots.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 69


Oracle Database 11gR2/12c Real Application Clusters

Connect String: 192.168.56.91:/1521/flavia.mlg.oracle.com


In the Connect String we may use the IP address of any of the SCAN Listeners.
Remove the dots in the DBA password text field and type oracle.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 70


Oracle Database 11gR2/12c Real Application Clusters

Validate Use Partitioning check box if you want your tables to be partitioned.
Make sure the Schemas Tablespace is SOE.

Select User Defined Scale radio button, and type 0.3 in the text field. Make sure OrderEntry tablespace
size does not overpass 1.0 GB. If it does, decrease the User Defined Scale.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 71


Oracle Database 11gR2/12c Real Application Clusters

Click Finish, and check the Log.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 72


Oracle Database 11gR2/12c Real Application Clusters

Now we can launch Swingbench and generate the workload on our Cluster Database.
For Linux: Go to the bin folder of your Swingbench application. Execute ./swingbench

For Windows: Go to the winbin folder of your Swingbench application. Execute swingbench.bat

In the User Details tab, under the first group of tabs, set the following:
Username: soe
Password: soe
Connect String: 192.168.56.92:1521/flavia.mlg.oracle.com
In the Connect String we may use the IP address of any of the SCAN Listeners
In the Load tab, under the second group of tabs, set the following:
Number of Users: 10
Min. Delay Between Transactions (ms): 1,000
Max. Delay Between Transactions (ms): 2,000
Click the green Play button to Start Benchmark Run.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 73


Oracle Database 11gR2/12c Real Application Clusters

Copyright 2013, Oracle and/or its affiliates. All rights reserved 74


Oracle Database 11gR2/12c Real Application Clusters

Copyright 2013, Oracle and/or its affiliates. All rights reserved 75


Oracle Database 11gR2/12c Real Application Clusters

Go back to Enterprise Manager console. Click on Database in the very first set of tabs. Then open Server
in the second set of tabs. Click on Tablespaces under Storage section. Check the size of the SOE
tablespace. Click on the SOE link to drill down into more details about this tablespace.

The datafile used by this tablespace also has 2150MB in size.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 76


Oracle Database 11gR2/12c Real Application Clusters

Click on the Performance tab to check the charts and other performance values while the Swingbench
workload is running.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 77


Oracle Database 11gR2/12c Real Application Clusters

Click on the Instances tab to see the workload running on each one of the RAC instances.

Click on flavia.mlg.oracle.com_flavia2 instance name to drill down into the Performance console of that
particular Database Instance. From here you may switch between the instances using the Switch
Database Instance drop-down list.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 78


Oracle Database 11gR2/12c Real Application Clusters

Let drill down into the workload executed on this Database Instance. Click on Top Activity.

You may use to moving window in the top chart to get Top SQL and Top Sessions information in the two
reports below.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 79


Oracle Database 11gR2/12c Real Application Clusters

Here you may also switch between the instances using the Switch Database Instance drop-down list.

Click on one SQL ID in the Top SQL report to drill down into execution details on that particular sentence

Click on Plan tab to check the Execution Plan.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 80


Oracle Database 11gR2/12c Real Application Clusters

Open Plan tab in Details region.

Click on Statistics tab.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 81


Oracle Database 11gR2/12c Real Application Clusters

Lets simulate a node failure. Go to RAC2 node connection, or open a new connection with SSH, login as
root/oracle, and execute the halt command. This will bring down the entire RAC2 virtual machine. The
connection is closed due to server shutdown procedure.

After a couple of minutes, depending on your virtual machines performance, on RAC1 node well check the
status of the cluster resources. Set the grid environment first. Then execute: crsctl stat res t. The
response should look like this.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 82


Oracle Database 11gR2/12c Real Application Clusters

The Swingbench application should continue to run, with some connections closed due to node failure.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 83


Oracle Database 11gR2/12c Real Application Clusters

Go back to Enterprise Manager console. Click on Cluster in the very first set of tabs. Click on Refresh until
you get the current status of the cluster: 1 node up, 1 node unreachable.

Open the Targets tab and check the status of all the cluster components.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 84


Oracle Database 11gR2/12c Real Application Clusters

Click on Database in the very first set of tabs. We get the same information: one instance is down.

Open the Performance tab.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 85


Oracle Database 11gR2/12c Real Application Clusters

In the Instances tab below we see just one instance: flavia1.

Stop the Swingbench workload execution by clicking the red Stop button under the main menu.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 86


Oracle Database 11gR2/12c Real Application Clusters

Start up the RAC2_opt virtual machine, and wait until its reachable. Connect to RAC2 node using SSH,
and credentials oracle/oracle.

Set the Grid environment.

After a couple of minutes, depending on your virtual machines performance, on RAC1 node well check
again the status of the cluster resources.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 87


Oracle Database 11gR2/12c Real Application Clusters

Copyright 2013, Oracle and/or its affiliates. All rights reserved 88


Oracle Database 11gR2/12c Real Application Clusters

Repeat the command execution until all resources are online on the appropriate cluster nodes.

Go back to Enterprise Manager console. On the Database tab we see that both nodes are up.

Go to Performance tab and scroll down on the page.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 89


Oracle Database 11gR2/12c Real Application Clusters

In the Instances tab below we see now that both instances are up.

To be able to fully monitor all the targets on the RAC2 node, we need to star the Enterprise Manager 11g
Database Control agent with the command: emctl start dbconsole. Set the environment first.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 90


Oracle Database 11gR2/12c Real Application Clusters

Go back to Enterprise Manager console. Click on Cluster in the very first set of tabs.

Scroll down at the bottom of the page. Everything is up and running.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 91


Oracle Database 11gR2/12c Real Application Clusters

Storage Management
The first operation is to add new shared disks to the virtual machines, that will be later used to create new
disk groups, or to increase capacity of existing ones. Open Oracle VM VirtualBox Manager, select one of
the virtual machines, and click Settings.

Click Add Hard Disk icon on the same SATA controller where the rest of the disks are.

Click Create new disk.

Select VDI (VirtualBox Disk Image).

Copyright 2013, Oracle and/or its affiliates. All rights reserved 92


Oracle Database 11gR2/12c Real Application Clusters

Select Fixed size. This attribute is mandatory if you want to make a disk Shareable in VirtualBox. That
means all the space will be allocated when disk is created, so make sure you have the necessary space on
your hard drive. All ASM disks have to be Fixed sized and Shareable.

Choose a location where you want the virtual disk to be created. If you plan to use these disks in a Normal
Redundancy ASM Disk Group, it is recommended to create smaller disks. ASM will reserve the amount of
the biggest disk in order to restore redundancy after a disk failure, by re-creating the lost data in another
failure group. I recommend you to specify no more than 4.00 GB as Size at this step (same size as the
other disks we already have in ASM disk group DATA).

Copyright 2013, Oracle and/or its affiliates. All rights reserved 93


Oracle Database 11gR2/12c Real Application Clusters

Check the Summary, and click Create.

Well temporary remove all newly created disks we just added, so their attributes can be changed.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 94


Oracle Database 11gR2/12c Real Application Clusters

After removing them all, click OK.

Well use Virtual Media Manager to change the attributes for the new disks.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 95


Oracle Database 11gR2/12c Real Application Clusters

When finished, well re-add the new disks to both nodes, selecting Choose existing disk at the first step.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 96


Oracle Database 11gR2/12c Real Application Clusters

Connect to both nodes via SSH with X11 forwarding. In my case I am using a third virtual machine, called
ph_host0, running in the same VirtualBox environment as my two RAC nodes. If your VirtualBox
environment is running on Windows, you may use Putty with Xming Server.
Login to first node with credentials oracle/oracle, and check the new disks. You can see that user oracle
and group dba already owns them.

I have added these lines in 50-udev.rules file in /etc/udev/rules.d folder. If a new disk you add does not
have a line in this file to specify that user oracle, group dba owns the disk, it cannot be added to any ASM
disk group. Please check /etc/udev/rules.d/50-udev.rules and add the corresponding lines.
Note: I added here some lines in advance, so I can add new disks without worrying about user/group
permissions.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 97


Oracle Database 11gR2/12c Real Application Clusters

Set up the Oracle Grid Infrastructure environment, and check the status of the resources. The cluster
database ora.flavia.db should be Open on both nodes.

Start Enterprise Manager Database Control on both nodes.

Login into Enterprise Manager Database Control using sys/oracle as SYSDBA credentials. At the bottom
of the first page, click on +ASM1_rac1.mlg.oracle.com link.

Go to Configuration tab.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 98


Oracle Database 11gR2/12c Real Application Clusters

Check the Configuration Parameters. They should look like these.

After any modifications, click Apply, and then go to Disk Groups tab.

Click disk group DATA.

At the bottom of the page, where the list of Member Disks is, click Add.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 99


Oracle Database 11gR2/12c Real Application Clusters

Select the disks you want to add, and click OK. Specify ASM Disk Name similar to the existing disks, and
an already existing Failure Group (DATA_0001, DATA_0002, or DATA_0003). For Normal Redundancy,
a minimum of 2 failure groups are required (2 failure groups are enough to avoid unnecessary
redundancy).

Note: If you want to re-add a disk that previously was member of a disk group and removed for any reason,
you have to clean the disk header before with the command (on any of the nodes; replace X with the
appropriate disk letter):
dd if=/dev/zero of=/dev/sdX bs=1024 count=100

Copyright 2013, Oracle and/or its affiliates. All rights reserved 100
Oracle Database 11gR2/12c Real Application Clusters

Check the Member Disks list, and focus on the Used (GB) and Used (%) for all disks.

After some minutes, refresh the page and check those values again. ASM automatically redistributes data
evenly across all drives in the disk group.

Lets see how we can add new disks using the graphical console of Oracle ASM Configuration Assistant.
Launch ASMCA in the terminal window, connected to one of the nodes via SSH, with X11 forwarding, or
using Putty and Xming Server.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 101
Oracle Database 11gR2/12c Real Application Clusters

Oracle ASM Configuration Assistant (ASMCA) supports installing and configuring Oracle ASM instances,
disk groups, volumes, and Oracle Automatic Storage Management Cluster File System (Oracle ACFS).

Right click on one of the Disk Group Names, and select Add Disks.

I have no available disks to add, though the process is straight forward: select the disk, and optionally
specify Disk Name and Failure Group.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 102
Oracle Database 11gR2/12c Real Application Clusters

Lets see now how a new disk group is created using the graphical console of Oracle ASM Configuration
Assistant. Set up the Grid environment, and launch ASM Configuration Assistant.

Click Create.

Name the Disk Group DATA12c, choose External (None) for Redundancy, and select the disks you want
to add from Show Eligible disks list. Click OK.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 103
Oracle Database 11gR2/12c Real Application Clusters

Select the new Disk Group DATA12C, and click Mount All.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 104
Oracle Database 11gR2/12c Real Application Clusters

Confirm the operation.

Finished. Click Exit.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 105
Oracle Database 11gR2/12c Real Application Clusters

Memory Management
From the physical machine, on which Oracle VirtualBox server is running, or a third virtual machine running
on the same VirtualBox server as RAC1 and RAC2, connect to both nodes using SSH. I am using a third
virtual machine, called ph_host0, running in the same VirtualBox environment as my two RAC nodes. If
your VirtualBox environment is running on Windows, you may need an SSH client, like Putty.
Login to first node via SSH. The password for user oracle is oracle. Set up the Oracle Grid Infrastructure
environment.

Check the status of the resources. The cluster database ora.flavia.db should be Open on both nodes.

Start Enterprise Manager Database Control on both nodes.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 106
Oracle Database 11gR2/12c Real Application Clusters

Login into Enterprise Manager Database Control using sys/oracle as SYSDBA credentials

At the bottom of the first page, click on flavia.mlg.oracle.com_flavia2 database instance link.

Go to Server tab, and click on Memory Advisors link under Database Configuration.

Disable the Automatic Memory Management.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 107
Oracle Database 11gR2/12c Real Application Clusters

Go at the bottom of this page and set 256 for Total SGA Size (MB) and also for the Maximum SGA Size
(MB). Click Apply when finished.
Note: In some cases it is not possible to make drastic memory reductions, try reduce it incrementally with
smaller amounts, on both nodes, alternatively.

After you make memory changes, the database has to be restarted. You may choose not to restart the
database, make the changes on both nodes, and then restart the ora.flavia.db resource on both nodes,
using the commands:
crsctl stop res ora.flavia.db
crsctl start res ora.flavia.db
Or, you can choose to restart the database, and click Yes.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 108
Oracle Database 11gR2/12c Real Application Clusters

Host Credentials: oracle/oracle. Database Credentials: sys/oracle as SYSDBA. Click OK.

Click Yes to confirm the operation.

Go to the SSH connection to one of the nodes, set the Grid environment variables, and execute crsctl stat
res -t to check the status of the targets. The instance for which we just made the changes in the previous
step has the state Instance Shutdown.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 109
Oracle Database 11gR2/12c Real Application Clusters

Re-execute the command until both instances are Open. Now you may continue making changes on the
other instance, or other operations.

Repeat all the steps on the second instance, from the click on the database instance link at the bottom of
the first page of Enterprise Manager.
When we rich a memory configuration that satisfies our need, we may re-enable the Automatic Memory
Management. For that, login using sys/oracle as SYSDBA on Enterprise Manager, click on the database
instance link at the bottom of the first page, go to Server > Memory Advisors. Click Enable next to
Automatic Memory Management.

Set a value for for both Maximum Memory Size and Total Memory Size for Automatic Memory
Management. Do not use a value less than 256MB.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 110
Oracle Database 11gR2/12c Real Application Clusters

You will be asked again if you want to restart the database to invoke the static parameter(s). Click Yes if
you want to restart, or No if you want to restart the database service later using crsctl command.

Now we will change the memory settings for Automatic Storage Management instances. Before we can
alter the memory of our ASM instances, we need to stop some resources on the cluster, most important the
databases using the ASM instances to store data.

Then we connect to the first instance (set the environment with oraenv), and check the current memory
configuration.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 111
Oracle Database 11gR2/12c Real Application Clusters

The objective is to reduce memory usage to 256 MB per ASM instance. Here are the sqlplus commands I
used to achieve it:
alter system set memory_target=0 scope=both sid=+ASM1;
alter system set pga_aggregate_target=44M scope=both sid=+ASM1;
alter system set sga_target=212M scope=both sid=+ASM1;

First we disable the Automatic Memory Management. Then we set the PGA to 44MB and the SGA to
212MB (total 256MB). This should be enough for both ASM instances. Then check again the memory
target values.

Ignore the parameter memory_max_target. It will show the correct new value after asm instance is
restarted. Restart the first instance so changes can take effect.
srvctl stop asm n rac1 f
srvctl start asm n rac1

Copyright 2013, Oracle and/or its affiliates. All rights reserved 112
Oracle Database 11gR2/12c Real Application Clusters

Reconnect to sqlplus as sysasm to check the final configuration.

Repeat the process on the second node. When finished, start all cluster resources stopped in the beginning
of this part. Changing the parameters on one instance, restart it to apply them, and then go to the next
instance is called Rolling Mode, and it allows you to keep the database running during the entire process.
Please give it a try, and see how it works.

11gR2 Oracle Grid Infrastructure Upgrade to 12c


First we install the necessary Linux packages. The first one is oracle-rdbms-server-12cR1-
preinstall.x86_64. To install the necessary packages well use yum, which is already configured on both
machines. In order to work, it needs internet connection, please make sure the eth0 network interface is
Bridged, and is has a valid IP address. You can do this with ifconfig eth0 as root. In case you need to
specify a proxy server, this can be done executing
export http_proxy=<proxy_server_name>:<port>

To check if your internet connection works, just try to get the content of a usual web page
wget www.oracle.com

and then try to list a usual package with yum


yum list gcc
yum list oracle-rdbms-server-12cR1*

Copyright 2013, Oracle and/or its affiliates. All rights reserved 113
Oracle Database 11gR2/12c Real Application Clusters

yum install oracle-rdbms-server-12cR1-preinstall.x86_64

In this screenshot I receive an error message Unable to connect to dbus. This is due to refresh-
packagekit that sends a dbus message to reload packages lists. To avoid it, use:
yum --disableplugin=refresh-packagekit install oracle-rdbms-server-12cR1-
preinstall.x86_64

We install oracle-rdbms-server-12cR1-preinstall on the second node too. Use the same commands. We
will do the same with the rest of the packages, so please repeat all steps on the second node when
finished on the first one.
All these packages will be required for future installations. We will upgrade 64bit ones (libXext.x86_64
libXtst.x86_64 libX11.x86_64 libXau.x86_64 libxcb.x86_64 libXi.x86_64) and install all 32bit.
yum upgrade libXext.x86_64 libXtst.x86_64 libX11.x86_64 libXau.x86_64
libxcb.x86_64 libXi.x86_64

Copyright 2013, Oracle and/or its affiliates. All rights reserved 114
Oracle Database 11gR2/12c Real Application Clusters

This is the confirmation you should receive.

Dont forget to repeat all operations on RAC2.


Installing the 32bit packages (libXext.i686 libXtst.i686 libX11.i686 libXau.i686 libxcb.i686 libXi.i686)
yum install libXext.i686 libXtst.i686 libX11.i686 libXau.i686 libxcb.i686
libXi.i686

Dont forget to repeat all operations on RAC2.


Upgrade Oracle ODBC drivers (unixODBC.i686 unixODBC.x86_64 unixODBC-devel.i686 unixODBC-
devel.x86_64) for both 32 and 64 bit.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 115
Oracle Database 11gR2/12c Real Application Clusters

To make sure the cluster has sufficient temporary file storage, we need to increase the tmpfs size to at
least 2 GB. Due to some bugs in Red Hat Linux 6, inherited by Oracle Linux 6, we cannot specify it in
/etc/fstab. My choice was to add two lines inside Oracle High Availability Services startup file
/etc/init.d/init.ohasd:
# increase tmpfs
mount -o remount,size=2G /dev/shm

Add these lines as root, on both nodes. To make the changes effective immediately, you may execute the
mount command as root (second line).

The head command displays the first 15 lines of my /etc/init.d/init.ohasd file.


Before you begin the installation process, make sure you have at least 7GB unallocated space on disk
group DATA, for the Grid Infrastructure Management Repository. If not, add more disks, or create a new
disk group to hold all new data for 12c products (OGI and Database).
Download Oracle Database 12c Release 1 Grid Infrastructure (12.1.0.1.0) for Linux x86-64 (Part 1 and 2)
from oracle Software Delivery Cloud in a folder on your host machine. Add that folder as a Shared Folder to
the RAC1_opt virtual machine. Mount the shared folder with the following command as root.
mount t vboxsf o uid=oracle,gid=oinstall SharedFolderName /mnt
Unzip both downloaded files in the same folder, and launch runInstaller.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 116
Oracle Database 11gR2/12c Real Application Clusters

Skip software updates.

Upgrade Oracle Grid Infrastructure.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 117
Oracle Database 11gR2/12c Real Application Clusters

Copyright 2013, Oracle and/or its affiliates. All rights reserved 118
Oracle Database 11gR2/12c Real Application Clusters

When asked to configure Grid Infrastructure Management Repository, I recommend selecting No for the
demo, if you are low on disks space, and want to save some of it on the ASM disks. We will not use Grid
Infrastructure Management Repository in any of the following steps of this workshop.
Oracle recommends that you create a Grid Infrastructure Management Repository. This repository is an
optional component, but if you do not select this feature during installation, then you lose access to Oracle
Database Quality of Service management, Memory Guard, and Cluster Health Monitor. You cannot enable
these features after installation except by reinstalling Oracle Grid Infrastructure.
(Oracle Grid Infrastructure Installation Guide 12c Release 1)

Copyright 2013, Oracle and/or its affiliates. All rights reserved 119
Oracle Database 11gR2/12c Real Application Clusters

Copyright 2013, Oracle and/or its affiliates. All rights reserved 120
Oracle Database 11gR2/12c Real Application Clusters

On a production cluster we actually need different groups for OSASM, OSDBA, and OSOPER. For demo
purposes I selected the same group for all of them. Although, the groups are created on the OS, so you
may test the installation with different groups.

The previous version of Grid Infrastructure software was installed as root, and oracle user cannot create
the necessary folders.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 121
Oracle Database 11gR2/12c Real Application Clusters

Go to the terminal, login as root, and create folder 12.1.0 in /u01/app. Then set oracle:oinstall as owner.
Repeat the operation on RAC2.

Continue with the upgrade process.

The password for root is oracle.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 122
Oracle Database 11gR2/12c Real Application Clusters

Set different batches for each node to make the installer execute root script on one node at a time.

For the purpose of the demo well ignore these warnings.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 123
Oracle Database 11gR2/12c Real Application Clusters

Click Yes to confirm.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 124
Oracle Database 11gR2/12c Real Application Clusters

When asked to confirm the execution of configuration scripts as root, click Yes.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 125
Oracle Database 11gR2/12c Real Application Clusters

Because we separated this execution in two different batches, it will ask for confirmation before executing
the next batch.

Click Continue.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 126
Oracle Database 11gR2/12c Real Application Clusters

Click Details, and copy the log file complete path. Switch to the terminal window and read that log file using
more command.

Lets check the log and see why Cluster Verification Utility failed. Name resolution fails because I have
another RAC configuration in my demo environment, on the public network with different IP class, using
the same alias for SCAN IP addresses. You should not get this error message. For the purpose of the
demo we will ignore this error. I left this in the process just to show how to check errors that might appear
during the installation.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 127
Oracle Database 11gR2/12c Real Application Clusters

In this case, I will click Skip at this screen.

Click Next.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 128
Oracle Database 11gR2/12c Real Application Clusters

I will confirm also that I want to skip the failed configuration steps. You may not see this message.

This is the last screen you may get, click Close.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 129
Oracle Database 11gR2/12c Real Application Clusters

The first things we do after the installation is to check /etc/oratab file for new entries, and their associated
Oracle Home. If you chose to install a Grid Infrastructure Management Repository, you will see MGMTDB
entry, which is the database for this repository. You will see this database also running as a resource on
the Oracle Clusterware.

What we are more interested to see in this file is the new Oracle Home for the ASM instance, which is
actually the Oracle Home for the new Grid Infrastructure we just upgraded. Notice the name of the folder
changed, showing the current version 12.1.0. Check the status of all cluster resources executing
crsctl stat res -t

Copyright 2013, Oracle and/or its affiliates. All rights reserved 130
Oracle Database 11gR2/12c Real Application Clusters

Set the database environment, and launch Enterprise Manager 11g Database Control on both nodes.
emctl start dbconsole

Copyright 2013, Oracle and/or its affiliates. All rights reserved 131
Oracle Database 11gR2/12c Real Application Clusters

Login using sys/oracle as SYSDBA.

Go to Cluster tab. Due to changes to ORACLE_HOME path and configuration files location for some
resources, after the upgrade we may get some Metric Collection Errors. Click on the error link if you want
to see more details.

Before fixing anything, we bounce both nodes to make sure there are no pending changes waiting for the
next reboot.

After reboot, check that all cluster resources are up and running, and then start the Enterprise Manager
Database Control on both nodes.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 132
Oracle Database 11gR2/12c Real Application Clusters

Login using sys/oracle as SYSDBA. Click Cluster tab. Click Monitoring Configuration at the bottom of
the page, under Related Links.

Set Oracle Home to /u01/app/12.1.0/grid, and click Update.

Click OK.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 133
Oracle Database 11gR2/12c Real Application Clusters

The new status is Status Pending.

Just click Refresh until it changes to Up.

Back on Enterprise Manager, click on Database tab, and then on +ASM2_rac2.mlg.oracle.com at the
bottom of the page, under Instances.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 134
Oracle Database 11gR2/12c Real Application Clusters

Click Monitoring Configuration at the bottom of the page, under Related Links.

Make sure that Oracle home path is /u01/app/12.1.0/grid (new Grid Infrastructure home), and click Test
Connection.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 135
Oracle Database 11gR2/12c Real Application Clusters

If the response is Test Successful, click OK.

On Cluster > Targets tab, we still have to check the listeners configuration, as they all appear as Down
after Grid Infrastructure upgrade. Click Setup link at the top of the page.

Click Agents.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 136
Oracle Database 11gR2/12c Real Application Clusters

Click on one of the two Management Agents.

Select one of the listeners under Monitored Targets, and click Configure.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 137
Oracle Database 11gR2/12c Real Application Clusters

Change listener.ora directory to /u01/app/12.1.0/grid/network/admin, and Oracle Home to


/u01/app/12.1.0/grid. Click OK.

Repeat last four steps for all listeners in the mlg-rac cluster. This should be the final result.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 138
Oracle Database 11gR2/12c Real Application Clusters

Note: If everything works fine, as root, you may delete the old Grid Infrastructure folder /u01/app/11.2.0, to
free up some space on the main disk.

Oracle Database 12c Real Application Clusters Installation


Before performing this installation, make sure you have 6.4GB of space available on the main disk drive of
both RAC nodes virtual images.
Download Oracle Database 12c Release 1 (12.1.0.1.0) for Linux x86-64 (Part 1 and 2) from oracle
Software Delivery Cloud in a folder on your host machine. Add that folder as a Shared Folder to the
RAC1_opt virtual machine. Mount the shared folder with the following command as root
mount t vboxsf o uid=oracle,gid=oinstall SharedFolderName /mnt

Unzip both downloaded files in the same folder, and launch runInstaller.

Skip Security Updates and Software Updates.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 139
Oracle Database 11gR2/12c Real Application Clusters

Choose Create and configure a database.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 140
Oracle Database 11gR2/12c Real Application Clusters

Select Server class.

We will perform an Oracle Real Application Clusters database installation.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 141
Oracle Database 11gR2/12c Real Application Clusters

We will not use server pools, so choose Admin managed.

Both nodes must be selected.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 142
Oracle Database 11gR2/12c Real Application Clusters

Choose Advanced Install.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 143
Oracle Database 11gR2/12c Real Application Clusters

Select Enterprise Edition.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 144
Oracle Database 11gR2/12c Real Application Clusters

Use a equal Software location as for 11gR2 RAC Database, /u01/app/oracle/product/12.1.0/dbhome_1.

Select General Purpose / Transaction Processing.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 145
Oracle Database 11gR2/12c Real Application Clusters

Well choose claudia.mlg.oracle.com for the Global database name. The other text field gets its value
claudia automatically.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 146
Oracle Database 11gR2/12c Real Application Clusters

Set the Allocate memory to the lowest value possible. Depending on the available resources on your
virtual machines, you may set a higher value. I will come back to memory settings when well prepare the
Cluster Database for a Swingbench workload execution. Check the other tabs before clicking Next.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 147
Oracle Database 11gR2/12c Real Application Clusters

Copyright 2013, Oracle and/or its affiliates. All rights reserved 148
Oracle Database 11gR2/12c Real Application Clusters

Check the box to Create database with sample schemas. The sample schemas will be available in the
Pluggable database PDB_C01.

Use Oracle Automatic Storage Management for database storage.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 149
Oracle Database 11gR2/12c Real Application Clusters

Skip the Register with Enterprise Manager (EM) Cloud Control and Enable Recovery steps.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 150
Oracle Database 11gR2/12c Real Application Clusters

Select an empty Disk Group with at least 6.5GB of Available space. The disk group may be shared, but
only with another 12c Database as it requires the attribute of ASM Compatibility set to 12.1.0.0.0. If its
lower, it will be changed during the installation process.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 151
Oracle Database 11gR2/12c Real Application Clusters

I used the same password for the entire workshop oracle. It does not conform to the Oracle
recommended standards, but for demo purpose it is ok.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 152
Oracle Database 11gR2/12c Real Application Clusters

Copyright 2013, Oracle and/or its affiliates. All rights reserved 153
Oracle Database 11gR2/12c Real Application Clusters

If should not get this failure during minimum requirements checks. I get it because I have multiple RAC
environments on the same network with the same SCAN names. It may be ignored, and click Next.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 154
Oracle Database 11gR2/12c Real Application Clusters

Copyright 2013, Oracle and/or its affiliates. All rights reserved 155
Oracle Database 11gR2/12c Real Application Clusters

Run this script as root on both nodes, one at a time, in the specified order.

When asked, leave the default local bin directory, just press Enter. Same on RAC2.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 156
Oracle Database 11gR2/12c Real Application Clusters

During Oracle Database configuration step, if you receive an error related to ASM Disk Group compatibility
attribute, do not abort the installation. Make sure you have selected an empty Disk Group for the 12c
Database creation. Then go to the terminal window of one of the nodes, set the Grid environment, and
launch ASMCA. Select the Disk Group where you want to create the 12c Database, right-click, and choose
Edit Attributes. Set value of ASM Compatibility to 12.1.0.0.0, and click OK. Close ASMCA, go back to
the installation process and click Retry.

Optionally click Password Management to set the default password for one or more user accounts in the
database.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 157
Oracle Database 11gR2/12c Real Application Clusters

Copyright 2013, Oracle and/or its affiliates. All rights reserved 158
Oracle Database 11gR2/12c Real Application Clusters

After the installation, you may check cluster resources and their status.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 159
Oracle Database 11gR2/12c Real Application Clusters

Optionally we may stop the 11gR2 Cluster Database to leave more computing resources available for the
new 12c one. This is done with the command
crsctl stop res ora.flavia.db

Copyright 2013, Oracle and/or its affiliates. All rights reserved 160
Oracle Database 11gR2/12c Real Application Clusters

Before continuing with the discovering and further testing, it is very important to perform a memory
configuration. This is the minimum configuration that worked well on my environment during the tests. In
the following screenshots you will find more details about how to change these values.

A very easy way to connect to one of the RAC instances is to set the environment for the Cluster Database,
and then export the environment variable ORACLE_SID using the name of the database instance. After
that you just need to run sqlplus / as sysdba. You may check the instance name and the parameters you
want to modify before performing the changes.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 161
Oracle Database 11gR2/12c Real Application Clusters

In this screenshot I modified (using the same value) the parameter SHARED_POOL_RESERVER_SIZE
and applied the changes only in the Spfile and just for the first instance, claudia1. Some of the parameters
will allow you to change the value also in memory, and for both instances at the same time (using
scope=both and without any value for sid). In order to be sure that all the changes are permitted, you may
use this formula. Execute the commands on all instances.
When finished, we need to restart ora.claudia.db resource on all nodes, so changes can take effect. You
may re-check the values.

Make sure you repeat the same procedures on the second instance, if you use the sid argument.
Our PDB called PDB_C01 is Mounted. By default, Oracle Database 12c does not open the PDBs
automatically at startup.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 162
Oracle Database 11gR2/12c Real Application Clusters

In order to set a Pluggable Database to be opened automatically at startup, we need to create a trigger.
Use this code to open all Pluggable Databases, or change it to open the ones you need.
CREATE or REPLACE trigger OPEN_ALL_PLUGGABLES
after startup
on database
BEGIN
execute immediate alter pluggable database all open;
END open_all_pdbs;
/

Exit from SQLplus, set the Grid environment, and re-bounce ora.claudia.db resource.

This way we test the auto-startup trigger and see if it works.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 163
Oracle Database 11gR2/12c Real Application Clusters

12c Cluster Management with Enterprise Manager 12c


Database Express
Check, and set up if necessary, the port number, which in my case is 5503. Make sure you are connected
to CDB$ROOT, using the command show con_name. If not, use these commands to make it right:
show con_name
alter session set container=CDB$ROOT;
exec dbms_xdb.sethttpport(5503);

Copyright 2013, Oracle and/or its affiliates. All rights reserved 164
Oracle Database 11gR2/12c Real Application Clusters

Launch Enterprise Manager Database Express 12c, and login using sys/oracle as sysdba credentials.

When it gets to load Resources area, you will notice a long delay.

And then you get this Critical Error.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 165
Oracle Database 11gR2/12c Real Application Clusters

Followed by a Connection Fail.

Dont worry, this is a perfect opportunity to see how patches can be applied in Online mode, which means
no downtime for the database.
To fix this we have to apply Patch 16527374 EM EXPRESS HOME GOT IO ERROR, available on My
Oracle Support. Download the patch on one of the nodes, launching Mozilla using a SSH connection with X
Server support. Or download the patch on your host computer, place it in a Shared Folder, and then mount
it on one of the nodes.
mount t vboxsf o uid=oracle SharedFolderName /mnt

In my case, I downloaded the patch on the host machine, and added the folder as Shared Folder to the
RAC1_opt virtual machine (VirtualBox Settings) under the name Downloads. Make sure you are
connected as root when you mount the Shared Folder. Logout from root connection for the rest of the
process.
Copy the patch to Oracles home, or unzip it there in the mounted Shared Folder.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 166
Oracle Database 11gR2/12c Real Application Clusters

I recommend to read the Read Me file for this patch on My Oracle Support before continuing. The apply
process has some prerequisites, and I will detail here just the ones valid for my configuration: the $PATH
environment variable should include the $ORACLE_HOME/Opatch folder, and we need to verify the
Oracle Inventory.

In this Oracle Home we have just one product installed, Oracle Database 12c (12.1.0.1.0), and there are
no other patches, this is the first one to be installed. It also notifies us that this is a RAC database with
multiple nodes.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 167
Oracle Database 11gR2/12c Real Application Clusters

We will apply the patch in Online mode, with no downtime, on both nodes, using this command, executed
from the patch folder we just unzipped:
opatch apply online connectString
claudia1:oracle:oracle:rac1,claudia2:oracle:oracle:rac2
You can find the entire command explained in the Read Me file.

If everything was done correctly, you should get OPatch succeeded message.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 168
Oracle Database 11gR2/12c Real Application Clusters

Now you may launch Enterprise Manager Database Express 12c again, and login using sys/oracle as
sysdba credentials.

Everything works now. Notice in the upper left, at the beginning of the main menu, that we are connected to
CLAUDIA (12.1.0.1.0 CDB RAC), which means CDB$ROOT Container Database. Lets take a tour and
see what we have here.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 169
Oracle Database 11gR2/12c Real Application Clusters

Click Configuration > Initialization Parameters.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 170
Oracle Database 11gR2/12c Real Application Clusters

Click Configuration > Memory.

We can configure memory parameters.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 171
Oracle Database 11gR2/12c Real Application Clusters

Click Configuration > Database Feature Usage.

Check High Water Marks.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 172
Oracle Database 11gR2/12c Real Application Clusters

Click Configuration > Current Database Properties.

Click Storage > Undo Management.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 173
Oracle Database 11gR2/12c Real Application Clusters

Click Storage > Redo Logs Group.

Click Storage > Archive Logs.

Click Storage > Control Files.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 174
Oracle Database 11gR2/12c Real Application Clusters

Click Security > Users.

You will notice that sample schema users are not shown in Common Users list. They are located in the
Pluggable Database. Click Security > Profiles.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 175
Oracle Database 11gR2/12c Real Application Clusters

Click Performance > Performance Hub.

I use a low resolution desktop, so I need to scroll in order to show all the graphs and diagrams on this
interactive page.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 176
Oracle Database 11gR2/12c Real Application Clusters

You may place the mouse pointer on any element of these graphs to get more details. The lower part of the
page has a set of tabs which gives even more monitoring and diagnostic information.

Take a look at every tab in this set.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 177
Oracle Database 11gR2/12c Real Application Clusters

You may also use the interactive dropdown menus to change the metrics.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 178
Oracle Database 11gR2/12c Real Application Clusters

Monitored SQL report offers more details at mouse over, or a drill down report when clicking on SQL IDs.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 179
Oracle Database 11gR2/12c Real Application Clusters

Click Performance > SQL Tuning Advisor.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 180
Oracle Database 11gR2/12c Real Application Clusters

For a complete drill down report, click a SQL ID.

Click on Alternative Plan link to see the execution plan. This is the Graphical representation of the plan.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 181
Oracle Database 11gR2/12c Real Application Clusters

Click on Tabular radio button for the classic view.

Click on CLAUDIA (12.1.0.1.0 CDB RAC) button to go back to the main page.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 182
Oracle Database 11gR2/12c Real Application Clusters

We have access to any of the RAC instances directly from the main page, just click on RAC - 2instance(s)
up link in the Status region

Now we can choose what RAC instance we want to check. Click on any of the instance name links. This
way we access the Performance Hub for that RAC instance in particular.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 183
Oracle Database 11gR2/12c Real Application Clusters

Similar to the Performance Hub of the Cluster Database, all components on this page are interactive, and
there are different set of tabs for comprehensive monitoring and diagnostic.

Similar for the Pluggable Database PDB_C01, before we launch Enterprise Manager Database Express
12c, we need to check and adjust if necessary the configuration. Connect to the 12c Cluster Database
using SQLplus and check the status of the Pluggable Databases.
Connect to PDB_C01 Pluggable Database with the alter session command, and check the users. All
sample schemas should be there.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 184
Oracle Database 11gR2/12c Real Application Clusters

With Oracle Database 12c, every Pluggable Database plus the Container Database, in the same
installation, have their own Enterprise Manager 12c Database Express instance. If necessary, make sure
you are connected to the Pluggable Database PDB_C01 using the command show con_name, before
executing DBMS_XDB.SETHTTPPORT.
On PDB_C01 Pluggable Database we have to set the HTTP Port for Enterprise Manager Database
Express to an available value. Use 5505.

Enterprise Manager Database Express service is offered by the XDB on one of the nodes. If you try to
connect to it on the first node and it does not answer, try the second node.

In my case is running on the second node. Though, I need to install Flash plugin for my web browser to be
able to use it.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 185
Oracle Database 11gR2/12c Real Application Clusters

This is the Enterprise Manager Database Express console for the Pluggable Database PDB_C01. Login
with sys/oracle as sysdba.
Note: If you receive a Logon denied error, please remove everything after /em and press Enter, so the
page reloads, before reentering the correct username and password.

Notice in the upper left, at the beginning of the main menu, that we are connected to CLAUDIA/PDB_C01
(12.1.0.1.0 CDB RAC), which means PDB_C01 Pluggable Database. Lets take a tour and see what we
have here.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 186
Oracle Database 11gR2/12c Real Application Clusters

Click RAC - 2 instance(s) up link.

Go to Configuration > Initialization Parameters.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 187
Oracle Database 11gR2/12c Real Application Clusters

Go to Storage > Tablespaces.

Go to Security > Users.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 188
Oracle Database 11gR2/12c Real Application Clusters

Here we may alter one of the sample schemas user account, for example HR. Go to Performance >
Performance Hub.

Use the interactive graphs and reports to see the performance during the last period of time. Click on a
SQL ID link to get more details.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 189
Oracle Database 11gR2/12c Real Application Clusters

Check all tabs of the details page.

Swingbench Workload Execution on 12c RAC


To understand how to connect to a RAC database, we need to understand the listeners and the services
they provide. If we need to check the listeners and services they provide, we have to set the Grid
environment. All listeners are installed and running in the Oracle Grid Infrastructure Home. If the listener is
running on the current node, we may check the status with lsnrctl status LISTENER_NAME. If not, we
need to use the command crsctl stat res LISTENER_RESOURCE_NAME. In following screenshot
LISTENER_SCAN1 is running on RAC2, and I am connected to RAC1 node.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 190
Oracle Database 11gR2/12c Real Application Clusters

Using the lsnrctl status command for LISTENER_SCAN2 works because this one is running on RAC1
node, and provides service for Cluster Database named claudia (which is the Container Database
CDB$ROOT), XDB (on which Enterprise Manager Database Express is running), and a service called
pdb_c01.mlg.oracle.com (which is the Pluggable Database PDB_C01 we created during the installation
process).

Copyright 2013, Oracle and/or its affiliates. All rights reserved 191
Oracle Database 11gR2/12c Real Application Clusters

This last service we use in the connection string for SQLplus to connect directly to a Pluggable Database.
In this case I connect to PDB_C01, which contains the sample schemas, set a new password for the user
HR, and unlock its account.

Now we test the connection to the HR sample schema, and query some data from it.

Next step is to prepare the storage for the Order Entry sample schema we will generate and use with the
Swingbench workload. First step is to check the available space on ASM Disk Groups. Our Oracle RAC
Database 12c is using the ORAC12C Disk Group, where I have 7748 Usable file MB. Make sure you have
at least 2400 Usable file MB if you want to use the same values I will specify for SOE schema generation.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 192
Oracle Database 11gR2/12c Real Application Clusters

ASMCMD is a command-line utility that you can use to manage Oracle ASM instances, disk groups, file
access control for disk groups, files and directories within disk groups, templates for disk groups, and
volumes. LSDG lists mounted disk groups and their information. For a complete reference, please read
Oracle Automatic Storage Management Administrator's Guide.
We can use Enterprise Manager Database Express to create the tablespace where all Swingbench sample
data will be stored. Click Storage > Tablespaces. Click Actions > Create.

Name it SOE.

Set 100M for File Size, enable Auto Extend, and set 20M for Increment.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 193
Oracle Database 11gR2/12c Real Application Clusters

Leave default values.

Optionally click Show SQL.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 194
Oracle Database 11gR2/12c Real Application Clusters

Next step is to generate the data that will be used for workload execution.
For Linux: Go to the bin folder of your Swingbench application. Execute ./oewizard.

For Windows: Go to the winbin folder of your Swingbench application. Execute oewizard.bat.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 195
Oracle Database 11gR2/12c Real Application Clusters

Connect String: 192.168.56.91:/1521/pdb_c01.mlg.oracle.com


In the Connect String we may use the IP address of any of the SCAN Listeners.
Remove the dots in the DBA password text field and type oracle.

Validate Use Partitioning check box if you want your tables to be partitioned. Make sure the Schemas
Tablespace is SOE.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 196
Oracle Database 11gR2/12c Real Application Clusters

Select User Defined Scale radio button, and type 0.3 in the text field. Make sure OrderEntry tablespace
size does not overpass 1.0 GB. If it does, decrease the User Defined Scale.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 197
Oracle Database 11gR2/12c Real Application Clusters

Copyright 2013, Oracle and/or its affiliates. All rights reserved 198
Oracle Database 11gR2/12c Real Application Clusters

Now we will execute the workload.


For Linux: Go to the bin folder of your Swingbench application. Execute ./swingbench.

For Windows: Go to the winbin folder of your Swingbench application. Execute swingbench.bat.

In the User Details tab, under the first group of tabs, set the following:
Username: soe
Password: soe
Connect String: 192.168.56.91:1521/pdb_c01.mlg.oracle.com
In the Connect String we may use the IP address of any of the SCAN Listeners. In the Load tab, under the
second group of tabs, set the following:
Number of Users: 10
Min. Delay Between Transactions (ms): 1,000
Max. Delay Between Transactions (ms): 2,000
Click Run (the green round icon with Play sign below the main menu).

Copyright 2013, Oracle and/or its affiliates. All rights reserved 199
Oracle Database 11gR2/12c Real Application Clusters

Copyright 2013, Oracle and/or its affiliates. All rights reserved 200
Oracle Database 11gR2/12c Real Application Clusters

Copyright 2013, Oracle and/or its affiliates. All rights reserved 201
Oracle Database 11gR2/12c Real Application Clusters

Go back to Enterprise Manager Database Express console, and login with sys/oracle as sysdba. Click
Storage > Tablespaces. We can see that the datafile grew to a total of 2GB after sample data was
generated.

Next, we can check the SOE user account. Click Security > Users.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 202
Oracle Database 11gR2/12c Real Application Clusters

Use Performance > Performance Hub console to check the performance metrics while Swingbench
workload is running.

Use the interactive graphs and reports to see the metric values you are interested in.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 203
Oracle Database 11gR2/12c Real Application Clusters

For example here is the workload generated by SOE user from the Swingbench application.

And this is one of the SQL queries executed on the Cluster Database.

Copyright 2013, Oracle and/or its affiliates. All rights reserved 204
Oracle Database 11gR2/12c Real Application Clusters

Copyright 2013, Oracle and/or its affiliates. All rights reserved 205
Oracle Database 11gR2/12c Real Application Clusters

Oracle Database 11gR2/12c Real Application Copyright 2012, Oracle and/or its affiliates. All rights reserved. This document is provided for information purposes only and the
Clusters contents hereof are subject to change without notice. This document is not warranted to be error-free, nor subject to any other
September 2013 warranties or conditions, whether expressed orally or implied in law, including implied warranties and conditions of merchantability or
Author: Valentin Leonard Tabacaru fitness for a particular purpose. We specifically disclaim any liability with respect to this document and no contractual obligations are
formed either directly or indirectly by this document. This document may not be reproduced or transmitted in any form or by any
EMEA Presales Center
means, electronic or mechanical, for any purpose, without our prior written permission.
Bangalore | Bucharest | Malaga
Severo Ochoa, 55
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
Campanillas-Malaga 29590
Spain

Copyright 2013, Oracle and/or its affiliates. All rights reserved 206

Вам также может понравиться