Oracle RAC 01 - Overview and design
Oracle RAC Solution · Next: Network and DNS plan
In autumn 2016 I built a two-node Oracle Real Application Clusters database, version 11g Release 2, on two SUSE Linux virtual machines running on Hyper-V. This Solution is written from my working notes of that build: six text files with numbered steps, commands, outputs and installer answers. This first Article says what was built and from what, in which order, where the notes contradict themselves, and what they do not contain at all.
What was built
Two nodes, oradb01 and oradb02, run Oracle Grid Infrastructure (Clusterware and ASM) and on top of it one RAC database with one instance per node. The database files live on five shared iSCSI LUNs managed by ASM. A small Debian server, dns1, is the authoritative DNS server for every name of the installation and the time source of the nodes. A Windows server with Symantec Backup Exec, mng-backupsrv01, backs up the operating systems and the database through an agent on each node.
flowchart TB subgraph hv["Hyper-V virtual machines"] n1["oradb01, SLES 11 SP3"] n2["oradb02, SLES 11 SP3"] end pub(["Public 10.30.10.x, with VIPs and SCAN"]) int(["Interconnect 10.30.20.x"]) bck(["Backup 10.30.30.x"]) mng(["Management 10.30.40.x"]) san(["iSCSI SAN 10.30.50.x"]) dns["dns1, Debian 8.5, Knot DNS and NTP"] bsrv["mng-backupsrv01, Backup Exec server"] lun[("Five shared LUNs, ASM disk groups OCR, DATA, FRA, ONTRLG")] n1 ---|"eth1"| pub n2 ---|"eth1"| pub n1 ---|"eth3 alias INT"| int n2 ---|"eth3 alias INT"| int n1 ---|"eth0"| bck n2 ---|"eth0"| bck n1 ---|"eth3"| mng n2 ---|"eth3"| mng n1 ---|"eth4"| san n2 ---|"eth4"| san dns --- mng bsrv --- mng bsrv --- bck lun --- san
Each node has five network interfaces and five roles for them, but the roles do not map one to one: eth2 is unused and the interconnect is an alias on the management interface. That is the trace of the largest problem of the whole build, a virtual switch that passes neither multicast nor broadcast. The plan is in Network and DNS plan, the story in Grid patches and the multicast problem.
Software inventory
The versions are the ones my notes give, in file names, in installer output or in the titles of the notes. Where the notes give none, the table says so.
| Component | Version as the notes give it | Where it runs |
|---|---|---|
| Hypervisor | Hyper-V, no version in the notes | under both nodes |
| Operating system of the nodes | SUSE Linux Enterprise Server 11 SP3, kernel 3.0.76-0.11-default | oradb01, oradb02 |
| Oracle Grid Infrastructure | 11.2.0.4 (Clusterware and ASM) | both nodes |
| Oracle Database | 11.2.0.4, Standard Edition, RAC | both nodes |
| Grid patch for SLES 11 SP3 | 17475946, file p17475946_112040_Linux-x86-64.zip | Grid home |
| OPatch replacement | file p6880880_112000_Linux-x86-64.zip | Grid home |
| Cumulative Grid patches | 20760982 and 20996923, a dead end | Grid home |
| ASMLib | oracleasm-support-2.1.8-1.SLE11, oracleasmlib-2.0.4-1.sle11, kernel driver package oracleasm | both nodes |
| Cluster verification disk package | cvuqdisk-1.0.9-1 | both nodes |
| DNS server | Debian 8.5, package knot, no version in the notes (Debian 8 carried Knot DNS 1.6.0) | dns1 |
| Backup server software | Symantec Backup Exec 15, media Backup_Exec_15_14.2_FP5 | mng-backupsrv01 |
| Backup agent | VRTSralus 14.2.1180-3142, the Backup Exec Agent for Linux | both nodes |
The kernel version is not in the preparation notes at all. It is printed by the Backup Exec agent installer when it checks the system.
Homes, owners and groups
Everything Oracle is installed under /data, a 99 GB ext3 file system on a logical volume in the volume group DATA, one per node. The two products have separate owners and separate homes, the layout the Oracle 11.2 installation guide calls role separation: grid owns the cluster software and ASM, oracle owns the database software.
| Item | Grid Infrastructure | Database |
|---|---|---|
| Owner | grid | oracle |
| Primary group | oinstall | oinstall |
| Secondary groups | asmadmin, asmdba | asmdba, dba |
ORACLE_BASE | /data/u01/app/grid | /data/u01/app/oracle |
ORACLE_HOME | /data/u01/app/grid11204 | /data/u01/app/oracle/db11204 |
| Inventory | /data/u01/app/oraInventory | /data/u01/app/oraInventory |
| Storage | OCR and voting files in ASM | database files in ASM |
The Grid home stands beside the Grid base, not below it, while the database home is below the database base. The notes give the paths without comment.
The numeric identifiers are set explicitly when the groups and users are created, so both nodes have the same ones.
| Name | Kind | ID |
|---|---|---|
oinstall | group | 30001 |
asmadmin | group | 30002 |
asmdba | group | 30003 |
dba | group | 30004 |
grid | user | 30101 |
oracle | user | 30102 |
The header blocks of the notes say "Permissions: 755" for both homes, while the command that prepares the directory tree is chmod -R 775 /data/u01. The details are in Operating system preparation.
The names inside the cluster:
| What | Name |
|---|---|
| Cluster | clsdb |
| SCAN | oradb-scan, port 1521, three addresses |
| VIPs | oradb01-vip, oradb02-vip |
| ASM instances | +ASM1, +ASM2 |
| Database | clsdb, global name clsdb.example.net |
| Database instances | clsdb1, clsdb2 |
| Additional listener | CLSDB, TCP 1525 |
| Disk groups | OCR, DATA, FRA, ONTRLG, all with external redundancy |
A remark in the notes next to the cluster name is worth repeating: the cluster name must not contain certain characters, - among them, and a single word is the safest choice. The remark is stricter than Oracle's documentation, which today allows hyphens in a cluster name and forbids underscores.
Build order
The notes are six files, and the Articles follow their order with two exceptions: the network plan and the DNS server come first here, because every later step resolves names, and the Grid Infrastructure notes are split into the installation and the trouble with it.
flowchart TB a2["02 Network and DNS plan"] --> a3["03 DNS server Knot"] a3 --> a4["04 Operating system preparation"] a4 --> a5["05 Storage and ASM disks"] a5 --> a6["06 Grid Infrastructure installation"] a6 -->|"root.sh fails"| a7["07 Grid patches and the multicast problem"] a7 -->|"root.sh passes on both nodes"| a8["08 Database software, listener and disk groups"] a8 --> a9["09 Database creation and user environments"] a9 --> a10["10 Backup Exec agent"] a10 --> a11["11 Backup Exec server and RAC backup"] a11 -.->|"records of the virtual RAC node"| a3
| No | Article | What it produces |
|---|---|---|
| 2 | Network and DNS plan | Interface roles, every name and address, what the installer was told about each subnet |
| 3 | DNS server: Knot | The zone example.net and four reverse zones on dns1 |
| 4 | Operating system preparation | Packages, users and groups, kernel parameters, limits, time synchronisation, /data, directories, SSH keys |
| 5 | Storage and ASM disks | Five shared LUNs with stable names from udev rules, labelled as ASMLib disks ASMDISK1 to ASMDISK5 |
| 6 | Grid Infrastructure installation | The installer answers, the cluster clsdb, the disk group OCR, the checks afterwards |
| 7 | Grid patches and the multicast problem | Why root.sh failed twice for two different reasons, and what fixed each |
| 8 | Database software, listener and disk groups | The database home on both nodes, the listener on 1525, the disk groups DATA, FRA, ONTRLG |
| 9 | Database creation and user environments | The RAC database from DBCA, the profiles of oracle and grid |
| 10 | Backup Exec agent | The Linux agent on both nodes and its Oracle configuration |
| 11 | Backup Exec server and RAC backup | The database account, the virtual RAC node, logon accounts and credentials on the server |
The order inside the notes is not always the order in which things were done. The ASMLib disks are created on device names like /dev/ORADB-CRS, and those names exist only after the udev rules of a later chapter are in place. The forward DNS zone was edited again when Backup Exec needed two more records, which is the dotted arrow in the diagram.
The notes carry no dates of their own, but a few can be read off what they quote.
| Trace in the notes | Value |
|---|---|
Timestamps of the local disks sda, sdb in a directory listing | Sep 26 |
| Timestamps of the five shared disks in the same listing | Oct 4 |
| Serials of the reverse DNS zones | 20161006, 20161007 |
| Working directory of the Backup Exec agent installer | installralus1025131129, which looks like 25 October |
| Serial of the forward DNS zone | 2016102609 |
So the shared storage was attached in the first days of October 2016, DNS followed within days, and the last change I can date is the DNS zone on 26 October, after the backup agent was installed.
Names that do not agree
The notes do not use one name for the database. I report the variants and do not pick a winner beyond what the command outputs show.
| Where | Database name | Listener name |
|---|---|---|
| Header of the preparation notes | csldb | opdb (TCP:1525) |
| Header of the database installation notes | clsdb | opdb (TCP:1525) |
| NETCA answers | not asked | CLSDB, TCP 1525 |
| DBCA answers | clsdb.example.net, SID prefix clsdb | not asked |
Output of srvctl config database -d clsdb | clsdb, instances clsdb1, clsdb2 | not shown |
Profiles of oracle and grid | ORACLE_UNQNAME=clsdb in both; ORACLE_SID=clsdb1 in the profile of oracle | not named |
| Backup Exec notes, throughout | clsopdb, instances clsopdb1, clsopdb2 | not named |
The same notes, output of select DBID, NAME from v$database | CLSDB | not named |
csldb in the first header is most likely a typing mistake. clsopdb is not: it is in the agent's instance list, in the connect strings, in the account names on the backup server and in the DNS name of the virtual RAC node, rac-clsopdb-1234567890. Yet the one SQL query in those notes, run over the connect string clsopdb, prints the database name CLSDB, and the comment above the DNS records also says CLSDB. The notes do not explain it, and they contain no tnsnames.ora that would show what the alias clsopdb pointed to. The Articles quote each name as the notes have it in that place.
The listener has the same problem on a smaller scale: both headers announce a listener opdb on TCP 1525, and the listener that NETCA created on that port is called CLSDB.
Other contradictions are reported where they belong: the patch number written two ways and the patch sets a step announces but does not show in Grid patches and the multicast problem, the disk sizes that swap places between two listings in Storage and ASM disks, the mistakes in the reverse zones in DNS server: Knot. One more observation of this kind: the disk group ONTRLG was created for the online transaction logs, the DBCA answers leave the storage at its defaults, and srvctl lists only DATA and FRA as disk groups of the database. The notes show no step that moves the logs to ONTRLG.
What the notes do not contain
The notes are a record of what I typed on the Linux and Oracle side. A reader who wants to rebuild the system will look for the following and not find it.
- Anything about the hypervisor: the Hyper-V version, the virtual switches, the virtual hardware of the nodes. Memory and CPU are not stated; only indirect figures exist,
kernel.shmmax = 4124030976, amemlocklimit of 3500000 and the DBCA memory answer "6307 MB, 80 %". - The storage side: the iSCSI target, its configuration, and the iSCSI initiator setup on the nodes. The LUNs simply appear as
sdctosdg. - The interface configuration files of the nodes, and the commands that moved the interconnect from
eth2to the alias oneth3. listener.oraandtnsnames.ora, the response filegrid.rspthat one step uses, and the scripts DBCA generated.- The configuration of
dns1beyond the added blocks ofknot.confand the zone files, and its NTP service, of which only the client side on the nodes is shown. - Any backup job, schedule or restore test. The backup notes end when the server can see the database.
- Failover tests, and how long anything took.
Passwords appear in this Solution only as named placeholders such as <GRID_OS_PASSWORD>. The SCSI identifiers of the disks, the DBID in the name of the virtual RAC node and the voting file identifier are made-up values of the right shape.