Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Wikibooks.org
Sponsored by Pythian
April 5, 2013
On the 28th of April 2012 the contents of the English as well as German Wikibooks and Wikipedia projects were
licensed under Creative Commons Attribution-ShareAlike 3.0 Unported license. An URI to this license is given
in the list of figures on page 229. If this document is a derived work from the contents of one of these projects
and the content was still licensed by the project under this license at the time of derivation this document has to
be licensed under the same, a similar or a compatible license, as stated in section 4b of the license. The list of
contributors is included in chapter Contributors on page 227. The licenses GPL, LGPL and GFDL are included in
chapter Licenses on page 239, since this book and/or parts of it may or may not be licensed under one or more of
these licenses, and thus require inclusion of these licenses. The licenses of the figures are given in the list of figures
on page 229. This PDF was generated by the LATEX typesetting software. The LATEX source itself was generated
by a program written by Dirk Hnniger with modifications by Jeremy Schneider. Dirks original program
is freely available under an open source license from http://de.wikibooks.org/wiki/Benutzer:
Dirk_Huenniger/wb2pdf. This distribution also contains a configured version of the pdflatex compiler
with all necessary packages and fonts needed to compile the LATEX source included in this PDF file. Full
instructions (including Jeremys modifications) for dynamically generating this print book using the RAC Attack
wikibook contents are available at http://racattack.org/book.
Contents
1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1. Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2. Making This Lab Successful . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3. Lab Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2. Planning Your Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2. Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
I. Setting Up RAC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3. Hardware and Windows Preparation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.1. Hardware and Windows Minimum Requirements . . . . . . . . . . . . . . . . . . . . 13
3.2. Install VMware Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.3. Setup Virtual Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.4. Setup Virtual Storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.5. Download Oracle Enterprise Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4. Linux Install . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.1. Create VM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.2. Prep for OS Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
4.3. OS Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
4.4. Wrap-up OS Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
4.5. Create RAC Attack DVD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
4.6. Prep for Oracle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
5. Create Cluster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
5.1. Create Interconnect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
5.2. Create Shared Disks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
5.3. Copy VM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
5.4. Configure Disks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
5.5. Configure Node 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
5.6. Configure Node 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
5.7. SSH and CVU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
6. Grid Install (ASM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
6.1. Setup ASMLIB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
6.2. Cluster Verification Utility (ASM) . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
6.3. Install Grid Infrastructure (ASM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
6.4. Increase CRS Fencing Timeout (ASM) . . . . . . . . . . . . . . . . . . . . . . . . . 116
6.5. Setup ASM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
7. Grid Install (Shared Filesystem) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
7.1. Setup OCFS2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
7.2. Cluster Verification Utility (Shared Filesystem) . . . . . . . . . . . . . . . . . . . . . 133
IV
Contents
1
1. Overview
RAC Attack is a free curriculum and platform for hands-on learning labs related to Oracle RAC (cluster
database). We believe that the best way to learn about RAC is with a lot of hands-on experience. This
curriculum has been used by individuals at home and by instructors in classes since 2008.
The original contributors were Jeremy Schneider, Dan Norris and Parto Jalili. The handbook was
published at http://www.ardentperf.com for several years before its migration to this wikibook.
All RAC Attack content was released under the CC-BY-SA license in May 2011 when this project was
initiated.
To learn about upcoming RAC Attack events or to organize one yourself, visit the Events page. You
can use the shortcut http://racattack.org/events to access this page at any time.
The goal of this workbook is to help students learn about Oracle RAC cluster databases through guided
examples. (Specifically, 11gR2 RAC on VMware Server with ASM or Shared Filesystem and Oracle
Enterprise Linux 5.) It can be used by organizers of events, by instructors in classes or by individuals at
home.
RAC Attack differs in depth from other tutorials currently available.
Every keystroke and mouse click is carefully documented here.
The process is covered from the very beginning to the very end - from the very first installation of
VMware on your laptop to various experiments on your running cluster database... with everything in
between.
The labs in the main workbook have been tested thoroughly and repeatedly.
1.1. Prerequisites
Students should be able to navigate in Unix - for example, listing files with "ls".
Most modern laptop and desktop computers should be powerful enough to run a two-node virtual RAC
cluster. In a nutshell, these are the recommended minimums:
Dual-core 2GHz 32-bit processor (it's been done with single-core)
4GB memory (it's been done with 3GB)
Two physical hard disks - not partitions (it's been done with one)
External HD for laptops (it's been done with certain USB flash memory sticks)
50 GB + 10.5 GB free space (it's been done with slightly less)
3
Overview
Windows XP or Vista (linux & mac are not covered in these instructions)
ASM Shared FS
/dev/sdb DATA /u51 (/u61)
/dev/sdc BACKUP /u52
collabn1 collabn2
4
Lab Tips
collabn1 collabn2
Interconnect 172.16.100.51 172.16.100.52
Administration 192.168.78.51 192.168.78.52
VIP 192.168.78.61 192.168.78.62
SCAN 192.168.78.250
5
2. Planning Your Time
For the most benefit, you must plan your time carefully. There will not be enough time to complete all
of the labs - so choose the ones which most interest you.
i Information
If you are using your own computer at home or at an event, then you always need to complete the
first lab (Hardware and Windows Preparation1 ) before you can jumpstart to any following labs. If
you are in a class then the instructor has probably completed the first lab for you, and you can
begin with a jumpstart.
2.1. Overview
7
Planning Your Time
2.2. Time
These times were gathered with a laptop just meeting the recommended minimum requirements2 . In
addition to the wait times listed below, we suggest that you reserve about 40 minutes of work time to
complete any given lab.
i Information
Downloads only apply to home users. If you are at an event or a class then the organizers have
already downloaded the software for you.
8
Jumpstart Size Next Lab Jumpstart Time Wait Times in the Build Time
Lab
Hardware and Win- Download: VMware
dows Preparation3 Server (500MB)
Download: OEL
(3GB)
0 Create VM4 15 min: Linux Install
Download: Oracle
Cluster & Database
(4.5GB)
1 3 GB Create Cluster5 4 min: jumpstart 5 min: Copy VM 6 min
3 min: startup col-
labn1
3 min: startup col-
labn2
2 13 GB Grid Install (ASM6 or 11 min: jumpstart 25 min: GI Install 17 min
Shared FS7 ) 3 min: startup nodes 10 min: root.sh col-
labn1
8 min: root.sh col-
labn2
3 20 GB RAC Install8 18 min: jumpstart 42 min: DB Install 30 min
4 min: startup col-
labn1
4 min: startup col-
labn2
9
Time
labn2
5 28 GB Rolling Patches10 25 min: jumpstart 22 min: GI Patch 45 min
Part II: Exploring 6 min: startup col- collabn1
RAC11 (w/o PSU) labn1 20 min: DB Patch
6 min: startup col- collabn1
labn2 22 min: GI Patch col-
labn2
20 min: DB Patch
collabn2
5 min: catbundle
6 37 GB Part II: Exploring 35 min: jumpstart 60 min
RAC12 (w/PSU) 6 min: startup col-
labn1
6 min: startup col-
labn2
Setting Up RAC
11
3. Hardware and Windows Preparation
This handbook will walk you through the process of creating a two-node Oracle RAC cluster on your
own laptop or desktop computer.
A detailed explanation of virtualization is beyond the scope of this lab but here is a simple overview of
what we are building:
Figure 2
Most modern laptop and desktop computers should be powerful enough to run a two-node virtual RAC
cluster. In a nutshell, these are the recommended minimums:
Dual-core 2GHz 32-bit processor (it's been done with single-core)
13
Hardware and Windows Preparation
i Information
Although we recommend against trying, RAC Attack has been done with: single-core, 3GB
memory, one physical hard drive, certain USB flash memory sticks, and less than 60GB of free
space.
1. Reboot windows. After this clean boot-up, don't start any unneeded programs - for example email
or instant messenger.
2. If possible, disable virus scanning (so that your antivirus software doesn't try to scan I/O on the
virtual machine disks).
3. Terminate any memory resident programs which are running, especially programs that help big
applications "quick-start" (these often use up a lot of memory).
1 http://www.orasavon.com/files/rac-attack-using-virtualbox-v0.4.pdf
14
Hardware and Windows Minimum Requirements
Processor
1. From the Start menu, choose or type RUN. In the dialog box that appears, type msinfo32.
Figure 3
2. Select System Summary in the left pane. Scroll down to Processor in the right pane. Verify that
you have at least 2 cores and that the speed is at least 2000 Mhz.
Figure 4
Memory
1. Scroll down to Memory in the right pane. Verify that Installed Physical Memory is at least
4GB. Also, verify that Available Memory is at least 1.4GB. You can terminate programs which
run in the foreground and background to increase the Available Memory.
Figure 5
15
Hardware and Windows Preparation
Hard Disks
1. In the left pane, choose Components -> Storage -> Disks. Count the number of Disk Drive
entries and verify that there are at least two.
Figure 6
16
Hardware and Windows Minimum Requirements
i Information
A single hard disk can max out as low as 45 MB/s. (This has been observed during RAC Attack
testing.) Typical USB Flash Thumb Drives get very, very poor performance and should not be
used. Some USB Flash Thumb Drives are marketed for performance; these typically get a
maximum around 30 MB/s. In tests for RAC Attack, USB drives worked well for storing ISO
images but somewhat poorly for storing virtual machine files.
For a detailed comparison of different connection types, refer to:
http://www.pixelbeat.org/speeds.html
i Information
We worked hard to reduce the footprint of RAC Attack, however with 11gR2 it's very difficult to
reduce it beyond this.
17
Hardware and Windows Preparation
RAC Attack requires a local windows user account with a password and with administrative privi-
leges. You may login using a network or password-free account only if the login account has admin
privileges and you know the password for a local account which also has admin privileges (and not an
empty password).
If your account is not local, or if your account does not have local admin privileges then you can create
an admin account by following the directions here.
1. From the Start menu, choose RUN. In the dialog box that appears, type cmd to launch a command
prompt.
On Windows 7 find the "search programs" field at the bottom of the Start menu. Type cmd in but
don't run it. Right click on "cmd" then choose to "Run as administrator".
After you have opened the command prompt as an admin user, run the following two commands:
net user admin racattack /add
net localgroup administrators admin /add
Login: admin
Password: racattack
1. Type net user %username% (if you're using a network or password-free login account then
replace %username% with the local password-ed admin account).
VERIFY the username, VERIFY that password required is yes, and VERIFY that local group
memberships include Administrators.
Figure 8
18
Install VMware Server
1. These labs have been tested with version 2.0.1 of VMware Server. Go to the VMware Server
website at http://www.vmware.com/go/getserver
Figure 9
Figure 10
19
Hardware and Windows Preparation
Figure 11
4. Accept the license agreement and all default options during the installation process.
Figure 12
20
Install VMware Server
Figure 13
Figure 14
21
Hardware and Windows Preparation
5. Enter your license information, which is visible at the VMware website on the same page where
you downloaded the software.
Figure 15
1. Choose Manage Virtual Networks from the start menu. After the program starts, make sure
that you see an "Apply" button at the bottom. If you do not see an "Apply" button then close the
program and re-start it by right-clicking and choosing to "run as administrator" (this must be done
on Windows 7 normally).
Figure 16
22
Setup Virtual Networks
2. Click the Host Virtual Network Mapping Tab and then click the Right Arrow Button next to
VMnet1. Choose Subnet from the submenu.
Figure 17
Figure 18
23
Hardware and Windows Preparation
4. Click the Right Arrow Button next to Vmnet8 and choose Subnet from the submenu.
Figure 19
Figure 20
24
Setup Virtual Networks
Figure 21
8. Go to the NAT tab and VALIDATE that the VMnet host is VMnet8 and Gateway IP is
192.168.78.2
Figure 22
25
Hardware and Windows Preparation
If you are at an event, then the event organizers might provide a special DEMO option - where you can
run a pre-configured RAC cluster on your own laptop. In order to use this DEMO option, follow this
lab but use the directories on the event-provided external hard drive.
1. RAC Attack is carefully designed to use three directories and spread out I/O for the best possible
responsiveness during labs. Create these three directories in the destinations that you chose
in Hardware and Windows Minimum Requirements , taking the guidelines into
consideration.
mkdir C:\RAC11g
mkdir D:\RAC11g-shared
mkdir D:\RAC11g-iso
In the RAC11g directory, make sure that collabn1 and collabn2 subdirectories don't exist.
rmdir C:\RAC11g\collabn1
rmdir C:\RAC11g\collabn2
2. The VMware Server management interface is web-based, and some new web browsers are not
compatible with it. There are two ways to open this management interface:
Open a non-default web browser and go to the address https://localhost:8333/
If you are at an event, then the event organizers might have provided Firefox 2.0.0.20 which
has been tested with RAC Attack. You can run this browser directly from the Jumpstart Drive
without installing it on your PC. This version of firefox can also be downloaded from the
internet.
Launch VMware Server Home Page from the start menu. This will use your default web
browser.
Figure 23
3. Depending on what web browser you use, you might receive security-related warnings. Proceed
through all of these warnings and choose to view the web page.
26
Setup Virtual Storage
4. Login to the VMware console with the local windows admin account username and password.
Figure 26
5. On the main screen (Summary tab), find the Commands box and choose Add Datastore.
Figure 27
27
Hardware and Windows Preparation
6. Repeat this step three times. Set the datastore names to RAC11g, RAC11g-shared and RAC11g-
iso. Choose Local Datastore and use the directory path which you previously chose and created.
Figure 28
7. VERIFY that the three new datastores exist in the Summary screen named RAC11g and
RAC11g-iso and RAC11g-shared. Also VERIFY that the two networks vmnet1 and vmnet8
are available as HostOnly and NAT respectively.
Figure 29
If you are at an event, then the event organizers have already downloaded the software and copied it to
the Jumpstart Drive.
Skip this lab.
If you are at home, then follow these instructions to download Oracle Enterprise Linux.
Continue below.
28
Download Oracle Enterprise Linux
Figure 30
2. Enter your Name, Company, Email and Country and review/accept the license and export
restrictions before clicking Continue. If you have visited Oracle EDelivery before then make
sure to enter your information exactly the same.
If this is the first time you've downloaded software from Oracle, then you might have to wait a
few days until you receive an email from Oracle granting you permission to continue.
Figure 31
3. Search for Oracle Linux on the x86-32-bit platform. Choose Oracle Linux Release 5 Update 6.
Figure 32
29
Hardware and Windows Preparation
4. Download the file for x86 (32 bit) not the source.
Figure 33
5. This zip file will contain a single file named Enterprise-R5-U6-Server-i386-dvd.iso extract
this file into the RAC11g-iso folder and then delete the original zip file.
30
4. Linux Install
4.1. Create VM
1. From the SUMMARY screen, choose Create Virtual Machine. Name the new machine col-
labn1 and select the RAC11g datastore.
Figure 34
2. Select Linux Operating System and choose Red Hat Enterprise Linux 5 (32-bit).
Figure 35
31
Linux Install
3. Allocate 760M of memory for the virtual machine and choose 1 processor.
Figure 36
Figure 37
32
Create VM
5. Set the disk size to 30G and name the file [RAC11g] collabn1/system.vmdk leave all other
options at their defaults and click Next.
Figure 38
Figure 39
33
Linux Install
Figure 40
Figure 41
34
Create VM
Figure 42
Figure 43
35
Linux Install
11. Review the configuration and click Finish. Do not power on the virtual machine yet.
Figure 44
Figure 45
36
Prep for OS Installation
2. From the Commands box, click Add Hardware. In the window that appears, click CD/DVD
Drive.
Figure 46
Figure 47
37
Linux Install
Figure 48
5. Open the section called Virtual Device Node and choose IDE 0:0. Then click
Next.
B Warning
Carefully follow this step because it's easy to miss.
Figure 49
38
Prep for OS Installation
6. Click Finish to add the device. Don't power on the virtual machine yet.
Figure 50
7. If you are in a class, then the instructor may have provided a second virtual DVD named
RAC11gR2.iso to save some class time. It contains all additional software downloads.
Repeat all previous steps from this lab to add the second DVD using RAC11gR2.iso image
and choosing IDE 0:1.
If you are not in a class, then you will later download all needed software and build the second
DVD yourself.
Continue below.
8. Scroll down to the Hardware box and confirm the Virtual Machine settings. They should match
this picture (except that you should only see the second DVD if you are in a class and it was
provided by the instructor):
Figure 51
39
Linux Install
4.3. OS Installation
1. Click the Console tab. You might see a message saying that the Remote Console Plug-in is not
installed. If you see this message then click Install plug-in and follow the directions before
continuing. (Note: you may be asked to restart your computer during this process.)
Figure 52
2. When the plugin is installed, you should see a large play button in the center of the console.
Click on the play button to start the VM.
Figure 53
40
OS Installation
3. When you see the square boxes, click anywhere to open a console window.
Figure 54
4. A new window will now open - outside of your web browser. If you opened this window soon
after starting the Virtual Machine, then you will see the boot screen of the Oracle Enterprise
Linux installer.
Figure 55
At first, this new console window will ignore your keyboard and mouse. Click inside the new
console window and it will begin accepting your keyboard and mouse.
41
Linux Install
i Information
Anytime your keyboard and mouse are stuck in the VMware Virtual Machine, you can press
CTRL and ALT together to move them outside the VM.
If you still see the boot screen then you may press enter to continue, or just wait for it to
automatically continue.
5. Choose to SKIP the media test.
Figure 56
Figure 57
42
OS Installation
Figure 58
Figure 59
43
Linux Install
Figure 60
10. Accept the default layout (with no encryption) and choose NEXT.
Figure 61
44
OS Installation
Figure 62
12. Set the hostname to collabn1.vm.ardentperf.com and leave DHCP enabled before choosing
NEXT.
Figure 63
45
Linux Install
13. Choose the timezone where you are located! Let the system clock run on UTC though.
Figure 64
Figure 65
46
OS Installation
15. Choose Customize Now but don't choose any "additional tasks". Then click NEXT.
Figure 66
16. Select only these package groups, then click NEXT to continue:
Category Selections
Desktop Environments Gnome Desktop Environment
Applications Editors
Graphical Internet
Text-based Internet
Development Development Libraries
Development Tools
Servers Server Configuration Tools
Base System Administration Tools
Base
System Tools
X Window System
B Warning
Do not choose Cluster Storage or Clustering.
47
Linux Install
Figure 67
Figure 68
48
OS Installation
Figure 69
Figure 70
49
Linux Install
19. After the machine reboots when you wee the Welcome screen choose FORWARD.
Figure 71
Figure 72
50
OS Installation
21. DISABLE the firewall and choose FORWARD. Confirm by clicking YES.
Figure 73
Figure 74
51
Linux Install
Figure 75
24. Leave the clock alone (with the wrong time) and click FORWARD.
Figure 76
52
OS Installation
Figure 77
Figure 78
53
Linux Install
Figure 79
Figure 80
54
Wrap-up OS Installation
Tip: If you are familiar with the unix command-line, then we recommend connecting through SSH
in addition to using the VMware console. You can then copy-and-paste many commands from this
handbook! Until we configure networking, VMware will assign the address 192.168.78.128.
1. Login as the user root with password racattack.
Figure 81
55
Linux Install
2. GNOME is the the graphical window environment installed by default in OEL. First, disable
GNOME CD automount. Go to the menu System >> Preferences >> Removable Drives and
Media.
Figure 82
3. Uncheck all of the options under Removable Storage and click Close.
Figure 83
56
Wrap-up OS Installation
4. Open a terminal window from the menu Applications >> Accessories >> Terminal.
Figure 84
Figure 85
57
Linux Install
6. In the Title and Command tab, check the box for Run command as a login shell, then close
the dialog.
Figure 86
7. The editor "gedit" is a simple graphical editor similar to notepad and it can be used to edit
files on Linux. If you are going to use gedit, then it is helpful if you open Edit > Preferences to
disable text wrapping and enable line numbers.
Figure 87
8. In a terminal window as the root user, shutdown and disable anacron then run it manually with
no delay.
58
Wrap-up OS Installation
i Information
It should not cause any problems for you, but be aware that several CPU and I/O intensive jobs
will run in the background for about 10 minutes while you continue with this lab (e.g. updatedb
and makewhatis). You might notice some slight system performance degradation. You can always
use the program top to see what is currently running.
9. In a terminal window as the root user, shutdown and disable the automounter.
10. In a terminal window as the root user, shutdown and disable the apple zeroconf service (avahi).
11. If any of the small CD images in the status bar do not have a green dot, then click on the CD
image and choose "Connect to [RAC11g] iso/... on Server". If a window opens showing the CD
contents then make sure to close the window.
Figure 88
59
Linux Install
[root@collabn1 ]# cd /mnt
[root@collabn1 mnt]# mkdir cdrom
[root@collabn1 mnt]# mkdir cdrom5
13. Add entries to /etc/fstab for all CD's and then mount them. If you are in a class then you will
probably have two CD's. If you are not in a class then you will probably have only one.
[root@collabn1 ]# ls /dev/cdrom-*
/dev/cdrom-hda /dev/cdrom-hdb
cd /mnt
# From Enterprise Linux 5 CDROM 2
rpm -Uvh */*/compat-libstdc++-33*
rpm -Uvh */*/libaio-devel-0.*
rpm -Uvh */*/unixODBC-2.*
rpm -Uvh */*/unixODBC-devel-2.*
# From Enterprise Linux 5 CDROM 3
rpm -Uvh */*/sysstat-7.*
60
Wrap-up OS Installation
16. Return to the Summary tab in the VMware console. From the Status box, choose to Install
VMware Tools. Click the Install button to begin.
Figure 89
Before running VMware Tools for the first time, you need to
configure it for your running kernel by invoking the
following command: "/usr/bin/vmware-config-tools.pl".
Enjoy,
...
Choose NO to skip the VMware FileSystem Sync Driver (vmsync)
61
Linux Install
Figure 90
18. Run the network commands. (You can cut and paste the commands into the terminal.) Next, run
vmware-toolbox and enable clock synchronization.
Figure 91
62
Create RAC Attack DVD
Figure 92
umount /mnt/cdrom
Using VMware Infrastructure web interface, mount Oracle Enterprise Linux from [RAC11g-iso]
data store. Mount it:
mount /mnt/cdrom
If you are in a class or at an event, then the instructor may have provided a second virtual DVD named
RAC11gR2.iso to save some class time. It contains all additional software downloads.
Skip this lab and continue to the next one.
If you are at home, then follow these instructions to download all needed software and build the second
DVD yourself.
Continue below.
1. While logged in as root, download the latest release of the RAC Attack supporting code (GPL).
63
Linux Install
# cd
# curl -kL github.com/ardentperf/racattack/tarball/master | tar xz
( ... )
1. Edit /etc/sysctl.conf
64
Prep for Oracle
net.core.rmem_default=4194304
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=262144
[root@collabn1 ]# sysctl -p
2. Edit /etc/security/limits.conf
3. Edit /etc/pam.d/login and insert the following lines BEFORE the "selinux open" line.
5. Create directories.
65
Linux Install
Figure 93
7. Disable GNOME CD automount for the oracle user. Go to the menu System >> Preferences >>
Removable Drives and Media.
Figure 94
66
Prep for Oracle
8. Uncheck all of the options under Removable Storage and click Close.
Figure 95
Figure 96
67
Linux Install
Figure 97
11. In the Title and Command tab, check the box for Run command as a login shell, then close
the dialog.
Figure 98
68
Prep for Oracle
12. If you are using gedit, then open Edit > Preferences to disable text wrapping and enable line
numbers.
Figure 99
[oracle@collabn1 ]$ su - root
[root@collabn1 ]# gedit /etc/oratab
69
Linux Install
grid:/u01/grid/oracle/product/11.2.0/grid_1:N
[root@collabn1 ]# chown oracle:dba /etc/oratab
[root@collabn1 ]# su - oracle
[oracle@collabn1 ]$ cd /mnt
[oracle@collabn1 ]$ cat */oracle-profile >>/home/oracle/.bash_profile
i Information
The source code for this file can be found at https://github.com/ardentperf/
racattack/blob/master/makeDVD/oracle-profile
15. Close andre-open your terminal sessions so that the new profiles take effect.
16. Install fix_cssd script.
i Information
In VMware test environments you usually have a very small amount of memory. Oracle CSS
processes can take up a *LOT* of the memory (over 50% in this lab) because it locks several
hundred MB in physical memory. In VMware (for both ASM and RAC environments) this may be
undesirable. This low-level hack will make the memory swappable at runtime.
NEVER, EVER, EVER EVEN IN YOUR WILDEST DREAMS THINK ABOUT TRYING
THIS ON ANYTHING CLOSE TO A PRODUCTION SYSTEM.
The source code for this file can be found at https://github.com/ardentperf/
racattack/blob/master/makeDVD/root/fix_cssd/fix_cssd.sh
[oracle@collabn1 ]$ su - root
[root@collabn1 ]# cd /
[root@collabn1 ]# tar xvf mnt/*/fix_cssd.tar
root/fix_cssd/fix_cssd.sh
[root@collabn1 ]# /etc/rc.d/rc.local
nohup: appending output to nohup.out'
70
5. Create Cluster
1. If the machine is running then logout and shutdown. The machine needs to be powered off.
2. In the Inventory tab at the left, select collabn1 (the virtual machine we just created).
Figure 100
3. Scroll down to the Hardware box and CONFIRM that there is one Network Adapter of type
NAT.
Figure 101
71
Create Cluster
4. From the Commands box, click Add Hardware. In the window that appears, click Network
Adapter.
Figure 102
5. Choose to create a HostOnly network connection. This will be used for the interconnect. Then
click Next.
Figure 103
72
Create Shared Disks
Figure 104
1. In the Inventory tab at the left, select collabn1 (the virtual machine we just created).
Figure 105
73
Create Cluster
2. From the Commands box, click Add Hardware. In the window that appears, click Hard Disk.
Figure 106
Figure 107
74
Create Shared Disks
Figure 108
Figure 109
B Warning
It may take a moment for the disk to appear to the VMware console. Wait until the new disk
appears before you continue with the lab. Furthermore, the web browser may display an error
which requires you to reload the page and login to VMware again.
6. Repeat steps 1-5 for the second disk (it is listed at the beginning of this lab).
75
Create Cluster
7. CONFIRM that your list of hard disks and network devices matches this screenshot.
Figure 110
Figure 111
9. Click the Advanced tab and scroll down to the Configuration Parameters. Use the Add New
Entry button to add the entries listed here. Click OK to save the configuration changes.
Name Value
disk.locking false
76
Copy VM
Name Value
diskLib.dataCacheMaxSize 0
diskLib.maxUnsyncedWrites 0
mainMem.useNamedFile false
Figure 112
i Information
I have found the following three websites among the most useful while creating custom VMware
configurations. They show how powerful and versatile VMware is even the free VMware Server
product.
http://sanbarrow.com/vmx/vmx-advanced.html
http://sanbarrow.com/vmx/vmx-config-ini.html
http://vmfaq.com/?View=entry&EntryID=25
5.3. Copy VM
1. In Windows Explorer, browse to the folder [RAC11g] \collabn1. Copy all of the files to the
folder [RAC11g] \collabn2.
The location of [RAC11g] was determined in the first lab. In a class, the instructor may provide
the location.
If the collabn2 folder does not exist, then create it.
77
Create Cluster
Make sure that you copy - not move - the files. Hold down CTRL to copy with drag-and-drop in
windows.
Figure 113
Figure 114
78
Copy VM
2. Browse to [RAC11g] \collabn2. Edit the file collabn1.vmx (the VMware Configuration File).
You can use notepad or wordpad to edit the file.
Figure 115
3. Find the line displayName and change it to collabn2 (the new node name), then save and close
the file.
displayName = "collabn2"
Figure 116
79
Create Cluster
Figure 117
2. Choose the Console tab. Click on the play button to start the VM. When you see the square boxes,
click anywhere to open a console window.
Figure 118
80
Configure Disks
Figure 119
Figure 120
5. Switch to the root user with the "su -" command. (The password is racattack.) CONFIRM
that two new disks exist and that they have the appropriate sizes. These two lines should exactly
match!!
81
Create Cluster
WARNING: Re-reading the partition table failed with error 16: Device
or resource busy.
The kernel still uses the old table.
Syncing disks.
82
Configure Node 1
After completing the previous lab, you should already be logged in as the oracle user on collabn1. You
should already have a terminal open, where you are currently switched to the root user.
1. As the root user, CONFIRM that the IP address if eth0 starts with 192.168.78 and that the IP
address of eth1 starts with 172.16.100.
2. Update the IP addresses by directly editing the linux network configuration files. Update the
BOOTPROTO line and add the remaining lines.
[root@collabn1 ]# cd /etc/sysconfig/network-scripts
[root@collabn1 network-scripts]# gedit ifcfg-eth0
BOOTPROTO=none
IPADDR=192.168.78.51
NETMASK=255.255.255.0
GATEWAY=192.168.78.2
[root@collabn1 network-scripts]# gedit ifcfg-eth1
BOOTPROTO=none
IPADDR=172.16.100.51
NETMASK=255.255.255.0
4. As root, restart the network services by typing service network restart. Then confirm the new
ip addresses with ifconfig. Also confirm the search domain by inspecting /etc/resolv.conf if
the file has reverted then edit it again. (When I wrote this lab, the change stuck after the second
time I edited the file.)
B Warning
You must perform this step in VMware; do not use PuTTY.
83
Create Cluster
Figure 121
5. Edit /etc/ hosts. EDIT the line with 127.0.0.1 and then ADD all of the other lines below:
84
Configure Node 2
1. In the VMware console, go to the Virtual Machine menu and choose Add Virtual Machine to
Inventory.
Figure 122
2. Browse to RAC11g/collabn2 and open collabn1.vmx. Make sure you browse to the right folder!
Figure 123
85
Create Cluster
3. In the Inventory tab at the left, select the new VM collabn2. Choose the Console tab and click
the play button to start the VM.
Figure 124
4. The VMware console should ask you whether you copied or moved the VM. Answer that you
copied the files and click OK.
Figure 125
86
Configure Node 2
5. When you see the square boxes, click anywhere to open a console window.
Figure 126
Figure 127
7. Open a terminal ( Applications >> Accessories >> Terminal ) and switch to the root
user.
87
Create Cluster
i Information
When you first open a console on collabn2, you will notice that the hostname still says collabn1.
This is because we copied the machine; we will change the hostname shortly.
88
Configure Node 2
Figure 128
9. Update the IP addresses by directly editing the linux network configuration files. Update the
BOOTPROTO line and add the remaining lines.
COMMENT or DELETE the line which begins with HWADDR.
[root@collabn1 ]# cd /etc/sysconfig/network-scripts
[root@collabn1 network-scripts]# gedit ifcfg-eth0
BOOTPROTO=none
#HWADDR=...
IPADDR=192.168.78.52
NETMASK=255.255.255.0
GATEWAY=192.168.78.2
89
Create Cluster
11. Update the HOSTNAME by editing the linux system configuration files. Set it to col-
labn2.vm.ardentperf.com. Then change the active system hostname with the hostname
command.
12. As root, restart the network services by typing service network restart. Then confirm the new
ip addresses with ifconfig. Confirm that search domain by inspecting /etc/resolv.conf if the file
has reverted then edit it again. (The change stuck after the second time I edited the file while
walking through this lab.) Also confirm the new hostname with hostname.
B Warning
You must perform this step in VMware; do not use PuTTY.
Figure 129
13. Exit your terminal session and start a new one so that you can see the updated hostname in the
prompt.
14. Edit /etc/hosts. EDIT the line with 127.0.0.1 and then ADD all of the other lines below:
90
SSH and CVU
1. Login to node collabn2. As the oracle user, make sure that you can ping both nodes on the
interconnect and public network.
2. Store the public keys for the hosts. You can do this with a tool called ssh-keyscan.
3. Test ssh equivilance. It is important that there is no prompt and you are automatically logged in.
[oracle@collabn1 ]$ exit
logout
Connection to collabn1 closed.
91
Create Cluster
4. Switch to node collabn1. As the oracle user, confirm that you can ping both servers. Then copy
the known_hosts file from collabn2.
[oracle@collabn2 ]$ exit
logout
Connection to collabn2 closed.
7. Run CLUVFY to validate your hardware and OS installation! The shared disk test will fail; this
is OK. Ignore that error.
92
SSH and CVU
93
6. Grid Install (ASM)
1. Login to collabn1 as oracle and open a teminal. Switch to the root user.
Figure 130
2. Install ASMLib on both nodes and initialize the disks. mount command may fail (mount:
/dev/cdrom-hda already mounted or /mnt/cdrom busy) if you already have cdrom mounted from
previous steps.
[root@collabn1 ]# cd /mnt
[root@collabn1 mnt]# mount /mnt/cdrom
mount: block device /dev/cdrom-hda is write-protected, mounting
read-only
[root@collabn1 mnt]# mount /mnt/cdrom5
mount: block device /dev/cdrom-hdb is write-protected, mounting
read-only
95
Grid Install (ASM)
# OracleASM
rpm -Uvh */*/oracleasm-support*
rpm -Uvh */*/oracleasm*el5-2* # (Note - that's lowercase EL5-2.)
# Missing from the install media; copied to RAC Attack DVD.
rpm -Uvh */oracleasmlib*
This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver
is
loaded on boot and what permissions it will have. The current
values
will be shown in brackets ('[]'). Hitting <ENTER> without typing an
answer will keep that current value. Ctrl-C will abort.
i Information
The disks are shared so you only need to initialize them once.
[root@collabn2 ]# cd /mnt
# OracleASM
rpm -Uvh */*/oracleasm-support*
rpm -Uvh */*/oracleasm*el5-2*
# Missing from the install media; copied to RAC Attack DVD.
rpm -Uvh */oracleasmlib*
This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver
is
loaded on boot and what permissions it will have. The current
96
Cluster Verification Utility (ASM)
values
will be shown in brackets ('[]'). Hitting <ENTER> without typing an
answer will keep that current value. Ctrl-C will abort.
Figure 131
2. Run CVU to validate that you're ready to install CRS. Use the new fixup feature of 11gR2
CVU to create a script that can fix missing parameters.
97
Grid Install (ASM)
98
Cluster Verification Utility (ASM)
collabn2,collabn1
Kernel parameter check passed for "ip_local_port_range"
Kernel parameter check passed for "rmem_default"
Kernel parameter check passed for "rmem_max"
Kernel parameter check passed for "wmem_default"
Kernel parameter check failed for "wmem_max"
Check failed on nodes:
collabn2,collabn1
Kernel parameter check failed for "aio-max-nr"
Check failed on nodes:
collabn2,collabn1
Package existence check passed for "make-3.81"
Package existence check passed for "binutils-2.17.50.0.6"
Package existence check passed for "gcc-4.1.2"
Package existence check passed for "gcc-c++-4.1.2"
Package existence check passed for "libgomp-4.1.2"
Package existence check passed for "libaio-0.3.106"
Package existence check passed for "glibc-2.5-24"
Package existence check passed for "compat-libstdc++-33-3.2.3"
Package existence check passed for "elfutils-libelf-0.125"
Package existence check passed for "elfutils-libelf-devel-0.125"
Package existence check passed for "glibc-common-2.5"
Package existence check passed for "glibc-devel-2.5"
Package existence check passed for "glibc-headers-2.5"
Package existence check passed for "libaio-devel-0.3.106"
Package existence check passed for "libgcc-4.1.2"
Package existence check passed for "libstdc++-4.1.2"
Package existence check passed for "libstdc++-devel-4.1.2"
Package existence check passed for "sysstat-7.0.2"
Package existence check passed for "unixODBC-2.2.11"
Package existence check passed for "unixODBC-devel-2.2.11"
Package existence check passed for "ksh-20060214"
Check for multiple users with UID value 0 passed
Current group ID check passed
Core file name pattern consistency check passed.
3. Switch to the root user and run the fixup script on both nodes.
99
Grid Install (ASM)
collabn1:/home/oracle[RAC1]$ su -
Password:
-bash: oraenv: No such file or directory
[root@collabn1 ]# /tmp/CVU_11.2.0.1.0_oracle/runfixup.sh
4. As the oracle user, run CVU again to make sure the fixit script worked. The NTP, memory and
swap checks might fail but this is acceptable for our VMware test cluster.
[root@collabn1 ]# exit
logout
...
Total memory check failed
...
Swap space check failed
...
Kernel parameter check passed for "file-max"
...
Kernel parameter check passed for "wmem_max"
Kernel parameter check passed for "aio-max-nr"
...
Liveness check failed for "ntpd"
...
100
Install Grid Infrastructure (ASM)
1. As the oracle user, launch the grid installer. At the first screen, choose Install and Configure
Grid Infrastructure for a Cluster and click NEXT.
[oracle@collabn1 ]$ /mnt/cdrom*/grid/runInstaller
Figure 132
101
Grid Install (ASM)
Figure 133
Figure 134
102
Install Grid Infrastructure (ASM)
Figure 135
4. Name the cluster collab and make sure that the SCAN name is collab-scan with port 1521, then
click NEXT.
Figure 136
103
Grid Install (ASM)
5. Add node collabn2 with VIP collabn2-vip and choose NEXT to validate the cluster configura-
tion.
Figure 137
6. Verify that eth0 on subnet 192.168.78.0 is PUBLIC and that eth1 on subnet 172.16.100.0 is
PRIVATE, then click NEXT.
Figure 138
104
Install Grid Infrastructure (ASM)
Figure 139
8. Create a diskgroup called DATA with External Redundancy using only the disk ORCL:DATA
and click NEXT.
Figure 140
105
Grid Install (ASM)
9. Choose to use the same passwords for all accounts and enter the password racattack, then click
NEXT. (Ignore the message that Oracle doesn't like this password.)
Figure 141
Figure 142
106
Install Grid Infrastructure (ASM)
11. Set the OSDBA group to asmdba, the OSOPER group to asmoper and the OSASM group to
asmadmin. Then click NEXT.
Figure 143
12. Accept the ORACLE_BASE location of /u01/app/oracle and use the ORACLE_HOME location
of /u01/grid/oracle/product/11.2.0/grid_1. Then click NEXT.
Figure 144
107
Grid Install (ASM)
13. Accept the default inventory location of /u01/app/oraInventory and choose NEXT
Figure 145
14. The prerequisite checks will execute. A warning will be issued saying that three checks failed:
physical memory, swap size and network time protocol. Click the CHECK BOX to Ignore All,
then click NEXT.
Figure 146
108
Install Grid Infrastructure (ASM)
15. SAVE a response file called grid.rsp in the oracle user home directory. Then click FINISH to
install grid infrastructure.
Figure 147
Figure 148
109
Grid Install (ASM)
16. When prompted, open a terminal as the root user and run the two root.sh scripts. Make sure to
run BOTH SCRIPTS on BOTH NODES!
Figure 149
[oracle@collabn1 ]$ su -
Password: racattack
[root@collabn1 ]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
[root@collabn1 ]# /u01/grid/oracle/product/11.2.0/grid_1/root.sh
Running Oracle 11g root.sh script...
110
Install Grid Infrastructure (ASM)
111
Grid Install (ASM)
Checking swap space: must be greater than 500 MB. Actual 968 MB
Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
'UpdateNodeList' was successful.
B Warning
Before you run any scripts on the second node, check the CPU utilization on the first node - where
you just finished running scripts. If %idle is 0 then something is still running in the background
112
Install Grid Infrastructure (ASM)
and you should wait until %idle increases. You can monitor the CPU with any of these three
commands:
top
vmstat 3
iostat -x sda sdb sdc 3
[root@collabn1 ]# vmstat 3 4
procs -----------memory---------- ---swap-- -----io---- --system--
-----cpu------
r b swpd free buff cache si so bi bo in cs us
sy id wa st
0 0 660156 11868 6472 263348 33 229 1505 2740 1194 2407 8
22 44 27 0
2 0 660156 11884 6472 263364 0 0 1 3 712 3635 2
4 90 4 0
1 0 660156 11884 6480 263368 0 0 0 34 701 3565 1
3 90 6 0
4 0 660156 11884 6480 263372 0 0 1 5 721 3642 2
8 88 2 0
[root@collabn2 ]# /u01/grid/oracle/product/11.2.0/grid_1/root.sh
Running Oracle 11g root.sh script...
113
Grid Install (ASM)
Checking swap space: must be greater than 500 MB. Actual 1205 MB
Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
'UpdateNodeList' was successful.
114
Install Grid Infrastructure (ASM)
17. After running both scripts, return to the installer window and click OK to continue running
configuration assistants.
Figure 150
18. The Cluster Verification Utility will fail because NTP is not running. If you want to, check the
error message at the very end of the logfile. Then click OK to close the messagebox and click
NEXT to continue.
Figure 151
115
Grid Install (ASM)
19. You should now see the final screen! Click CLOSE to exit the installer.
Figure 152
These steps are not necessary for a test or production environment. However they might make your
VMware test cluster just a little more stable and they will provide a good learning opportunity about
Grid Infrastructure.
1. Grid Infrastructure must be running on only one node to change these settings. Shutdown the
clusterware on collabn2 as user root.
collabn2:/home/oracle[RAC1]$ su -
Password: racattack
116
Setup ASM
2. Return to node collabn1. As the root user, increase the misscount so that CRS waits 1.5 minutes
before it reboots. (VMware can drag a little on some laptops!)
3. Increase the disktimeout so that CRS waits 10 minutes for I/O to complete before rebooting.
1. As the oracle user, use the oenv macro (from Ardent Performance Computing) to set your
environment for the SID +ASM1. Then, type asmca to launch ASMCA.
collabn1:/home/oracle[RAC1]$ oenv
SIDs here are: grid +ASM1
ORACLE_SID = [RAC1] ? +ASM1
The Oracle base for
ORACLE_HOME=/u01/grid/oracle/product/11.2.0/grid_1
is /u01/app/oracle
collabn1:/home/oracle[+ASM1]$ asmca
117
Grid Install (ASM)
2. Make sure you're on the Disk Groups tab and then right-click on the DATA diskgroup and choose
Edit Attributes.
Figure 153
3. Set the Database Compatibility and the ADVM Compatibility both to 11.2.0.0.0 then click OK.
Choose YES when prompted about advancing database compatibility.
Figure 154
118
Setup ASM
Figure 155
5. Name the new diskgroup BACKUP. Choose External redundancy and select the disk
ORCL:BACKUP. Then, click the Show Advanced Options button.
Figure 156
119
Grid Install (ASM)
6. Leave the Allocation Unit at 1MB and set all compatibility parameters to 11.2.0.0.0, then click
OK.
Figure 157
Figure 158
120
Setup ASM
Figure 159
121
7. Grid Install (Shared Filesystem)
Figure 160
2. Create mountpoints on both nodes for two OCFS volumes: /u51 and /u52.
3. Install and load the OCFS2 packages from the OEL (Oracle Enterprise Linux) installation media
and then load the module. Install and load OCFS2 on collabn2 as well.
123
Grid Install (Shared Filesystem)
[root@collabn1 ]# cd /mnt
124
Setup OCFS2
Figure 161
5. Choose CONFIGURE NODES. . . from the CLUSTER menu. If you see a notification that the
cluster has been started, then acknowledge it by clicking the Close button.
Figure 162
125
Grid Install (Shared Filesystem)
Figure 163
6. Click ADD and enter the collabn1 and the private IP 172.16.100.51. Accept the default port.
Click OK to save.
Figure 164
126
Setup OCFS2
7. Click ADD a second time and enter collabn2 and 172.16.100.52. Then choose to APPLY then
click CLOSE to close the window.
Figure 165
127
Grid Install (Shared Filesystem)
8. Choose PROPAGATE CONFIGURATION. . . from the CLUSTER menu. If you are prompted
to accept host keys then type YES. Type the root password racattack at the both prompts. When
you see the message Finished! then press <ALT-C> to close the window.
Figure 166
128
Setup OCFS2
9. From the TASKS menu, choose FORMAT to create the OCFS filesystem. Select /dev/sdb1 and
type the volume label u51-data. Leave the rest of the options at their defaults and click OK to
format the volume. Confirm by clicking YES.
Figure 167
Figure 168
129
Grid Install (Shared Filesystem)
10. Repeat the previous step for volume /dev/sdc1 and name it u52-backup.
Figure 169
11. Exit the OCFS2 console by selecting QUIT from the FILE menu.
Figure 170
130
Setup OCFS2
12. Configure OCFS2 on both nodes. We will use a conservative disk heartbeat timeout (300 seconds)
because VMware is slow on some laptops.
13. Reload the O2CB driver on the node where you ran ocfs2console.
131
Grid Install (Shared Filesystem)
14. Edit /etc/fstab to add entries for the new file systems.
[root@collabn1 ]# vi /etc/fstab
LABEL=u51-data /u51 ocfs2 _netdev,datavolume,nointr 0 0
LABEL=u52-backup /u52 ocfs2 _netdev,datavolume,nointr 0 0
15. Mount the volumes and create directories for the oracle database files.
[root@collabn1 ]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sdb1 3.3G 279M 3.0G 9% /u51
/dev/sdc1 3.3G 279M 3.0G 9% /u52
16. Login to the second node collabn2 as root and repeat these steps there.
[root@collabn2 ]# vi /etc/fstab
LABEL=u51-data /u51 ocfs2 _netdev,datavolume,nointr 0 0
LABEL=u52-backup /u52 ocfs2 _netdev,datavolume,nointr 0 0
[root@collabn2 ]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sdb1 3.3G 279M 3.0G 9% /u51
/dev/sdc1 3.3G 279M 3.0G 9% /u52
[root@collabn2 ]# ls -l /u5*
/u51:
total 0
drwxr-xr-x 2 oracle dba 3896 Sep 26 15:30 cluster
drwxr-xr-x 2 root root 3896 Sep 26 15:26 lost+found
drwxr-xr-x 2 oracle dba 3896 Sep 26 15:29 oradata
/u52:
total 0
drwxr-xr-x 2 root root 3896 Sep 26 15:26 lost+found
drwxr-xr-x 2 oracle dba 3896 Sep 26 15:30 oradata
17. Optionally, examine /var/log/messages and dmesg output for status messages related to OCFS2.
132
Cluster Verification Utility (Shared Filesystem)
Figure 171
2. Run CVU to validate that you're ready to install CRS. Use the new fixup feature of 11gR2
CVU to create a script that can fix missing parameters.
133
Grid Install (Shared Filesystem)
134
Cluster Verification Utility (Shared Filesystem)
3. Switch to the root user and run the fixup script on both nodes.
collabn1:/home/oracle[RAC1]$ su -
Password:
-bash: oraenv: No such file or directory
[root@collabn1 ]# /tmp/CVU_11.2.0.1.0_oracle/runfixup.sh
135
Grid Install (Shared Filesystem)
root@collabn2's password:
/root/.bashrc: line 16: oraenv: No such file or directory
4. As the oracle user, run CVU again to make sure the fixit script worked. The NTP, memory and
swap checks might fail but this is acceptable for our VMware test cluster.
[root@collabn1 ]# exit
logout
...
Total memory check failed
...
Swap space check failed
...
Kernel parameter check passed for "file-max"
...
Kernel parameter check passed for "wmem_max"
Kernel parameter check passed for "aio-max-nr"
...
Liveness check failed for "ntpd"
...
Several NFS appliances and big-iron cluster filesystems are very common in large cluster database
deployments. We will use OCFS2 here to practice 11gR2 RAC with a filesystem.
Note: 11gR2 clusterware has a bug it does allow cluster files on OCFS2 (even though this is a
supported configuration). To work around this bug, we will present the OCFS2 directory to clusterware
with a local "loopback" NFS mount.
1. As the root user, Follow the steps below to setup the local NFS mount on node collabn1.
136
Install Grid Infrastructure (Shared Filesystem)
[root@collabn1 ]# vi /etc/exports
/u51 *(rw,no_root_squash,sync)
[root@collabn2 ]# vi /etc/exports
/u51 *(rw,no_root_squash,sync)
Several NFS appliances and big-iron cluster filesystems are very common in large cluster database
deployments. We will use OCFS2 here to practice 11gR2 RAC with a filesystem.
1. As the oracle user, launch the grid installer. At the first screen, choose Install and Configure
Grid Infrastructure for a Cluster and click NEXT.
[oracle@collabn1 ]$ /mnt/cdrom*/grid/runInstaller
137
Grid Install (Shared Filesystem)
Figure 172
Figure 173
138
Install Grid Infrastructure (Shared Filesystem)
Figure 174
Figure 175
139
Grid Install (Shared Filesystem)
4. Name the cluster collab and make sure that the SCAN name is collab-scan with port 1521, then
click NEXT.
Figure 176
5. Add node collabn2 with VIP collabn2-vip and choose NEXT to validate the cluster configura-
tion.
Figure 177
140
Install Grid Infrastructure (Shared Filesystem)
6. Verify that eth0 on subnet 192.168.78.0 is PUBLIC and that eth1 on subnet 172.16.100.0 is
PRIVATE, then click NEXT.
Figure 178
7. Choose to store the Clusterware Files in Shared File System and choose NEXT.
Figure 179
141
Grid Install (Shared Filesystem)
8. For the OCR, choose External Redundancy and type the path /u61/cluster/ocr. (This is the NFS
location from the BUG WORKAROUND.) Click NEXT to continue.
Figure 180
9. For the Voting Disk, do the same choose External Redundancy and type the path
/u61/cluster/vdsk. (Again, this is the NFS location from the BUG WORKAROUND.) Click
NEXT to continue.
Figure 181
142
Install Grid Infrastructure (Shared Filesystem)
Figure 182
11. Set the OSDBA group to asmdba, the OSOPER group to asmoper and the OSASM group to
asmadmin. Then click NEXT.
Figure 183
143
Grid Install (Shared Filesystem)
12. Accept the ORACLE_BASE location of /u01/app/oracle and use the ORACLE_HOME location
of /u01/grid/oracle/product/11.2.0/grid_1. Then click NEXT.
Figure 184
Figure 185
144
Install Grid Infrastructure (Shared Filesystem)
14. The prerequisite checks will execute. A warning will be issued saying that three checks failed:
physical memory, swap size and network time protocol. Click the CHECK BOX to Ignore All,
then click NEXT.
Figure 186
15. SAVE a response file called grid.rsp in the oracle user home directory. Then click FINISH to
install grid infrastructure.
Figure 187
145
Grid Install (Shared Filesystem)
Figure 188
16. When prompted, open a terminal as the root user and run the two root.sh scripts. Make sure to
run BOTH SCRIPTS on BOTH NODES!
Figure 189
[oracle@collabn1 ]$ su -
Password: racattack
146
Install Grid Infrastructure (Shared Filesystem)
[root@collabn1 ]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
[root@collabn1 ]# /u01/grid/oracle/product/11.2.0/grid_1/root.sh
Running Oracle 11g root.sh script...
147
Grid Install (Shared Filesystem)
148
Install Grid Infrastructure (Shared Filesystem)
Checking swap space: must be greater than 500 MB. Actual 968 MB
Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
'UpdateNodeList' was successful.
[root@collabn2 ]# /u01/grid/oracle/product/11.2.0/grid_1/root.sh
Running Oracle 11g root.sh script...
149
Grid Install (Shared Filesystem)
Checking swap space: must be greater than 500 MB. Actual 1205 MB
Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
'UpdateNodeList' was successful.
17. After running both scripts, return to the installer window and click OK to continue running
configuration assistants.
Figure 190
150
Install Grid Infrastructure (Shared Filesystem)
18. The Cluster Verification Utility will fail because NTP is not running. If you want to, check the
error message at the very end of the logfile. Then click OK to close the messagebox and click
NEXT to continue.
Figure 191
19. You should now see the final screen! Click CLOSE to exit the installer.
Figure 192
151
Grid Install (Shared Filesystem)
These steps are not necessary for a test or production environment. However they might make your
VMware test cluster just a little more stable and they will provide a good learning opportunity about
Grid Infrastructure.
1. Grid Infrastructure must be running on only one node to change these settings. Shutdown the
clusterware on collabn2 as user root.
collabn2:/home/oracle[RAC1]$ su -
Password: racattack
2. Return to node collabn1. As the root user, increase the misscount so that CRS waits 1.5 minutes
before it reboots. (VMware can drag a little on some laptops!)
3. Increase the disktimeout so that CRS waits 10 minutes for I/O to complete before rebooting.
152
8. RAC Install
1. Login to collabn1 as the oracle user and open a terminal. Run CLUVFY to check that you're
ready to start the DB install. The memory, swap and NTP/time checks may fail but everything
else should succeed.
153
RAC Install
"collabn2:/u01/grid/oracle/product/11.2.0/grid_1,collabn2:/tmp"
Free disk space check passed for
"collabn1:/u01/grid/oracle/product/11.2.0/grid_1,collabn1:/tmp"
User existence check passed for "oracle"
Group existence check passed for "oinstall"
Group existence check passed for "dba"
Membership check for user "oracle" in group "oinstall" [as Primary]
passed
Membership check for user "oracle" in group "dba" passed
Run level check passed
Hard limits check passed for "maximum open file descriptors"
Soft limits check passed for "maximum open file descriptors"
Hard limits check passed for "maximum user processes"
Soft limits check passed for "maximum user processes"
System architecture check passed
Kernel version check passed
Kernel parameter check passed for "semmsl"
Kernel parameter check passed for "semmns"
Kernel parameter check passed for "semopm"
Kernel parameter check passed for "semmni"
Kernel parameter check passed for "shmmax"
Kernel parameter check passed for "shmmni"
Kernel parameter check passed for "shmall"
Kernel parameter check passed for "file-max"
Kernel parameter check passed for "ip_local_port_range"
Kernel parameter check passed for "rmem_default"
Kernel parameter check passed for "rmem_max"
Kernel parameter check passed for "wmem_default"
Kernel parameter check passed for "wmem_max"
Kernel parameter check passed for "aio-max-nr"
Package existence check passed for "make-3.81"
Package existence check passed for "binutils-2.17.50.0.6"
Package existence check passed for "gcc-4.1.2"
Package existence check passed for "libgomp-4.1.2"
Package existence check passed for "libaio-0.3.106"
Package existence check passed for "glibc-2.5-24"
Package existence check passed for "compat-libstdc++-33-3.2.3"
Package existence check passed for "elfutils-libelf-0.125"
Package existence check passed for "elfutils-libelf-devel-0.125"
Package existence check passed for
"elfutils-libelf-devel-static-0.125"
Package existence check passed for "glibc-common-2.5"
Package existence check passed for "glibc-devel-2.5"
Package existence check passed for "glibc-headers-2.5"
Package existence check passed for "kernel-headers-2.6.18"
Package existence check passed for "gcc-c++-4.1.2"
Package existence check passed for "libaio-devel-0.3.106"
Package existence check passed for "libgcc-4.1.2"
Package existence check passed for "libstdc++-4.1.2"
Package existence check passed for "libstdc++-devel-4.1.2"
Package existence check passed for "sysstat-7.0.2"
Package existence check passed for "unixODBC-2.2.11"
Package existence check passed for "unixODBC-devel-2.2.11"
Package existence check passed for "ksh-20060214"
Check for multiple users with UID value 0 passed
Current group ID check passed
Default user file creation mask check passed
154
Install Database Software
155
RAC Install
Figure 193
3. On the first screen, leave the email blank and uncheck the "security update" option. Click NEXT
to continue. Choose YES to verify that you don't want to enter an email address.
Figure 194
156
Install Database Software
Figure 195
5. Choose Real Application Clusters database installation and select all nodes. Click NEXT to
continue.
Figure 196
157
RAC Install
Figure 197
Figure 198
158
Install Database Software
Figure 199
9. Verify that the OSDBA group is dba and the OSOPER group is oper. Click NEXT to continue.
Figure 200
159
RAC Install
10. The prerequisite checks will execute. A warning will be issued saying that three checks failed:
physical memory, swap size and network time protocol. Click the CHECK BOX to Ignore All,
then click NEXT.
Figure 201
11. SAVE a response file called db.rsp in the oracle user home directory. Then click FINISH to
install the oracle database software.
Figure 202
160
Install Database Software
Figure 203
12. When prompted, open a terminal as the root user and run the root.sh script. Enter /usr/bin as the
local bin directory and overwrite the files which were previously installed by grid infrastructure.
Make sure to run it on BOTH NODES!
Figure 204
161
RAC Install
[oracle@collabn1 ]$ su -
Password: racattack
[root@collabn1 ]# /u01/app/oracle/product/11.2.0/db_1/root.sh
Running Oracle 11g root.sh script...
[root@collabn2 ]# /u01/app/oracle/product/11.2.0/db_1/root.sh
Running Oracle 11g root.sh script...
162
Install Database Software
13. After running both scripts, return to the installer window and click OK to finish the installation.
You should now see the final screen! Click CLOSE to exit the installer.
Figure 205
163
9. Create Database
9.1. Create DB
1. ASM Databases Only: Login to a terminal as the oracle user. Use the oenv macro to set your
environment for the SID +ASM1. Then, type asmca to launch ASMCA.
collabn1:/home/oracle[RAC1]$ oenv
SIDs here are: grid +ASM1
ORACLE_SID = [RAC1] ? +ASM1
The Oracle base for
ORACLE_HOME=/u01/grid/oracle/product/11.2.0/grid_1
is /u01/app/oracle
collabn1:/home/oracle[+ASM1]$ asmca
2. ASM Databases Only: Verify that both diskgroups are mounted. If you have jumpstarted or
rebooted, then the BACKUP diskgroup may be dismounted. To mount it, right click then choose
Mount on All Nodes. Click EXIT to close the ASM Configuration Assistant.
Figure 206
165
Create Database
3. Type ". oraenv" to setup the environment. Leave the default SID and enter
/u01/app/oracle/product/11.2.0/db_1 for the ORACLE_HOME. Then type dbca to launch
the Database Configuration Assistant.
Figure 207
4. At the first prompt, choose Real Application Clusters Database and click NEXT.
Figure 208
166
Create DB
Figure 209
Figure 210
167
Create Database
7. Choose Admin-Managed Database, Set the global database name to RAC.vm.ardentperf.com and
select all cluster nodes. Then click NEXT to continue.
Figure 211
8. Do not configure Enterprise Manager (there's probably not enough memory here). Uncheck it
and click the Automatic Maintenance Tasks tab.
Figure 212
168
Create DB
9. Disable the automatic maintenance tasks (they can really tax the CPU on your laptop...) After
unchecking the box, click NEXT to continue.
Figure 213
10. Set all passwords to racattack and click NEXT to continue. Choose YES to continue even
though Oracle doesn't like the password.
Figure 214
11. Choose a Storage Type depending on which track of the RAC Attack lab you're doing.
169
Create Database
Choose a Storage Type of Automatic Stor- Choose a Storage Type of Cluster File
age Management (ASM). System.
170
Create DB
14. Choose to install the sample schemas. After checking the box, click NEXT to continue.
Figure 221
15. Bump the memory target up to 400MB and do not check Automatic Memory Management. Skip
the other tabs and click NEXT to continue.
Figure 222
171
Create Database
16. Accept the default storage settings and click NEXT to continue.
Figure 223
17. Go ahead and generate scripts (in the default location), but leave Create Database option checked.
the Click FINISH to begin database creation.
Figure 224
172
Create DB
Figure 225
19. DBCA will inform you after it generates the scripts. Click OK to continue with database creation.
Figure 226
173
Create Database
Figure 227
20. When database creation is complete a summary window will appear. Click EXIT to close the
installer.
Figure 228
174
Create DB
Figure 229
21. One last thing: edit /etc/oratab on both nodes and replace the DB name with the Instance name.
Also edit the bash_profile on node 2 and set the instance name to RAC2.
[oracle@collabn1 ]$ vi /etc/oratab
RAC1:/u01/app/oracle/product/11.1.0/db_1:N
[oracle@collabn2 ]$ vi /home/oracle/.bash_profile
export ORACLE_SID=RAC2
175
10. Rolling Patches
Figure 230
Upgrades to the "base version" are very complicated and always use the full Oracle installer (runIn-
staller). Major new features are only introduced in new base versions.
Patch Sets are also installed with the full Oracle installer. Historically, each patchset was installed
on top of the base version (top row in the illustration) by using runInstaller. However, starting with
11.2.0.2 the patch sets can be installed as a new installation without the base version. It is now
recommended to perform Patch Set upgrades "out-of-place" in this manner. Sometimes new features
are also included with Patch Sets (for example RAT data collection).
PSUs are installed with opatch. They include security updates and important bug fixes. They are
released quarterly and always include the latest CPU.
CPUs are installed with opatch. CPUs include only security updates, and are also released quarterly.
They cannot be applied after you have applied any PSU. (Until you upgrade to a new patch set or base
version.)
Before performing any installation or upgrade of Oracle, you should always check the Support Status
and Known Issues for the release. Metalink note 161818.1 is always the starting point open this note
and review it. Next, follow the link for 11.2.0.X to metalink note 880782.1 and review that note. Finally,
follow the link to note 880707.1 and review the known issues with Oracle 11.2.0.1 which is the version
we will be using for this lab.
i Information
177
Rolling Patches
These notes have been saved as HTML files on the the virtual DVD provided by the instructor. It is
available in your Virtual RAC Nodes at /mnt/cdrom5.
For this lab, the instructor has provided recent PSUs. PSUs and CPUs are collections of one-off patches.
One-off patches can only be applied to an Oracle database in a rolling manner if they have been certified
for rolling upgrades.
1. Review the installation instructions. We're going to install three patches and you can find the
README files at these locations:
/mnt/cdrom5/patch/psu6-db-12419378/12419378/README.html
/mnt/cdrom5/patch/psu2-gi-9655006/README.html
/mnt/cdrom5/patch/opatch-6880880/README.txt
2. First we need to update the OPatch utility. Find patch 6880880 on the instructor-provided
CDROM and unzip it directly into both the grid home and the database home. Before unzipping
the file, backup the existing OPatch programs.
$ oenv
SIDs here are: grid +ASM1 RAC1
ORACLE_SID = [RAC1] ? grid
$ cd $ORACLE_HOME
$ tar czvf /gi-opatch-backup_$(date +%Y-%m-%d).tgz OPatch/
...
$ unzip -o /mnt/cdrom*/patch/opatch-6880880/p6880880_112000_LINUX.zip
...
$ OPatch/opatch version
Invoking OPatch 11.2.0.1.5
OPatch Version: 11.2.0.1.5
OPatch succeeded.
$ oenv
SIDs here are: grid +ASM1 RAC1
ORACLE_SID = [grid] ? RAC1
$ cd $ORACLE_HOME
$ mv OPatch OPatch.backup
$ unzip /mnt/cdrom*/patch/opatch-6880880/p6880880_112000_LINUX.zip
...
$ OPatch/opatch version
Invoking OPatch 11.2.0.1.5
OPatch Version: 11.2.0.1.5
OPatch succeeded.
$ ssh collabn2
$ exit
178
Patching Grid and Database Software
4. This new version of OPatch requires an "OCM response file" for certain operations. Use the
OCM utility to generate this file. We don't want to configure OCM; leave your username blank
and confirm that "YES" you don't want to enter any account information.
5. Find the Grid Infrastructure and Database PSUs on the instructor-provided DVD.
$ cd /mnt/cdrom5/patch
$ ls
opatch-6880880 psu2-gi-9655006 psu6-db-12419378
6. We know that these PSUs can be applied in a rolling manner, but verify this.
$ for D in psu*/[0-9]*; do
echo -n $D:
cd $D
$ORACLE_HOME/OPatch/opatch query -is_rolling_patch | grep rolling
cd ../..
done
7. We also know that there won't be any patch conflicts (since these are the first patches we're
installing) but verify this too.
$ oenv
ORACLE_SID = [RAC1] ? grid
[grid]$ cd psu2-gi-9655006
psu2-gi-9655006[grid]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail
-phBaseDir ./9655006
...
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
179
Rolling Patches
[grid]$ oenv
ORACLE_SID = [RAC1] ? RAC1
[RAC1]$ cd ../psu6-db-12419378/
psu6-db-12419378[RAC1]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail
-phBaseDir ./12419378
...
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
8. The automated patch application process will automatically shutdown and restart all database
processes on the node. However, we don't want the automatic restart because we are applying
two PSUs (one for grid and one for database). Disable the instance auto-start for node collabn1
and manually shutdown the instance for patch application.
i Information
On a production system, all active connections would need to be migrated to the other instance
before doing this (for example, with services).
9. We will use automated patch application to apply the grid infrastructure PSU. First use oenv to
enter the grid environment, then switch to the root user and run opatch auto.
Note: any database processes on this node will be automatically shutdown during patching.
When prompted for the OCM response file path, enter /home/oracle/ocm.rsp and press enter.
When prompted about the grid home being shared, type yes to continue.
B Warning
Make sure to specify the grid home on the command line so that the patch doesn't find the database
home and apply itself there in addition.
$ oenv
SIDs here are: grid +ASM1 RAC1
ORACLE_SID = [RAC1] ? grid
The Oracle base for
ORACLE_HOME=/u01/grid/oracle/product/11.2.0/grid_1 is /u01/app/oracle
[grid]$ cd /mnt/cdrom5/patch/psu2-gi-9655006
psu2-gi-9655006[grid]$ su
Password: racattack
180
Patching Grid and Database Software
OPatch is bundled with OCM, Enter the absolute OCM response file
path:
/home/oracle/ocm.rsp
Can't change permissions of ./.: Read-only file system
10. Return to the oracle user and find the Database PSU on the instructor-provided DVD. Use oenv
to enter the database environment, then run opatch apply.
Run OPatch in local mode so that it does not attempt an automatic rolling install across the
entire cluster.
When prompted about OCM, leave your username blank and confirm with "y" that you don't
want to enter any account information.
When prompted whether the local home is ready for patching, type "y" to continue.
# exit
$ cd ../psu6-db-12419378
psu6-db-12419378$ oenv
SIDs here are: grid +ASM1 RAC1
ORACLE_SID = [grid] ? RAC1
The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
is /u01/app/oracle
psu6-db-12419378[RAC1]$ cd 12419378
181
Rolling Patches
You selected -local option, hence OPatch will patch the local system
only.
Return Code = 0
OPatch succeeded.
182
Patching Grid and Database Software
11. Enable and start the Oracle database instance on node collabn1. After the instance is running,
stop and disable the instance on node collabn2. There should be no point at which the database is
not running.
i Information
On a production system, all active connections would need to be migrated to the other instance at
this point (for example, with services).
12. Use automated patch application to apply the grid infrastructure PSU to collabn2.
Note: any database processes on this node will be automatically shutdown during patching.
Copy the OCM response file (/home/oracle/ocm.rsp) to collabn2.
When prompted about the grid home being shared, type yes to continue.
B Warning
Make sure to specify the grid home on the command line so that the patch doesn't find the database
home and apply itself there in addition.
[grid]$ cd /mnt/cdrom5/patch/psu2-gi-9655006
psu2-gi-9655006[grid]$ su
Password: racattack
183
Rolling Patches
13. Return to the oracle user and find the Database PSU on the instructor-provided DVD. Use oenv
to enter the database environment, then run opatch apply.
Run OPatch in local mode so that it does not attempt an automatic rolling install across the
entire cluster.
When prompted about OCM, leave your username blank and confirm with "y" that you don't
want to enter any account information.
When prompted whether the local home is ready for patching, type "y" to continue.
# exit
$ cd ../psu6-db-12419378
psu6-db-12419378$ oenv
SIDs here are: grid +ASM2 RAC2
ORACLE_SID = [grid] ? RAC2
The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
is /u01/app/oracle
psu6-db-12419378[RAC2]$ cd 12419378
184
Patching Grid and Database Software
You selected -local option, hence OPatch will patch the local system
only.
Return Code = 0
OPatch succeeded.
14. Enable and restart the Oracle database instance on node collabn2.
185
Rolling Patches
$ ss
SQL> @?/rdbms/admin/catbundle.sql psu apply
16. Optional: if you want more practice working with patches, then try rolling back the database
PSU and then try applying it in automated rolling mode (without local flag) or in the minimum
downtime mode.
186
Part II.
Exploring RAC
187
11. Clusterware Testing
The goal of this lab is to demonstrate Oracle Clusterwares fencing ability by forcing a configuration
that will trigger Oracle Clusterwares built-in fencing features. With Oracle Clusterware, fencing is
handled at the node level by rebooting the non-responsive or failed node. This is similar to the as Shoot
The Other Machine In The Head (STOMITH) algorithm, but its really a suicide instead of affecting
the other machine. There are many good sources for more information online. For more information, I
highly recommend reading this blog posting from Kevin Closson (now with Oracle):
http://kevinclosson.wordpress.com/2007/08/17/oracle-clusterware-and-fencingagain/
1. Start with a normal, running cluster with the database instances up and running.
2. Monitor the logfiles for clusterware on each node. On each node, start a new window and run the
following command:
[oracle@<node_name> ]$ tail -f \
> /u01/grid/oracle/product/11.2.0/grid_1/log/hostname -s/crsd/crsd.log
[oracle@<node_name> ]$ tail -f \
> /u01/grid/oracle/product/11.2.0/grid_1/log/hostname -s/cssd/ocssd.log
3. We will simulate unplugging the network interface by taking one of the private network
interfaces down. On the collabn2 node, take the private network interface down by running the
following command (as the root user):
189
Clusterware Testing
Alternatively, you can also simulate this by physically taking the HostOnly network adapter
offline in VMware.
Figure 231
Figure 232
4. Following this command, watch the logfiles you began monitoring in step 2 above. You should
see errors in those logfiles and eventually (could take a minute or two, literally) you will observe
one node reboot itself.
If you used ifconfig to trigger a failure, then the node will rejoin the cluster and the instance
should start automatically.
If you used VMware to trigger a failure then the node will not rejoin the cluster.
Which file has the error messages that indicate why the node is not rejoining the cluster?
Is the node that reboots always the same as the node with the failure? Why or why not?
The goal of this lab is to demonstrate Oracle Fast Application Notification (FAN) Callouts. In versions
prior to 11g, these were also known as Oracle Clusterware Callouts.
190
Clusterware Callouts
This feature is a relatively little-known capability for Oracle Clusterware to fire a script (or a whole
directory full of them) to perform whatever tasks you may want performed when a cluster-wide event
happens.
For more information, consult the documentation here: http://download.oracle.com/docs/
cd/B28359_01/rac.111/b28254/hafeats.htm#BABGCEBF
For this exercise, well configure some FAN callout scripts on each node and then trigger various cluster
events to see how each one triggers the callout script.
1. Start with a normal, running cluster with both nodes up and running.
2. From a shell prompt (logged in as oracle) on each server, navigate to
/u01/grid/oracle/product/11.2.0/grid_1/racg/usrco. Create file there called callout1.sh us-
ing vi (or your favorite editor). The contents of the file should be this:
#!/bin/ksh
umask 022
FAN_LOGFILE=/tmp/hostname_uptime.log
echo $* "reported="date >> $FAN_LOGFILE &
B Warning
Note the use of backticks around the hostname and date commands.
3. Make sure that the permissions on the file are set to 755 using the following command:
4. Monitor the logfiles for clusterware on each node. On each node, start a new window and run the
following command:
[oracle@<node_name> ]$ tail -f \
/u01/grid/oracle/product/11.2.0/grid_1/log/hostname -s/crsd/crsd.log
5. Next, we need to trigger an event that will cause the callout to fire. One such event is node
shutdown. Shutdown the clusterware on node collabn2.
6. Following this command, watch the logfiles you began monitoring in step 2 above. Because we
set long timeouts on our test cluster, you might have to wait for a few minutes before you see
anything.
191
Clusterware Testing
You should eventually observe entries noting that the node has failed and shortly following that,
you should observe an entry placed in the /tmp/<hostname>_uptime.log file indicating that the
node is down.
Note which members run the clusterware callout script. (A surviving member could run
commands to notify clients and/or application servers that one of the cluster nodes has died.)
You should see these messages in the /tmp/*.log files:
8. Try powering off one of the virtual machines is there an difference from the previous test? What
if you disable a linux network interface or VMware network card?
9. You may conduct more testing, if you wish. Another interesting event is a database instance
going down unexpectedly. Come back to this lab after installing a database to test that situation.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 -
Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
i Information
One popular use for clusterware callouts is to notify administrators (possibly via email) that a
cluster event has occurred. You may use the arguments to the script (youll see the arguments in
the logfile weve created) to conditionally perform notification as well. For example, you may not
want to notify anyone unless a node crashes unexpectedly. By testing some of these arguments,
you may be able to send notifications only when desired.
192
12. Services, Failover and Load Balancing
In order to test failover it would be best to connect from a client outside the cluster, so we'll start by
downloading and installing Oracle's Basic Instant Client (English-only) and the Instant Client SQLPlus
package.
1. Login to the node collabn1 as user oracle and open a connection to the database as SYSDBA
and unlock the SH user account. Also grant DBA access.
User altered.
Grant succeeded.
2. Download Oracle's Basic (English-only) Instant Client and Oracle's Instant Client SQLPlus
package. The lab instructor may have made them available, or they can also be downloaded from
Oracle's website here:
http://www.oracle.com/technetwork/topics/winsoft-085727.html
The two files you need are:
instantclient-basiclite-*.zip
instantclient-sqlplus-*.zip
193
Services, Failover and Load Balancing
3. Each archive contains a folder named "instantclient_11_2". Extract this folder (from both archives)
into C:\. (In Explorer you can drag-and-drop or you can choose "Extract All" from the File menu.)
Figure 233
194
Install Instant Client
Figure 234
C:\instantclient_11_2> sqlplus
sh/sh@//collab-scan/RAC.vm.ardentperf.com
Figure 235
6. Create a TNSNAMES files and copy the RAC, RAC1 and RAC2 entries from either cluster
database node.
RAC =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = collab-scan)(PORT = 1521))
(CONNECT_DATA =
195
Services, Failover and Load Balancing
(SERVER = DEDICATED)
(SERVICE_NAME = RAC.vm.ardentperf.com)
)
)
RAC2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = collabn-scan)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RAC.vm.ardentperf.com)
(INSTANCE_NAME = RAC2)
)
)
RAC1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = collabn-scan)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RAC.vm.ardentperf.com)
(INSTANCE_NAME = RAC1)
)
)
7. Test your TNSNAMES by setting the TNS_ADMIN environment variable and running SQLPLUS.
C:\instantclient_11_2>set TNS_ADMIN=c:\instantclient_11_2
C:\instantclient_11_2>sqlplus sh/sh@RAC
Figure 236
1. Login to collabn1 as the oracle user. Create a new service svctest with RAC1 as a preferred
instance and RAC2 as an available instance. This means that it will normally run on the RAC1
instance but will failover to the RAC2 instance if RAC1 becomes unavailable.
196
Service Failover
2. Examine where the service is running by checking lsnrctl on both nodes and looking at the
SERVICE_NAMES init parameter on both nodes.
B Warning
You should never directly change the SERVICE_NAMES init parameter on a RAC database!! This
parameter is maintained automatically by the clusterware.
(ADDRESS=(PROTOCOL=TCP)(HOST=collabn1.vm.ardentperf.com)(PORT=1521))
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
(ADDRESS=(PROTOCOL=TCP)(HOST=collabn1.vm.ardentperf.com)(PORT=1521))
INST_ID VALUE
----------
------------------------------------------------------------
1 svctest, RAC.vm.ardentperf.com
2 RAC.vm.ardentperf.com
3. Use SHUTDOWN ABORT to kill the instance where service svctest is running.
197
Services, Failover and Load Balancing
INSTANCE_NAME
----------------
RAC1
4. Wait a few moments and then repeat step 2. What has happened?
7. Manually failover the service. Confirm where it is now running. Note that this does not
disconnect any current sessions
IMPORTANT NOTE:This lab was written for Oracle 11gR1 and the information here is crucial when
working with this and older versions. It will demonstrate how failover works and the importance of
using proper addresses in TNSNAMES. However, starting with 11gR2 the node VIPs should not be used
to connect to the database the SCAN VIP should always be used instead. The 11gR2 client has this
same failover functionality built-in for multiple SCAN VIPs returned on a single DNS entry.
198
Connection Failover
1. On your local computer edit the TNSNAMES.ORA file used by the Instance Client. Add two
entries called CFTEST and CFTEST-NOVIP which connect to the RAC service with no load
balancing. Explicitly enable connection failover even though it is already enabled by default
anyway. Don't use the VIP's for the second entry (this is wrong but we'll test it to see what
happens).
CFTEST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = collabn1-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = collabn2-vip)(PORT = 1521))
(LOAD_BALANCE = no)
(FAILOVER = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RAC.vm.ardentperf.com)
)
)
CFTEST-NOVIP =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = collabn1)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = collabn2)(PORT = 1521))
(LOAD_BALANCE = no)
(FAILOVER = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RAC.vm.ardentperf.com)
)
)
2. On collabn1 check the number of established connections from the listener to the RAC service.
Connect from Windows to CFTEST and CFTEST-NOVIP several times and then check the lsnrctl
statistics again. All connections from the Windows machine are attaching to listener on collabn1
but this listener is spreading the connections between both instances.
First look at the number of established connections on node 1. It's ok if they're not all zero.
(ADDRESS=(PROTOCOL=TCP)(HOST=collabn1.vm.ardentperf.com)(PORT=1521))
Instance "RAC2", status READY, has 1 handler(s) for this
service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
REMOTE SERVER
(ADDRESS=(PROTOCOL=TCP)(HOST=collabn2.vm.ardentperf.com)(PORT=1521))
199
Services, Failover and Load Balancing
Second, connect to the database several times in a row and use both service names. You can exit
each session after you check how long it takes to connect. All of the sessions should connect
quickly. Count the number of times you connect.
Third, check the listener connections on node 1 again. Make sure that the total number of
established connections shows an increase by at least the same number of sessions that you
connected. (That is, confirm that all of your sessions connected to this node.) There might be
more connections; that's ok.
Also, notice how the listener is distributing connections to both instances - even though our client
is only connecting to the listener on one node. It doesn't matter how many connections go to each
instance; it's ok of you don't see 3 and 3.
(ADDRESS=(PROTOCOL=TCP)(HOST=collabn1.vm.ardentperf.com)(PORT=1521))
Instance "RAC2", status READY, has 1 handler(s) for this
service...
Handler(s):
"DEDICATED" established:3 refused:0 state:ready
REMOTE SERVER
(ADDRESS=(PROTOCOL=TCP)(HOST=collabn2.vm.ardentperf.com)(PORT=1521))
200
Connection Failover
3. In the VMware Console, make sure that you have opened the node collabn1 which you are
connecting to from Windows. Simulate a complete node failure by choosing Power Off from the
Virtual Machine menu.
Figure 237
4. Wait about a minute (so that the cluster can detect the failed node). Then, from Windows, connect
to the CFTEST and CFTEST-VIP services again. What happens when you use the NOVIP
connection?
i Information
The purpose of this lab is to demonstrate why you should always use VIP connections!
201
Services, Failover and Load Balancing
1. Power on collabn1 from the VMware Console. After it has started, login as the oracle user and
failback the svctest service which we created earlier in this lab.
Figure 238
2. On your local computer edit the TNSNAMES.ORA file used by the Instance Client. Add
a new entry called SVCTEST which connects to the svctest service and make sure that the
connection works. Also check your TAF settings after connecting. (Side note: we did not
configure this service with a domain name, but you can't connect to it unless you specify one in
the TNSNAMES entry. Try it. Where did this domain name come from?)
202
Runtime Failover
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = svctest.vm.ardentperf.com)
)
)
INSTANCE_NAME
----------------
RAC1
3. From your Windows SQLPlus session, update the server-side TAF (Transparent Application
Failover) settings for the svctest service.
begin
dbms_service.modify_service(
service_name=>'svctest',
failover_type=>dbms_service.failover_type_select,
failover_method=>dbms_service.failover_method_basic,
failover_delay=>5,
failover_retries=>60
);
end;
/
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release
11.1.0.6.0 - Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
INSTANCE_NAME
----------------
RAC1
203
Services, Failover and Load Balancing
C:\> cd \instantclient_11_2
C:\instantclient_11_2> set TNS_ADMIN=c:\instantclient_11_2
C:\instantclient_11_2> sqlplus sh/sh@svctest-novip
INSTANCE_NAME
----------------
RAC1
6. Start a long-running query in both queries. While the query is running, Power Down the node
that they are connected to. What happens to each session?
Note: This lab was written for 11.1 and does not show the same behavior in 11.2 - it needs to be
updated!
--
204
Client Load Balancing
Figure 239
2. Open a SQLPlus session on the database and confirm that there are no sessions for the SH user.
SQL> select inst_id, count(*) from gv$session where username='SH' group by inst_-
id;
no rows selected
System altered.
System altered.
205
Services, Failover and Load Balancing
System altered.
4. In your other connected SQLPlus session, keep an eye on the balance of connections. At the
same time, open a new shell session and run this script which will open 160 connections to the
database.
How were the connections distributed between the database instances during client-side load
balancing?
i Information
Note: In 11.2 these connections are load balanced across the SCAN listeners instead of the RAC
nodes.
5. Terminate all of the sqlplus sessions by running these two commands. After you run the second
command, press <Ctrl-C> after you start seeing the message "no more job".
killall sqlplus
while true; do fg; done
<Ctrl-C>
1. Open a SQLPlus session on the database and confirm that there are no sessions for the SH user.
no rows selected
206
Server Load Balancing
If there are any sessions, you can kill them with the output of this SQL:
2. Re-enable server-side load balancing on both instances by setting the REMOTE_LISTENER init
parameter back to its default (collab-scan:1521) and re-registering. Before registering with the
listeners, restart them to reset the connection statistics.
System altered.
Why is it true that you only need to run the "alter system" command once, but you need to run the
lsnrctl command on both nodes?
System altered.
(ADDRESS=(PROTOCOL=TCP)(HOST=collabn1.vm.ardentperf.com)(PORT=1521))
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
Instance "RAC2", status READY, has 1 handler(s) for this
service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
REMOTE SERVER
(ADDRESS=(PROTOCOL=TCP)(HOST=collabn2.vm.ardentperf.com)(PORT=1521))
3. Edit the TNSNAMES.ORA file on the server you're connected to. Add an entry called LBTEST
that connects to the RAC service - but only uses one listener.
[root@collabn1 ]# vi $ORACLE_HOME/network/admin/tnsnames.ora
LBTEST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = collab-scan)(PORT = 1521))
(LOAD_BALANCE = no)
(CONNECT_DATA =
207
Services, Failover and Load Balancing
(SERVER = DEDICATED)
(SERVICE_NAME = RAC.vm.ardentperf.com)
)
)
4. In your other connected SQLPlus session, keep an eye on the balance of connections. At the
same time, open a new shell session and run this script which will open 160 connections to the
database - but this time it will use the LBTEST connection.
How were the connections distributed between the database instances during server-side load
balancing?
5. Terminate all of the sqlplus sessions by running these two commands. After you run the second
command, press <Ctrl-C> after you start seeing the message "no more job".
killall sqlplus
while true; do fg; done
<Ctrl-C>
208
13. RAC SQL and PLSQL
SQL> @?/rdbms/admin/dbmslock.sql
Package created.
Synonym created.
Grant succeeded.
209
RAC SQL and PLSQL
g_start number;
g_run1 number;
g_run2 number;
procedure rs_start
is
begin
delete from run_stats;
g_start := dbms_utility.get_time;
end;
procedure rs_middle
is
begin
g_run1 := (dbms_utility.get_time-g_start);
end;
dbms_output.put_line
( 'Run1 ran in ' || g_run1 || ' hsecs' );
dbms_output.put_line
( 'Run2 ran in ' || g_run2 || ' hsecs' );
dbms_output.put_line
( 'run 1 ran in ' || round(g_run1/g_run2*100,2) ||
'% of the time' );
dbms_output.put_line( chr(9) );
dbms_output.put_line
( rpad( 'Name', 30 ) || lpad( 'Run1', 12 ) ||
lpad( 'Run2', 12 ) || lpad( 'Diff', 12 ) );
for x in
( select rpad( a.name, 30 ) ||
to_char( b.value-a.value, '999,999,999' ) ||
to_char( c.value-b.value, '999,999,999' ) ||
to_char( ( (c.value-b.value)-(b.value-a.value)),
'999,999,999' ) data
from run_stats a, run_stats b, run_stats c
where a.name = b.name
and b.name = c.name
and a.runid = 'before'
and b.runid = 'after 1'
210
Sequence Test
dbms_output.put_line( chr(9) );
dbms_output.put_line
( 'Run1 latches total versus runs -- difference and pct' );
dbms_output.put_line
( lpad( 'Run1', 12 ) || lpad( 'Run2', 12 ) ||
lpad( 'Diff', 12 ) || lpad( 'Pct', 10 ) );
for x in
( select to_char( run1, '999,999,999' ) ||
to_char( run2, '999,999,999' ) ||
to_char( diff, '999,999,999' ) ||
to_char( round( run1/run2*100,2 ), '99,999.99' ) || '%'
data
from ( select sum(b.value-a.value) run1,
sum(c.value-b.value) run2,
sum( (c.value-b.value)-(b.value-a.value)) diff
from run_stats a, run_stats b, run_stats c
where a.name = b.name
and b.name = c.name
and a.runid = 'before'
and b.runid = 'after 1'
and c.runid = 'after 2'
and a.name like 'LATCH%'
)
) loop
dbms_output.put_line( x.data );
end loop;
end;
end;
/
The first test we will perform is a sequence test. Sequential fields often become points of contention in
cluster database systems.
1. First, open a connection to the database as SYSDBA on both nodes.
2. Setup a table and several sequence types for comparison. Also enable serveroutput.
211
RAC SQL and PLSQL
3. On node collabn1 measure the differences between various methods. Run this two or three times
to warm up the machines. (Note: subtract 500 from the runtimes reported (in hsecs) to account
for time in DBMS_LOCK.SLEEP.)
exec runstats_pkg.rs_start;
DECLARE
myval number;
BEGIN
FOR counter IN 1..10
LOOP
select highval into myval from SEQTEST where seqid='MYTABLE' for
update;
update SEQTEST set highval=highval+1 where seqid='MYTABLE';
dbms_lock.sleep(0.5);
commit;
END LOOP;
END;
/
exec runstats_pkg.rs_middle;
DECLARE
myval number;
BEGIN
FOR counter IN 1..10
LOOP
myval := SEQTEST_O_C.NEXTVAL;
dbms_lock.sleep(0.5);
commit;
END LOOP;
END;
/
exec runstats_pkg.rs_stop;
4. On the other node - collabn2 - start an anonymous PL/SQL block that retrieves a value every half
second.
DECLARE
myval number;
BEGIN
LOOP
select highval into myval from SEQTEST where seqid='MYTABLE' for
update;
update SEQTEST set highval=highval+1 where seqid='MYTABLE';
select SEQTEST_O_NC.NEXTVAL into myval from dual;
select SEQTEST_O_C.NEXTVAL into myval from dual;
select SEQTEST_NO_NC.NEXTVAL into myval from dual;
select SEQTEST_NO_C.NEXTVAL into myval from dual;
dbms_lock.sleep(0.5);
commit;
END LOOP;
212
Parallel Query Test
END;
/
5. Repeat step 3 on node collabn1. See how the results are different as soon as cluster contention is
introduced.
6. Perform more tests, comparing different types of sequences. What conclusions can you draw
about sequences? Does caching matter for ORDER sequences?
exec runstats_pkg.rs_start;
DECLARE
myval number;
BEGIN
FOR counter IN 1..10
LOOP
myval := SEQTEST_O_NC.NEXTVAL;
dbms_lock.sleep(0.5);
commit;
END LOOP;
END;
/
exec runstats_pkg.rs_middle;
DECLARE
myval number;
BEGIN
FOR counter IN 1..10
LOOP
myval := SEQTEST_O_C.NEXTVAL;
dbms_lock.sleep(0.5);
commit;
END LOOP;
END;
/
exec runstats_pkg.rs_stop;
1. Login to the node collabn1 and open a connection to the database as SYSDBA and unlock the SH
user account. Also grant it DBA access.
User altered.
Grant succeeded.
213
RAC SQL and PLSQL
2. Reconnect to the database as the sh user with the RAC1 service name. Check your SID and the
service you're connected to.
SID
----------
145
3. Enable tracing and run a parallel query on the SH schema. Look for the trace files to determine
where the slaves ran. Which nodes to the slaves run on?
exec dbms_session.set_identifier('racpx01');
alter session set tracefile_identifier = 'racpx01';
exec dbms_monitor.client_id_trace_enable(client_id=>'racpx01');
exec dbms_monitor.client_id_trace_disable(client_id=>'racpx01');
INST_ID VALUE
----------
------------------------------------------------------------
1 /u01/app/oracle/diag/rdbms/rac/RAC1/trace
2 /u01/app/oracle/diag/rdbms/rac/RAC2/trace
4. Create a new service which only runs on node 2 and repeat the test (from collabn1). Which
nodes to the slaves run on now? How is this different from Oracle 10g?
214
Scheduler Test
(ADDRESS=(PROTOCOL=TCP)(HOST=collabn2.vm.ardentperf.com)(PORT=1521))
collabn1:/home/oracle[RAC1]$ vi $ORACLE_HOME/network/admin/tnsnames.ora
PXTEST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = collabn1-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = collabn2-vip)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PXTEST.vm.ardentperf.com)
)
)
exec dbms_session.set_identifier('racpx05');
alter session set tracefile_identifier = 'racpx05';
exec dbms_monitor.client_id_trace_enable(client_id=>'racpx05');
exec dbms_monitor.client_id_trace_disable(client_id=>'racpx05');
In RAC, PL/SQL can execute on either node - and this must be taken into account when processes are
architected. We will take a brief look at this property through two simple tests.
215
RAC SQL and PLSQL
First we'll have a look at the scheduler. Note that this lab relies on the PXTEST service created in the
Parallel Query Test .
1. Login to the node collabn1 as oracle and confirm that the pxtest service is running on instance
RAC2.
3. Login to the RAC1 service as sh and create a job class and a PL/SQL procedure that we can
execute from the job. Note that the service name is case sensitive!
exec dbms_scheduler.create_job_class('TESTOFF1',service=>'pxtest');
4. Schedule the job to run immediately with the job class that's tied to the PXTEST service. Check
to see if it ran. Query the user_schedule_jobs table a few times in a row. Did anything happen?
from user_scheduler_jobs;
begin
dbms_scheduler.create_job('TESTJOB1','PLSQL_BLOCK',
job_action=>'traceme(scheduler01);',
job_class=>'TESTOFF1',enabled=>true);
end;
/
from user_scheduler_jobs;
5. Startup the PXTEST service and check the status of the job again. Make sure to query the
user_schedule_jobs table a few times in a row. (Be patient for at least one minute.) Did the job
execute? If so, then on which node?
216
File Test
from user_scheduler_jobs;
6. Modify the PXTEST service to run on both nodes and stop it.
7. Submit 20 jobs to run the program and then enable the service. (This way all of the jobs should
get scheduled nearly concurrently.) On which node(s) did they execute?
begin
FOR i IN 10..29
LOOP
dbms_scheduler.create_job('TESTJOB'||i,'PLSQL_BLOCK',
job_action=>'traceme(scheduler'||i||);',
job_class=>'TESTOFF1',enabled=>true);
END LOOP;
end;
/
from user_scheduler_jobs;
from user_scheduler_jobs;
Our second PL/SQL test will look at the UTL_FILE package. With any PL/SQL operations on RAC you
must be aware that the code could execute on any node where its service lives. This could also impact
packages like DBMS_PIPE, UTL_MAIL, UTL_HTTP (proxy server source IP rules for example), or
even DBMS_RLS (refreshing policies).
217
RAC SQL and PLSQL
1. Login to RAC1 as sh and create a file that we can try reading later.
declare
fl utl_file.file_type;
begin
fl := utl_file.fopen('ORAHOME','data.txt','w');
utl_file.put_line(fl, 'Some sample data for an oracle test.',
TRUE);
utl_file.fclose(fl);
end;
/
2. Exit SQLPLUS. At the prompt, copy this command to connect to the RAC service as sh againand
attempt to read the file you just wrote. Run this command 10-20 times in a row. (Cut-and-paste is
recommended.) What happens? Why?
218
14. RAC Backups and Recovery
During this lab we will intentionally misconfigure the cluster database backups and make some common
mistakes with local, non-shared storage.
1. Login to a terminal on collabn1 as the user oracle.
2. On collabn1 create a directory /u01/app/oradata and try to configure it as the Flash Recovery
Area (FRA) through the init param db_recovery_file_dest. The operation will fail.
collabn1:/home/oracle[RAC1]$ ss
SQL*Plus: Release 11.1.0.6.0 - Production on Mon May 4 07:39:57 2009
i Information
The error occurred on the remote node, but was reported here. It was also recorded on the remote
node do you know where it is recorded? What kind of monitoring would need to be in place to
be proactively alerted by messages like this?
3. Now create the directory on the remote node and re-run the operation. This should succeed but it
is still a poor configuration; we will investigate the reasons later in this lab.
219
RAC Backups and Recovery
4. Shutdown the database across the cluster. Then mount it on collabn1 and put the database into
archivelog mode. No archivelog destination is assigned where will the archivelogs go and why?
i Information
You do not need to disable the cluster_database init param for this.
collabn1:/home/oracle[RAC1]$ ss
SQL*Plus: Release 11.1.0.6.0 - Production on Mon May 4 09:08:01 2009
FLASHBACK_ON
------------------
YES
OLDEST_FLASHBACK_SCN FLASHBACK_SIZE
-------------------- --------------
610425 8192000
2. Now, login to collabn2 and startup the database from sqlplus. You will get an error message.
220
Flashback Database
collabn2:/home/oracle[RAC2]$ ss
SQL*Plus: Release 11.1.0.6.0 - Production on Mon May 4 09:21:25 2009
SQL> startup
ORACLE instance started.
FLASHBACK_ON
------------------
YES
OLDEST_FLASHBACK_SCN FLASHBACK_SIZE
-------------------- --------------
0 16384000
3. Interestingly, the database seems to be running alright. Investigate the alert log for error messages.
collabn2:/home/oracle[RAC2]$ cdd
collabn2:/u01/app/oracle/diag[RAC2]$ cd rdbms/rac/RAC2/trace/
collabn2:/u01/app/oracle/diag/rdbms/rac/RAC2/trace[RAC2]$ less
alert_RAC2.log
4. Investigate the alert log on collabn1 do any error messages appear here? Do any other problems
occur?
i Information
You might have to wait for a few minutes. Check the output of "srvctl status database -d RAC" too.
5. Disable flashback database. You do not need to shutdown for the disable operation.
221
RAC Backups and Recovery
1. Enable block change tracking on the database and explicitly choose the local FRA destination.
(Typically the block change tracking file is created in the OMF DB destination rather than the
FRA.)
What happens? Make sure to check the alert logs. Try it with only one instance open, and then
open the other instance to see what happens.
2. Disable block change tracking.
THREAD# SEQUENCE#
---------- ----------
1 6
2 3
2. Execute alter system switch logfile and check the result. What happened?
THREAD# SEQUENCE#
---------- ----------
1 6
2 4
3. Execute alter system archive log current and check the result. What happened now?
222
Archived Logs
THREAD# SEQUENCE#
---------- ----------
1 7
2 5
4. Check where the archived logs are being stored by default. (Was this what you expected?)
Explicitly assign them to the FRA and test to see if your changes took effect.
5. Take a backup of all the current archivelogs, using the default RMAN configuration. Why does it
fail?
223
RAC Backups and Recovery
6. Crosscheck the archived logs; most will fail. Then copy the files from the local FRA on collabn2
and crosscheck them again.
=====================================================================
Key Thrd Seq S Low Time
------- ---- ------- - ---------
6 1 4 X 26-APR-09
Name:
/u01/app/oradata/RAC/archivelog/2009_05_04/o1_mf_1_4_4zy03zdh_.arc
=====================================================================
Key Thrd Seq S Low Time
------- ---- ------- - ---------
6 1 4 A 26-APR-09
Name:
/u01/app/oradata/RAC/archivelog/2009_05_04/o1_mf_1_4_4zy03zdh_.arc
224
Database Backups
We will configure backups to take full advantage of the cluster by running in parallel.
1. Configure the RMAN default channels and parallelism.
225
RAC Backups and Recovery
i Information
Try this again, without allocating the maintenance channel. What happens and why?
2. Preview a restore of the entire database. Why does it fail? How can you remediate this?
RMAN-00571:
===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS
===============
RMAN-00571:
===========================================================
RMAN-03002: failure of restore command at 05/04/2009 11:44:53
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 5 found to restore
RMAN-06023: no backup or copy of datafile 3 found to restore
RMAN-06023: no backup or copy of datafile 2 found to restore
3. Revert the FRA to the correct shared location, assigned during DB creation before lab 6.
4. Now, repeat the Database Backups exercise and this exercise with shared storage.
226
15. Contributors
Edits User
432 ArdentPerf1
1 Mabdul2
1 MartinNash3
96 QUBot4
1 http://en.wikibooks.org/w/index.php?title=User:ArdentPerf
2 http://en.wikibooks.org/w/index.php?title=User:Mabdul
3 http://en.wikibooks.org/w/index.php?title=User:MartinNash
4 http://en.wikibooks.org/w/index.php?title=User:QUBot
227
List of Figures
229
List of Figures
230
List of Figures
1 ArdentPerf6 GFDL
2 ArdentPerf7 GFDL
3 Microsoft Corporation, Jeremy Schneider MS
4 Microsoft Corporation, Jeremy Schneider MS
5 Microsoft Corporation, Jeremy Schneider MS
6 Microsoft Corporation, Jeremy Schneider MS
7 Nominally User:Stannered8 PD
8 Microsoft Corporation, Jeremy Schneider MS
9 VMware Inc, Firefox Contributers, Jeremy Schneider WEB
10 VMware Inc, Firefox Contributers, Jeremy Schneider WEB
11 VMware Inc, Jeremy Schneider FAIR
12 VMware Inc, Jeremy Schneider FAIR
13 VMware Inc, Jeremy Schneider FAIR
14 VMware Inc, Jeremy Schneider FAIR
15 VMware Inc, Diego Pafumi FAIR
16 Microsoft Corporation, Jeremy Schneider FAIR
17 VMware, Jeremy Schneider FAIR
18 VMware, Jeremy Schneider FAIR
19 VMware, Jeremy Schneider FAIR
20 VMware, Jeremy Schneider FAIR
21 VMware, Jeremy Schneider FAIR
22 VMware, Jeremy Schneider FAIR
23 Microsoft Corporation, Jeremy Schneider FAIR
24 Firefox Contributers, Jeremy Schneider GPL
25 Microsoft Corporation, Jeremy Schneider FAIR
26 VMware, Jeremy Schneider FAIR
27 VMware, Jeremy Schneider FAIR
28 VMware, Jeremy Schneider FAIR
29 VMware, Jeremy Schneider FAIR
30 Oracle, Jeremy Schneider WEB
31 Oracle, Jeremy Schneider WEB
32 Oracle, Jeremy Schneider WEB
33 Oracle, Jeremy Schneider WEB
34 VMware, Jeremy Schneider FAIR
35 VMware, Jeremy Schneider FAIR
36 VMware, Jeremy Schneider FAIR
37 VMware, Jeremy Schneider FAIR
38 VMware, Jeremy Schneider FAIR
39 VMware, Jeremy Schneider FAIR
40 VMware, Jeremy Schneider FAIR
41 VMware, Jeremy Schneider FAIR
42 VMware, Jeremy Schneider FAIR
43 VMware, Jeremy Schneider FAIR
44 VMware, Jeremy Schneider FAIR
45 VMware, Jeremy Schneider FAIR
6 http://en.wikibooks.org/wiki/User%3AArdentPerf
7 http://en.wikibooks.org/wiki/User%3AArdentPerf
8 http://en.wikibooks.org/wiki/User%3AStannered
231
List of Figures
232
List of Figures
233
List of Figures
234
List of Figures
235
List of Figures
236
List of Figures
9 http://en.wikibooks.org/wiki/User%3AArdentPerf
237
List of Figures
238
16. Licenses
16.1. Fair Use 16.2. Copyrighted Web 16.3. Use of Microsoft
Screenshots of proprietary software and websites are copyrighted. It is impossi- Pages Copyrighted
ble to create public domain or free screenshots of proprietary software or web-
sites. These screenshots are being used under "fair use" to illustrate how to use
certain proprietary software. Content
These images may contain screenshots of copyrighted web pages, and the copy-
These screenshots may contain copyrighted computer software, and the copy- right for them is most likely held by owner(s) of the website(s). They may also
right for their contents is most likely held by the author(s) or the company that contain trademarked logos, which are likely not affiliated with RAC Attack. It This screenshot of Microsoft software (or parts of it) is copyrighted by Mi-
created the software. It is believed that the limited use of these screenshots: is believed that the limited use of crosoft Corporation.
for identification of, and critical commentary on, the software in question for identification and critical commentary relating to the website in question Microsoft permits the use of unmodified screenshots in documentation (includ-
in the absence of a free alternative, in this free educational textbook created and maintained by the professional ing educational brochures), tutorial books, and on websites, as declared below:
in this free educational textbook created and maintained by the professional community
community
Used with permission from Microsoft.
qualifies as fair use under United States copyright law. Any other uses of these qualifies as fair use under United States copyright law. Any other uses of these
images may be copyright infringement. images may be copyright infringement. http://www.microsoft.com/en-us/legal/intellectualproperty/Permissions/default.aspx
239
Licenses
A compilation of a covered work with other separate and independent works, material be marked in reasonable ways as different from the original version; knowledge that, but for the patent license, your conveying the covered work in a
which are not by their nature extensions of the covered work, and which are or * d) Limiting the use for publicity purposes of names of licensors or authors country, or your recipients use of the covered work in a country, would infringe
not combined with it such as to form a larger program, in or on a volume of of the material; or * e) Declining to grant rights under trademark law for use one or more identifiable patents in that country that you have reason to believe
a storage or distribution medium, is called an aggregate if the compilation of some trade names, trademarks, or service marks; or * f) Requiring indem- are valid.
and its resulting copyright are not used to limit the access or legal rights of the nification of licensors and authors of that material by anyone who conveys the
compilations users beyond what the individual works permit. Inclusion of a material (or modified versions of it) with contractual assumptions of liability to If, pursuant to or in connection with a single transaction or arrangement, you
covered work in an aggregate does not cause this License to apply to the other the recipient, for any liability that these contractual assumptions directly impose convey, or propagate by procuring conveyance of, a covered work, and grant
parts of the aggregate. 6. Conveying Non-Source Forms. on those licensors and authors. a patent license to some of the parties receiving the covered work authorizing
them to use, propagate, modify or convey a specific copy of the covered work,
You may convey a covered work in object code form under the terms of sections All other non-permissive additional terms are considered further restrictions then the patent license you grant is automatically extended to all recipients of
4 and 5, provided that you also convey the machine-readable Corresponding within the meaning of section 10. If the Program as you received it, or any part the covered work and works based on it.
Source under the terms of this License, in one of these ways: of it, contains a notice stating that it is governed by this License along with a
term that is a further restriction, you may remove that term. If a license docu-
A patent license is discriminatory if it does not include within the scope of its
* a) Convey the object code in, or embodied in, a physical product (including ment contains a further restriction but permits relicensing or conveying under
coverage, prohibits the exercise of, or is conditioned on the non-exercise of one
a physical distribution medium), accompanied by the Corresponding Source this License, you may add to a covered work material governed by the terms
or more of the rights that are specifically granted under this License. You may
fixed on a durable physical medium customarily used for software interchange. of that license document, provided that the further restriction does not survive
not convey a covered work if you are a party to an arrangement with a third party
* b) Convey the object code in, or embodied in, a physical product (including a such relicensing or conveying.
that is in the business of distributing software, under which you make payment
physical distribution medium), accompanied by a written offer, valid for at least to the third party based on the extent of your activity of conveying the work,
three years and valid for as long as you offer spare parts or customer support for If you add terms to a covered work in accord with this section, you must place, and under which the third party grants, to any of the parties who would receive
that product model, to give anyone who possesses the object code either (1) a in the relevant source files, a statement of the additional terms that apply to the covered work from you, a discriminatory patent license (a) in connection
copy of the Corresponding Source for all the software in the product that is cov- those files, or a notice indicating where to find the applicable terms. with copies of the covered work conveyed by you (or copies made from those
ered by this License, on a durable physical medium customarily used for soft- copies), or (b) primarily for and in connection with specific products or compi-
ware interchange, for a price no more than your reasonable cost of physically Additional terms, permissive or non-permissive, may be stated in the form of a lations that contain the covered work, unless you entered into that arrangement,
performing this conveying of source, or (2) access to copy the Corresponding separately written license, or stated as exceptions; the above requirements apply or that patent license was granted, prior to 28 March 2007.
Source from a network server at no charge. * c) Convey individual copies of either way. 8. Termination.
the object code with a copy of the written offer to provide the Corresponding
Nothing in this License shall be construed as excluding or limiting any implied
Source. This alternative is allowed only occasionally and noncommercially, and
You may not propagate or modify a covered work except as expressly provided license or other defenses to infringement that may otherwise be available to you
only if you received the object code with such an offer, in accord with subsec-
under this License. Any attempt otherwise to propagate or modify it is void, under applicable patent law. 12. No Surrender of Others Freedom.
tion 6b. * d) Convey the object code by offering access from a designated place
and will automatically terminate your rights under this License (including any
(gratis or for a charge), and offer equivalent access to the Corresponding Source
patent licenses granted under the third paragraph of section 11). If conditions are imposed on you (whether by court order, agreement or other-
in the same way through the same place at no further charge. You need not re-
quire recipients to copy the Corresponding Source along with the object code. If wise) that contradict the conditions of this License, they do not excuse you from
the place to copy the object code is a network server, the Corresponding Source However, if you cease all violation of this License, then your license from a par- the conditions of this License. If you cannot convey a covered work so as to sat-
may be on a different server (operated by you or a third party) that supports ticular copyright holder is reinstated (a) provisionally, unless and until the copy- isfy simultaneously your obligations under this License and any other pertinent
equivalent copying facilities, provided you maintain clear directions next to the right holder explicitly and finally terminates your license, and (b) permanently, obligations, then as a consequence you may not convey it at all. For example,
object code saying where to find the Corresponding Source. Regardless of what if the copyright holder fails to notify you of the violation by some reasonable if you agree to terms that obligate you to collect a royalty for further conveying
server hosts the Corresponding Source, you remain obligated to ensure that it is means prior to 60 days after the cessation. from those to whom you convey the Program, the only way you could satisfy
available for as long as needed to satisfy these requirements. * e) Convey the both those terms and this License would be to refrain entirely from conveying
object code using peer-to-peer transmission, provided you inform other peers Moreover, your license from a particular copyright holder is reinstated perma- the Program. 13. Use with the GNU Affero General Public License.
where the object code and Corresponding Source of the work are being offered nently if the copyright holder notifies you of the violation by some reasonable
to the general public at no charge under subsection 6d. means, this is the first time you have received notice of violation of this License Notwithstanding any other provision of this License, you have permission to
(for any work) from that copyright holder, and you cure the violation prior to link or combine any covered work with a work licensed under version 3 of the
A separable portion of the object code, whose source code is excluded from the 30 days after your receipt of the notice. GNU Affero General Public License into a single combined work, and to con-
Corresponding Source as a System Library, need not be included in conveying vey the resulting work. The terms of this License will continue to apply to the
the object code work. Termination of your rights under this section does not terminate the licenses of part which is the covered work, but the special requirements of the GNU Affero
parties who have received copies or rights from you under this License. If your General Public License, section 13, concerning interaction through a network
A User Product is either (1) a consumer product, which means any tangi- rights have been terminated and not permanently reinstated, you do not qualify will apply to the combination as such. 14. Revised Versions of this License.
ble personal property which is normally used for personal, family, or household to receive new licenses for the same material under section 10. 9. Acceptance
purposes, or (2) anything designed or sold for incorporation into a dwelling. In Not Required for Having Copies. The Free Software Foundation may publish revised and/or new versions of the
determining whether a product is a consumer product, doubtful cases shall be GNU General Public License from time to time. Such new versions will be
resolved in favor of coverage. For a particular product received by a particular You are not required to accept this License in order to receive or run a copy similar in spirit to the present version, but may differ in detail to address new
user, normally used refers to a typical or common use of that class of product, of the Program. Ancillary propagation of a covered work occurring solely as a problems or concerns.
regardless of the status of the particular user or of the way in which the partic- consequence of using peer-to-peer transmission to receive a copy likewise does
ular user actually uses, or expects or is expected to use, the product. A product not require acceptance. However, nothing other than this License grants you Each version is given a distinguishing version number. If the Program specifies
is a consumer product regardless of whether the product has substantial com- permission to propagate or modify any covered work. These actions infringe that a certain numbered version of the GNU General Public License or any
mercial, industrial or non-consumer uses, unless such uses represent the only copyright if you do not accept this License. Therefore, by modifying or prop- later version applies to it, you have the option of following the terms and con-
significant mode of use of the product. agating a covered work, you indicate your acceptance of this License to do so. ditions either of that numbered version or of any later version published by the
10. Automatic Licensing of Downstream Recipients. Free Software Foundation. If the Program does not specify a version number of
Installation Information for a User Product means any methods, procedures, the GNU General Public License, you may choose any version ever published
authorization keys, or other information required to install and execute modi- Each time you convey a covered work, the recipient automatically receives a by the Free Software Foundation.
fied versions of a covered work in that User Product from a modified version license from the original licensors, to run, modify and propagate that work, sub-
of its Corresponding Source. The information must suffice to ensure that the ject to this License. You are not responsible for enforcing compliance by third If the Program specifies that a proxy can decide which future versions of the
continued functioning of the modified object code is in no case prevented or parties with this License. GNU General Public License can be used, that proxys public statement of ac-
interfered with solely because modification has been made.
ceptance of a version permanently authorizes you to choose that version for the
An entity transaction is a transaction transferring control of an organization, Program.
If you convey an object code work under this section in, or with, or specifically or substantially all assets of one, or subdividing an organization, or merging or-
for use in, a User Product, and the conveying occurs as part of a transaction in ganizations. If propagation of a covered work results from an entity transaction,
Later license versions may give you additional or different permissions. How-
which the right of possession and use of the User Product is transferred to the each party to that transaction who receives a copy of the work also receives
ever, no additional obligations are imposed on any author or copyright holder as
recipient in perpetuity or for a fixed term (regardless of how the transaction is whatever licenses to the work the partys predecessor in interest had or could
a result of your choosing to follow a later version. 15. Disclaimer of Warranty.
characterized), the Corresponding Source conveyed under this section must be give under the previous paragraph, plus a right to possession of the Correspond-
accompanied by the Installation Information. But this requirement does not ap- ing Source of the work from the predecessor in interest, if the predecessor has
ply if neither you nor any third party retains the ability to install modified object it or can get it with reasonable efforts. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PER-
code on the User Product (for example, the work has been installed in ROM). MITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED
IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
You may not impose any further restrictions on the exercise of the rights granted
The requirement to provide Installation Information does not include a require- PROVIDE THE PROGRAM AS IS WITHOUT WARRANTY OF ANY
or affirmed under this License. For example, you may not impose a license fee,
ment to continue to provide support service, warranty, or updates for a work that KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIM-
royalty, or other charge for exercise of rights granted under this License, and
has been modified or installed by the recipient, or for the User Product in which ITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
you may not initiate litigation (including a cross-claim or counterclaim in a
it has been modified or installed. Access to a network may be denied when the FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO
lawsuit) alleging that any patent claim is infringed by making, using, selling,
modification itself materially and adversely affects the operation of the network THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.
offering for sale, or importing the Program or any portion of it. 11. Patents.
or violates the rules and protocols for communication across the network. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE
COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16.
A contributor is a copyright holder who authorizes use under this License of Limitation of Liability.
Corresponding Source conveyed, and Installation Information provided, in ac- the Program or a work on which the Program is based. The work thus licensed
cord with this section must be in a format that is publicly documented (and is called the contributors contributor version.
with an implementation available to the public in source code form), and must IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED
require no special password or key for unpacking, reading or copying. 7. Addi- TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER
A contributors essential patent claims are all patent claims owned or con- PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PER-
tional Terms. trolled by the contributor, whether already acquired or hereafter acquired, that MITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING
would be infringed by some manner, permitted by this License, of making, us- ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAM-
Additional permissions are terms that supplement the terms of this License by ing, or selling its contributor version, but do not include claims that would be AGES ARISING OUT OF THE USE OR INABILITY TO USE THE PRO-
making exceptions from one or more of its conditions. Additional permissions infringed only as a consequence of further modification of the contributor ver- GRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA
that are applicable to the entire Program shall be treated as though they were sion. For purposes of this definition, control includes the right to grant patent BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR
included in this License, to the extent that they are valid under applicable law. If sublicenses in a manner consistent with the requirements of this License. THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH
additional permissions apply only to part of the Program, that part may be used ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY
separately under those permissions, but the entire Program remains governed Each contributor grants you a non-exclusive, worldwide, royalty-free patent li- HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17.
by this License without regard to the additional permissions. cense under the contributors essential patent claims, to make, use, sell, offer Interpretation of Sections 15 and 16.
for sale, import and otherwise run, modify and propagate the contents of its
When you convey a copy of a covered work, you may at your option remove any contributor version.
If the disclaimer of warranty and limitation of liability provided above cannot
additional permissions from that copy, or from any part of it. (Additional per-
be given local legal effect according to their terms, reviewing courts shall apply
missions may be written to require their own removal in certain cases when you In the following three paragraphs, a patent license is any express agreement or local law that most closely approximates an absolute waiver of all civil liability
modify the work.) You may place additional permissions on material, added by commitment, however denominated, not to enforce a patent (such as an express in connection with the Program, unless a warranty or assumption of liability
you to a covered work, for which you have or can give appropriate copyright permission to practice a patent or covenant not to sue for patent infringement). accompanies a copy of the Program in return for a fee.
permission. To grant such a patent license to a party means to make such an agreement or
commitment not to enforce a patent against the party.
END OF TERMS AND CONDITIONS How to Apply These Terms to Your
Notwithstanding any other provision of this License, for material you add to a
New Programs
covered work, you may (if authorized by the copyright holders of that material) If you convey a covered work, knowingly relying on a patent license, and the
supplement the terms of this License with terms: Corresponding Source of the work is not available for anyone to copy, free of
charge and under the terms of this License, through a publicly available net- If you develop a new program, and you want it to be of the greatest possible
* a) Disclaiming warranty or limiting liability differently from the terms of sec- work server or other readily accessible means, then you must either (1) cause use to the public, the best way to achieve this is to make it free software which
tions 15 and 16 of this License; or * b) Requiring preservation of specified rea- the Corresponding Source to be so available, or (2) arrange to deprive yourself everyone can redistribute and change under these terms.
sonable legal notices or author attributions in that material or in the Appropriate of the benefit of the patent license for this particular work, or (3) arrange, in a
Legal Notices displayed by works containing it; or * c) Prohibiting misrepresen- manner consistent with the requirements of this License, to extend the patent To do so, attach the following notices to the program. It is safest to attach them
tation of the origin of that material, or requiring that modified versions of such license to downstream recipients. Knowingly relying means you have actual to the start of each source file to most effectively state the exclusion of warranty;
240
GNU Free Documentation License
and each file should have at least the copyright line and a pointer to where the You should have received a copy of the GNU General Public License along with The hypothetical commands show w and show c should show the appropri-
full notice is found. this program. If not, see <http://www.gnu.org/licenses/>. ate parts of the General Public License. Of course, your programs commands
might be different; for a GUI interface, you would use an about box.
<one line to give the programs name and a brief idea of what it does.> Copy-
right (C) <year> <name of author> Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or school,
if any, to sign a copyright disclaimer for the program, if necessary. For
This program is free software: you can redistribute it and/or modify it under more information on this, and how to apply and follow the GNU GPL, see
the terms of the GNU General Public License as published by the Free Soft- If the program does terminal interaction, make it output a short notice like this <http://www.gnu.org/licenses/>.
ware Foundation, either version 3 of the License, or (at your option) any later when it starts in an interactive mode:
version. The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you may con-
This program is distributed in the hope that it will be useful, but WITHOUT <program> Copyright (C) <year> <name of author> This program comes with sider it more useful to permit linking proprietary applications with the library. If
ANY WARRANTY; without even the implied warranty of MERCHANTABIL- ABSOLUTELY NO WARRANTY; for details type show w. This is free soft- this is what you want to do, use the GNU Lesser General Public License instead
ITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General ware, and you are welcome to redistribute it under certain conditions; type of this License. But first, please read <http://www.gnu.org/philosophy/why-not-
Public License for more details. show c for details. lgpl.html>.
241
Licenses
If the Cover Text requirement of section 3 is applicable to these copies of the (for any work) from that copyright holder, and you cure the violation prior to "Incorporate" means to publish or republish a Document, in whole or in part, as
Document, then if the Document is less than one half of the entire aggregate, the 30 days after your receipt of the notice. part of another Document.
Documents Cover Texts may be placed on covers that bracket the Document
within the aggregate, or the electronic equivalent of covers if the Document is An MMC is "eligible for relicensing" if it is licensed under this License, and
in electronic form. Otherwise they must appear on printed covers that bracket Termination of your rights under this section does not terminate the licenses of
parties who have received copies or rights from you under this License. If your if all works that were first published under this License somewhere other than
the whole aggregate. 8. TRANSLATION this MMC, and subsequently incorporated in whole or in part into the MMC,
rights have been terminated and not permanently reinstated, receipt of a copy
of some or all of the same material does not give you any rights to use it. 10. (1) had no cover texts or invariant sections, and (2) were thus incorporated prior
Translation is considered a kind of modification, so you may distribute transla- FUTURE REVISIONS OF THIS LICENSE to November 1, 2008.
tions of the Document under the terms of section 4. Replacing Invariant Sec-
tions with translations requires special permission from their copyright holders, The operator of an MMC Site may republish an MMC contained in the site un-
but you may include translations of some or all Invariant Sections in addition to The Free Software Foundation may publish new, revised versions of the GNU der CC-BY-SA on the same site at any time before August 1, 2009, provided
the original versions of these Invariant Sections. You may include a translation Free Documentation License from time to time. Such new versions will be the MMC is eligible for relicensing. ADDENDUM: How to use this License
of this License, and all the license notices in the Document, and any Warranty similar in spirit to the present version, but may differ in detail to address new for your documents
Disclaimers, provided that you also include the original English version of this problems or concerns. See http://www.gnu.org/copyleft/.
License and the original versions of those notices and disclaimers. In case of a To use this License in a document you have written, include a copy of the Li-
disagreement between the translation and the original version of this License or Each version of the License is given a distinguishing version number. If the cense in the document and put the following copyright and license notices just
a notice or disclaimer, the original version will prevail. Document specifies that a particular numbered version of this License "or any after the title page:
later version" applies to it, you have the option of following the terms and con-
If a section in the Document is Entitled "Acknowledgements", "Dedications", ditions either of that specified version or of any later version that has been pub- Copyright (C) YEAR YOUR NAME. Permission is granted to copy, distribute
or "History", the requirement (section 4) to Preserve its Title (section 1) will lished (not as a draft) by the Free Software Foundation. If the Document does and/or modify this document under the terms of the GNU Free Documentation
typically require changing the actual title. 9. TERMINATION not specify a version number of this License, you may choose any version ever License, Version 1.3 or any later version published by the Free Software Foun-
published (not as a draft) by the Free Software Foundation. If the Document dation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
specifies that a proxy can decide which future versions of this License can be Texts. A copy of the license is included in the section entitled "GNU Free Doc-
You may not copy, modify, sublicense, or distribute the Document except as used, that proxys public statement of acceptance of a version permanently au- umentation License".
expressly provided under this License. Any attempt otherwise to copy, modify, thorizes you to choose that version for the Document. 11. RELICENSING
sublicense, or distribute it is void, and will automatically terminate your rights
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, re-
under this License.
"Massive Multiauthor Collaboration Site" (or "MMC Site") means any World place the "with . . . Texts." line with this:
Wide Web server that publishes copyrightable works and also provides promi-
However, if you cease all violation of this License, then your license from a par- nent facilities for anybody to edit those works. A public wiki that anybody can with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover
ticular copyright holder is reinstated (a) provisionally, unless and until the copy- edit is an example of such a server. A "Massive Multiauthor Collaboration" Texts being LIST, and with the Back-Cover Texts being LIST.
right holder explicitly and finally terminates your license, and (b) permanently, (or "MMC") contained in the site means any set of copyrightable works thus
if the copyright holder fails to notify you of the violation by some reasonable published on the MMC site. If you have Invariant Sections without Cover Texts, or some other combination
means prior to 60 days after the cessation. of the three, merge those two alternatives to suit the situation.
"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 license
Moreover, your license from a particular copyright holder is reinstated perma- published by Creative Commons Corporation, a not-for-profit corporation with If your document contains nontrivial examples of program code, we recommend
nently if the copyright holder notifies you of the violation by some reasonable a principal place of business in San Francisco, California, as well as future releasing these examples in parallel under your choice of free software license,
means, this is the first time you have received notice of violation of this License copyleft versions of that license published by that same organization. such as the GNU General Public License, to permit their use in free software.
You may convey a Combined Work under terms of your choice that, taken to-
A Combined Work is a work produced by combining or linking an Appli- The Free Software Foundation may publish revised and/or new versions of the
gether, effectively do not restrict modification of the portions of the Library
cation with the Library. The particular version of the Library with which the GNU Lesser General Public License from time to time. Such new versions will
contained in the Combined Work and reverse engineering for debugging such
Combined Work was made is also called the Linked Version. be similar in spirit to the present version, but may differ in detail to address new
modifications, if you also do each of the following:
problems or concerns.
The Minimal Corresponding Source for a Combined Work means the Corre- * a) Give prominent notice with each copy of the Combined Work that the Li-
sponding Source for the Combined Work, excluding any source code for por- brary is used in it and that the Library and its use are covered by this License. Each version is given a distinguishing version number. If the Library as you
tions of the Combined Work that, considered in isolation, are based on the Ap- * b) Accompany the Combined Work with a copy of the GNU GPL and this received it specifies that a certain numbered version of the GNU Lesser Gen-
plication, and not on the Linked Version. license document. * c) For a Combined Work that displays copyright notices eral Public License or any later version applies to it, you have the option of
during execution, include the copyright notice for the Library among these no- following the terms and conditions either of that published version or of any
tices, as well as a reference directing the user to the copies of the GNU GPL and later version published by the Free Software Foundation. If the Library as you
The Corresponding Application Code for a Combined Work means the object received it does not specify a version number of the GNU Lesser General Pub-
this license document. * d) Do one of the following: o 0) Convey the Minimal
code and/or source code for the Application, including any data and utility pro- lic License, you may choose any version of the GNU Lesser General Public
Corresponding Source under the terms of this License, and the Corresponding
grams needed for reproducing the Combined Work from the Application, but License ever published by the Free Software Foundation.
Application Code in a form suitable for, and under terms that permit, the user to
excluding the System Libraries of the Combined Work. 1. Exception to Section
recombine or relink the Application with a modified version of the Linked Ver-
3 of the GNU GPL.
sion to produce a modified Combined Work, in the manner specified by section If the Library as you received it specifies that a proxy can decide whether future
6 of the GNU GPL for conveying Corresponding Source. o 1) Use a suitable versions of the GNU Lesser General Public License shall apply, that proxys
You may convey a covered work under sections 3 and 4 of this License without shared library mechanism for linking with the Library. A suitable mechanism public statement of acceptance of any version is permanent authorization for
being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. is one that (a) uses at run time a copy of the Library already present on the you to choose that version for the Library.
242