Sie sind auf Seite 1von 310

Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O Oracle Database 12c R2: RAC
r m e
C a Administration

Activity Guide
D81250GC20
Edition 2.0 | March 2018 | D103168

Learn more from Oracle University at education.oracle.com


Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Author
Sean Kim Disclaimer

This document contains proprietary information and is protected by copyright and other
Technical Contributors intellectual property laws. You may copy and print this document solely for your own
and Reviewers use in an Oracle training course. The document may not be modified or altered in any
way. Except where your use constitutes "fair use" under copyright law, you may not
Sean Kim use, share, download, upload, copy, print, display, perform, reproduce, publish,
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Jerry Lee license, post, transmit, or distribute this document in whole or in part without the
express authorization of Oracle.
Joel Goodman
Frank Fu The information contained in this document is subject to change without notice. If you
find any problems in the document, please report them in writing to: Oracle University,
James Womack 500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not
warranted to be error-free.

Graphic Designers Restricted Rights Notice


Seema Bopaiah
If this documentation is delivered to the United States Government or anyone using
Kavya Bellur the documentation on behalf of the United States Government, the following notice is
a ble
applicable:
f e r
Publishers U.S. GOVERNMENT RIGHTS
an s
Raghunath M - t r
The U.S. Government’s rights to use, modify, reproduce, release, perform, display, or
n
Veena Narasimhan
a no
disclose these training materials are restricted by the terms of the applicable Oracle
license agreement and/or the applicable U.S. Government contract.
Joseph Fernandez
h a s
Trademark Notice

m ฺ
)of Oracleidand/or
e
ฺ c oowners.Gu its affiliates. Other names
Oracle and Java are registered trademarks

r a cle ent
may be trademarks of their respective

a @ o
S tud
o a n this
e nฺ use
( c arm se to
a na licen
e nO
rm
Ca
Table of Contents
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Course Practice Environment: Security Credentials .................................................................... I-1


Practices for Lesson 1: Grid Infrastructure Overview .................................................................. 5
Practices for Lesson 1: Overview ................................................................................................... 6
Practice 1-1: Configuring a Standalone Flex Cluster ...................................................................... 7
Practices for Lesson 2: RAC Databases Overview & Architecture ............................................. 49
Practices for Lesson 2 .................................................................................................................... 50
Practices for Lesson 3: Grid Infrastructure Overview .................................................................. 51
a b le
e r
Practices for Lesson 3: Overview ...................................................................................................
a n sf 53 52

n - tr
Practice 3-1: Installing RAC Database Software ............................................................................

n o
Practice 3-2: Creating a RAC Database ......................................................................................... 70

s a
h
) ide a
Practices for Lesson 4: Oracle RAC Administration ....................................................................

93

o m
Practices for Lesson 4: Overview ...................................................................................................
u
94
Practice 4-1: Operating System and Password File Authenticated
l e ฺc t GConnections ...........................95
Practice 4-2: Oracle Database Authenticated rConnections a c e n
o t u d ........................................................... 98

a
Practice 4-3: Stopping a Complete ORACLE_HOME
n @ s S Component Stack ......................................101
Practice 4-4: Configuring LeafoNodesa to runthRead-Only i
n ฺ e Instances ................................................ 104

m
Practice 4-5: Working with
r e Temporary
t o usTablespaces ......................................................................119
(ca 5:nUpgrading
Practices for Lesson
a se and Patching Oracle RAC ....................................................127
n e
lic 5 ....................................................................................................................128
a for Lesson
Practices
n O
rme
Practices for Lesson 6: Managing Backup and Recovery for RAC ............................................. 129

Ca Practices for Lesson 6: Overview ................................................................................................... 130


Practice 6-1: Configuring Archive Log Mode .................................................................................. 131
Practice 6-2: Configuring RMAN and Performing Parallel Backups ............................................... 135
Practices for Lesson 7: Global Resource Management Concepts .............................................. 145
Practices for Lesson 7 .................................................................................................................... 146
Practices for Lesson 8: RAC Database Monitoring and Tuning .................................................. 147
Practices for Lesson 8: Overview ................................................................................................... 148
Practice 8-1: ADDM and RAC Part I ............................................................................................... 149
Practice 8-2: ADDM and RAC Part II .............................................................................................. 164
Practice 8-3: ADDM and RAC Part III ............................................................................................. 172
Practices for Lesson 9: Managing High Availability of Services ................................................. 177
Practices for Lesson 9: Overview ................................................................................................... 178
Practice 9-1: Working with Services ............................................................................................... 179
Practice 9-2: Monitoring Services ................................................................................................... 187

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

Oracle Database 12c R2: RAC Administration – Table of Contents iii


Practices for Lesson 10: High Availability for Connections and Applications .......................... 195
Practices for Lesson 10: Overview ................................................................................................. 196
Practice 10-1: Using Application Continuity .................................................................................... 197
Practices for Lesson 11: Oracle RAC One Node ........................................................................... 209
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Practices for Lesson 11: Overview ................................................................................................. 210


Practice 11-1: RAC One Node ........................................................................................................ 211
Practices for Lesson 12: Oracle Database In-Memory in RAC .................................................... 217
Practices for Lesson 12: Overview ................................................................................................. 218
Practice 12-1: Reconfiguring the Environment ............................................................................... 219
Practices for Lesson 13: Multitenant Architecture and RAC ....................................................... 237

b
Practices for Lesson 13: Overview ................................................................................................. 238
a le
e r
Practice 13-1: Exploring CDB Architecture and Structures in RAC ................................................
a n sf 253 239

n - tr
Practice 13-2: Cloning a PDB in the RAC CDB ..............................................................................

n o
Practice 13-3: Affinitizing PDB Services to CDB Instances ............................................................ 258

s a
Practice 13-4: Dropping a PDB ....................................................................................................... 269
Practices for Appendix A: Cleanup and Catchup Procedures )forhPractices
a ฺ .............................275
m i d e
e ฺco t Gu
Appendix A-1: Cleanup Script .........................................................................................................
l 276

ra udec n
Appendix A-2: Catchup Script for Practice 1 .................................................................................. 292
o t
@3 ..................................................................................
n a
Appendix A-3: Catchup Script for Practice
i s S 300

n ฺ oa e th
r m e
t o us
a (ca nse
O an lice
n
rme
Ca

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

iv Oracle Database 12c R2: RAC Administration – Table of Contents


Course Practice Environment: Security Credentials

For operating system (Linux) usernames and passwords, see the following:
 If you are attending a classroom-based or live virtual class, ask your instructor or LVC
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

producer for OS credential information.


 If you are using a self-study format, refer to the communication that you received from
Oracle University for this course.

Operating System Credentials


Practice Environment Username Password
DNS node root Read the note above
a ble
f e r
oracle
ans
host01 ~ host05 root oracle n - t r
a no
grid
h a s oracle
oracle
m ) oracle d e ฺ
ฺco t Gu i
l e
o rac uden
@ s Ssee
For product-specific credentials usedninathis course,
t the following table:
ฺ o a
e t hi
r m en us
( c to
a se Product-Specific Credentials

a na licen
Product/Application Username Password (Case Sensitive)
O
n Manager Database Express
rme
Enterprise sys oracle_4U

Ca Database (orcl) sys oracle_4U


system oracle_4U
dbsnmp oracle_4U
hr hr
jmw jmw
ASM Instance SYS oracle_4U
ASMSNMP oracle_4U

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

I-1
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

I-2
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
a no
h a s
Practices for
m ) ideฺ 1: Grid
Lesson
l e ฺco t GuOverview
Infrastructure
o rac uden
a @ S t
o an thi s
e ฺ
n use
( c arm se to
ana licen
n O
r m e
C a
Practices for Lesson 1: Overview

Overview
In this practice, you will install and configure a standalone Flex Cluster. You will install to five
nodes; host01, host02, host03, host04, and host05. You will designate host01~host03
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

to be HUB nodes and host04~host05 will be designated as LEAF nodes.

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

6 Practices for Lesson 1: Grid Infrastructure Overview


Practice 1-1: Configuring a Standalone Flex Cluster

Overview
In this practice, you will install and configure a standalone Flex Cluster. You will install to five
nodes; host01, host02, host03, host04, and host05. You will designate host01~host03
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

to be HUB nodes and host04~host05 will be designated as LEAF nodes.

1. From a terminal in the dns node, change to the root account. First, set the time across all
nodes using the command shown below. Then restart the NAMED service to ensure viability
and availability of the services for the software installation.
[oracle@dns ~]$ su -
Password: <Enter the root password at the dns node>
a ble
f e r
[root@dns ~]# TIME="`date +%T`";for H in host01 host02 host03
an s
host04 host05;do ssh $H date -s $TIME;done
n - t r
o
root@host01's password: s an
Tue Oct 31 10:43:40 UTC 2017 ) ha eฺ
root@host02's password:
ฺ c om Guid
Tue Oct 31 10:43:40 UTC 2017
r a cle ent
root@host03's password:
a @ o
S tud
a
Tue Oct 31 10:43:40 UTC
o n2017 this
nฺ use
root@host04's password:
e
( c arm se to 2017
Tue Oct 31 10:43:40 UTC

na licen
root@host05's password:
a
O
Tue Oct 31 10:43:40 UTC 2017

r m en
C a [root@dns ~]# service named restart
Stopping named: [ OK ]
Starting named: [ OK ]
[root@dns ~]#

2. Review the /etc/hosts file. You should see output similar to the example displayed
below. It shows that your environment is configured with six VMs, which you will use to form
a cluster in upcoming practices. The dns node in the output is a gateway VM.
[root@dns ~]# more /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6

192.0.2.101 host01.example.com host01

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

Practices for Lesson 1: Grid Infrastructure Overview 7


192.0.2.102 host02.example.com host02
192.0.2.103 host03.example.com host03
192.0.2.104 host04.example.com host04
192.0.2.105 host05.example.com host05
192.0.2.1 dns.example.com dns
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

[root@dns ~]#

3. Check that the DHCPD is running on the DNS server. You will configure nodes VIPs using
the DHCPD service later.
[root@dns ~]# service dhcpd status
dhcpd (pid 17024) is running...
a b le
[root@dns ~]# f e r
an s
n - t r
4.
a no
Using SSH, connect to host01 as root user account. Start the local naming cache
daemon on all five cluster nodes with the service nscd start command. To make sure
h a s
) ideฺ
nscd starts at reboot, execute the chkconfig nscd command. Perform these steps on
m
all five of your nodes.
l e ฺco t Gu
[root@dns ~]# ssh host01
o r ac den
root@host01's password: <Enter@ S u
the roottpassword at the host01 node>
a s
annscdthstart
i
ฺ o e
Starting nscd:rm
en ] us
[root@host01 ~]# service
[ OK to
(ca~]#nchkconfig
[root@host01
a se nscd on
a n e
lic~]# ssh host02 service nscd start
n O
[root@host01
rmeStarting nscd: [ OK ]
Ca [root@host01 ~]# ssh host02 chkconfig nscd on

[root@host01 ~]# ssh host03 service nscd start


Starting nscd: [ OK ]
[root@host01 ~]# ssh host03 chkconfig nscd on

[root@host01 ~]# ssh host04 service nscd start


Starting nscd: [ OK ]
[root@host01 ~]# ssh host04 chkconfig nscd on

[root@host01 ~]# ssh host05 service nscd start


Starting nscd: [ OK ]
[root@host01 ~]# ssh host05 chkconfig nscd on

[root@host01 ~]#

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

8 Practices for Lesson 1: Grid Infrastructure Overview


5. As the root user, run the /stage/RAC/labs/less_01/limits.sh script on host01.
This script replaces the profile for the oracle and grid users and replaces
/etc/profile. It replaces the /etc/security/limits.conf file with a new one with
entries for oracle and grid.
[root@host01 ~]# cat /stage/RAC/labs/less_01/bash_profile
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

# .bash_profile

# Get the aliases and functions


if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin a ble
export PATH f e r
ans
umask 022 n - t r
a no
[root@host01 ~]# cat /stage/RAC/labs/less_01/profile
h a s
# /etc/profile
m ) ideฺ
o Gufor login setup
ฺcprograms,
# System wide environment and startup
c l e n t
r a
# Functions and aliases go in /etc/bashrc e
a @ o
S tud
pathmunge () {
o a n this
if [m e nฺ = "after"
if ! echo $PATH
"$2" u se ] ; then
| /bin/egrep -q "(^|:)$1($|:)" ; then

( c arPATH=$PATH:$1
e to
ana else c e ns
O li PATH=$1:$PATH
n
rme
fi

Ca
fi
}

# ksh workaround
if [ -z "$EUID" -a -x /usr/bin/id ]; then
EUID=`id -u`
UID=`id -ru`
fi

# Path manipulation
if [ "$EUID" = "0" ]; then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
fi

# No core files by default


ulimit -S -c 0 > /dev/null 2>&1

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

Practices for Lesson 1: Grid Infrastructure Overview 9


if [ -x /usr/bin/id ]; then
USER="`id -un`"
LOGNAME=$USER
MAIL="/var/spool/mail/$USER"

fi
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

HOSTNAME=`/bin/hostname`
HISTSIZE=1000

if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then


INPUTRC=/etc/inputrc
fi

export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC


a b le
for i in /etc/profile.d/*.sh ; do f e r
if [ -r "$i" ]; then
an s
. $i
n - t r
o
an
fi
done s
ha eฺ
)
if [ $USER = "oracle" ] || [ $USER = "grid"
ฺ c om ];
G u id
then

clethenent
umask 022
if [ $SHELL = "/bin/ksh"a];
ulimit -p 16384 o
r ud
a @ S t
o
ulimit ฺ–s
n this
ulimit -n 65536
a10240
else e n use
c rm e-uto16384 -n 65536 –s 10240
aulimit
(
afi cens
fi an
n O i li
unset
rmeunset pathmunge
Ca
[root@host01 ~]# cat /stage/RAC/labs/less_01/limits.conf

# - priority - the priority to run user process with


# - locks - max number of file locks the user can hold
# - sigpending - max number of pending signals
# - msgqueue - max memory used by POSIX message queues
# - nice - max nice priority allowed to raise to
# - rtprio - max realtime priority
#<domain> <type> <item> <value>

#* soft core 0
#* hard rss 10000
#@student hard nproc 20
#@faculty soft nproc 20
#@faculty hard nproc 50
#ftp hard nproc 0
#@student - maxlogins 4

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

10 Practices for Lesson 1: Grid Infrastructure Overview


# End of file
oracle soft nofile 131072
oracle hard nofile 131072
oracle soft nproc 131072
oracle hard nproc 131072
oracle soft core unlimited
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

oracle hard core unlimited


oracle soft memlock 3500000
oracle hard memlock 3500000
oracle soft stack 10240
oracle hard stack 32768
grid soft nofile 131072
grid hard nofile 131072
grid soft nproc 131072
grid hard nproc 131072
grid soft core unlimited
a ble
grid hard core unlimited f e r
grid soft memlock 3500000
ans
grid hard memlock 3500000
n - t r
grid soft stack 10240
a no
grid hard stack 32768
h a s
m d e ฺ
) installations
# Recommended stack hard limit 32MB for oracle
ฺco t Gu i
# oracle hard stack 32768
c l e n
o r a d e
a @ S tu 100% 194 0.2KB/s 00:00
[root@host01 ~]# /stage/RAC/labs/less_01/limits.sh
bash_profile
o an thi s
bash_profile
limits.conf e n ฺ s e 100% 194
100% 1276
0.2KB/s
1.3KB/s
00:00
00:00
r m o u
profile
profile ( c a se t 100% 1279
100% 1279
1.3KB/s
1.3KB/s
00:00
00:00

a na licen
bash_profile 100% 194 0.2KB/s 00:00

n O
bash_profile
limits.conf
100% 194
100% 1276
0.2KB/s
1.3KB/s
00:00
00:00
rmeprofile 100% 1279 1.3KB/s 00:00
Ca profile
bash_profile
100%
100%
1279
194
1.3KB/s
0.2KB/s
00:00
00:00
bash_profile 100% 194 0.2KB/s 00:00
limits.conf 100% 1276 1.3KB/s 00:00
profile 100% 1279 1.3KB/s 00:00
profile 100% 1279 1.3KB/s 00:00
bash_profile 100% 194 0.2KB/s 00:00
bash_profile 100% 194 0.2KB/s 00:00
limits.conf 100% 1276 1.3KB/s 00:00
profile 100% 1279 1.3KB/s 00:00
profile 100% 1279 1.3KB/s 00:00
bash_profile 100% 194 0.2KB/s 00:00
bash_profile 100% 194 0.2KB/s 00:00
limits.conf 100% 1276 1.3KB/s 00:00
profile 100% 1279 1.3KB/s 00:00
profile 100% 1279 1.3KB/s 00:00

[root@host01 ~]#

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

Practices for Lesson 1: Grid Infrastructure Overview 11


6. Create the installation directories for both grid and oracle-owned software. Set the
ownership and permissions of the directories as shown below: Do this on all five hosts. Use
the /stage/RAC/labs/less_01/cr_dir.sh script to save time.
[root@host01 ~]# cat /stage/RAC/labs/less_01/cr_dir.sh

#!/bin/bash
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

mkdir -p /u01/app/12.2.0/grid
mkdir -p /u01/app/grid
mkdir -p /u01/app/oracle
chown -R grid:oinstall /u01
chown oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/
a b le
ssh host02 mkdir -p /u01/app/12.2.0/grid
f e r
ssh host02 mkdir -p /u01/app/grid
an s
ssh host02 mkdir -p /u01/app/oracle n - t r
o
ssh host02 chown -R grid:oinstall /u01
s an
ssh host02 chown ha eฺ
oracle:oinstall /u01/app/oracle
)
ssh host02 chmod -R 775 /u01/
ฺ c om Guid
a
ssh host03 mkdir -p /u01/app/12.2.0/grid
r cle ent
ssh host03 mkdir -p /u01/app/grid
a @ o
S tud
a n this
ssh host03 mkdir -p /u01/app/oracle
o
ssh host03 chown e -Rnฺgrid:oinstall
s e /u01
r m o u
( c a se t
ssh host03 chown oracle:oinstall /u01/app/oracle

a na licen-R 775 /u01/


ssh host03 chmod

e n Ohost04 mkdir -p /u01/app/12.2.0/grid


ssh
rm ssh host04 mkdir -p /u01/app/grid
Ca ssh host04 mkdir -p /u01/app/oracle
ssh host04 chown -R grid:oinstall /u01
ssh host04 chown oracle:oinstall /u01/app/oracle
ssh host04 chmod -R 775 /u01/

ssh host05 mkdir -p /u01/app/12.2.0/grid


ssh host05 mkdir -p /u01/app/grid
ssh host05 mkdir -p /u01/app/oracle
ssh host05 chown -R grid:oinstall /u01
ssh host05 chown oracle:oinstall /u01/app/oracle
ssh host05 chmod -R 775 /u01/

[root@host01 ~]# /stage/RAC/labs/less_01/cr_dir.sh


[root@host01 ~]#

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

12 Practices for Lesson 1: Grid Infrastructure Overview


7. Open a terminal window on your dns node and ssh to host01 as the grid user. Unzip
the /stage/clusterware.zip file to /u01/app/12.2.0/grid on host01.
[oracle@dns ~]# ssh -X grid@host01
grid@host01's password: <Enter the grid password at the host01 node>
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

[grid@host01 ~]$ unzip -d /u01/app/12.2.0/grid


/stage/clusterware.zip
Archive: /stage/clusterware.zip
...
finishing deferred symbolic links:
/u01/app/12.2.0/grid/bin/lbuilder -> ../nls/lbuilder/lbuilder
...
/u01/app/12.2.0/grid/lib/libclntsh.so -> libclntsh.so.12.1
a ble
/u01/app/12.2.0/grid/lib/libocci.so -> libocci.so.12.1 f e r
ans
n - t r
[grid@host01 ~]$
a no
h a s
m ) ideฺ
8. As the grid user, change your working directory to /u01/app/12.2.0/grid and
o u
execute the gridSetup.sh script.
c l eฺc nt G
[grid@host01 ~]$ cd /u01/app/12.2.0/grid
o ra ude
a @ S t
o an thi
[grid@host01 grid]$ ฺ./gridSetup.sh
s
e n use
( c arm se to
a na licen
e nO
rm
Ca

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

Practices for Lesson 1: Grid Infrastructure Overview 13


9. On the Select Configuration Option page, select “Configure Oracle Grid Infrastructure for a
New Cluster and click “Next”.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

14 Practices for Lesson 1: Grid Infrastructure Overview


10. On the Select Cluster Configuration page, select “Configure an Oracle Standalone Cluster”
and click “Next”.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 1: Grid Infrastructure Overview 15


11. On the Grid Plug and Play Information page, enter the following settings:
 Cluster Name: cluster01
 SCAN Name: cluster01-scan.cluster01.example.com (Auto-filled, Do NOT
edit it manually).
 SCAN Port: 1521
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

 Click the “Configure GNS” check box


 Click the “Configure nodes Virtual IPs as assigned by the Dynamic Networks”
 Click the “Create a new GNS” radio button
 GNS VIP Address: 192.0.2.155
 GNS Sub Domain: example.com

a b le
f e r
an s
n - t r
a no
h a s
m ) ideฺ
l e ฺco t Gu Do NOT edit
o rac uden manually
a @ sS t
o a n t hi

en us e
r m
a se to
( c
ana licen
n O
r m e
C a

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

16 Practices for Lesson 1: Grid Infrastructure Overview


12. On the Cluster Node Information page, click Add to begin the process of specifying
additional cluster nodes. Click the Add button and add host02.example.com. Make sure
to set Node Role to HUB, and click OK. Repeat for the following nodes.
 host01.example.com (HUB)
 host02.example.com (HUB)
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

 host03.example.com (HUB)
 host04.example.com (LEAF)
 host05.example.com (LEAF)

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 1: Grid Infrastructure Overview 17


13. Click the SSH Connectivity button. Enter the grid password (please refer to the Course
Practice Environment: Security Credentials page for account passwords) into the OS
Password field and click Test to confirm that the required SSH connectivity is configured
across the cluster. Your lab environment is preconfigured with the required SSH
connectivity so you will next see a dialog confirming this. Click OK to continue. Review the
information in the Cluster Node Information page and click Next. Your screen Cluster Node
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Information page should look like the one below:

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

18 Practices for Lesson 1: Grid Infrastructure Overview


14. On the Specify Network Interface Usage page, select Public for eth0, ASM for eth1, and
Private for eth2 and eth3. Click “Next” to continue.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 1: Grid Infrastructure Overview 19


15. On the Storage Option Information page, click the “Configure ASM using block devices”
button and click Next.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

20 Practices for Lesson 1: Grid Infrastructure Overview


16. On the Grid Infrastructure Management Repository Option page, click YES then click Next.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 1: Grid Infrastructure Overview 21


17. On the Create ASM Disk Group page, click the “Change Discovery Path” button. Enter
/dev/c1* in the Disk Discovery Path field and click OK.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

22 Practices for Lesson 1: Grid Infrastructure Overview


18. On the Create ASM Disk Group page, select the first 10 candidate disks (c1_DATA1 disks)
in the list for the DATA disk group. Make sure Redundancy is Normal and the “Configure
Oracle ASM Filter Driver” check box is NOT selected. Click “Next”.
 /dev/c1_DATA1_dsk1
 /dev/c1_DATA1_dsk10
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

 /dev/c1_DATA1_dsk11
 /dev/c1_DATA1_dsk12
 /dev/c1_DATA1_dsk13
 /dev/c1_DATA1_dsk14
 /dev/c1_DATA1_dsk2
 /dev/c1_DATA1_dsk3
a ble
 /dev/c1_DATA1_dsk4 f e r
ans
 /dev/c1_DATA1_dsk5
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 1: Grid Infrastructure Overview 23


19. On the Create GIMR Data Disk Group page, select All candidate disks
(c1_MGMT1_dsk1~c1_MGMT_dsk14 disks) in the list for the MGMT disk group. There will
be 14 disks. Set the Redundancy to External. Click “Next” to continue.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

24 Practices for Lesson 1: Grid Infrastructure Overview


20. On the Specify ASM Password page, click the “Use same passwords for these accounts”
radio button and enter the SYS password (as specified in the Course Practice
Environment: Security Credentials page) in the Specify Password and Confirm Password
fields. Click “Next” to continue.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 1: Grid Infrastructure Overview 25


21. On the Failure Isolation Support screen, click Next to accept the default setting (Do not use
IPMI).
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

26 Practices for Lesson 1: Grid Infrastructure Overview


22. On the Specify Management Options screen, accept the defaults (nothing selected) and
click Next to continue.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 1: Grid Infrastructure Overview 27


23. On the Privileged Operating System Groups screen, the values should default to the
following:
 Oracle ASM Administrator Group: asmadmin
 Oracle ASM DBA Group: asmdba
 Oracle ASM Operator Group: asmoper
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Click Next to accept the default values.

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

28 Practices for Lesson 1: Grid Infrastructure Overview


24. On the Specify Installation Location page, Oracle base should default to /u01/app/grid.
Accept this value and click “Next” to continue.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 1: Grid Infrastructure Overview 29


25. On the Create Inventory screen, click Next to accept the default installation inventory
location of /u01/app/oraInventory.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

30 Practices for Lesson 1: Grid Infrastructure Overview


26. On the Root script execution configuration page, click the “Automatically run configuration
scripts” check box. Click the “Use “root” user credential” button and enter the root password
(as specified in the Course Practice Environment: Security Credentials page) in the
Password field. Click “Next” to continue.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 1: Grid Infrastructure Overview 31


27. Wait while a series of prerequisite checks are performed.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

32 Practices for Lesson 1: Grid Infrastructure Overview


28. On the Perform Prerequisite Checks page, a list of exceptions is displayed after the checks
have completed. Click the Fix and Check Again button.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 1: Grid Infrastructure Overview 33


29. The Fixup Script dialog box will appear. The generated script will need to be run on
host01, host02, host03, host04, and host05 as the root user.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
30.eOpen a new terminal window and ssh as root to host01. Run the fixup script on
a r m
C host01, and then run it on host02, host03, host04, and host05. (Your script name
will vary from the example as the filename contains a timestamp.)
[oracle@dns ~]$ ssh root@host01
Password:

[root@host01 ~]# /tmp/GridSetupActions2017-10-31_01-35-


39PM/CVU_12.2.0.1.0_grid/runfixup.sh
All Fix-up operations were completed successfully.

[root@host01 ~]# ssh host02 /tmp/GridSetupActions2017-10-31_01-35-


39PM/CVU_12.2.0.1.0_grid/runfixup.sh
All Fix-up operations were completed successfully.

[root@host01 ~]# ssh host03 /tmp/GridSetupActions2017-10-31_01-35-


39PM/CVU_12.2.0.1.0_grid/runfixup.sh
All Fix-up operations were completed successfully.

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

34 Practices for Lesson 1: Grid Infrastructure Overview


[root@host01 ~]# ssh host04 /tmp/GridSetupActions2017-10-31_01-35-
39PM/CVU_12.2.0.1.0_grid/runfixup.sh
All Fix-up operations were completed successfully.

[root@host01 ~]# ssh host05 /tmp/GridSetupActions2017-10-31_01-35-


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

39PM/CVU_12.2.0.1.0_grid/runfixup.sh
All Fix-up operations were completed successfully.

[root@host01 ~]#

31. Return to the installer and click OK on the Fixup Script dialog box.

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 1: Grid Infrastructure Overview 35


32. After dismissing the Fixup Script dialog box, prerequisites will be checked again. The DNS
and ASM exceptions can be ignored. Click the “Ignore All” check box and click “Next” to
continue.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

36 Practices for Lesson 1: Grid Infrastructure Overview


33. A dialog box will appear asking you to confirm your decision to proceed. Click Yes to
continue.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 1: Grid Infrastructure Overview 37


34. Examine the Summary screen. When ready, click Install to begin the installation. Oracle
Grid Infrastructure release 12.2 will now install on the cluster. The Install Product screen
follows the course of the installation.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

38 Practices for Lesson 1: Grid Infrastructure Overview


35. After the installer runs for a short time, a dialog box will open and confirm you want to run
the root scripts using the credentials provided earlier. Click Yes. It takes about 65min to
complete the installation at this stage (44%).
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 1: Grid Infrastructure Overview 39


36. When the installation is complete, click “Close”.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
a no
h a s
m ) ideฺ
l e ฺco t Gu
o rac uden
a @ S t
o an thi s
e ฺ
n use
( c arm se to
a na terminal
l i c ensession, configure the environment using the oraenv script. Enter
e nO
37. Back in your
+ASM1 when you are prompted for an ORACLE_SID value.
rm
Ca [grid@host01 ~]$ . oraenv
ORACLE_SID = [grid] ? +ASM1
The Oracle base has been set to /u01/app/grid
[grid@host01 ~]$

38. Now check the configuration of the nodes, asm, and cluster.
[grid@host01 ~]$ crsctl get cluster class
CRS-41008: Cluster class is 'Standalone Cluster'

[grid@host01 ~]$ crsctl get cluster mode status


Cluster is running in "flex" mode

[grid@host01 ~]$ crsctl get cluster configuration


Name : cluster01

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

40 Practices for Lesson 1: Grid Infrastructure Overview


Class : Standalone Cluster
Type : flex
The cluster is not extended.

[grid@host01 ~]$ crsctl get node role status -all


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Node 'host01' active role is 'hub'


Node 'host02' active role is 'hub'
Node 'host03' active role is 'hub'
Node 'host04' active role is 'leaf'
Node 'host05' active role is 'leaf'

[grid@host01 ~]$ asmcmd showclustermode


ASM cluster : Flex mode enabled
a ble
f e r
ans
[grid@host01 ~]$
n - t r
a no
39. Check the status of the cluster. Ensure that all the listed servicess
cluster nodes. h a
) ideฺ
are online on all the

m
o Gu
[grid@host01 ~]$ crsctl check clusterฺc -all
c l e n t
r a e
**************************************************************
host01:
a @ o
S tud
CRS-4537: Cluster Ready o a nServices
t h isis online
nฺ use
CRS-4529: ClustereSynchronization Services is online
r m t o
a (ca nse
CRS-4533: Event Manager is online

O an lice
**************************************************************
host02:
n
rmeCRS-4537: Cluster Ready Services is online
Ca CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
host03:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
host04:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
host05:
CRS-4537: Cluster Ready Services is online

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

Practices for Lesson 1: Grid Infrastructure Overview 41


CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
[grid@host01 ~]$
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

40. List the Clusterware resources. Ensure that all the Clusterware resources are running as
shown in the following output.
[grid@host01 ~]$ crsctl status resource -t
-----------------------------------------------------------------
Name Target State Server State details
-----------------------------------------------------------------
Local Resources
-----------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr a b le
ONLINE ONLINE host01 STABLE f e r
ONLINE ONLINE host02 STABLE an s
ONLINE ONLINE host03 STABLE n - t r
o
ora.DATA.dg
ONLINE ONLINE host01 s an
STABLE
ONLINE ONLINE host02 ) ha eฺSTABLE
ONLINE ONLINE host03
ฺ c om Guid STABLE
ora.LISTENER.lsnr
r a cle ent
ONLINE ONLINE
a @ o
S tud
host01 STABLE

o a n this
ONLINE ONLINE host02 STABLE

e nฺ use
ONLINE ONLINE host03 STABLE

( arm se to
ora.LISTENER_LEAF.lsnr
c OFFLINE OFFLINE host04 STABLE
ana licen OFFLINE OFFLINE host05 STABLE
n O
r m e ora.MGMT.dg

C a ONLINE ONLINE host01 STABLE


ONLINE ONLINE host02 STABLE
ONLINE ONLINE host03 STABLE
ora.chad
ONLINE ONLINE host01 STABLE
ONLINE ONLINE host02 STABLE
ONLINE ONLINE host03 STABLE
ONLINE ONLINE host04 STABLE
ONLINE ONLINE host05 STABLE
ora.net1.network
ONLINE ONLINE host01 STABLE
ONLINE ONLINE host02 STABLE
ONLINE ONLINE host03 STABLE
ora.ons
ONLINE ONLINE host01 STABLE

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

42 Practices for Lesson 1: Grid Infrastructure Overview


ONLINE ONLINE host02 STABLE
ONLINE ONLINE host03 STABLE
ora.proxy_advm
OFFLINE OFFLINE host01 STABLE
OFFLINE OFFLINE host02 STABLE
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

OFFLINE OFFLINE host03 STABLE


-----------------------------------------------------------------
Cluster Resources
-----------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE host03 STABLE
ora.LISTENER_SCAN2.lsnr
1 ONLINE ONLINE host02 STABLE
a ble
ora.LISTENER_SCAN3.lsnr f e r
ans
1 ONLINE ONLINE host01 STABLE
n - t r
ora.MGMTLSNR o
1 ONLINE ONLINE host01
s an
169.254.116.21
) ha eฺ192.168.1.101

ฺ c om Guid 192.168.2.1

r a cle ent 01,STABLE


ora.asm
a @ o
S tud
1
o a n this
ONLINE ONLINE host01 Started,STABLE
2
e nฺ use
ONLINE ONLINE host03 Started,STABLE

arm se to
3 ONLINE ONLINE host02 Started,STABLE
ora.cvu ( c
a
1na licenONLINE ONLINE host01 STABLE
n O
ora.gns
r m e
C a 1 ONLINE ONLINE host01 STABLE
ora.gns.vip
1 ONLINE ONLINE host01 STABLE
ora.host01.vip
1 ONLINE ONLINE host01 STABLE
ora.host02.vip
1 ONLINE ONLINE host02 STABLE
ora.host03.vip
1 ONLINE ONLINE host03 STABLE
ora.mgmtdb
1 ONLINE ONLINE host01 Open,STABLE
ora.qosmserver
1 ONLINE ONLINE host01 STABLE
ora.scan1.vip
1 ONLINE ONLINE host03 STABLE
ora.scan2.vip

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

Practices for Lesson 1: Grid Infrastructure Overview 43


1 ONLINE ONLINE host02 STABLE
ora.scan3.vip
1 ONLINE ONLINE host01 STABLE
-----------------------------------------------------------------
[grid@host01 ~]$
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

41. Stop and disable the ora.cvu resource using SRVCTL to conserve disk space.
[grid@host01 ~]$ srvctl stop cvu

[grid@host01 ~]$ srvctl disable cvu

[grid@host01 ~]$
a b le
f e r
an s
42. Next, you will create another ASM disk group to host the Fast Recovery Area (FRA). Start
n - t r
the ASM Configuration Assistant (asmca). o
[grid@host01 ~]$ asmca s an
) ha eฺ
ฺ c omDiskGGroups.
u id
cle ent
43. After the ASM Configuration Assistant appears, click on
r a
a @ o
S tud
o a n this
e nฺ use
( c arm se to
a na licen
e nO
rm
Ca

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

44 Practices for Lesson 1: Grid Infrastructure Overview


44. Click on Create.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 1: Grid Infrastructure Overview 45


45. In the Create Disk Group window, enter FRA as the disk group name and select the
following four candidate disks (c1_DATA1_dsk).
 /dev/c1_DATA1_dsk6
 /dev/c1_DATA1_dsk7
 /dev/c1_DATA1_dsk8
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

 /dev/c1_DATA1_dsk9
Make sure the Redundancy is External and The Label disks using AFD is NOT selected.
Then click OK to create the disk group.

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

46 Practices for Lesson 1: Grid Infrastructure Overview


46. Click Exit to quit the ASM Configuration Assistant.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 1: Grid Infrastructure Overview 47


47. Click Yes to confirm that you want to quit the ASM Configuration Assistant.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o an for this
48. Close all terminal windows ฺopened t h s
ipractice.
e n use
( c arm se to
a na licen
e nO
rm
Ca

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

48 Practices for Lesson 1: Grid Infrastructure Overview


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
a no
h a s
Practices for
m ) ideฺ 2: RAC
Lesson
Databases
l e ฺco t Overview
G u &
a c n
o rArchitecture
t u de
n a @ s S
a h i
e nฺo use t
( c arm se to
ana licen
n O
r m e
C a
Practices for Lesson 2

There are no practices for this lesson.


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

50 Practices for Lesson 2: RAC Databases Overview & Architecture


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
a no
h a s
Practices for
m ) ideฺ 3: Grid
Lesson
l e ฺco t GuOverview
Infrastructure
o rac uden
a @ S t
o an thi s
e ฺ
n use
( c arm se to
ana licen
n O
r m e
C a
Practices for Lesson 3: Overview

Overview
In this practice, you will install the database software to both HUB and LEAF nodes in your
cluster.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

52 Practices for Lesson 3: Grid Infrastructure Overview


Practice 3-1: Installing RAC Database Software

Overview
In this practice, you will install the database software to both HUB and LEAF nodes in your
cluster.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

1. Open a terminal window as root on host01. Change the permissions on /u01/app to


allow the oracle user write privileges. Repeat these commands on host02, host03,
host04, and host05.
[oracle@dns ~]$ ssh root@host01
root@host01's password:

[root@host01 ~]# chmod 775 /u01/app


a ble
[root@host01 ~]# ssh host02 chmod 775 /u01/app
f e r
[root@host01 ~]# ssh host03 chmod 775 /u01/app ans
[root@host01 ~]# ssh host04 chmod 775 /u01/app n - t r
[root@host01 ~]# ssh host05 chmod 775 a no /u01/app
[root@host01 ~]# h a s
m ) ideฺ
l e ฺ co t Gu
2. Open a terminal window and ssh to host01 as
r a c the oracle
e n user. Change the working
o tu d
directory to /stage/database and execute runInstaller.
a
n thi@ s S
[oracle@dns ~]$ ssh -X aoracle@host01
ฺ o
n use
e
oracle@host01's password:

( c arm se to
na lice~]$
[oracle@host01
a n cd /stage/database
e nO
[oracle@host01 database]$ ./runInstaller

rm
Ca

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

Practices for Lesson 3: Grid Infrastructure Overview 53


3. On the Configure Security Updates page, uncheck “I wish to receive security updates via
My Oracle Support” and click Next.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

54 Practices for Lesson 3: Grid Infrastructure Overview


4. Click Yes on the dialog box confirming your wish regarding security updates.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 3: Grid Infrastructure Overview 55


5. On the Select Installation Option page, select “Install database software only” and click
Next.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

56 Practices for Lesson 3: Grid Infrastructure Overview


6. On the Select Database Installation Option page select “Oracle Real Application Clusters
database installation” and click Next.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 3: Grid Infrastructure Overview 57


7. On the Select List of Nodes page, ensure all nodes are checked and click Next.
Note: Oracle recommends that you install the Oracle Database software on all the cluster
nodes, even Leaf Nodes. This simplifies things if you ever want to convert a Leaf Node to a
Hub Node and run database instances on it or if you plan to run database instances in the
Leaf Nodes.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

58 Practices for Lesson 3: Grid Infrastructure Overview


8. On the Select Database Edition page, ensure “Enterprise Edition” is selected and click
Next.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 3: Grid Infrastructure Overview 59


9. On the Specify Installation Location page, accept the defaults as shown here and click
Next.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

60 Practices for Lesson 3: Grid Infrastructure Overview


10. On the Privileged Operating System groups, accept the defaults as shown here and click
Next.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 3: Grid Infrastructure Overview 61


11. The Perform Prerequisite Checks page shows the progress of checks performed before the
installation begins.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

62 Practices for Lesson 3: Grid Infrastructure Overview


12. Review the information on the Summary page and click Next.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 3: Grid Infrastructure Overview 63


13. Monitor the installation on the Install Product page. It takes about 25min to complete the
installation at this stage.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

64 Practices for Lesson 3: Grid Infrastructure Overview


14. At the end of the installation (97%), you will be prompted to run the root scripts.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
a no
h a s
m ) ideฺ
l e ฺco t Gu
o rac uden
a @ S t
o an thi s
e ฺ
n use
( c arm se to
a n a cen
li terminal and run the root scripts on host01, host02, host03,
O to the root
15. Return
n
rmehost04, and host05.
Ca [root@host01 ~]# /u01/app/oracle/product/12.2.0/dbhome_1/root.sh
Performing root user operation.

The following environment variables are set as:


ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/12.2.0/dbhome_1

Enter the full pathname of the local bin directory:


[/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.

Entries will be added to the /etc/oratab file as needed by


Database Configuration Assistant when a database is created
Finished running generic part of root script.

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

Practices for Lesson 3: Grid Infrastructure Overview 65


Now product-specific root actions will be performed.

[root@host01 ~]# ssh host02


/u01/app/oracle/product/12.2.0/dbhome_1/root.sh
Performing root user operation.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

The following environment variables are set as:


ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/12.2.0/dbhome_1

Enter the full pathname of the local bin directory:


[/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
a b le
The contents of "coraenv" have not changed. No need to overwrite. f e r
a n s
Entries will be added to the /etc/oratab file as needed nby - t r
Database Configuration Assistant when a database is a no
created
Finished running generic part of root script.has
Now product-specific root actions will bem
) ideฺ
performed.
l e ฺco t Gu
[root@host01 ~]# ssh host03
o r ac den
@ tu
/u01/app/oracle/product/12.2.0/dbhome_1/root.sh
a S
an thi
Performing root user operation.
o s
e ฺ
n use
m to variables are set as:
The following renvironment
a
a ( c
ORACLE_OWNER= n e
soracle
an e
lic /u01/app/oracle/product/12.2.0/dbhome_1
n OORACLE_HOME=

rme
Ca Enter the full pathname of the local bin directory:
[/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.

Entries will be added to the /etc/oratab file as needed by


Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.

[root@host01 ~]# ssh host04


/u01/app/oracle/product/12.2.0/dbhome_1/root.sh
Performing root user operation.

The following environment variables are set as:


ORACLE_OWNER= oracle

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

66 Practices for Lesson 3: Grid Infrastructure Overview


ORACLE_HOME= /u01/app/oracle/product/12.2.0/dbhome_1

Enter the full pathname of the local bin directory:


[/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

The contents of "coraenv" have not changed. No need to overwrite.

Entries will be added to the /etc/oratab file as needed by


Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.

[root@host01 ~]# ssh host05


a ble
/u01/app/oracle/product/12.2.0/dbhome_1/root.sh f e r
ans
Performing root user operation.
n - t r
The following environment variables are set as: a no
ORACLE_OWNER= oracle h a s
m ) ideฺ
ORACLE_HOME= /u01/app/oracle/product/12.2.0/dbhome_1
l e ฺco t Gu
Enter the full pathname of the local
o r ac bin d e n
directory:
[/usr/local/bin]:
a @ S tu
The contents of "dbhome"
o s
anhavethnot
i changed. No need to overwrite.

en uhave
The contents of "oraenv" e
s not changed. No need to overwrite.
r m o
t have not changed. No need to overwrite.
The contents aof "coraenv"
( c s e
a nawilllicbeenadded to the /etc/oratab file as needed by
n O Configuration Assistant when a database is created
Entries

rm eDatabase
Ca Finished running generic part of root script.
Now product-specific root actions will be performed.

[root@host01 ~]#

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

Practices for Lesson 3: Grid Infrastructure Overview 67


16. After the root scripts have been run, return to the installer and click OK on the dialog box.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

68 Practices for Lesson 3: Grid Infrastructure Overview


17. Click Close on the Finish page to dismiss the installer.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
a a cen
nterminals
O
18. Close all li opened for this practice.
n
rme
Ca

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

Practices for Lesson 3: Grid Infrastructure Overview 69


Practice 3-2: Creating a RAC Database

Overview
In this practice, you will create a RAC database in the HUB Nodes.
1. Open a terminal window on your dns node and ssh to host01 as the oracle user. Set
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

the environment for the Oracle database software.


[oracle@dns ~]$ ssh -X host01
oracle@host01's password:

[oracle@host01 ~]$ export


ORACLE_HOME=/u01/app/oracle/product/12.2.0/dbhome_1

a b le
[oracle@host01 ~]$ export PATH=$PATH:$ORACLE_HOME/bin
f e r
an s
[oracle@host01 ~]$ n - t r
a no
h a s
2. Create a server pool called orcldb using srvctl.
m ) ideฺ
[oracle@host01 ~]$ srvctl add serverpool
l e ฺco -serverpool
t G u orcldb -max 3

rac uden
-category hub

@ o t
a s S
[oracle@host01 ~]$
ฺ o an thi
e n use
c rm
3. Change directoryato to
$ORACLE_HOME/bin
e and run DBCA.
( s
na lice~]$
[oracle@host01
a n dbca
e nO
rm
Ca

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

70 Practices for Lesson 3: Grid Infrastructure Overview


4. On the “Select Database Operation” page, select Create a database and click Next.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 3: Grid Infrastructure Overview 71


5. On The “Select Database Creation Mode” page, select “Advanced configuration” and click
Next.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

72 Practices for Lesson 3: Grid Infrastructure Overview


6. On the “Select Database Deployment Type” page, select “Oracle Real Application Cluster
(RAC) database” from the Database type pull-down list and “Policy Managed” from the
Configuration type pull-down list. Select the “General Purpose or Transaction Processing”
template and click Next.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 3: Grid Infrastructure Overview 73


7. On the Select Server Pool Option page, click the “Use existing Server pool for this
database” button. Select the orcldb Server pool and click Next.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

74 Practices for Lesson 3: Grid Infrastructure Overview


8. Ensure the Global database name is orcl. Do NOT accept the default database name.
Make sure the Create as Container database check box is NOT checked. Click Next to
continue.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 3: Grid Infrastructure Overview 75


9. On the Select Database Storage Option page, click the “Use following for the database
storage attributes” button. Make sure “Automatic Storage Management (ASM)” is selected
from the Database files storage type pull down list and the Database files location is
+DATA/{DB_UNIQUE_NAME}. Make sure the “Use Oracle-Managed Files (OMF)” check
box is selected and click Next.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

76 Practices for Lesson 3: Grid Infrastructure Overview


10. On the Select Fast Recovery Option, make the following adjustments:
 Fast Recovery Area: +FRA
 Fast Recovery Area Size: 8100
Click Next to continue.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 3: Grid Infrastructure Overview 77


11. On the Select Oracle Data Vault Config Option page, click Next.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

78 Practices for Lesson 3: Grid Infrastructure Overview


12. On the Specify Configuration Options page, set Memory Size (SGA and PGA) to around
3000. Click the Sample Schemas folder tab.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 3: Grid Infrastructure Overview 79


13. Click the “Add sample schemas to the database” check box and click Next.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

80 Practices for Lesson 3: Grid Infrastructure Overview


14. Click Yes to dismiss the dialog box.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 3: Grid Infrastructure Overview 81


15. On the Management Options screen, uncheck Run Cluster Verification Utility (CVU) Checks
Periodically. Ensure Configure EM Database Express is checked and accept the default
port value of 5500. Click next to continue.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

82 Practices for Lesson 3: Grid Infrastructure Overview


16. On the Specify database User Credentials page, click the “Use the same administrative
password for all accounts” button. Enter the sys password (please refer to the Course
Practice Environment: Security Credentials page for account passwords) in both the
Password and Confirm Password fields and click Next.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 3: Grid Infrastructure Overview 83


17. On the Select Database Creation Options page, make sure the “Create database” check
box is selected and click Next.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

84 Practices for Lesson 3: Grid Infrastructure Overview


18. Wait while a series of prerequisite checks are performed.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 3: Grid Infrastructure Overview 85


19. On the Summary page, review the information and click Finish.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

86 Practices for Lesson 3: Grid Infrastructure Overview


20. Wait a few moments and follow the database creation process on the Progress Page. It
takes about 20min to complete the rest of steps (step 19 ~ step 25).
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 3: Grid Infrastructure Overview 87


21. On the Finish page, click the “Password Management” button.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

88 Practices for Lesson 3: Grid Infrastructure Overview


22. Select the HR account and enter the HR password (please refer to the Course Practice
Environment: Security Credentials page for account passwords) in the New Password
and Confirm Password fields, click the Lock Account field to unlock the account and click
OK.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 3: Grid Infrastructure Overview 89


23. Click Yes to dismiss the dialog box.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

90 Practices for Lesson 3: Grid Infrastructure Overview


24. Click Close to dismiss DBCA.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
a no
h a s
m ) ideฺ
l e ฺco t Gu
o rac uden
a @ S t
o an thi s
e ฺ
n use
( c arm se to
a n a oracle
25. Return to the
c e nterminal and check the database status and configuration details with
O
SRVCTL. li
n
rme[oracle@host01 ~]$ srvctl status database -db orcl
Ca Instance orcl_1 is running on node host02
Instance orcl_2 is running on node host03
Instance orcl_3 is running on node host01

[oracle@host01 ~]$ srvctl config database -db orcl


Database unique name: orcl
Database name: orcl
Oracle home: /u01/app/oracle/product/12.2.0/dbhome_1
Oracle user: oracle
Spfile: +DATA/ORCL/PARAMETERFILE/spfile.297.958993403
Password file: +DATA/ORCL/PASSWORD/pwdorcl.284.958993065
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY

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

Practices for Lesson 3: Grid Infrastructure Overview 91


Management policy: AUTOMATIC
Server pools: orcldb
Disk Groups: FRA,DATA
Mount point paths:
Services:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Type: RAC
Start concurrency:
Stop concurrency:
OSDBA group: dba
OSOPER group: oper
Database instances:
Configured nodes:
CSS critical: no
a b le
CPU count: 0 f e r
an s
Memory target: 0
n - t r
Maximum memory: 0 o
Default network number for database services:
s an
Database is policy managed ) ha eฺ
ฺ c om Guid
[oracle@host01 ~]$
r a cle ent
a @ o
S tud
26. Close all terminals opened for a
o n practice.
this
t h is
e nฺ use
( c arm se to
a na licen
e nO
rm
Ca

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

92 Practices for Lesson 3: Grid Infrastructure Overview


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
a no
h a s
Practices for
m ) ideฺ 4:
Lesson
Oracle
l e ฺcoRAC
t G u
Administration
o rac uden
a @ S t
o an thi s
e ฺ
n use
( c arm se to
ana licen
n O
r m e
C a
Practices for Lesson 4: Overview

Overview
In this practice, you will make the local and remote connections to contrast operating system
and password file authentication.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

In this practice, you will make multiple Oracle database authenticated connections to a
database instance and notice the effects of load-balanced connections.
In this practice, you will use the srvctl utility to stop all resource components executing from a
single Oracle home location.
In this practice, you will configure leaf nodes to run read-only instances.
In this practice, you will work with local temporary tablespaces on read-write and read-only
instances.
a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

94 Practices for Lesson 4: Oracle RAC Administration


Practice 4-1: Operating System and Password File Authenticated
Connections

Overview
In this practice, you will make the local and remote connections to contrast operating system
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

and password file authentication.


1. Connect to your first node as the oracle user and update the /etc/oratab file.
[oracle@dns ~]$ ssh oracle@host01
oracle@host01's password:

[oracle@host01 ~]$ vi /etc/oratab

a ble
***** Add the orcl entry at the end ***** f e r
ans
...
n - t r
orcl:/u01/app/oracle/product/12.2.0/dbhome_1:N
a no
h a s
:wq!
m ) ideฺ
l e ฺco t Gu
rac uden
[oracle@host01 ~]$

@ o t
a s S
an by using
2. Set up your environment variables
ฺ o t hi the oraenv script.
n
[oracle@host01e ~]$ . uoraenvs e
r m t o
a (ca =n[oracle]
ORACLE_SID
s e ? orcl

O an Oracle
The
licebase remains unchanged with value /u01/app/oracle
n
rme [oracle@host01 ~]$
Ca
3. Identify all the database instance names that are currently executing on your machine by
using the Linux ps command.
Note: All database instances have a mandatory background process named pmon, and the
instance name will be part of the complete process name.
[oracle@host01 ~]$ ps -ef | grep -i pmon
grid 13193 1 0 Nov01 ? 00:00:07 mdb_pmon_-MGMTDB
oracle 21316 17541 0 12:36 pts/5 00:00:00 grep -i pmon
oracle 25617 1 0 11:04 ? 00:00:00 ora_pmon_orcl_3
grid 31287 1 0 Nov01 ? 00:00:07 asm_pmon_+ASM1

[oracle@host01 ~]$

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

Practices for Lesson 4: Oracle RAC Administration 95


4. Attempt to make a local connection to the orcl_n instance by using SQL*Plus with the
sysdba privilege. This is known as operating system authentication because a password is
not needed. What happens when you are trying to connect to the instance?
[oracle@host01 ~]$ sqlplus / as sysdba
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

SQL*Plus: Release 12.2.0.1.0 Production on Thu Nov 2 12:40:20


2017

Copyright (c) 1982, 2016, Oracle. All rights reserved.

Connected to an idle instance.

SQL> exit
a b le
Disconnected f e r
an s
[oracle@host01 ~]$
n - t r
a no
5. Attempt to connect to the instance by using a network connectionsstring @orcl with the
) ha Is the
sysdba privilege. This is known as password file authentication. e ฺconnection
m i d
successful this time?
l e ฺco t Gu
[oracle@host01 ~]$ sqlplus sys@orcl
o rac udas ensysdba
a @ S t
SQL*Plus: Release o 12.2.0.1.0 s
an thi Production on Thu Nov 2 12:43:09
2017 e ฺ
n use
( c arm se to
na lic(c)
Copyright
a en 1982, 2016, Oracle. All rights reserved.
e n OEnter password: **** << Password is not displayed
rm
Ca
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 -
64bit Production

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release
12.2.0.1.0 - 64bit Production
[oracle@host01 ~]$

6. Display the values of the environment variables (ORACLE_BASE, ORACLE_HOME,


ORACLE_SID, and so on) that were defined with the oraenv script in step 2.
[oracle@host01 ~]$ env | grep ORA
ORACLE_SID=orcl
ORACLE_BASE=/u01/app/oracle

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

96 Practices for Lesson 4: Oracle RAC Administration


ORACLE_HOME=/u01/app/oracle/product/12.2.0/dbhome_1
[oracle@host01 ~]$

7. Modify the ORACLE_SID environment variable to match the actual database instance name
for the orcl database.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

[oracle@host01 ~]$ export ORACLE_SID=orcl_3


[oracle@host01 ~]$

8. Attempt the local connection with system authentication to the local instance by using
SQL*Plus with the sysdba privilege. This is the same command as in step 4.
[oracle@host01 ~]$ sqlplus / as sysdba
le
SQL*Plus: Release 12.2.0.1.0 Production on Thu Nov 2 12:46:41fe
rab
a n s
2017
n -t r
o
Copyright (c) 1982, 2016, Oracle. All rights reserved.
s an
) ha eฺ
ฺ c om Guid
Connected to:
r a cle ent
Oracle Database 12c Enterprise
64bit Production a @ S tud Release 12.2.0.1.0 -
o Edition
o a n this
e nฺ use
arm se to
SQL>
( c
a nainstance_name
l i c en column of the v$instance dynamic performance view to
n O the instance that you connected with. Exit SQL*Plus when finished.
9. Query the

rm evalidate

Ca SQL> select instance_name from v$instance;

INSTANCE_NAME
----------------
orcl_3

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release
12.2.0.1.0 - 64bit Production
[oracle@host01 ~]$

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

Practices for Lesson 4: Oracle RAC Administration 97


Practice 4-2: Oracle Database Authenticated Connections

Overview
In this practice, you will make multiple Oracle database authenticated connections to a
database instance and notice the effects of load-balanced connections.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

1. From your first node, connected as the oracle user, validate the instance names on each
host.
[oracle@host01 ~]$ srvctl status database -db orcl
Instance orcl_1 is running on node host02
Instance orcl_2 is running on node host03
Instance orcl_3 is running on node host01
a b le
f e r
[oracle@host01 ~]$ an s
n - t r
a no
2.
h a s
Connect to a database instance by using SQL*Plus with the system account. This is
) ideฺ
known as Oracle database authentication. After it is connected, query the instance_name
m
l e ฺco t Gu
column from the v$instance dynamic performance view.
aconesddisplayed
Note: Your instance names may vary fromrthe
o e n below:
[oracle@host01 ~]$ sqlplus a @ S tu
system@orcl
o an thi s
e ฺ e Production on Thu Nov 2 12:53:59
n 12.2.0.1.0
s
SQL*Plus: Release u
2017
( c arm se to
a na licen
e n OCopyright (c) 1982, 2016, Oracle. All rights reserved.
rm
Ca Enter password: ***** << Password is not displayed

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 -
64bit Production

SQL> select instance_name from v$instance;

INSTANCE_NAME
----------------
orcl_2

SQL>

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

98 Practices for Lesson 4: Oracle RAC Administration


3. Use the SQL*Plus host command to temporarily exit SQL*Plus and return to the operating
system prompt.
Note: SQL*Plus is still running when this is performed. Repeat the previous step from the
operating system prompt to establish a second SQL*Plus session and database instance
connection. What instance name did you connect to?
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

SQL> host
[oracle@host01 ~]$ sqlplus system@orcl

SQL*Plus: Release 12.2.0.1.0 Production on Thu Nov 2 12:53:59


2017

Copyright (c) 1982, 2016, Oracle. All rights reserved.

Enter password: ***** << Password is not displayed a ble


f e r
ans
Connected to:
n - t r
64bit Production a no
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 -

h a s
SQL> select instance_name from v$instance; m ) ideฺ
l e ฺco t Gu
INSTANCE_NAME
o rac uden
----------------
a @ S t
orcl_1 o an thi s
e ฺ
n use
SQL>
( c arm se to
a na licen
n Othe SQL*Plus host command to temporarily exit SQL*Plus and return to the operating
4. Use
e
rm system prompt.
Ca Note: SQL*Plus is still running when this is performed. Validate that you are still on your
first node. Repeat the previous step from the operating system prompt to establish a third
SQL*Plus session and database instance connection. What instance name did you connect
to?
SQL> host
[oracle@host01 ~]$ sqlplus system@orcl

SQL*Plus: Release 12.2.0.1.0 Production on Thu Nov 2 12:53:59


2017

Copyright (c) 1982, 2016, Oracle. All rights reserved.

Enter password: ***** << Password is not displayed

Connected to:

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

Practices for Lesson 4: Oracle RAC Administration 99


Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 -
64bit Production

SQL> select instance_name from v$instance;

INSTANCE_NAME
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

----------------
orcl_3

SQL>

5. Exit the three SQL*Plus sessions that are currently executing on the first node.
SQL> exit a b le
f e r
Disconnected from Oracle Database 12c Enterprise Edition Release
an s
12.2.0.1.0 - 64bit Production
n - t r
a no
[oracle@host01 ~]$ exit
h a s
exit
m ) ideฺ
l e ฺ co t Gu
SQL> exit
r a c e n
o
Disconnected from Oracle Databasetu d
12c Enterprise Edition Release
a @ s S
ฺ o an thi
12.2.0.1.0 - 64bit Production

e n use
r
[oracle@host01
a m toexit
~]$
exit
a (c nse
a n lice
O
n SQL> exit
r m e
C a Disconnected from Oracle Database 12c Enterprise Edition Release
12.2.0.1.0 - 64bit Production
[oracle@host01 ~]$

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

100 Practices for Lesson 4: Oracle RAC Administration


Practice 4-3: Stopping a Complete ORACLE_HOME Component Stack

Overview
In this practice, you will use the srvctl utility to stop all resource components executing from a
single Oracle home location.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

1. Validate that the instances are running on each node of the cluster using the ps command.
Note: The instance locations (-MGMTDB, orcl_<n>, and +ASM<n>) may be different.
[oracle@host01 ~]$ ps -ef|grep -i pmon
grid 13193 1 0 Nov01 ? 00:00:07 mdb_pmon_-MGMTDB
oracle 25617 1 0 11:04 ? 00:00:00 ora_pmon_orcl_3
oracle 27849 17541 0 12:59 pts/5 00:00:00 grep -i pmon
grid 31287 1 0 Nov01 ? 00:00:07 asm_pmon_+ASM1 a ble
f e r
ans
[oracle@host01 ~]$ ssh host02 ps -ef|grep -i pmon
n - t r
oracle 3335 1 0 11:04 ? no
00:00:00 ora_pmon_orcl_1
a
grid 18628 1 0 Nov01 ? s
00:00:07 asm_pmon_+ASM3
h a
m ) ideฺ
[oracle@host01 ~]$ ssh host03 ps -ef|grep
l e ฺco t G-iu pmon
grid 9786 1 0 Nov01a?c n00:00:07 asm_pmon_+ASM2
oracle 25000 1 0@ o r
11:04 ? tu d e 00:00:00 ora_pmon_orcl_2
a s S
ฺ o an thi
[oracle@host01e~]$ n use
( c arm se to
a nasyntax
2. Display the
l i c en help for the srvctl status home command.
usage

e n O[oracle@host01 ~]$ srvctl status home -help


rm
Ca Displays the current state of of all resources for the Oracle
home.

Usage: srvctl status home -oraclehome <oracle_home> -statefile


<state_file> -node <node_name>
-oraclehome <path> Oracle home path
-statefile <state_file> Specify a file path for the
srvctl status home command to store the state of the resources
-node <node_name> Node name
-help Print usage
[oracle@host01 ~]$

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

Practices for Lesson 4: Oracle RAC Administration 101


3. Use the srvctl status home command to check the state of all resources running from
the /u01/app/oracle/product/12.2.0/dbhome_1 home location. Create the
required state file in the /tmp directory with the file name host01_dbhome_state1.dmp
for the first node only.
[oracle@host01 ~]$ srvctl status home -oraclehome
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

/u01/app/oracle/product/12.2.0/dbhome_1 -statefile
/tmp/host01_dbhome_state1.dmp -node host01
Database orcl is running on node host01

[oracle@host01 ~]$

4. Display the syntax usage help for the srvctl stop home command.
[oracle@host01 ~]$ srvctl stop home -help a b le
f e r
an s
Stops all Oracle clusterware resources that run from the Oracle
n - t r
home.
a no
h a s
Usage: srvctl stop home -oraclehome <oracle_home>
m d e ฺ -statefile
) <stop_options>]
<state_file> -node <node_name> [-stopoption
ฺ c o Gu i [-
force]
r a cle Oracle
e n t
-oraclehome <path> o t u d home path
a
-statefile <state_file>
n @ s S Specify a file path for the
o a
srvctl stop home command t
to h i
store the state of the resources
n ฺ e
r m e
-node <node_name>
t o us Node name

a (caExamples
-stopoption
n s e<stop_options> Stop options for the
an lice IMMEDIATE, or ABORT. are NORMAL,
database. of shutdown options

n O
TRANSACTIONAL,

r m e -force Force stop


C a -help Print usage

[oracle@host01 ~]$

5. Stop all resources executing from /u01/app/oracle/product/12.2.0/dbhome_1. Do


not use the optional parameters identified by square brackets “[]” displayed in the syntax
usage help.
[oracle@host01 ~]$ srvctl stop home -oraclehome
/u01/app/oracle/product/12.2.0/dbhome_1 -node host01 -statefile
/tmp/host01_dbhome_state2.dmp

[oracle@host01 ~]$

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

102 Practices for Lesson 4: Oracle RAC Administration


6. Check the status of the database instances on each node. .
[oracle@host01 ~]$ srvctl status database -db orcl
Instance orcl_1 is running on node host02
Instance orcl_2 is running on node host03
Instance orcl_3 is not running on node host01
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

[oracle@host01 ~]$

7. Start all resources for the /u01/app/oracle/product/12.2.0/dbhome_1 home using


the state file created by the stop command.
[oracle@host01 ~]$ srvctl start home -oraclehome
/u01/app/oracle/product/12.2.0/dbhome_1 -node host01 -statefile
/tmp/host01_dbhome_state2.dmp
a ble
f e r
[oracle@host01 ~]$
ans
n - t r
8. a no
Check the status of the database instances on each node. What do you observe?
[oracle@host01 ~]$ srvctl status database h a
-db
s orcl
m ) ideฺ
Instance orcl_1 is running on node host02 o Gu
ฺchost03
Instance orcl_2 is running on node c l e n t
Instance orcl_3 is running oon nodeud r a e
a @ S t host01
o a n this
[oracle@host01 ~]$
e nฺ use
a
The instance (orcl_3
c rm in ethistoexample) on host01 was restored back to the original state
(
na liceninsthe host01_dbhome_state2.dmp file.
using the information
a
n O
rm e
9. Close all terminal windows opened for this practice.
Ca

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

Practices for Lesson 4: Oracle RAC Administration 103


Practice 4-4: Configuring Leaf Nodes to run Read-Only Instances

Overview
In this practice, you will configure leaf nodes to run read-only instances.
1. Open a terminal to connect to host01 as the root user. Check the network resource with
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

crsctl.
[oracle@dns ~]$ ssh root@host01
root@host01's password:

[root@host01 ~]# . oraenv


ORACLE_SID = [root] ? +ASM1
The Oracle base has been set to /u01/app/grid
a b le
[root@host01 ~]#
f e r
[root@host01 ~]# crsctl stat res –t | more
an s
n - t r
no
------------------------------------------------------------------
a
Name Target State Server
h a s State details
) ideฺ
------------------------------------------------------------------
m
Local Resources
l e ฺco t Gu
rac uden
------------------------------------------------------------------
o
ora.ASMNET1LSNR_ASM.lsnr a@ S t
o anONLINEthi s
e n ฺ
ONLINE
s e host01 STABLE

a r mONLINEto uONLINE host02 STABLE

a (c nONLINE
se ONLINE host03 STABLE
an lic e
O
ora.DATA.dg

rm en ONLINE ONLINE host01 STABLE


Ca ONLINE ONLINE host02 STABLE
ONLINE ONLINE host03 STABLE
ora.FRA.dg
ONLINE ONLINE host01 STABLE
ONLINE ONLINE host02 STABLE
ONLINE ONLINE host03 STABLE
ora.LISTENER.lsnr
ONLINE ONLINE host01 STABLE
ONLINE ONLINE host02 STABLE
ONLINE ONLINE host03 STABLE
ora.LISTENER_LEAF.lsnr
OFFLINE OFFLINE host04 STABLE
OFFLINE OFFLINE host05 STABLE

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

104 Practices for Lesson 4: Oracle RAC Administration


ora.MGMT.dg
ONLINE ONLINE host01 STABLE
ONLINE ONLINE host02 STABLE
ONLINE ONLINE host03 STABLE
ora.chad
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

ONLINE ONLINE host01 STABLE


ONLINE ONLINE host02 STABLE
ONLINE ONLINE host03 STABLE
ONLINE ONLINE host04 STABLE
ONLINE ONLINE host05 STABLE
ora.net1.network
ONLINE ONLINE host01 STABLE
a b le
e r
ONLINE ONLINE host02 sf
STABLE
a n
ONLINE ONLINE
no
host03
n-trSTABLE
...
s a
h a
) ideฺ
[root@host01 ~]# m
l e ฺco t Gu
o rac touhost04
2. As the root user, extend the network resource d en and host05 using SRVCTL.
Recheck the network resource. a@ S t
o anmodifyt s
hinetwork -netnum 1 -extendtoleaf

en us
[root@host01 ~]# srvctl e
yes r m
a se to
( c
na lic~]#
[root@host01
a en crsctl stat res ora.net1.network -t
O
n---------------------------------------------------------------
rm e
Ca Name Target State Server State details
---------------------------------------------------------------
Local Resources
---------------------------------------------------------------
ora.net1.network
ONLINE ONLINE host01 STABLE
ONLINE ONLINE host02 STABLE
ONLINE ONLINE host03 STABLE
OFFLINE OFFLINE host04 STABLE
OFFLINE OFFLINE host05 STABLE
---------------------------------------------------------------

[root@host01 ~]#

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

Practices for Lesson 4: Oracle RAC Administration 105


3. Check the host VIPs on host01, host02, host03, host04, and host05 using SRVCTL.
[root@host01 ~]# srvctl status vip -node host01
VIP 192.0.2.254 is enabled
VIP 192.0.2.254 is running on node: host01
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

[root@host01 ~]# srvctl status vip -node host02


VIP 192.0.2.231 is enabled
VIP 192.0.2.231 is running on node: host02

[root@host01 ~]# srvctl status vip -node host03


VIP 192.0.2.220 is enabled
VIP 192.0.2.220 is running on node: host03
a b le
f e r
an s
[root@host01 ~]# srvctl status vip -node host04
n - t r
PRKO-2165 : VIP does not exist on node(s) : host04
a no
h a s
[root@host01 ~]# srvctl status vip -node host05
m ) ideฺ
PRKO-2165 : VIP does not exist on node(s)
l e ฺco t: Ghost05
u
o r ac den
[root@host01 ~]#
a @ S tu
o an thi s
e ฺ
n resources
s eto host04 and host05 using SRVCTL and check
4. As the root user, add VIP u
rmVIPs.e Note:
to Since we chose the “Configure nodes Virtual IPs as
( c anew
ens Networks” option during the Grid Infrastructure installation, the -
the status of the
a
assigned nbya theliDynamic
c
e n O option is not allowed.
address
rm
Ca [root@host01 ~]# srvctl add vip -node host04 -netnum 1 -address
host04-vip/255.255.255.0
PRCR-1170 : Failed to add resource ora.host04.vip
PRCN-3028 : VIP ipv4 address modification is not allowed because
the network type is "dhcp"

[root@host01 ~]# srvctl add vip -node host04 -netnum 1

[root@host01 ~]# srvctl add vip -node host05 -netnum 1

[root@host01 ~]# srvctl status vip -node host04


VIP host04 is enabled
VIP host04 is not running

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

106 Practices for Lesson 4: Oracle RAC Administration


[root@host01 ~]# srvctl status vip -node host05
VIP host05 is enabled
VIP host05 is not running

[root@host01 ~]#
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

5. Start the VIPs on host04 and host05. Check the VIP and Network resource status. Both
should be up.
[root@host01 ~]# srvctl start vip -node host04

[root@host01 ~]# srvctl start vip -node host05

a ble
[root@host01 ~]# crsctl stat res -t f e r
ans
n - t r
no details
----------------------------------------------------------------
a
Name Target State
h a s State Server
) ideฺ
----------------------------------------------------------------
m
Local Resources
l e ฺco t Gu
rac uden
----------------------------------------------------------------
o
ora.ASMNET1LSNR_ASM.lsnr a@ S t
o anONLINEthi s
e n ฺ
ONLINE
s e host01 STABLE

r mONLINE
t o uONLINE host02 STABLE
a
(c nONLINE
se ONLINE host03 STABLE
n a e
a
ora.DATA.dg
O lic
rm en ONLINE ONLINE host01 STABLE
Ca ONLINE ONLINE host02 STABLE
ONLINE ONLINE host03 STABLE
ora.FRA.dg
ONLINE ONLINE host01 STABLE
ONLINE ONLINE host02 STABLE
ONLINE ONLINE host03 STABLE
ora.LISTENER.lsnr
ONLINE ONLINE host01 STABLE
ONLINE ONLINE host02 STABLE
ONLINE ONLINE host03 STABLE
ora.LISTENER_LEAF.lsnr
OFFLINE OFFLINE host04 STABLE
OFFLINE OFFLINE host05 STABLE

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

Practices for Lesson 4: Oracle RAC Administration 107


ora.MGMT.dg
ONLINE ONLINE host01 STABLE
ONLINE ONLINE host02 STABLE
ONLINE ONLINE host03 STABLE
ora.chad
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

ONLINE ONLINE host01 STABLE


ONLINE ONLINE host02 STABLE
ONLINE ONLINE host03 STABLE
ONLINE ONLINE host04 STABLE
ONLINE ONLINE host05 STABLE
ora.net1.network
ONLINE ONLINE host01 STABLE a b le
f e r
ONLINE ONLINE host02 STABLE
a n s
ONLINE ONLINE host03 t r
n-STABLE
ONLINE ONLINE
a no STABLE host04
ONLINE ONLINE host05 has STABLE
) ฺ
...
ฺ c om Guide
r a cle ent
---------------------------------------------------------------
Cluster Resources
a @ o
S tud
a n this
---------------------------------------------------------------
o
e nฺ use
ora.LISTENER_SCAN1.lsnr
1
( c armONLINE
s e to ONLINE host03 STABLE
na licen
ora.LISTENER_SCAN2.lsnr
a
O 1
rm en ONLINE ONLINE host02 STABLE

Ca
ora.LISTENER_SCAN3.lsnr
1 ONLINE ONLINE host01 STABLE

...

ora.host01.vip
1 ONLINE ONLINE host01 STABLE
ora.host02.vip
1 ONLINE ONLINE host02 STABLE
ora.host03.vip
1 ONLINE ONLINE host03 STABLE
ora.host04.vip
1 ONLINE ONLINE host04 STABLE

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

108 Practices for Lesson 4: Oracle RAC Administration


ora.host05.vip
1 ONLINE ONLINE host05 STABLE
...

[root@host01 ~]#
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

6. Open a terminal to connect to host01 as the grid user and set the environment. Check
listener status for the cluster. You will need to extend listeners to the leaf nodes and start
them.
[oracle@dns ~]$ ssh grid@host01
grid@host01's password:
a ble
f e r
[grid@host01 ~]$ . oraenv
ans
ORACLE_SID = [grid] ? +ASM1 n - t r
The Oracle base has been set to /u01/app/grid a no
h a s
) ideฺ
[grid@host01 ~]$ srvctl status listenerom
l e ฺ c t Gu
Listener LISTENER is enabled
o r ac den
Listener LISTENER is running
a @ tu host02,host03, host01
on node(s):
S
o an thi s

n umodify
[grid@host01 ~]$esrvctl s e listener -listener LISTENER -
m to
aryes
a ( c
extendtoleaf
n se
an e
lic~]$ srvctl start listener -listener LISTENER -node
O
rm en[grid@host01
host04
Ca
[grid@host01 ~]$ srvctl start listener -listener LISTENER -node
host05

[grid@host01 ~]$ srvctl status listener


Listener LISTENER is enabled
Listener LISTENER is running on node(s):
host02,host03,host01,host04,host05

[grid@host01 ~]$

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

Practices for Lesson 4: Oracle RAC Administration 109


7. Open a terminal to connect to host01 as the oracle user to edit the /etc/oratab file
on host01. Add five lines for instances orcl_1, orcl_2, orcl_3, orcl_4, and orcl_5
as shown below. Repeat this on host02, host03, host04, and host05. If you prefer,
you can add them using the /stage/RAC/labs/less_04/oratab_upd.sh script.
[oracle@dns ~]$ ssh oracle@host01
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

oracle@host01’s password:

[oracle@host01 ~]$ vi /etc/oratab

# This file is used by ORACLE utilities. It is created by


root.sh
# and updated by either Database Configuration Assistant while
a b le
creating f e r
an s
# a database or ASM Configuration Assistant while creating ASM
n - t r
instance.
a no
h a s
) ideAฺ new line
# A colon, ':', is used as the field terminator.
m
terminates
l e ฺco t Gu
# the entry. Lines beginning with
r a c a pound
e n sign, '#', are
comments. o tu d
a @ s S
#
ฺ o an thi
n form:
# Entries are ofethe
u s e
# c arm se to
$ORACLE_SID:$ORACLE_HOME:<N|Y>:
(
#
ana licen
O
rm en# The first and second fields are the system identifier and home
Ca # directory of the database respectively.
indicates
The third field

# to the dbstart utility that the database should , "Y", or


should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
+ASM1:/u01/app/12.2.0/grid:N # line added by Agent
-MGMTDB:/u01/app/12.2.0/grid:N
orcl:/u01/app/oracle/product/12.2.0/dbhome_1:N
orcl_1:/u01/app/oracle/product/12.2.0/dbhome_1:N
orcl_2:/u01/app/oracle/product/12.2.0/dbhome_1:N

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

110 Practices for Lesson 4: Oracle RAC Administration


orcl_3:/u01/app/oracle/product/12.2.0/dbhome_1:N
orcl_4:/u01/app/oracle/product/12.2.0/dbhome_1:N
orcl_5:/u01/app/oracle/product/12.2.0/dbhome_1:N

**** Save file and Repeat for host02, host03, host04, and host06
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

*****
OR
**** You can use the oratab_upd.sh script to add the entries
******

[oracle@host01 ~]$ /stage/RAC/labs/less_04/oratab_upd.sh

a ble
[oracle@host01 ~]$ f e r
ans
n - t r
8.
a no
As the oracle user, check and see which orcl instance is running on host01. In this
a s
example, the instance is orcl_3. Set the environment for that instance.
h
m ) server
d e ฺpool.
 Add a database service called OLTPSVC using the
ฺ co t Gu
orcldb i
l e
o r ac RACLEAF.
 Add a server pool for the leaf nodes called
d e n
 Add a service for the leaf nodes@
a tu using the RACLEAF pool.
called LEAFSVC
S
[oracle@host01 ~]$ ฺps o a-ef|grep s
n thiora_smon
oracle 9054me
n se
5263 0u08:02 pts/5 00:00:00 grep ora_smon
a r t
c nse1 0 Nov02 ?o
oracle
a (32060 00:00:04 ora_smon_orcl_3
an lic e
O
n[oracle@host01 ~]$ . oraenv
rme
Ca ORACLE_SID = [oracle] ? orcl_3
The Oracle base has been set to /u01/app/oracle

[oracle@host01 ~]$ srvctl add service -db orcl -service OLTPSVC


-serverpool orcldb
[oracle@host01 ~]$ srvctl add srvpool -serverpool RACLEAF -
category LEAF
[oracle@host01 ~]$ srvctl add service -db orcl -service LEAFSVC
-rfpool RACLEAF

[oracle@host01 ~]$

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

Practices for Lesson 4: Oracle RAC Administration 111


9. Check the status of the new services. Start them using SRVCTL. It will take a few moments
for the LEAFSVC service to start as starting it will cause database instances to start on
host04 and host05. Recheck the status of the new services and check the status of the
orcl database.
[oracle@host01 ~]$ srvctl status service -db orcl
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Service LEAFSVC is not running.


Service OLTPSVC is not running.

[oracle@host01 ~]$ srvctl start service -db orcl -service


OLTPSVC

[oracle@host01 ~]$ srvctl start service -db orcl -service


a b le
LEAFSVC
f e r
an s
n - t r
[oracle@host01 ~]$ srvctl status service -db orcl
a no
Service LEAFSVC is running on nodes: host04,host05
h a s
) ideฺ
Service OLTPSVC is running on nodes: host02,host03,host01
m
l e ฺco t Gu
[oracle@host01 ~]$
o rac uden
a @ S t
o anSQL*Plus
t s
hi and run the query shown below to check this.

en us
10. From your oracle terminal, start e
r m
a ~]$ to
( c
[oracle@host01
s esqlplus / as sysdba

a na licen
O
nSQL*Plus: Release 12.2.0.1.0 Production on Fri Nov 3 08:13:53
e
rm 2017
Ca
Copyright (c) 1982, 2016, Oracle. All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 -
64bit Production

SQL> col host_name for a20

SQL> select instance_name, host_name, status, database_status,


instance_mode from gv$instance order by 1;

INSTANCE_NAME HOST_NAME STATUS DATABASE_STATUS NSTANCE_MO


------------- ------------------- -------- ---------------- -----------
orcl_1 host02.example.com OPEN ACTIVE REGULAR

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

112 Practices for Lesson 4: Oracle RAC Administration


orcl_2 host03.example.com OPEN ACTIVE REGULAR
orcl_3 host01.example.com OPEN ACTIVE REGULAR
orcl_4 host04.example.com OPEN ACTIVE REGULAR
orcl_5 host05.example.com OPEN ACTIVE REGULAR
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

SQL>

Note that the instances on host04 and host05 are NOT open read-only.

11. Setting up reader nodes manually as you have done does not set the
rf_node.instance_mode parameter to read-only. You will have to do this using
a ble
SQL*Plus. In addition, set the parameter _read_mostly_enable_logon to true to allow
f e r
non-privileged users to logon to read-only instances. When finished, use SRVCTL to stop
ans
and then restart the database.
n - t r
a no
SQL> alter system set instance_mode='read-only' family='rf_node'
scope=spfile;
h a s
m ) ideฺ
l e ฺco t Gu
rac uden
System altered.

@ o t
a s S
ฺ o an thi
SQL> alter system set "_read_mostly_enable_logon"=true
scope=spfile;
e n use
( c arm se to
System a
an altered.
l i c en
O
rm en SQL> exit
Ca Disconnected from Oracle Database 12c Enterprise Edition Release
12.2.0.1.0 - 64bit Production

[oracle@host01 ~]$ srvctl stop database -db orcl

[oracle@host01 ~]$ srvctl start database -db orcl


[oracle@host01 ~]$

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

Practices for Lesson 4: Oracle RAC Administration 113


12. Check which instance has been started on host01. It will most likely be different from the
one running there before the database was bounced. Set the environment for that instance,
restart SQL*Plus and re-run the query against gv$instance you ran earlier. What do you
see?
[oracle@host01 ~]$ ps -ef|grep ora_smon
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

oracle 16948 1 0 08:27 ? 00:00:00 ora_smon_orcl_5


oracle 17662 5263 0 08:28 pts/5 00:00:00 grep ora_smon

[oracle@host01 ~]$ . oraenv


ORACLE_SID = [orcl_3] ? orcl_5
The Oracle base remains unchanged with value /u01/app/oracle

a b le
[oracle@host01 ~]$ sqlplus / as sysdba f e r
an s
n - t r
no
SQL*Plus: Release 12.2.0.1.0 Production on Fri Nov 3 08:29:50
a
2017
h a s
m ) ideฺ
Copyright (c) 1982, 2016, Oracle. e
l ฺcorights
All
t G ureserved.
o rac uden
a @ S t
Connected to:
o s
an thiEdition Release 12.2.0.1.0
e ฺ
n use
Oracle Database 12c Enterprise -

( c arm se to
64bit Production

na licen for a20


SQL>acol host_name
O
rm en
Ca SQL> select instance_name, host_name, status, database_status,
instance_mode from gv$instance order by 1;

INSTANCE_NAME HOST_NAME STATUS DATABASE_STATUS NSTANCE_MO


------------- ------------------- ------- ---------------- -----------
orcl_1 host04.example.com OPEN ACTIVE READ ONLY
orcl_2 host05.example.com OPEN ACTIVE READ ONLY
orcl_3 host02.example.com OPEN ACTIVE REGULAR
orcl_4 host03.example.com OPEN ACTIVE REGULAR
orcl_5 host01.example.com OPEN ACTIVE REGULAR

Note that database instances on host04 and host05 are now correctly running in read-only
mode.

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

114 Practices for Lesson 4: Oracle RAC Administration


SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release
12.2.0.1.0 - 64bit Production

[oracle@host01 ~]$
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

13. Next, let’s quickly test the services. Edit


$ORACLE_HOME/network/admin/tnsnames.ora and add connect strings for the
OLTPSVC and LEAFSVC services at the bottom of the file as shown below. If you prefer, you
can add them using the /stage/RAC/labs/less_04/add_svcs_tns.sh script.
Test them with tnsping.
[oracle@host01 ~]$ vi $ORACLE_HOME/network/admin/tnsnames.ora
a ble
# tnsnames.ora Network Configuration File: f e r
/u01/app/oracle/product/12.2.0/dbhome_1/network/admin/tnsnames.ora ans
n - t r
# Generated by Oracle configuration tools. o
… s an
ORCL = ) ha eฺ
(DESCRIPTION = ฺ c om Guid
r a cle e= ncluster01-
(ADDRESS = (PROTOCOL = TCP)(HOST
t
@
scan.cluster01.example.com)(PORT S ud
o = t1521))
= an
a is
(CONNECT_DATA o t h
(SERVER e
nฺ use
= DEDICATED)
( c arm se to = orcl)
(SERVICE_NAME
ana) licen
O
rm en )
Ca
OLTPSVC = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST =
cluster01-scan.cluster01.example.com)(PORT = 1521))(LOAD_BALANCE =
YES)(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = oltpsvc)))

LEAFSVC = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST =


cluster01-scan.cluster01.example.com)(PORT = 1521))(LOAD_BALANCE =
YES)(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = leafsvc)))

**** Or add then by executing /stage/RAC/labs/less_04/add_svcs_tns.sh


****

[oracle@host01 ~]$ /stage/RAC/labs/less_04/add_svcs_tns.sh

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

Practices for Lesson 4: Oracle RAC Administration 115


[oracle@host01 ~]$ tnsping oltpsvc
...
Used parameter files:

Used TNSNAMES adapter to resolve the alias


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL =


TCP)(HOST = cluster01-scan.cluster01.example.com)(PORT =
1521))(LOAD_BALANCE = YES)(CONNECT_DATA = (SERVER =
DEDICATED)(SERVICE_NAME = oltpsvc)))
OK (30 msec)

[oracle@host01 ~]$ tnsping leafsvc


a b le
...
f e r
Used parameter files: an s
n - t r
a no
Used TNSNAMES adapter to resolve the alias
h a s
Attempting to contact (DESCRIPTION = (ADDRESS
m = ฺ
) id(PROTOCOL
e =

l e ฺ co t Gu
TCP)(HOST = cluster01-scan.cluster01.example.com)(PORT =

rac ude=n (SERVER =


1521))(LOAD_BALANCE = YES)(CONNECT_DATA
o
DEDICATED)(SERVICE_NAME = leafsvc)))
a @ S t
OK (40 msec)
o an thi s
e ฺ
n use
[oracle@host01
( c arm~]$ e to
ana licens
n Osome connections to the services. Query V$INSTANCE to make sure they are
14.eMake

C arm working as configured.


[oracle@host01 ~]$ sqlplus sys/<SYS_PASSWORD>@oltpsvc as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Fri Nov 3 14:03:27 2017

Copyright (c) 1982, 2016, Oracle. All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit
Production

SQL> col host_name for a20

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

116 Practices for Lesson 4: Oracle RAC Administration


SQL> select instance_name, host_name, instance_mode from
v$instance;

INSTANCE_NAME HOST_NAME INSTANCE_MO


---------------- -------------------- -----------
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

orcl_3 host02.example.com REGULAR

SQL> connect sys/<SYS_PASSWORD>@oltpsvc as sysdba


Connected.

SQL> select instance_name, host_name, instance_mode from


v$instance;
a ble
f e r
ans
INSTANCE_NAME HOST_NAME INSTANCE_MO n - t r
---------------- -------------------- ----------- a no
h a s
orcl_4 host03.example.com
) ideฺ
REGULAR
m
l e ฺco t Gu
rac udeas
SQL> connect sys/<SYS_PASSWORD>@leafsvc
o
n sysdba
Connected.
a @ S t
o an thi s
e ฺ
n usehost_name, instance_mode from
SQL> select instance_name,
v$instance;
( c arm se to
ana licen
O
rm enINSTANCE_NAME HOST_NAME INSTANCE_MO

Ca ---------------- -------------------- -----------


orcl_1 host04.example.com READ ONLY

SQL> connect sys/<SYS_PASSWORD>@leafsvc as sysdba


Connected.

SQL> select instance_name, host_name, instance_mode from


v$instance;

INSTANCE_NAME HOST_NAME INSTANCE_MO


---------------- -------------------- -----------
orcl_2 host05.example.com READ ONLY

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

Practices for Lesson 4: Oracle RAC Administration 117


SQL> exit

[oracle@host01 ~]$

15. Close all terminals opened for this practice.


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

118 Practices for Lesson 4: Oracle RAC Administration


Practice 4-5: Working with Temporary Tablespaces

Overview
In this practice, you will work with local temporary tablespaces on read-write and read-only
instances.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

1. Open a new terminal window to connect to host01 as oracle user and set the
environment using oraenv.
[oracle@dns ~]$ ssh oracle@host01
oracle@host01's password:

[oracle@host01 ~]$ ps -ef|grep ora_smon


oracle 16948 1 0 08:27 ? 00:00:00 ora_smon_orcl_5 a ble
f e r
oracle 16973 16899 0 10:14 pts/8 00:00:00 grep ora_smon
ans
n - t r
[oracle@host01 ~]$ . oraenv a no
ORACLE_SID = [oracle] ? orcl_5 h a s
m ) ideฺ
The Oracle base has been set to /u01/app/oracle
l e ฺco t Gu
o r ac den
[oracle@host01 ~]$
a @ S tu
o an thi s
e ฺ
nas sysdbas eand create two local temporary tablespaces, one
m to u
arand
2. Start a SQL*Plus session
( c
called TEMP_LEAF
a n e one called TEMP_ALL. Create TEMP_LEAF using the
sanother
CREATE a nLOCAL
l ic e
TEMPORARY TABLESPACE for LEAF command and TEMP_ALL using
O
n CREATE LOCAL TEMPORARY TABLESPACE for ALL command.
rm ethe

Ca [oracle@host01 ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Fri Nov 3 10:15:35


2017

Copyright (c) 1982, 2016, Oracle. All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 -
64bit Production
SQL> CREATE LOCAL TEMPORARY TABLESPACE for LEAF TEMP_LEAF
TEMPFILE 'temp_leaf01.dbf' SIZE 5M AUTOEXTEND ON;

Tablespace created.

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

Practices for Lesson 4: Oracle RAC Administration 119


SQL> CREATE LOCAL TEMPORARY TABLESPACE for ALL TEMP_ALL TEMPFILE
'temp_all01.dbf' SIZE 5M AUTOEXTEND ON;

Tablespace created.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

SQL>

3. Look at the temp files created using SQL*Plus. In this example, orcl_1 and orcl_2 are
running on the Leaf Nodes. The rest of instances are running on the Hub Nodes.
SQL> !srvctl status database -db orcl
Instance orcl_1 is running on node host04 a b le
f e r
Instance orcl_2 is running on node host05
an s
Instance orcl_3 is running on node host02
n - t r
Instance orcl_4 is running on node host03
a no
Instance orcl_5 is running on node host01
h a s
m ) ideฺ
SQL> set linesize 120 l e ฺco t Gu
SQL> col file_name format a65 ora
c e n
tu d
a @ s S
oan e thshared
SQL> break on inst_id
i
SQL> select inst_id,nฺfile_name, from dba_temp_files order by
e u s
inst_id;
( c arm se to
na licen
INST_ID aFILE_NAME
O SHARED
n ------------------------------------------------------------- -------------
rme
-------

Ca
1 /u01/app/oracle/product/12.2.0/dbhome_1/dbs/temp_leaf01.dbf_1 LOCAL_ON_LEAF
/u01/app/oracle/product/12.2.0/dbhome_1/dbs/temp_all01.dbf_1 LOCAL_ON_ALL
2 /u01/app/oracle/product/12.2.0/dbhome_1/dbs/temp_all01.dbf_2 LOCAL_ON_ALL
/u01/app/oracle/product/12.2.0/dbhome_1/dbs/temp_leaf01.dbf_2 LOCAL_ON_LEAF
3 /u01/app/oracle/product/12.2.0/dbhome_1/dbs/temp_all01.dbf_3 LOCAL_ON_ALL
4 /u01/app/oracle/product/12.2.0/dbhome_1/dbs/temp_all01.dbf_4 LOCAL_ON_ALL
5 /u01/app/oracle/product/12.2.0/dbhome_1/dbs/temp_all01.dbf_5 LOCAL_ON_ALL
+DATA/ORCL/TEMPFILE/temp.296.958993285 SHARED

8 rows selected.

SQL>

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

120 Practices for Lesson 4: Oracle RAC Administration


4. Grant dba privileges to hr.
SQL> grant dba to hr;
Grant succeeded.
SQL>
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

5. Alter the hr user and assign TEMP_LEAF as the local temporary tablespace. Confirm the
assignment.
SQL> alter user hr local temporary tablespace TEMP_LEAF;

User altered.

a ble
SQL> select username, TEMPORARY_TABLESPACE,
f e r
LOCAL_TEMP_TABLESPACE from dba_users where username = 'HR'; ans
n - t r
USERNAME TEMPORARY_TABLESPACE a no LOCAL_TEMP_TABLESPACE
h a s
) ideฺ
---------- --------------------------- ------------------------
m
HR TEMP
l e ฺcoTEMP_LEAF
t G u
SQL>
o rac uden
a @ S t
o n thi
aConnect s
6. Grant SELECT on col$ for
e ฺ
n use as hr and count the records in col$.
hr.

( c arm seontocol$ to hr;


SQL> grant select

a na licen
O succeeded.
nGrant
rm e
Ca SQL> connect hr/<hr_password>
Connected.

SQL> select count(*) from sys.col$;

COUNT(*)
----------
114532

1 row selected.

SQL>

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

Practices for Lesson 4: Oracle RAC Administration 121


7. As hr, create a table called test as SELECT from sys.col$. Perform an INSERT AS
SELECT into test to add more records. Re-execute the command (/) 5 times as shown
below then COMMIT.
SQL> create table test as select obj#, col#, name from sys.col$;
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Table created.

SQL> insert into test select * from test;

114532 rows created.

SQL> /

a b le
229064 rows created.
f e r
an s
SQL> / n - t r
n o
s a
458128 rows created.
) ha eฺ
ฺ c om Guid
cle ent
SQL> /
r a
916256 rows created.
a @ o
S tud
o a n this
SQL> / e nฺ use
( c arm se to
1832512arows created.
an licen
O
rm enSQL> /
Ca 3665024 rows created.

SQL> commit;

Commit complete.

SQL> select count(*) from test;

COUNT(*)
----------
7330048

SQL>

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

122 Practices for Lesson 4: Oracle RAC Administration


8. Run the query below to check tempfile activity for the instance.
SQL> select f.name, s.phyrds, s.phywrts from v$tempfile f, v$tempstat
s where f.file# = s.file# order by 1;

NAME PHYRDS PHYWRTS


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

------------------------------------------------------------ ------ -------


+DATA/ORCL/TEMPFILE/temp.296.958993285 1 4
/u01/app/oracle/product/12.2.0/dbhome_1/dbs/temp_all01.dbf 0 0
/u01/app/oracle/product/12.2.0/dbhome_1/dbs/temp_leaf01.dbf 0 0

SQL>

a b le
e r
9. Now, as hr logged into orcl_5 (a read-write instance), set autotrace to traceonly
a n sf (to
suppress query output) and select all records in the table.
n - tr
SQL> show user
a no
USER is "HR"
h a s
m ) ideฺ
SQL> set autotrace traceonly
l e ฺco t Gu
c
1,ra2; e n
SQL> select * from test order by o
tu d
a @ s S
7333376 rows selected.nฺo
an thi
e u s e
( c arm se to
na licen
Execution Plan
a
O
----------------------------------------------------------
nhash
rm e
Plan value: 2007178810

Ca
-----------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time |
-----------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 114K| 2014K| | 763 (1)| 00:00:01 |
| 1 | SORT ORDER BY | | 114K| 2014K| 3160K| 763 (1)| 00:00:01 |
| 2 | TABLE ACCESS FULL| TEST | 114K| 2014K| | 109 (1)| 00:00:01 |
-----------------------------------------------------------------------------------

Statistics
----------------------------------------------------------
195 recursive calls
964 db block gets
24139 consistent gets

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

Practices for Lesson 4: Oracle RAC Administration 123


24715 physical reads
0 redo size
134929753 bytes sent via SQL*Net to client
5378365 bytes received via SQL*Net from client
488889 SQL*Net roundtrips to/from client
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

0 sorts (memory)
1 sorts (disk)
7333312 rows processed
SQL>

10. Set AUTOTRACE OFF and re-run the query from step 8.
a b le
SQL> set autotrace off
f e r
an s
n - t r
SQL> select f.name, s.phyrds, s.phywrts from v$tempfile f, v$tempstat
s where f.file# = s.file# order by 1; a no
h a s
m ) ideฺ
NAME
l e ฺ co t Gu PHYRDS PHYWRTS

o r ac den
----------------------------------------------------------- -------- -------
+DATA/ORCL/TEMPFILE/ temp.296.958993285
a @ S tu 983 1580

o an thi s
/u01/app/oracle/product/12.2.0/dbhome_1/dbs/temp_all01.dbf 0 0

en usฺ e
/u01/app/oracle/product/12.2.0/dbhome_1/dbs/temp_leaf01.dbf 0 0
r m
a se t o
( c
SQL>
a na licen
e nO
C arm
Note that the shared tempfile is being used.

11. Open a new terminal window to connect to the leaf node host04 as oracle user and
set the environment using oraenv. Login as hr to the read-only instance. In this example,
that is orcl_1. Set AUTOTRACE to TRACEONLY and rerun the query against the test
table.
[oracle@dns ~]$ ssh oracle@host04
oracle@host04's password:

[oracle@host04 ~]$ ps -ef|grep ora_smon


oracle 16469 1 0 16:48 ? 00:00:00 ora_smon_orcl_1
oracle 25899 25605 0 17:30 pts/0 00:00:00 grep ora_smon

[oracle@host04 ~]$ . oraenv

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

124 Practices for Lesson 4: Oracle RAC Administration


ORACLE_SID = [oracle] ? orcl_1
The Oracle base has been set to /u01/app/oracle

[oracle@host04 ~]$ sqlplus hr/<hr_password>


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

SQL> set autotrace traceonly

SQL> select * from hr.test order by 1, 2;


...
ERROR:
ORA-16000: database or pluggable database open for read-only access
SP2-0612: Error generating AUTOTRACE EXPLAIN report a ble
f e r
ans
Statistics
n - t r
o
----------------------------------------------------------
s an
1593 recursive calls
) ha eฺ
385 db block gets
ฺ c om Guid
24250 consistent gets
r a cle ent
48847 physical reads
a @ o
S tud
0 redo size
o a n this
34929753 bytes sent e nฺvia uSQL*Net
s e to client
c
5378365 bytes
( armreceived
e to via SQL*Net from client
na SQL*Net
488889
a c e nsroundtrips to/from client
O195 sortsli (memory)
e n
rm
Ca
1 sorts (disk)
7333312 rows processed

SQL>
You can disregard the ORA-16000 and SP2-0612 messages. This is a read-only instance and
PLAN_TABLE cannot be created or updated. This is unimportant as we are only using
AUTOTRACE TRACEONLY to suppress excessive output from the query.

12. Set AUTOTRACE OFF and re-run the query from step 10.
SQL> set autotrace off

SQL> col name format a60


SQL> set lines 150

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

Practices for Lesson 4: Oracle RAC Administration 125


SQL> select f.name, s.phyrds, s.phywrts from v$tempfile f,
v$tempstat s where f.file# = s.file# order by 1;

NAME PHYRDS PHYWRTS


----------------------------------------------------------- -------- ------
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

+DATA/ORCL/TEMPFILE/ temp.296.958993285 1 0
/u01/app/oracle/product/12.2.0/dbhome_1/dbs/temp_all01.dbf 1 0
/u01/app/oracle/product/12.2.0/dbhome_1/dbs/temp_leaf01.dbf 968 992

SQL>

Note that the TEMP_LEAF local temporary tablespace was used.


a ble
f e r
an s
n - t r
no
13. Switch to the terminal session on host01 and drop two local temporary tablespaces.
a
SQL> drop tablespace temp_leaf including contents a
h s datafiles;
and
m ) ideฺ
l e ฺco t Gu
rac uden
Tablespace dropped.

@ o t
a
n thi
SQL> drop tablespace temp_all s S
including contents and datafiles;
o a
e nฺ use
( c arm se to
Tablespace dropped.

ana licen
SQL>n O
rme
Ca
14. Close all terminals opened for this practice.

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

126 Practices for Lesson 4: Oracle RAC Administration


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
a no
h a s
Practices for
m ) ideฺ 5:
Lesson
ฺco t and
Upgrading
l e G u Patching
o ac dRAC
rOracle e n
a @ S tu
o an thi s
e ฺ
n use
( c arm se to
ana licen
n O
r m e
C a
Practices for Lesson 5

There are no practices for this lesson.


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

128 Practices for Lesson 5: Upgrading and Patching Oracle RAC


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
a no
h a s
m ) ideฺ 6:
Practices for Lesson
ฺco tBackup
Managing
l e G u and
o ac denfor RAC
rRecovery
a @ S tu
o an thi s
e ฺ
n use
( c arm se to
ana licen
n O
r m e
C a
Practices for Lesson 6: Overview

Overview
In this practice, you will configure ARCHIVELOG mode for your RAC database.
In this practice, you will designate two read-only instances running on the Leaf Nodes of your
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

policy-managed database responsible for performing parallel backups of the database. The
database will be backed up to the +FRA ASM disk group by default.

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

130 Practices for Lesson 6: Managing Backup and Recovery for RAC
Practice 6-1: Configuring Archive Log Mode

Overview
In this practice, you will configure ARCHIVELOG mode for your RAC database.
1. Open a terminal session to host01 as the oracle user and set up the environment
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

variables using the oraenv script for the database instance. Determine the instance
running on host01. Change the value of the ORACLE_SID variable to allow local system
authenticated connections.
[oracle@dns ~] ssh oracle@host01
Oracle@host01’s Password:

[oracle@host01 ~]$ . oraenv


a ble
ORACLE_SID = [oracle] ? orcl
f e r
The Oracle base has been set to /u01/app/oracle ans
n - t r
o
[oracle@host01 ~]$ an
srvctl status database -db orcl
s
Instance orcl_1 is ha eฺ
running on node host04
)
Instance orcl_2 is om Guid
running on node host05
ฺ c
Instance orcl_3 is
r a cle ent
running on node host02
Instance orcl_4 is
a @ o
S tud
running on node host03
Instance orcl_5 is
o a n this running on node host01

e nฺ export
u s e ORACLE_SID=orcl_5
arm s~]$
[oracle@host01 ~]$
( c
[oracle@host01 e to
ana licen
2. e nO
Make a local connection using operating system authentication to the database instance,
a r m and then use the archive log list SQL command to determine whether the database
C is in archive log mode. Exit SQL*Plus when done.
[oracle@host01 ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Mon Nov 6 08:22:05


2017

Copyright (c) 1982, 2016, Oracle. All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 -
64bit Production

SQL> archive log list


Database log mode No Archive Mode

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

Practices for Lesson 6: Managing Backup and Recovery for RAC 131
Automatic archival Disabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 1
Current log sequence 1
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release
12.2.0.1.0 - 64bit Production
[oracle@host01 ~]$

3. Stop the orcl database on each node of the cluster by using the srvctl stop
database command.
[oracle@host01 ~]$ srvctl stop database -db orcl a ble
f e r
[oracle@host01 ~]$
ans
n - t r
o
4.
s an
Verify that the orcl database is not running on any node of the cluster by using the
srvctl status database command.
) ha eฺ
[oracle@host01 ~]$ srvctl status database
ฺ c om G-db
u idorcl
Instance orcl_1 is not running con
a le nodenhost04
t
r
o ontunode
Instance orcl_2 is not running
e
d host05
a @ S
Instance orcl_3 is not
o a n running
t h is on node host02
ฺ not srunning
Instance orcl_4 nis
e e on node host03
u
( c arm seistonot running on node host01
Instance orcl_5

ana licen ~]$


[oracle@host01
e nO
r m
a 5. Make a local connection using operating system authentication to the local database
C
instance, and then start up the database on only the first node with the mount option.
[oracle@host01 ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Mon Nov 6 08:26:10


2017

Copyright (c) 1982, 2016, Oracle. All rights reserved.

Connected to an idle instance.

SQL> startup mount


ORACLE instance started.

Total System Global Area 2399141888 bytes

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

132 Practices for Lesson 6: Managing Backup and Recovery for RAC
Fixed Size 8623496 bytes
Variable Size 721422968 bytes
Database Buffers 1660944384 bytes
Redo Buffers 8151040 bytes
Database mounted.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

SQL>

6. Issue the alter database archivelog SQL command to change the archive mode of
the database, and then verify the results by using the archive log list SQL command.
SQL> alter database archivelog;

Database altered.
a ble
f e r
SQL> archive log list
ans
Database log mode Archive Mode
n - t r
Automatic archival no
Enabled
a
Archive destination
h a s
USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence m ) ideฺ 80
Next log sequence to archive
l e ฺco t Gu 81
Current log sequence
o rac uden 81
SQL> a @ S t
o an thi s
e ฺ e
ninstanceuwith
s
r m to
7. Shut down the database
a the immediate option and exit SQL*Plus. Use the

a c restart
srvctl utility(to
n e database instances on all nodes of the cluster.
sthe
n
a shutdown e
lic immediate
O SQL>
n ORA-01109: database not open
rme
Ca
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release
12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic
Storage Management, OLAP,
Advanced Analytics and Real Application Testing options

[oracle@host01 ~]$ srvctl start database -db orcl


[oracle@host01 ~]$

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

Practices for Lesson 6: Managing Backup and Recovery for RAC 133
8. Verify that the orcl database is running on all the five nodes of your cluster by using the
srvctl status database command.
[oracle@host01 ~]$ srvctl status database -db orcl
Instance orcl_1 is running on node host04
Instance orcl_2 is running on node host05
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Instance orcl_3 is running on node host02


Instance orcl_4 is running on node host03
Instance orcl_5 is running on node host01

[oracle@host01 ~]$

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

134 Practices for Lesson 6: Managing Backup and Recovery for RAC
Practice 6-2: Configuring RMAN and Performing Parallel Backups

Overview
In this practice, you will designate two read-only instances running on the Leaf Nodes of your
policy-managed database responsible for performing parallel backups of the database. The
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

database will be backed up to the +FRA ASM disk group by default.


1. Using the recovery manager utility (RMAN), connect to the orcl database as the target
database.
[oracle@host01 ~]$ rman target /

Recovery Manager: Release 12.2.0.1.0 - Production on Mon Nov 6


08:38:16 2017
a ble
f e r
Copyright (c) 1982, 2017, Oracle and/or its affiliates.
a n
Alls
rights reserved.
n-t r
a no
connected to target database: ORCL (DBID=1487037122)
h a s
m ) ideฺ
RMAN>
l e ฺco t Gu
o rac uden
2. Display all of the current RMAN n a @ s St
thi
settings.
RMAN> show all; nฺo
a
e us e
r m t o
(ca ndatabase
usinga target se control file instead of recovery catalog
a n li c e
n ORMAN configuration parameters for database with db_unique_name

rme
ORCL are:

Ca
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO
'%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO
BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; #
default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; #
default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT'
OPTIMIZE FOR LOAD TRUE ; # default

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

Practices for Lesson 6: Managing Backup and Recovery for RAC 135
CONFIGURE RMAN OUTPUT TO KEEP FOR 7 DAYS; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO
'/u01/app/oracle/product/12.2.0/dbhome_1/dbs/snapcf_orcl_5.f'; #
default
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

RMAN>

3. Configure RMAN to automatically back up the control file and server parameter file each
time any backup operation is performed.
RMAN> configure controlfile autobackup on;

new RMAN configuration parameters:


a ble
CONFIGURE CONTROLFILE AUTOBACKUP ON; f e r
ans
new RMAN configuration parameters are successfully stored
n - t r
a no
RMAN>
h a s
m ) ideฺ
4. Configure channels to use automatic load balancing.
l e ฺcoSet parallelism
t G u to 4, then configure the
acleafsvc
connect string. Note: You already created rthe
o d e nservice in practice 4-4.
RMAN> CONFIGURE DEVICEaTYPE @ diskS u
tPARALLELISM 4;
n
oa e th i s
n ฺ
r m e
new RMAN configuration
t o usparameters:
CONFIGURE
a (caDEVICE
n s e TYPE DISK PARALLELISM 4 BACKUP TYPE TO
O an
BACKUPSET;
ce
new RMAN liconfiguration parameters are successfully stored
n
rme
Ca RMAN> configure channel device type disk connect =
'sys/<sys_password>@leafsvc';

new RMAN configuration parameters:


CONFIGURE CHANNEL DEVICE TYPE DISK CONNECT '*';
new RMAN configuration parameters are successfully stored

RMAN>

5. Open a second terminal session as the oracle user and set up the environment variables
for the orcl database. Invoke SQL*plus as the system user, and run the
/stage/RAC/labs/less_06/monitor_rman.sql script. Do not exit the first session
with the RMAN prompt or this second session with the SQL prompt.
[oracle@host01 ~]$ . oraenv
ORACLE_SID = [oracle] ? orcl

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

136 Practices for Lesson 6: Managing Backup and Recovery for RAC
The Oracle base has been set to /u01/app/oracle
[oracle@host01 ~]$ srvctl status database -db orcl
Instance orcl_1 is running on node host04
Instance orcl_2 is running on node host05
Instance orcl_3 is running on node host02
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Instance orcl_4 is running on node host03


Instance orcl_5 is running on node host01

[oracle@host01 ~]$ export ORACLE_SID=orcl_5


[oracle@host01 ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Mon Nov 6 08:42:31


2017
a ble
f e r
Copyright (c) 1982, 2016, Oracle. All rights reserved. an s
n - t r
a no
Connected to: h a s
m ฺ
) ide12.2.0.1.0
ฺco t Gu
Oracle Database 12c Enterprise Edition Release -
64bit Production l e
o rac uden
a @ S t
SQL> @/stage/RAC/labs/less_06/monitor_rman.sql
o an thi s
e ฺ
n use
no rows selected
( c arm se to
na licen
SQL>
a
enO
a r m
6. In the first session with the RMAN prompt, perform a full database backup with archive
C logs. The backup should happen only on the designated leaf nodes (host04 and host05
in our case) as the backup nodes. Immediately move to the next step.
RMAN> backup database plus archivelog;

Starting backup at 06-NOV-17


current log archived
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=29 instance=orcl_2 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=36 instance=orcl_1 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=38 instance=orcl_2 device type=DISK
allocated channel: ORA_DISK_4

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

Practices for Lesson 6: Managing Backup and Recovery for RAC 137
channel ORA_DISK_4: SID=37 instance=orcl_1 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=3 sequence=1 RECID=3 STAMP=959330600
channel ORA_DISK_1: starting piece 1 at 06-NOV-17
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

channel ORA_DISK_2: starting archived log backup set


channel ORA_DISK_2: specifying archived log(s) in backup set
input archived log thread=2 sequence=1 RECID=2 STAMP=959330600
channel ORA_DISK_2: starting piece 1 at 06-NOV-17
channel ORA_DISK_3: starting archived log backup set
channel ORA_DISK_3: specifying archived log(s) in backup set
input archived log thread=1 sequence=2 RECID=1 STAMP=959330598
channel ORA_DISK_3: starting piece 1 at 06-NOV-17
a ble
channel ORA_DISK_4: starting archived log backup set f e r
ans
channel ORA_DISK_4: specifying archived log(s) in backup set
n - t r
input archived log thread=1 sequence=6 RECID=16 STAMP=959331231 o
an
input archived log thread=2 sequence=5 RECID=15 STAMP=959331229
s
) ha eฺ
input archived log thread=3 sequence=5 RECID=13 STAMP=959330814

ฺ c om Guid
input archived log thread=3 sequence=6 RECID=14 STAMP=959331229

r a cle ent
input archived log thread=3 sequence=7 RECID=19 STAMP=959331265

a @ o
S tud
input archived log thread=2 sequence=6 RECID=18 STAMP=959331264

o a n this
input archived log thread=1 sequence=7 RECID=17 STAMP=959331264
nฺ use
input archived log thread=1 sequence=8 RECID=20 STAMP=959331642
e
( c arm se to
input archived log thread=2 sequence=7 RECID=21 STAMP=959331643
channel ORA_DISK_4: starting piece 1 at 06-NOV-17
ana licen
channel ORA_DISK_1: finished piece 1 at 06-NOV-17
n O
r m e piece

C a handle=+FRA/ORCL/BACKUPSET/2017_11_06/annnf0_tag20171106t091006_
0.258.959332207 tag=TAG20171106T091006 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=3 sequence=8 RECID=22 STAMP=959331643
input archived log thread=1 sequence=9 RECID=23 STAMP=959331663
input archived log thread=2 sequence=8 RECID=24 STAMP=959331664
input archived log thread=3 sequence=9 RECID=25 STAMP=959331664
input archived log thread=1 sequence=10 RECID=26 STAMP=959332050
input archived log thread=2 sequence=9 RECID=27 STAMP=959332051
input archived log thread=3 sequence=10 RECID=28 STAMP=959332051
input archived log thread=1 sequence=11 RECID=29 STAMP=959332069
input archived log thread=2 sequence=10 RECID=30 STAMP=959332069
channel ORA_DISK_1: starting piece 1 at 06-NOV-17
channel ORA_DISK_2: finished piece 1 at 06-NOV-17

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

138 Practices for Lesson 6: Managing Backup and Recovery for RAC
piece
handle=+FRA/ORCL/BACKUPSET/2017_11_06/annnf0_tag20171106t091006_
0.278.959332209 tag=TAG20171106T091006 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_2: starting archived log backup set
channel ORA_DISK_2: specifying archived log(s) in backup set
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

input archived log thread=1 sequence=3 RECID=4 STAMP=959330633


input archived log thread=2 sequence=2 RECID=6 STAMP=959330635
input archived log thread=3 sequence=2 RECID=5 STAMP=959330635
input archived log thread=1 sequence=4 RECID=9 STAMP=959330777
input archived log thread=2 sequence=3 RECID=7 STAMP=959330775
input archived log thread=3 sequence=3 RECID=8 STAMP=959330776
input archived log thread=2 sequence=4 RECID=11 STAMP=959330811
a ble
input archived log thread=3 sequence=4 RECID=12 STAMP=959330811
f e r
input archived log thread=1 sequence=5 RECID=10 STAMP=959330810
ans
channel ORA_DISK_2: starting piece 1 at 06-NOV-17 n - t r
o
an
channel ORA_DISK_3: finished piece 1 at 06-NOV-17
s
piece
) ha eฺ
handle=+FRA/ORCL/BACKUPSET/2017_11_06/annnf0_tag20171106t091006_
ฺ c om Guid
0.257.959332209 tag=TAG20171106T091006 comment=NONE
a cle ent
channel ORA_DISK_3: backup set complete, elapsed time: 00:00:02
r
a @ o
S tud
channel ORA_DISK_3: starting archived log backup set
a n this
channel ORA_DISK_3: specifying archived log(s) in backup set
o
e nฺ use
input archived log thread=3 sequence=11 RECID=31 STAMP=959332069

( c arm se to
input archived log thread=1 sequence=12 RECID=32 STAMP=959332186

na licen
input archived log thread=2 sequence=11 RECID=33 STAMP=959332186
a
n Oinput archived log thread=3 sequence=12 RECID=34 STAMP=959332186

r m e channel ORA_DISK_3: starting piece 1 at 06-NOV-17


C a channel ORA_DISK_1: finished piece 1 at 06-NOV-17
piece
handle=+FRA/ORCL/BACKUPSET/2017_11_06/annnf0_tag20171106t091006_
0.280.959332211 tag=TAG20171106T091006 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:00
channel ORA_DISK_2: finished piece 1 at 06-NOV-17
piece
handle=+FRA/ORCL/BACKUPSET/2017_11_06/annnf0_tag20171106t091006_
0.283.959332211 tag=TAG20171106T091006 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:00
channel ORA_DISK_4: finished piece 1 at 06-NOV-17
piece
handle=+FRA/ORCL/BACKUPSET/2017_11_06/annnf0_tag20171106t091006_
0.279.959332209 tag=TAG20171106T091006 comment=NONE
channel ORA_DISK_4: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_3: finished piece 1 at 06-NOV-17

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

Practices for Lesson 6: Managing Backup and Recovery for RAC 139
piece
handle=+FRA/ORCL/BACKUPSET/2017_11_06/annnf0_tag20171106t091006_
0.282.959332211 tag=TAG20171106T091006 comment=NONE
channel ORA_DISK_3: backup set complete, elapsed time: 00:00:01
Finished backup at 06-NOV-17
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Starting backup at 06-NOV-17


using channel ORA_DISK_3
using channel ORA_DISK_1
using channel ORA_DISK_4
using channel ORA_DISK_2
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
a ble
input datafile file number=00001
f e r
name=+DATA/ORCL/DATAFILE/system.258.959256231
ans
input datafile file number=00007
n - t r
o
an
name=+DATA/ORCL/DATAFILE/users.261.959256333
s
channel ORA_DISK_1: starting piece 1 at 06-NOV-17
ha eฺ
)
channel ORA_DISK_2: starting full datafile backup set
ฺ c om Guid
channel ORA_DISK_2: specifying datafile(s) in backup set
a cle ent
input datafile file number=00003
r
a @ o
S tud
name=+DATA/ORCL/DATAFILE/sysaux.259.959256297

o a n this
input datafile file number=00005
nฺ use
name=+DATA/ORCL/DATAFILE/undotbs2.274.959256735
e
( c arm se to
channel ORA_DISK_2: starting piece 1 at 06-NOV-17
channel ORA_DISK_3: starting full datafile backup set
ana licen
channel ORA_DISK_3: specifying datafile(s) in backup set
n O
input datafile file number=00002
r m e name=+DATA/ORCL/DATAFILE/undotbs3.275.959256737
C a input datafile file number=00004
name=+DATA/ORCL/DATAFILE/undotbs1.260.959256331
channel ORA_DISK_3: starting piece 1 at 06-NOV-17
channel ORA_DISK_3: finished piece 1 at 06-NOV-17
piece
handle=+FRA/ORCL/BACKUPSET/2017_11_06/nnndf0_tag20171106t091011_
0.286.959332213 tag=TAG20171106T091011 comment=NONE
channel ORA_DISK_3: backup set complete, elapsed time: 00:00:04
channel ORA_DISK_1: finished piece 1 at 06-NOV-17
piece
handle=+FRA/ORCL/BACKUPSET/2017_11_06/nnndf0_tag20171106t091011_
0.259.959332213 tag=TAG20171106T091011 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:09
channel ORA_DISK_2: finished piece 1 at 06-NOV-17

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

140 Practices for Lesson 6: Managing Backup and Recovery for RAC
piece
handle=+FRA/ORCL/BACKUPSET/2017_11_06/nnndf0_tag20171106t091011_
0.285.959332213 tag=TAG20171106T091011 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:08
Finished backup at 06-NOV-17
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Starting backup at 06-NOV-17


current log archived
using channel ORA_DISK_3
using channel ORA_DISK_1
using channel ORA_DISK_4
using channel ORA_DISK_2
channel ORA_DISK_1: starting archived log backup set
a ble
channel ORA_DISK_1: specifying archived log(s) in backup set
f e r
input archived log thread=1 sequence=13 RECID=37 STAMP=959332228
ans
channel ORA_DISK_1: starting piece 1 at 06-NOV-17 n - t r
o
an
channel ORA_DISK_2: starting archived log backup set
s
ha eฺ
channel ORA_DISK_2: specifying archived log(s) in backup set
)
ฺ c om Guid
input archived log thread=3 sequence=13 RECID=36 STAMP=959332226

r a cle ent
channel ORA_DISK_2: starting piece 1 at 06-NOV-17

tud
channel ORA_DISK_3: starting archived log backup set
@ o
a S
channel ORA_DISK_3: specifying archived log(s) in backup set
n this
o a
e nฺ use
input archived log thread=2 sequence=12 RECID=35 STAMP=959332222
channel ORA_DISK_3: starting piece 1 at 06-NOV-17
( c arm se to
channel ORA_DISK_1: finished piece 1 at 06-NOV-17
na licen
piece
a
n Ohandle=+FRA/ORCL/BACKUPSET/2017_11_06/annnf0_tag20171106t091028_
r m e 0.318.959332229 tag=TAG20171106T091028 comment=NONE
C a channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_2: finished piece 1 at 06-NOV-17
piece
handle=+FRA/ORCL/BACKUPSET/2017_11_06/annnf0_tag20171106t091028_
0.319.959332229 tag=TAG20171106T091028 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:00
channel ORA_DISK_3: finished piece 1 at 06-NOV-17
piece
handle=+FRA/ORCL/BACKUPSET/2017_11_06/annnf0_tag20171106t091028_
0.320.959332229 tag=TAG20171106T091028 comment=NONE
channel ORA_DISK_3: backup set complete, elapsed time: 00:00:00
Finished backup at 06-NOV-17

Starting Control File and SPFILE Autobackup at 06-NOV-17

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

Practices for Lesson 6: Managing Backup and Recovery for RAC 141
piece
handle=+FRA/ORCL/AUTOBACKUP/2017_11_06/s_959332229.321.959332231
comment=NONE
Finished Control File and SPFILE Autobackup at 06-NOV-17

RMAN>
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

7. While the backup is in progress, rerun the query on the second terminal window to monitor
the RMAN backup session progress within the cluster. The backup should be done in
parallel, with work distributed to two leaf nodes of the cluster. Enter the slash (/) symbol
and press the Enter key to rerun the query. It may be necessary to do this multiple times
until the output appears. When the backup finishes, exit SQL*Plus.
Note: You may not be able to see the output because it takes about a minute to complete
a ble
the full database backup.
f e r
ans
SQL> /
n - t r
no rows selected
a no
h a s
SQL> /
m ) ideฺ
ฺco t GTOTALWORK
CONTEXT cle SOFAR
u
INST_ID SID SERIAL#
r a e n %_COMPLETE

58586 a@ S tud79614 ----------


o ----------
------- ----- -------- ---------- ----------
1 275
a n h i s
1 88320 90.14
2 38
e ฺo se t 1
n32484 76926 103040 74.66

SQL> / (ca
rm e to u
a na licens
e n Ono rows selected
a r m
C SQL> exit

[oracle@host01 ~]$

8. Shut down the database using srvctl so the ARCHIVELOG mode can be disabled for your
RAC database.
[oracle@host01 ~]$ srvctl stop database -db orcl
[oracle@host01 ~]$

9. Make a local connection using operating system authentication to the local database
instance, and then start up the database on only the first node with the mount option.
Disable archivelog mode with the alter database noarchivelog statement. Confirm
this operation with the archive log list statement. Shut down the database and exit
SQL*Plus when finished.

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

142 Practices for Lesson 6: Managing Backup and Recovery for RAC
[oracle@host01 ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Mon Nov 6 09:21:02


2017
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Copyright (c) 1982, 2016, Oracle. All rights reserved.

Connected to an idle instance.

SQL> startup mount


ORACLE instance started.

a ble
Total System Global Area 2399141888 bytes
f e r
Fixed Size 8623496 bytes ans
Variable Size 721422968 bytes n - t r
Database Buffers 1660944384 bytes a no
Redo Buffers 8151040 bytes h a s
m ) ideฺ
ฺco t Gu
Database mounted.
SQL> alter database noarchivelog; l e
o rac uden
a @ S t
Database altered.
o an thi s
e ฺ
n listuse
SQL> archivemlog
c r mode
alog e to
a (
Database
n s No Archive Mode
a n
Automatic
l e
icarchival Disabled
O
n Archive destination USE_DB_RECOVERY_FILE_DEST
r m e
C a Oldest online log sequence 11
Current log sequence 13

SQL> shutdown immediate;


ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release
12.2.0.1.0 - 64bit Production
[oracle@host01 ~]$

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

Practices for Lesson 6: Managing Backup and Recovery for RAC 143
10. Use srvctl to re-start your database. Ensure that all instances are up.
[oracle@host01 ~]$ srvctl start database -db orcl

[oracle@host01 ~]$ srvctl status database -db orcl


Instance orcl_1 is running on node host04
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Instance orcl_2 is running on node host05


Instance orcl_3 is running on node host02
Instance orcl_4 is running on node host03
Instance orcl_5 is running on node host01

[oracle@host01 ~]$

a ble
11. Close all terminal windows opened for this practice.
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

144 Practices for Lesson 6: Managing Backup and Recovery for RAC
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
a no
h a s
Practices for
m ) ideฺ 7:
Lesson
Global
l e ฺcoResource
t G u
o ac den Concepts
rManagement
a @ S tu
o an thi s
e ฺ
n use
( c arm se to
ana licen
n O
r m e
C a
Practices for Lesson 7

There are no practices for this lesson.


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

146 Practices for Lesson 7: Global Resource Management Concepts


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
a no
h a s
Practices for
m ) ideฺ 8: RAC
Lesson
Database
l e ฺco Monitoring
t G u and
a c n
o rTuning
t u de
n a @ s S
a h i
e nฺo use t
( c arm se to
ana licen
n O
r m e
C a
Practices for Lesson 8: Overview

Overview
The goal of this practice is to show you how to manually discover performance issues by using
the EM Express performance pages as well as ADDM. This first part generates a workload that
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

uses a bad RAC application design.


The goal of this practice is to show you how to manually discover performance issues by using
the EM Express performance pages as well as ADDM. In this second part of the practice, you
are going to correct the previously found issue by creating a sequence number instead of by
using a table.
The goal of this practice is to show you how to manually discover performance issues by using
the EM Express performance pages as well as ADDM. This last part generates the same
workload as in the previous practice, but uses more cache entries for sequence number S. a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

148 Practices for Lesson 8: RAC Database Monitoring and Tuning


Practice 8-1: ADDM and RAC Part I

Overview
The goal of this practice is to show you how to manually discover performance issues by using
the EM Express performance pages as well as ADDM. This first part generates a workload that
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

uses a bad RAC application design.


Note that all the necessary scripts for this practice are located in the
/stage/RAC/labs/less_08 directory.

1. Connect to your first node as the oracle user. Be sure to use the –X option. Set up your
environment variables by using the oraenv script. Determine that the Oracle instance is
running on host01. You will need this information throughout these practices.
a ble
[oracle@dns ~]$ ssh -X oracle@host01 f e r
ans
oracle@host01's password:
n - t r
[oracle@host01 ~]$ . oraenv a no
h a s
ORACLE_SID = [oracle] ? orcl
m ) ideฺ
l e ฺco t Gu
The Oracle base has been set to /u01/app/oracle

o racora_smon
d e n
[oracle@host01 ~]$ ps -ef|grep
18660 3459 na
@ spts/3S tu 00:00:00 grep ora_smon
thi ?
oracle 0 17:25
oracle
a Jan13
31630 nฺo 1 0 e 00:01:06 ora_smon_orcl_5
e u s
c a rm e to
(
[oracle@host01s~]$
ana licen
nO
2. eExecute the setupseq1.sh script from the/stage/RAC/labs/less_08 directory to set
a r m
C up the necessary configuration for this practice.
[oracle@host01 ~]$ cd /stage/RAC/labs/less_08

[oracle@host01 less_08]$ ./setupseq1.sh

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

drop user jmw cascade


*
ERROR at line 1:
ORA-01918: user 'JMW' does not exist

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

Practices for Lesson 8: RAC Database Monitoring and Tuning 149


drop tablespace seq including contents and datafiles
*
ERROR at line 1:
ORA-00959: tablespace 'SEQ' does not exist
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Tablespace created.

User created.

a ble
f e r
ans
Grant succeeded.
n - t r
o
drop sequence s
s an
* ) ha eฺ
ERROR at line 1:
ฺ c om Guid
r a cle ent
ORA-02289: sequence does not exist

a @ o
S tud
o a n this
nฺ use
drop table s purge
e
c a rm
*
e t o
(
ERROR at line s
n 1: or view does not exist
ana licetable
ORA-00942:
e nO
a r m
C drop table t purge
*
ERROR at line 1:
ORA-00942: table or view does not exist

Table created.

Table created.

Index created.

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

150 Practices for Lesson 8: RAC Database Monitoring and Tuning


1 row created.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Commit complete.

PL/SQL procedure successfully completed.

[oracle@host01 less_08]$

Login as SYSDBA to set the EM Database Express port to 5501. a ble


3.
f e r
[oracle@host01 less_08]$ srvctl status database -db orcl
ans
Instance orcl_1 is running on node host04 n - t r
Instance orcl_2 is running on node host05 a no
Instance orcl_3 is running on node host03 h a s
m
Instance orcl_4 is running on node host02) ideฺ
l e ฺco t Gu
Instance orcl_5 is running on node host01
o rac uden
[oracle@host01 less_08]$a @
export S t
ORACLE_SID=orcl_5
o an thi s
e ฺ
n usesqlplus / as sysdba
arm se to
[oracle@host01 less_08]$
( c
a na licRelease
SQL*Plus: en 12.2.0.1.0 Production on Tue Nov 7 09:16:03
e n O2017
a r m
C Copyright (c) 1982, 2016, Oracle. All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 -
64bit Production

SQL> exec dbms_xdb_config.sethttpport(5501);

PL/SQL procedure successfully completed.

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release
12.2.0.1.0 – 64bit Production

[oracle@host01 less_08]$

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

Practices for Lesson 8: RAC Database Monitoring and Tuning 151


4. Start a browser and enter the following address: http://cluster01-
scan.cluster01.example.com:5501/em. If you don’t see the EM login page due to the
plugin issue,
 Click a small red icon in the location bar.
 Click the Allow and Remember button
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

[oracle@host01 less_08]$ firefox&


[1] 32419
[oracle@host01 less_08]$

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

152 Practices for Lesson 8: RAC Database Monitoring and Tuning


5. Log in to EM Express as sys/<sys_password>. Make sure the connection is as SYSDBA.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
6. UseO ana to lcreate
PL/SQL
n
ice a new AWR snapshot.
n
rme [oracle@host01 less_08]$ ./create_snapshot.sh
Ca
PL/SQL procedure successfully completed.

[oracle@host01 less_08]$

7. Open a second terminal to host01 as the oracle user. Change the directory to
/stage/RAC/labs/less_08. Execute the lockinfo.sh script. This script allows you to
view global lock contention issues. Your output should show no transactions for JMW.
[oracle@dns ~]$ ssh oracle@host01
oracle@host01's password:

[oracle@host01 ~]$ cd /stage/RAC/labs/less_08

[oracle@host01 less_08]$ ./lockinfo.sh

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

Practices for Lesson 8: RAC Database Monitoring and Tuning 153


SQL*Plus: Release 12.2.0.1.0 Production on Wed Nov 8 08:46:47
2017

Copyright (c) 1982, 2016, Oracle. All rights reserved.

Connected to:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 -


64bit Production

SQL>
Sess Op Sys OBJ NAME or
ID USERNAME User ID TERMINAL TRANS_ID TY Lock Mode Req Mode
---- -------- ------- -------- ------------ -- ----------- -----------
33 SYS oracle Trans-4 PS Share
42 SYS oracle ORA$BASE AE Share a ble
f e r
42 SYS oracle Trans-4 PS Share
ans
42 SYS oracle Trans-1 PS Share
n - t r
42 SYS oracle Trans-2 PS Share o
42 SYS oracle Trans-5
s an
PS Share
42 SYS oracle Trans-3
) ha eฺ
PS Share
255 SYS oracle Trans-5
ฺ c om Guid
PS Share
257 SYS oracle
cle ent
Trans-1
r a
PS Share
271
274
SYS
SYSRAC oracle a @ o
S tud
ORA$BASE
Trans-2
AE Share
PS Share
o a n this
nฺ use
274 SYS oracle Trans-2 PS Share
282 SYS e
oracle Trans-3 PS Share

( c arm se to
ana selected.
13 rows
l i c en
n OSQL> Disconnected from Oracle Database 12c Enterprise Edition
rme Release 12.2.0.1.0 - 64bit Production
Ca [oracle@host01 less_08]$

8. From the first oracle terminal, execute the startseq1.sh script to generate a workload
on host01 and host02. Do not wait; proceed with the next step.
[oracle@host01 less_08]$ ./startseq1.sh

INSTANCE_NAME
----------------
orcl_5

INSTANCE_NAME
----------------
orcl_4
[oracle@host01 less_08]$

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

154 Practices for Lesson 8: RAC Database Monitoring and Tuning


9. From the second terminal, execute the lockinfo.sh script again to view information
regarding possible lock contention. You can also select Blocking Sessions from the Cluster
Database Performance pull-down menu. You may have to refresh several times to see a
lock contention for transactions belonging to JMW.
[oracle@host01 less_08]$ ./lockinfo.sh
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

SQL*Plus: Release 12.2.0.1.0 Production on Wed Nov 8 08:46:47


2017

Copyright (c) 1982, 2016, Oracle. All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 -
64bit Production
a ble
f e r
SQL>
ans
Sess Op Sys OBJ NAME or
n - t r
ID USERNAME User ID TERMINAL TRANS_ID TY Lock Mode Req Mode o
---- an
-------- ------- -------- ------------ -- ----------- -----------
s
42 SYS oracle ORA$BASE
) ha eฺAE Share
42 SYS oracle
om Guid
Trans-3
ฺ c PS Share
42 SYS oracle
r a cle ent
Trans-1 PS Share

tud
42 SYS oracle Trans-5 PS Share
@ o
42 SYS
a
oracle
n this S Trans-2 PS Share
42 SYS
o a
oracle Trans-4 PS Share
49 SYS e nฺ use
oracle Trans-4 PS Share
51
( c arm se to
JMW oracle S TM --Waiting-- Exclusive

ana licen
51 JMW oracle ORA$BASE AE Share

n O 51 JMW oracle Trans-196608 TX Exclusive

r m e 255 SYS oracle Trans-5 PS Share

C a 256 SYS oracle Trans-1 PS Share


264 SYSRAC oracle T TM Row Excl
264 JMW oracle T TM Row Excl
264 SYSRAC oracle ORA$BASE AE Share
264 SYSRAC oracle S TM Exclusive
264 JMW oracle S TM Exclusive
264 JMW oracle ORA$BASE AE Share
271 SYS ORA$BASE AE Share
274 SYS oracle Trans-2 PS Share
274 SYSRAC oracle Trans-2 PS Share
282 SYS oracle Trans-3 PS Share

22 rows selected.
SQL> Disconnected from Oracle Database 12c Enterprise Edition
Release 12.2.0.1.0 - 64bit Production
[oracle@host01 less_08]$

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

Practices for Lesson 8: RAC Database Monitoring and Tuning 155


10. While the scripts are still executing, look at the Average Active Sessions graphic. Then, drill
down to the Cluster wait class for the first node. What are your conclusions?
a. Click Performance, and then Performance Hub.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

b. From there you can now see the Active Sessions graph in the bottom left corner. Make
a ble
sure that Auto Refresh is set to 15 Seconds.
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a
c. After a few seconds, the graphic should clearly show that the Cluster and Application
wait classes are causing most waits.

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

156 Practices for Lesson 8: RAC Database Monitoring and Tuning


d. Click the Workload tab. In the Workload Profile graph, place the cursor over the
Transactions line at the current time on the timeline. Transactions should be around
120-180 per second.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
e. an
Click the Instances tab and scroll down to the Top Instances section. Looking at the
s
ha eฺ
Active Sessions column, you should see that the number of active sessions on host01
)
and host02 are similar.
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a
f. Click the instance running on host01 (orcl_5 in this example). This takes you to the
Performance Hub for the orcl_5 page.

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

Practices for Lesson 8: RAC Database Monitoring and Tuning 157


g. Click the Activity tab, look under the SQL ID column, and then click the SQL identifier
that uses most of the resource
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
h.
an
This takes you to the SQL Details page for the corresponding statement. The SQL text
s
ha eฺ
should be LOCK TABLE S IN EXCLUSIVE MODE, and the user should be JMW.
)
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
O
r m en
C a i. Click the Back button in the web browser to return to the Performance Hub for the
orcl_5 page. Under the User Session column, click the User Session ID with the
highest activity.

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

158 Practices for Lesson 8: RAC Database Monitoring and Tuning


j. The User Name should be JMW. Beneath the Monitored SQL section, drill down on the
SQL ID under the ID column.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
k. Place the cursor over the SQL Text to see the entire SQL statement. You will see that
ans
the script running on the first instance is executing a SELECT/UPDATE statement on
n - t r
o
table S that causes most of the Cluster waits.
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

By using EM Express, you can quickly identify the top waiting SQL statements and the top
waiting sessions on both instances. Here it appears that a SELECT or UPDATE statement on
table S is causing most of the waits for the Cluster wait class.

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

Practices for Lesson 8: RAC Database Monitoring and Tuning 159


11. Using EM Express, Click Performance, then Performance Hub, and then click the Global
Cache tab. Look at the Global Cache Blocks Received graph. What are your conclusions?
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
a no
h a s
m ) ideฺ
l e ฺco t Gu
o ac shows
rclearly d e nthat there are a lot of blocks
12. The Global Cache Blocks Received graph
a @ S tusee cumulative transfer rates (both CR
o an500 blocks
transferred per second on the system.
s
You should
t hi per second.

and current blocks) in excess
en us
of
e
r m
a se to
( c
a na licen
e nO
rm
Ca

13. After the workload finishes, use PL/SQL to create a new AWR snapshot. If the workload is
still running, press CTRL + C and hit Enter.

INSTANCE_NAME
----------------
orcl_5

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

160 Practices for Lesson 8: RAC Database Monitoring and Tuning


INSTANCE_NAME
----------------
orcl_4

****** If the workload is still running, press CTRL + C ******


^C
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.  Hit Enter

[oracle@host01 less_08]$ ./create_snapshot.sh

a ble
PL/SQL procedure successfully completed.
f e r
ans
[oracle@host01 less_08]$ n - t r
a no
h a s
m ) ideฺ
14. Using EM Express, review the latest ADDM run. What are your conclusions?

l e ฺ o click
a. Click Performance, then Performance Hub, andcthen
t G u ADDM tab.
the

a c ADDMenTasks and click it. This takes you to


b. Find the link for the latest ADDM task under
r
a @ o
S tud page.
the Automatic Database Diagnostic Monitor (ADDM)

o a n this
e nฺ use
( c arm se to
a na licen
e nO
rm
Ca

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

Practices for Lesson 8: RAC Database Monitoring and Tuning 161


c. On the Automatic Database Diagnostic Monitor (ADDM) page, the ADDM Tasks
section shows you the consolidation of ADDM reports from all instances running in
your cluster. This is your first entry point before drilling down to specific instances.
From there, investigate the Top SQL Statements, Table Locks, and Global Cache
Messaging findings.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
d. Click the Top SQL Statements finding, which affects all instances, revealing LOCK o
s an
TABLE, SELECT, and UPDATE commands on table JMW.S as possible problems to
) ha eฺ
investigate. Click the Back button to return to the ADDM report.

ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a
e. Click the Table Locks finding, which affects all instances, revealing that you should
investigate your application logic regarding the JMW.S object.

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

162 Practices for Lesson 8: RAC Database Monitoring and Tuning


f. Click the Back button to return to the ADDM report. Click the Global Cache Messaging
finding revealing either the UPDATE S or SELECT command as responsible for
significant amount of Cluster waits during the analysis period. Click the Back button.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
g. You now have the possibility to drill down to each instance using the links located in
ans
the DB Time Breakdown By Instance table. Click the link corresponding to the most n - t r
affected instance.
a no
h a s
m ) ideฺ
l e ฺco t Gu
o rac uden
a @ S t
o an thi s
e ฺ
n use
( c arm se to
h. anacorresponding
l i c en Automatic Database Diagnostic Monitor page, you should
n
On
O the

r m e retrieve similar top findings seen previously at the cluster level.

C a
15. Keep all terminal windows for the next practices.

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

Practices for Lesson 8: RAC Database Monitoring and Tuning 163


Practice 8-2: ADDM and RAC Part II

Overview
The goal of this practice is to show you how to manually discover performance issues by using
the EM Express performance pages as well as ADDM. In this second part of the practice, you
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

are going to correct the previously found issue by creating a sequence number instead of by
using a table.
Note that all the necessary scripts for this practice are located in the
/stage/RAC/labs/less_08 directory.

1. Execute the setupseq2.sh script to create the necessary objects used for the rest of this
practice.
a ble
[oracle@host01 less_08]$ ./setupseq2.sh
f e r
ans
n - t r
PL/SQL procedure successfully completed. o
s an
) ha eฺ
PL/SQL procedure successfully completed.
ฺ c om Guid
r a cle ent
a @ o
S tud
User dropped.
o a n this
e nฺ use
m to
ardropped.
( c
Tablespace
a n se
n lic e
n Oa
r m e
C a Tablespace created.

User created.

Grant succeeded.

drop table s purge


*
ERROR at line 1:
ORA-00942: table or view does not exist

drop sequence s
*

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

164 Practices for Lesson 8: RAC Database Monitoring and Tuning


ERROR at line 1:
ORA-02289: sequence does not exist

drop table t purge


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

*
ERROR at line 1:
ORA-00942: table or view does not exist

Table created.

a ble
f e r
ans
Index created.
n - t r
o
s an
Sequence created. ) ha eฺ
ฺ c om Guid
r a cle ent
PL/SQL procedure successfully
a @ S tud
o completed.
o a n this
nฺ use
[oracle@host01 less_08]$
e
( c arm se to
a na to lcreate
2. Use PL/SQL
i c ena new AWR snapshot.
e n O[oracle@host01 less_08]$ ./create_snapshot.sh
rm
Ca PL/SQL procedure successfully completed.

[oracle@host01 less_08]$

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

Practices for Lesson 8: RAC Database Monitoring and Tuning 165


3. Execute the startseq2.sh script to generate a workload on the instances running on
host01 and host02. Do not wait; proceed with the next step.
[oracle@host01 less_08]$ ./startseq2.sh
[oracle@host01 less_08]$
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

… Do not wait after this point and go to the next step.

4. While the scripts are still executing, look at the Active Sessions graphic. View the workload.
What are your conclusions?
a. Click Performance, and then Performance Hub.

a ble
f e r
ans
n - t r
a no
h a s
m ) ideฺ
l e ฺco t Gu
r a c e n
o d
tu Sessions graph. Make sure 15
a @the Auto
b. From there you can now see the Average Active
Seconds Refresh is selectednfrom s S
o a t h i Refresh drop-down list. After a few
ฺ showsthat
seconds, the graphicnwill
e e the Cluster and Concurrency wait classes are
u
( c arm se to
causing most waits.

a na licen
e nO
rm
Ca

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

166 Practices for Lesson 8: RAC Database Monitoring and Tuning


c. Click the Instances tab and scroll down to the Top Instances section. You should see
that the number of active sessions is similar on host01 and host02.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Click the first instance’s link, orcl_5 in this case (on host01). This takes you to the a ble
d.
f e r
Performance Hub for the orcl_5 page.
ans
n - t r
a no
h a s
m ) ideฺ
l e ฺco t Gu
o rac uden
a @ S t
o an thi s
e ฺ
n use
( c arm se to
a na licen
n e. OOn the Active Sessions graph, you can see the most significant wait events causing
rme most of the waits in the Cluster and Concurrency wait class on the first instance
Ca (orcl_5 in this example).

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

Practices for Lesson 8: RAC Database Monitoring and Tuning 167


f. Click the Activity tab.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
a no
h a s
g. Click the SQL identifier under the SQL ID column that uses
m ) statement.
d e ฺ You will see that
most of the resources. This

ฺcoan tINSERT
takes you to the SQL Details page for the corresponding i
u statement on table T
l e
the script running on the first instance is executing G
that causes most of the Cluster waits.o rac uden
a @ S t
o an thi s
e ฺ
n use
( c arm se to
a na licen
n O
r m e
C a

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

168 Practices for Lesson 8: RAC Database Monitoring and Tuning


h. Click Performance, then Performance Hub, and then the Workload tab. Make sure 15
Seconds Refresh is selected from the Auto Refresh drop-down list. In the Workload
Profile graph, place the cursor over the Transactions line at the current time on the
timeline. Transactions should be around 90~100 per second.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
a no
h a s
m ) ideฺ
l e ฺco t Gu
rac ua dnew
5. After the workload finishes, use PL/SQL to create
o enAWR snapshot.
a @ S t
o
PL/SQL procedure successfully
s
an thi completed.
e ฺ
n use
arm se successfully
PL/SQL procedure
( c to completed.  Hit Enter

a na licen
e n O[oracle@host01 less_08]$ ./create_snapshot.sh
rm
Ca PL/SQL procedure successfully completed.

[oracle@host01 less_08]$

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

Practices for Lesson 8: RAC Database Monitoring and Tuning 169


6. Using EM Express, review the latest ADDM run. What are your conclusions?
a. Click Performance, then Performance Hub, and then the ADDM tab.
b. Find the link for the latest ADDM task under ADDM Tasks and click it. This takes you to
the Automatic Database Diagnostic Monitor (ADDM) page.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
c. On the Automatic Database Diagnostic Monitor (ADDM) page, the Findings section
n - t r
o
an
shows you the consolidation of ADDM reports from all instances running in your
s
cluster. This is your first entry point before drilling down to specific instances. From
ha eฺ
)
there, investigate the Top SQL Statements, Sequence Usage, and Unusual
“Concurrency” Wait Event findings.
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a
d. Click the Top SQL Statements finding. The Top SQL Statements should reveal an
INSERT INTO T command using sequence S as a possible problem to investigate.
Click the Back button to return to the ADDM report.

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

170 Practices for Lesson 8: RAC Database Monitoring and Tuning


e. Click Sequence Usage. The Sequence Usage finding reveals that you should use a
larger cache size for your hot sequences. Click the Back button to return to the ADDM
report.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
f. Click Unusual “Concurrency” Wait Event. The Unusual “Concurrency” Wait Event o
an
finding asks you to investigate the cause for high “row cache lock” waits. Refer to the
s
ha eฺ
Oracle Database Reference for the description of this wait event. Click the Back button.
)
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

7. Keep all terminal windows for the next practice.

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

Practices for Lesson 8: RAC Database Monitoring and Tuning 171


Practice 8-3: ADDM and RAC Part III

Overview
The goal of this practice is to show you how to manually discover performance issues by using
the EM Express performance pages as well as ADDM. This last part generates the same
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

workload as in the previous practice, but uses more cache entries for sequence number S.
Note that all the necessary scripts for this practice are located in the
/stage/RAC/labs/less_08 directory.

1. Execute the setupseq3.sh script to create the necessary objects used for the rest of this
practice.
[oracle@host01 less_08]$ ./setupseq3.sh
a ble
f e r
PL/SQL procedure successfully completed. ans
n - t r
o
s an
PL/SQL procedure successfully completed. ha
m ) ideฺ
l e ฺco t Gu
User dropped. o rac uden
a @ S t
o an thi s
e ฺ
n use
( c a m se to
Tablespace rdropped.

a na licen
e n OTablespace created.
a r m
C
User created.

Grant succeeded.

drop table s purge


*
ERROR at line 1:
ORA-00942: table or view does not exist

drop sequence s
*

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

172 Practices for Lesson 8: RAC Database Monitoring and Tuning


ERROR at line 1:
ORA-02289: sequence does not exist

drop table t purge


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

*
ERROR at line 1:
ORA-00942: table or view does not exist

Table created.

a ble
f e r
ans
Index created.
n - t r
o
s an
Sequence created. ) ha eฺ
ฺ c om Guid
r a cle ent
PL/SQL procedure successfully
a @ S tud
o completed.
o a n this
nฺ use
[oracle@host01 less_08]$
e
( c arm se to
a na to lcreate
2. Use PL/SQL
i c ena new AWR snapshot.
e n O[oracle@host01 less_08]$ ./create_snapshot.sh
rm
Ca PL/SQL procedure successfully completed.

[oracle@host01 less_08]$

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

Practices for Lesson 8: RAC Database Monitoring and Tuning 173


3. Execute the startseq2.sh script to generate the same workload on both instances of
your cluster as for the previous practice. Do not wait, and proceed with the next step.
[oracle@host01 less_08]$ ./startseq2.sh
[oracle@host01 less_08]$
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

… Do not wait after this point and go to the next step.

4. Until the scripts are executed, look at the Active Sessions graphic. What are your
conclusions?
a. Click Performance, and then Performance Hub. Make sure 15 Seconds Refresh is
selected from the Auto Refresh drop-down list. After all the scripts have finished their
a ble
execution, the Active Sessions graph will clearly show that there are no significant
f e r
waits on your cluster.
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
O
r m eb.n Next, click the Workload tab. In the Workload Profile graph, place the cursor over the
C a Transactions line at the current time on the timeline. After a few moments, transactions
should be in excess of 1000 per second.

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

174 Practices for Lesson 8: RAC Database Monitoring and Tuning


5. After the workload finishes, use PL/SQL to create a new AWR snapshot.
[oracle@host01 less_08]$
PL/SQL procedure successfully completed.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

PL/SQL procedure successfully completed.  Hit Enter

[oracle@host01 less_08]$ ./create_snapshot.sh

PL/SQL procedure successfully completed.

[oracle@host01 less_08]$
a ble
f e r
6. Using EM Express, review the latest ADDM run. What are your conclusions?
ans
a. Click Performance, then Performance Hub, and then the ADDM tab. n - t r
a no
h a s
m ) ideฺ
l e ฺco t Gu
o rac uden
a @ S t
o an thi s
e ฺ
n use
( c arm se to
a a cen
nthe
b. O
Find linklifor the latest ADDM task under ADDM Tasks and click it. This takes you to
e n the Automatic Database Diagnostic Monitor (ADDM) page. On the Automatic Database
a r m
C Diagnostic Monitor (ADDM) page, the Findings section shows you the consolidation of
ADDM reports from all instances running in your cluster.

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

Practices for Lesson 8: RAC Database Monitoring and Tuning 175


c. In the DB Time Breakdown By Instance section, drill down on the task link for orcl_5.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

d. From there, investigate the Buffer Busy findings. You should no longer see the
Sequence Usage, nor specific instances impacted.

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
@
7. Close all terminal windows openedafor
o
S tud
this practice.
o a n this
e nฺ use
( c arm se to
a na licen
e nO
rm
Ca

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

176 Practices for Lesson 8: RAC Database Monitoring and Tuning


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
a no
h a s
m ) ideฺ 9:
Practices for Lesson
ฺco tHigh
Managing
l e G u Availability of
o ac den
rServices
a @ S tu
o an thi s
e ฺ
n use
( c arm se to
ana licen
n O
r m e
C a
Practices for Lesson 9: Overview

Overview
In this practice, you will create a service called prod1. You then observe what happens to your
service when you terminate the instances on which it is running.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

In this practice, you will use EM Express to determine the amount of resources used by
sessions executing under a particular service.

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

178 Practices for Lesson 9: Managing High Availability of Services


Practice 9-1: Working with Services

Overview
In this practice, you will create a service called prod1. You then observe what happens to your
service when you terminate the instances on which it is running.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

1. Use SRVCTL to create a singleton service called PROD1.


a. Connect to your first node as the oracle user. Set up your environment variables
using the oraenv script. Change directory to /stage/RAC/labs/less_09 .
[oracle@dns ~]$ ssh oracle@host01
oracle@host01's password:
a ble
f e r
[oracle@host01 ~]$ . oraenv
ans
ORACLE_SID = [oracle] ? orcl
n - t r
The Oracle base has been set to /u01/app/oracle
a no
h a s
[oracle@host01 ~]$ cd /stage/RAC/labs/less_09
m ) ideฺ
l e ฺco t Gu
[oracle@host01 less_09]$
o rac uden
a @ S t
Use SRVCTL to create aoSINGLETON i s
an thservice called PROD1 using the orcldb server
b.
n ฺ e
pool.
r m e
t o us
(ca nsless_09]$
[oracle@host01
a e srvctl add service -db orcl -service
an lice
PROD1 -serverpool orcldb -cardinality singleton -policy manual
n O
r m e [oracle@host01 less_09]$ srvctl status service -db orcl
C a Service LEAFSVC is running on nodes: host04,host05
Service OLTPSVC is running on nodes: host02,host03,host01
Service PROD1 is not running.

[oracle@host01 less_09]$

c. Use SRVCTL to start the PROD1 service


[oracle@host01 less_09]$ srvctl start service -db orcl -service
prod1
[oracle@host01 less_09]$ srvctl status service -db orcl -service
prod1
Service PROD1 is running on nodes: host01

[oracle@host01 less_09]$

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

Practices for Lesson 9: Managing High Availability of Services 179


d. Add the following entry for the PROD1 service in the tnsnames.ora on all three hosts.
prod1 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST =
cluster01-scan.cluster01.example.com)(PORT = 1521))(LOAD_BALANCE
= YES)(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME =
prod1)))
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Use the add_tns.sh script to add the entries on all three hosts if you like.
[oracle@host01 less_09]$ cat add_tns.sh
cat /stage/RAC/labs/less_09/prod1_tns.txt>>
/u01/app/oracle/product/12.2.0/dbhome_1/network/admin/tnsnames.ora

ssh host02 "cat /stage/RAC/labs/less_09/prod1_tns.txt>>


/u01/app/oracle/product/12.2.0/dbhome_1/network/admin/tnsnames.ora"

a ble
ssh host03 "cat /stage/RAC/labs/less_09/prod1_tns.txt>>
f e r
/u01/app/oracle/product/12.2.0/dbhome_1/network/admin/tnsnames.ora"
ans
n - t r
o
s an
echo "PROD1 tnsnames.ora entry completed for HOST01"
echo "PROD1 tnsnames.ora entry completed for HOST02"
) ha eฺ
echo "PROD1 tnsnames.ora entry completed for HOST03"
ฺ c om Guid
[oracle@host01 less_09]$ cat a
r cle ent
prod1_tns.txt
prod1 = (DESCRIPTION = @o
a S tud
a
(ADDRESS = (PROTOCOL
o t h is
n = TCP)(HOST = cluster01-

n us e
scan.cluster01.example.com)(PORT
e = 1521))

( c arm se t=o YES)=(CONNECT_DATA


(LOAD_BALANCE
DEDICATED)(SERVICE_NAME prod1)))
= (SERVER =

a na licen
e n O[oracle@host01 less_09]$ ./add_tns.sh
a r m PROD1 tnsnames.ora entry completed for HOST01
C PROD1 tnsnames.ora entry completed for HOST02
PROD1 tnsnames.ora entry completed for HOST03

[oracle@host01 less_09]$

2. Use the srvctl command to check the status of the new service. On which host is your
service running? (It may be different from the example below)
[oracle@host01 less_09]$ srvctl status service -db orcl -service
prod1
Service prod1 is running on nodes: host01
[oracle@host01 ~]$

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

180 Practices for Lesson 9: Managing High Availability of Services


3. Change user to grid, set the environment and check the status of the PROD1 service using
CRSCTL.
[oracle@host01 less_09]$ su - grid
Password:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

[grid@host01 ~]$ . oraenv


ORACLE_SID = [grid] ? +ASM1
The Oracle base has been set to /u01/app/grid

[grid@host01 ~]$ crsctl stat res -t


----------------------------------------------------------------------
Name Target State Server State details
----------------------------------------------------------------------
a ble
Local Resources f e r
---------------------------------------------------------------------- ans
ora.ASMNET1LSNR_ASM.lsnr n - t r
o
ONLINE ONLINE host01
s an STABLE
ONLINE ONLINE
ha eฺ
host02
)
STABLE
ONLINE ONLINE
ฺ c om Guid
host03 STABLE

cle ent
ora.DATA.dg
r a
ONLINE ONLINE host01 STABLE
@ o
ONLINE ONLINE
a S tud host02 STABLE

o a n this
ONLINE ONLINE host03 STABLE
ora.FRA.dg
e nฺ use
( c arm se to
ONLINE ONLINE host01 STABLE

na licen
ONLINE ONLINE host02 STABLE

O a ONLINE ONLINE host03 STABLE


e n ora.LISTENER.lsnr
a r m ONLINE ONLINE host01 STABLE
C ONLINE ONLINE host02 STABLE
ONLINE ONLINE host03 STABLE
ONLINE ONLINE host04 STABLE
ONLINE ONLINE host05 STABLE
ora.LISTENER_LEAF.lsnr
OFFLINE OFFLINE host04 STABLE
OFFLINE OFFLINE host05 STABLE
ora.MGMT.dg
ONLINE ONLINE host01 STABLE
ONLINE ONLINE host02 STABLE
ONLINE ONLINE host03 STABLE
ora.chad
ONLINE ONLINE host01 STABLE
ONLINE ONLINE host02 STABLE
ONLINE ONLINE host03 STABLE
ONLINE ONLINE host04 STABLE

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

Practices for Lesson 9: Managing High Availability of Services 181


ONLINE ONLINE host05 STABLE
ora.net1.network
ONLINE ONLINE host01 STABLE
ONLINE ONLINE host02 STABLE
ONLINE ONLINE host03 STABLE
ONLINE ONLINE host04 STABLE
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

ONLINE ONLINE host05 STABLE


ora.ons
ONLINE ONLINE host01 STABLE
ONLINE ONLINE host02 STABLE
ONLINE ONLINE host03 STABLE
ora.proxy_advm
OFFLINE OFFLINE host01 STABLE
OFFLINE OFFLINE host02 STABLE
a ble
OFFLINE OFFLINE host03 STABLE f e r
---------------------------------------------------------------------- ans
Cluster Resources n - t r
o
an
----------------------------------------------------------------------
s
ora.LISTENER_SCAN1.lsnr
) ha eฺ
1 ONLINE ONLINE
ฺ om Guid
host03
c
STABLE

cle ent
ora.LISTENER_SCAN2.lsnr
1 r
ONLINE ONLINE a host02 STABLE
ora.LISTENER_SCAN3.lsnr
a @ o
S tud
1 a n this
ONLINE ONLINE
o host01 STABLE
ora.MGMTLSNR
e nฺ use
(
1
c arm se to
ONLINE ONLINE host01 169.254.116.21

na licen
192.168.1.101

O a 192.168.2.101,
e n STABLE
a r m ora.asm
C 1 ONLINE ONLINE host01 Started,STABLE
2 ONLINE ONLINE host03 Started,STABLE
3 ONLINE ONLINE host02 Started,STABLE
ora.cvu
1 OFFLINE OFFLINE STABLE
ora.gns
1 ONLINE ONLINE host01 STABLE
ora.gns.vip
1 ONLINE ONLINE host01 STABLE
ora.host01.vip
1 ONLINE ONLINE host01 STABLE
ora.host02.vip
1 ONLINE ONLINE host02 STABLE
ora.host03.vip
1 ONLINE ONLINE host03 STABLE
ora.host04.vip

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

182 Practices for Lesson 9: Managing High Availability of Services


1 ONLINE ONLINE host04 STABLE
ora.host05.vip
1 ONLINE ONLINE host05 STABLE
ora.mgmtdb
1 ONLINE ONLINE host01 Open,STABLE
ora.orcl.db
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

1 ONLINE ONLINE host04 Open,Readonly,HOME=/


u01/app/oracle/produ
ct/12.2.0/dbhome_1,
STABLE
2 ONLINE ONLINE host05 Open,Readonly,HOME=/
u01/app/oracle/produ
ct/12.2.0/dbhome_1,
STABLE
a ble
3 ONLINE ONLINE host03 Open,HOME=/u01/app/o f e r
ans
racle/product/12.2.0
n - t r
/dbhome_1,STABLE
o
4 ONLINE ONLINE
s an host02 Open,HOME=/u01/app/o

) ha eฺ racle/product/12.2.0

ฺ c om Guid /dbhome_1,STABLE

cle ent
5 ONLINE ONLINE host01 Open,HOME=/u01/app/o
r a racle/product/12.2.0

a @ o
S tud /dbhome_1,STABLE
ora.orcl.leafsvc.svc an
o t h is
1
e nฺ uONLINE
ONLINE s e host04 STABLE
2
a r m t
ONLINEo ONLINE host05 STABLE
( c s e
na1 licenONLINE
ora.orcl.oltpsvc.svc

O a ONLINE host03 STABLE


e n 2 ONLINE ONLINE host01 STABLE
a r m 3 ONLINE ONLINE host02 STABLE
C ora.orcl.prod1.svc
1 ONLINE ONLINE host01 STABLE
ora.qosmserver
1 ONLINE ONLINE host01 STABLE
ora.scan1.vip
1 ONLINE ONLINE host03 STABLE
ora.scan2.vip
1 ONLINE ONLINE host02 STABLE
ora.scan3.vip
1 ONLINE ONLINE host01 STABLE
----------------------------------------------------------------------

[grid@host01 ~]$ exit


logout
[oracle@host01 less_09]$

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

Practices for Lesson 9: Managing High Availability of Services 183


4. Connect to the service and query V$INSTANCE and determine what instance you are
connected to. Check the database status to determine the host on which the instance is
running.
[oracle@host01 less_09]$ sqlplus sys/<sys_password>@prod1 as
sysdba
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

SQL*Plus: Release 12.2.0.1.0 Production on Tue Nov 7 09:16:03


2017

Copyright (c) 1982, 2016, Oracle. All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 -
a b le
64bit Production
f e r
an s
SQL> select instance_name from v$instance;
n - t r
a no
INSTANCE_NAME
h a s
---------------- m ) ideฺ
orcl_5
l e ฺco t Gu
o rac uden
SQL> exit
a @ S t
Disconnected from o an Database
Oracle t hi s 12c Enterprise Edition Release
n ฺ e
12.2.0.1.0 - 64bit
r m e
t o us
Production

a (ca nsless_09]$
[oracle@host01
e srvctl status database -db orcl
a n l i c e
e n OInstance orcl_1 is running on node host04
a r m Instance orcl_2 is running on node host05
C Instance orcl_3 is running on node host03
Instance orcl_4 is running on node host02
Instance orcl_5 is running on node host01
[oracle@host01 less_09]$

5. From a terminal session on the node hosting the PROD1 service, as the oracle user, crash
the instance on that node. In this example, the service is running on host01. Use ssh to
log into the host, find the database pmon process and kill the ora_pmon_orcl_n process.
Use the pkill -9 –f ora_pmon_orcl_n command to crash the database instance.
The orcl_1 instance will crash and the Clusterware services will restart it very quickly. Exit
back to host01.
[oracle@host01 less_09]$ ssh host01

[oracle@host01 ~]$ ps -ef|grep ora_pmon

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

184 Practices for Lesson 9: Managing High Availability of Services


oracle 4305 1 0 Sep13 ? 00:04:25 ora_pmon_orcl_5
oracle 26772 26746 0 13:47 pts/1 00:00:00 grep ora_pmon

[oracle@host01 ~]$ pkill -9 -f ora_pmon_orcl_5


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

[oracle@host01 ~]$ exit


logout
Connection to host01 closed.
[oracle@host01 less_09]$

6. Use SRVCTL to check the status of the PROD1 service. Where is the service running now?
In the example below, the service has been failed over to host02. What instance is
running on the system hosting the service? a ble
f e r
[oracle@host01 less_09]$ srvctl status service -db orcl -service
ans
prod1
n - t r
Service PROD1 is running on nodes: host02
a no
h a s
[oracle@host01 less_09]$ srvctl status database
m ) ide-db ฺ orcl
Instance orcl_1 is running on nodeฺc o Gu
host04
Instance orcl_2 is running onanode
l e
c host05n t
r e
oon nodetudhost03
Instance orcl_3 is running
n a @ s S
Instance orcl_4 is a running h i
on node host02
t on node host01
Instance orcl_5e nisฺo running
s e
a r m to u
a (c nsless_09]$
e
an
[oracle@host01
lic e
n O
r m e
7. Make a connection to the database using the PROD1 service. What instance are you
C a connected to?
[oracle@host01 less_09]$ sqlplus sys/<sys_password>@prod1 as
sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Tue Nov 7 09:39:58


2017

Copyright (c) 1982, 2016, Oracle. All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 -
64bit Production

SQL> select instance_name from v$instance;

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

Practices for Lesson 9: Managing High Availability of Services 185


INSTANCE_NAME
----------------
orcl_4
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release
12.2.0.1.0 - 64bit Production

[oracle@host01 less_09]$ srvctl status database -db orcl


Instance orcl_1 is running on node host04
Instance orcl_2 is running on node host05
Instance orcl_3 is running on node host03
a b le
Instance orcl_4 is running on node host02
f e r
Instance orcl_5 is running on node host01 an s
n - t r
[oracle@host01 less_09]$ a no
h a s
m ) ideฺ
8. Use SRVCTL to relocate the PROD1 service back to c
l e ฺ theo original
t G uhost.
[oracle@host01 less_09]$ srvctl
o r ac relocate
d e n service -db orcl -
service PROD1 -c host02 -n host01tu
n a @ sS
o a t h i

n us
[oracle@host01eless_09]$ e
r m
a se to
( c
nathe PROD1
9. Verify that
a l i c enservice has been relocated to the host specified in the previous step.
e n O[oracle@host01 less_09]$ srvctl status service -db orcl -service
rm prod1
Ca Service PROD1 is running on nodes: host01

[oracle@host01 less_09]$

10. Close all terminal sessions opened for this practice.

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

186 Practices for Lesson 9: Managing High Availability of Services


Practice 9-2: Monitoring Services

Overview
In this practice, you will use EM Express to determine the amount of resources used by
sessions executing under a particular service.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

1. Connect to your first node as the oracle user. Set up your environment variables using
the oraenv script. Change directory to /stage/RAC/labs/less_09. Execute the
createuser.sh script. This script creates a new user called jmw identified by the
password jmw. The default tablespace of this user is USERS, and its temporary tablespace
is TEMP. This new user has the CONNECT, RESOURCE, and DBA roles.
[oracle@dns ~]$ ssh oracle@host01
oracle@host01's password:
a ble
f e r
[oracle@host01 ~]$ . oraenv ans
ORACLE_SID = [oracle] ? orcl n - t r
The Oracle base has been set to /u01/app/oracle a no
h a s
m ) ideฺ
ฺco t Gu
[oracle@host01 ~]cd /stage/RAC/labs/less_09

c l e n
[oracle@host01 less_09]$ cato racreateuser.sh
d e
export HOST=`hostname a @
-s` S tu
o an thi s
e ฺ
export ORACLE_HOME=/u01/app/oracle/product/12.2.0/dbhome_1
n use
a r m to -f2 -d" "`
export ORACLE_SID=`$ORACLE_HOME/bin/srvctl status database -db

a (c nse
orcl|grep $HOST|cut
n
export
lice
PATH=$PATH:$ORACLE_HOME/bin
n Oa
r m e
C a /u01/app/oracle/product/12.2.0/dbhome_1/bin/sqlplus -s /NOLOG
<<EOF

connect / as sysdba
drop user jmw cascade;
create user jmw identified by jmw default tablespace users
temporary tablespace temp;
grant connect, resource, dba to jmw;

EOF

[oracle@host01 less_09]$ ./createuser.sh

User dropped.

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

Practices for Lesson 9: Managing High Availability of Services 187


User created.

Grant succeeded.

[oracle@host01 less_09]$
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

2. Open a second terminal to your first node as the oracle user. Be sure to use the –X
option. Set up your environment variables using the oraenv script. Next, start Firefox and
enter the following address:
 http://cluster01-scan.cluster01.example.com:5501/em
 Login to EM Express as sys/<sys_password> as SYSDBA.
[oracle@dns ~]$ ssh -X oracle@host01
a ble
oracle@host01's password:
f e r
ans
[oracle@host01 ~]$ . oraenv
n - t r
o
an
ORACLE_SID = [oracle] ? orcl
s
The Oracle base has been set to /u01/app/oracle
ha eฺ
)
[oracle@host01 ~]$ firefox&
ฺ c om Guid
[oracle@host01 ~]$
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
e nO
a r m
C

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

188 Practices for Lesson 9: Managing High Availability of Services


3. From the first terminal session, connect to prod1 as jmw using SQL*Plus. When
connected, determine the instance on which your session is currently running.
Then execute the following query:
select count(*) from dba_objects,dba_objects,dba_objects
Do not wait; instead, proceed with the next step.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

[oracle@host01 less_09]$ sqlplus jmw/<jmw_password>@PROD1

SQL> select instance_name from v$instance;

INSTANCE_NAME
----------------
orcl_5
a ble
f e r
SQL> select count(*) from dba_objects,dba_objects,dba_objects;
ans
n - t r
a no
h
4. Open a terminal window to connect to host01 as the oracle a s
m ) ideฺ
user. Set up your

ฺco t Gu
environment variables using the oraenv script.
l e
[oracle@dns ~]$ ssh oracle@host01
o r ac den
oracle@host01's password:
a @ S tu
o an thi s
[oracle@host01e~]$ ฺ
n . oraenvs e
ORACLE_SIDar=m [oracle]
u
to ? orcl
( c e
na licbase
The Oracle
a ens has been set to /u01/app/oracle
e nO
rm [oracle@host01 ~]
Ca
5. Check statistics on your service with gv$service_stats from a SQL*Plus session
connected as SYSDBA as shown below.
[oracle@host01 ~]$ sqlplus sys/<sys_password>@oltpsvc as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Tue Nov 7 09:16:03


2017

Copyright (c) 1982, 2016, Oracle. All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 -
64bit Production

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

Practices for Lesson 9: Managing High Availability of Services 189


SQL> select stat_name, sum(value) from gv$service_stats where
service_name = 'PROD1' group by stat_name;

STAT_NAME SUM(VALUE)
----------------------------------------------------- ----------
user calls 25
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

DB CPU 8105608
redo size 3224
db block changes 19
Main function call count 18
DB time 6934
user rollbacks 0
gc cr blocks received 1
a b le
gc cr block receive time 0
f e r
gc current blocks received 193 an s
opened cursors cumulative 544 n - t r
a no
STAT_NAME h a s SUM(VALUE)
m ) ideฺ
workarea executions - multipass leฺ
co t Gu
----------------------------------------------------- ----------
0
session cursor cache hits ora
c e n
tu d 433
user I/O wait time a @ s S 237033
parse count (total) ฺ o an thi 204
e n use
physical readsm to
arblock
16
( c
gc current
a n se receive time 27
a n c e
liexecutions
n Oworkarea
concurrency wait time
- optimal 90
35897
r m e
C a parse time elapsed 866581
physical writes 0
workarea executions - onepass 0

STAT_NAME SUM(VALUE)
----------------------------------------------------- ----------
execute count 568
session logical reads 35993
cluster wait time 75464
application wait time 1327
logons cumulative 2
sql execute elapsed time 11821774
user commits 0

29 rows selected.

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

190 Practices for Lesson 9: Managing High Availability of Services


SQL> exit

[oracle@host01 ~]$

6. You can also use EM Express to view service activity.


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a. Click Performance, then Performance Hub.

a ble
f e r
ans
n - t r
o
an
b. Click the Activity tab. On the activity timeline graph, select Session Identifiers > Service
from the pull-down list. s
ha eฺ
)
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 9: Managing High Availability of Services 191


c. On the bottom-left summary graphic, again choose Session Identifiers > Service from
the pull-down list.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a b le
f e r
an s
n - t r
a no
h a s
m ) ideฺ
l e ฺco t Gu
o rac uden
a @ S t
o an thi s
e ฺ
n use
( c arm se to
d.
a nabottom-right
On the
l i c en summary graphic, choose Session Identifiers > User ID from the
n Opull-down list.
r m e
C a

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

192 Practices for Lesson 9: Managing High Availability of Services


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Spend a few moments and monitor the service activity for the PROD1 service. You should
see the PROD1 service activity steadily increase.

7. Go to the first terminal window. If the query is still running, stop it by issuing a <Ctrl + C>.
SQL> select count(*) from dba_objects,dba_objects,dba_objects;
a ble
f e r
<Ctrl + C> ans
n - t r
^Cselect count(*) from dba_objects,dba_objects,dba_objects
a no
*
h a s
ERROR at line 1:
m ) ideฺ
l e ฺco t Gu
ORA-01013: user requested cancel of current operation

SQL> exit o rac uden


Disconnected from OraclenDatabasea @ s 12c S t Enterprise Edition Release

12.2.0.1.0 - 64bit Productiono a
e t hi
[oracle@host01 m
r en us
less_09]$
( c a se to
a
8. Returningnato EMliExpress,
c en you should see the service activity for PROD1 steadily decrease
e n Oit disappears from the monitored list due to inactivity.
until
rm
Ca

9. In the first terminal window, stop the PROD1 service and remove it.
[oracle@host01 less_09]$ srvctl stop service -db orcl -service PROD1

[oracle@host01 less_09]$ srvctl remove service -db orcl -service


PROD1

[oracle@host01 less_09]$

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

Practices for Lesson 9: Managing High Availability of Services 193


10. Dismiss Firefox and EM Express and close all terminal windows opened for this practice.
11. Close all terminal windows opened for this practice.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

194 Practices for Lesson 9: Managing High Availability of Services


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
a no
h a s
Practices for
m ) ideฺ 10: High
Lesson
l e ฺco t G
Availability u Connections
for
o ac Applications
rand d e n
a @ S tu
o an thi s
e ฺ
n use
( c arm se to
ana licen
n O
r m e
C a
Practices for Lesson 10: Overview

Overview
In this practice, you will use Application Continuity in a RAC environment to demonstrate how
Application Continuity helps an application to seamlessly recover after the failure of a RAC
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

instance.

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

196 Practices for Lesson 10: High Availability for Connections and Applications
Practice 10-1: Using Application Continuity

Overview
In this practice, you will use Application Continuity in a RAC environment to demonstrate how
Application Continuity helps an application to seamlessly recover after the failure of a RAC
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

instance.
1. Open a terminal window to connect to host01 as the root user and set the environment
variables. Stop Oracle Clusterware in host03, host04, and host05.
[oracle@dns ~]$ ssh root@host01
root@host01’s Password:

[root@host01 ~]# . oraenv


a ble
ORACLE_SID = [root] ? +ASM1
f e r
The Oracle base has been set to /u01/app/grid
ans
n - t r
o
an
[root@host01 ~]# crsctl stop cluster -n host03 host04 host05
s
ha eฺ
CRS-2673: Attempting to stop 'ora.crsd' on 'host05'
)
ฺ c om Guid
CRS-2673: Attempting to stop 'ora.crsd' on 'host04'

r a cle ent
CRS-2673: Attempting to stop 'ora.crsd' on 'host03'

@ o
resources on server 'host05'
a S tud
CRS-2790: Starting shutdown of Cluster Ready Services-managed

o a n this
CRS-2673: Attempting to stop 'ora.chad' on 'host05'
e nฺ use
CRS-2673: Attempting to stop 'ora.orcl.leafsvc.svc' on 'host05'
c arm se to
CRS-2790: Starting shutdown of Cluster Ready Services-managed
(
na licen
resources on server 'host04'
a
n OCRS-2673: Attempting to stop 'ora.chad' on 'host04'

r m e CRS-2673: Attempting to stop 'ora.orcl.leafsvc.svc' on 'host04'


C a CRS-2790: Starting shutdown of Cluster Ready Services-managed
resources on server 'host03'
CRS-2673: Attempting to stop 'ora.orcl.oltpsvc.svc' on 'host03'
CRS-2673: Attempting to stop 'ora.chad' on 'host03'
CRS-2677: Stop of 'ora.orcl.leafsvc.svc' on 'host05' succeeded
CRS-2673: Attempting to stop 'ora.orcl.db' on 'host05'
CRS-2677: Stop of 'ora.orcl.leafsvc.svc' on 'host04' succeeded
CRS-2673: Attempting to stop 'ora.orcl.db' on 'host04'
CRS-2677: Stop of 'ora.orcl.db' on 'host04' succeeded
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'host04'
CRS-2677: Stop of 'ora.orcl.db' on 'host05' succeeded
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'host05'
CRS-2673: Attempting to stop 'ora.LISTENER_LEAF.lsnr' on
'host05'
CRS-2677: Stop of 'ora.orcl.oltpsvc.svc' on 'host03' succeeded

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

Practices for Lesson 10: High Availability for Connections and Applications 197
CRS-2673: Attempting to stop 'ora.orcl.db' on 'host03'
CRS-2673: Attempting to stop 'ora.LISTENER_LEAF.lsnr' on
'host04'
CRS-2677: Stop of 'ora.LISTENER_LEAF.lsnr' on 'host04' succeeded
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'host04' succeeded
CRS-2677: Stop of 'ora.LISTENER_LEAF.lsnr' on 'host05' succeeded
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'host05' succeeded


CRS-2673: Attempting to stop 'ora.host05.vip' on 'host05'
CRS-2673: Attempting to stop 'ora.host04.vip' on 'host04'
CRS-2677: Stop of 'ora.host04.vip' on 'host04' succeeded
CRS-2677: Stop of 'ora.host05.vip' on 'host05' succeeded
CRS-2677: Stop of 'ora.chad' on 'host04' succeeded
CRS-2672: Attempting to start 'ora.host04.vip' on 'host02'
a ble
CRS-2677: Stop of 'ora.orcl.db' on 'host03' succeeded
f e r
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'host03' ans
CRS-2673: Attempting to stop 'ora.FRA.dg' on 'host03' n - t r
o
an
CRS-2673: Attempting to stop 'ora.MGMT.dg' on 'host03'
s
ha eฺ
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'host03'
)
ฺ c om Guid
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on
'host03'
r a cle ent
tud
CRS-2677: Stop of 'ora.chad' on 'host03' succeeded
@ o
a S
CRS-2677: Stop of 'ora.FRA.dg' on 'host03' succeeded
n this
o a
e nฺ use
CRS-2677: Stop of 'ora.DATA.dg' on 'host03' succeeded
CRS-2677: Stop of 'ora.MGMT.dg' on 'host03' succeeded
( c arm se to
CRS-2673: Attempting to stop 'ora.asm' on 'host03'
na licen
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'host03' succeeded
a
n O
CRS-2673: Attempting to stop 'ora.host03.vip' on 'host03'
r m e CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'host03'
C a succeeded
CRS-2673: Attempting to stop 'ora.scan1.vip' on 'host03'
CRS-2677: Stop of 'ora.asm' on 'host03' succeeded
CRS-2673: Attempting to stop 'ora.ASMNET1LSNR_ASM.lsnr' on
'host03'
CRS-2677: Stop of 'ora.host03.vip' on 'host03' succeeded
CRS-2677: Stop of 'ora.scan1.vip' on 'host03' succeeded
CRS-2676: Start of 'ora.host04.vip' on 'host02' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'host04'
CRS-2677: Stop of 'ora.net1.network' on 'host04' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources
on 'host04' has completed
CRS-2677: Stop of 'ora.chad' on 'host05' succeeded
CRS-2672: Attempting to start 'ora.host05.vip' on 'host02'
CRS-2677: Stop of 'ora.ASMNET1LSNR_ASM.lsnr' on 'host03'
succeeded

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

198 Practices for Lesson 10: High Availability for Connections and Applications
CRS-2672: Attempting to start 'ora.scan1.vip' on 'host01'
CRS-2672: Attempting to start 'ora.host03.vip' on 'host02'
CRS-2677: Stop of 'ora.crsd' on 'host04' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on
'host04'
CRS-2673: Attempting to stop 'ora.ctssd' on 'host04'
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

CRS-2673: Attempting to stop 'ora.evmd' on 'host04'


CRS-2673: Attempting to stop 'ora.storage' on 'host04'
CRS-2677: Stop of 'ora.storage' on 'host04' succeeded
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'host04'
succeeded
CRS-2677: Stop of 'ora.ctssd' on 'host04' succeeded
CRS-2677: Stop of 'ora.evmd' on 'host04' succeeded
a ble
CRS-2673: Attempting to stop 'ora.cssd' on 'host04'
f e r
CRS-2677: Stop of 'ora.cssd' on 'host04' succeeded
ans
CRS-2676: Start of 'ora.host05.vip' on 'host02' succeeded n - t r
o
an
CRS-2676: Start of 'ora.scan1.vip' on 'host01' succeeded
s
'host01' ) ha eฺ
CRS-2672: Attempting to start 'ora.LISTENER_SCAN1.lsnr' on

ฺ c om Guid
CRS-2673: Attempting to stop 'ora.net1.network' on 'host05'
r a cle ent
CRS-2677: Stop of 'ora.net1.network' on 'host05' succeeded
@ o
S tud
CRS-2792: Shutdown of Cluster Ready Services-managed resources
a
a n this
on 'host05' has completed
o
e nฺ use
CRS-2676: Start of 'ora.host03.vip' on 'host02' succeeded

( c arm se to
CRS-2677: Stop of 'ora.crsd' on 'host05' succeeded

ana licen
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on
'host05'
n O
r m e CRS-2673: Attempting to stop 'ora.ctssd' on 'host05'

C a CRS-2673: Attempting to stop 'ora.evmd' on 'host05'


CRS-2673: Attempting to stop 'ora.storage' on 'host05'
CRS-2677: Stop of 'ora.storage' on 'host05' succeeded
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'host05'
succeeded
CRS-2677: Stop of 'ora.ctssd' on 'host05' succeeded
CRS-2677: Stop of 'ora.evmd' on 'host05' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'host05'
CRS-2677: Stop of 'ora.cssd' on 'host05' succeeded
CRS-2676: Start of 'ora.LISTENER_SCAN1.lsnr' on 'host01'
succeeded
CRS-2673: Attempting to stop 'ora.ons' on 'host03'
CRS-2677: Stop of 'ora.ons' on 'host03' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'host03'
CRS-2677: Stop of 'ora.net1.network' on 'host03' succeeded

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

Practices for Lesson 10: High Availability for Connections and Applications 199
CRS-2792: Shutdown of Cluster Ready Services-managed resources
on 'host03' has completed
CRS-2677: Stop of 'ora.crsd' on 'host03' succeeded
CRS-2673: Attempting to stop 'ora.ctssd' on 'host03'
CRS-2673: Attempting to stop 'ora.evmd' on 'host03'
CRS-2673: Attempting to stop 'ora.storage' on 'host03'
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

CRS-2677: Stop of 'ora.storage' on 'host03' succeeded


CRS-2673: Attempting to stop 'ora.asm' on 'host03'
CRS-2677: Stop of 'ora.ctssd' on 'host03' succeeded
CRS-2677: Stop of 'ora.evmd' on 'host03' succeeded
CRS-2677: Stop of 'ora.asm' on 'host03' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on
'host03'
a ble
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'host03'
f e r
succeeded
ans
CRS-2673: Attempting to stop 'ora.cssd' on 'host03'
n - t r
CRS-2677: Stop of 'ora.cssd' on 'host03' succeeded
a no
h a s
[root@host01 ~]#
m ) ideฺ
l e ฺco t Gu
o racusing
2. Open a terminal window connected to host01 d e
the
noracle OS user.
a @ S tu
oan e thi
[oracle@dns ~]$ ssh oracle@host01 s

oracle@host01's npassword:
e~]$ us
r m
a se to
[oracle@host01
( c
ana licen
n O the environment by using the oraenv script.
3. Configure
e
rm [oracle@host01 ~]$ . oraenv
Ca ORACLE_SID = [oracle] ? orcl
The Oracle base has been set to /u01/app/oracle
[oracle@host01 ~]$

4. Confirm that two instances of the RAC database are up and running.
[oracle@host01 ~]$ srvctl status database -db orcl
Instance orcl_4 is running on node host02
Instance orcl_5 is running on node host01

[oracle@host01 ~]$

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

200 Practices for Lesson 10: High Availability for Connections and Applications
5. Navigate to the directory that contains the files for this practice.
[oracle@host01 ~]$ cd /stage/RAC/labs/less_10
[oracle@host01 less_10]$

6. Execute the setup10.sh script from the/stage/RAC/labs/less_10 directory to set up


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

the necessary configuration for this practice.


[oracle@host01 less_10]$ ./setup10.sh

User dropped.

Tablespace dropped.

a ble
Tablespace created.
f e r
ans
User created. n - t r
n o
s a
Grant succeeded.
) ha eฺ
ฺ c om Guid
cle ent
drop table emp
* r a
ERROR at line 1:
a @ o
S tud
ORA-00942: table oro a n does
view t h isnot exist
e nฺ use
c arm se to
Table created.
(
a na licen
e n O[oracle@host01 less_10]$
a r m
C 7. Create a database service on the orcl database. Configure the service for use in
conjunction with Application Continuity.
[oracle@host01 less_10]$ srvctl add service -db orcl -service
actest -serverpool ora.orcldb -cardinality singleton -
failovertype TRANSACTION -commit_outcome TRUE -failoverretry 50
-failoverdelay 5 -retention 86400 -replay_init_time 1800 -
notification TRUE

[oracle@host01 less_10]$

8. Start the service.


[oracle@host01 less_10]$ srvctl start service -db orcl -service
actest
[oracle@host01 less_10]$

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

Practices for Lesson 10: High Availability for Connections and Applications 201
9. Examine the status of the newly created service. Take note of the node it is running on
(host01 in this example) because it may be different in your environment.
[oracle@host01 less_10]$ srvctl status service -db orcl -service
actest
Service actest is running on nodes: host01
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

[oracle@host01 less_10]$

10. Establish another terminal session connected to host01 using the oracle OS user. To
differentiate this session from your primary session, it will be referred to as the ADMIN
session for the rest of the practice.
[oracle@dns ~]$ ssh oracle@host01
oracle@host01's password:
a ble
f e r
[oracle@host01 ~]$ cd /stage/RAC/labs/less_10
ans
[oracle@host01 less_10]$
n - t r
a no
11. Configure the prompt in your ADMIN session as shown below. h a s will help you to
This
m ) through
d e ฺ
differentiate between your terminal sessions as you progress i this practice.
ฺco t Gu ADMIN] $ '
e
[oracle@host01 less_10]$ export lPS1='[HOST01
[HOST01 ADMIN] $ o rac uden
a @ S t
o an thi s
e
12. Configure the environment ฺ
n usADMIN
in your e session by using the oraenv script.
[HOST01 ADMIN]
( c arm s$e psto -ef |grep ora_smon
a na licen
e n Ooracle 21046 1 0 15:04 ? 00:00:00 ora_smon_orcl_5
rm oracle 23595 18572 0 15:09 pts/44 00:00:00 grep ora_smon
Ca
[HOST01 ADMIN] $. oraenv
ORACLE_SID = [oracle] ? orcl_5
The Oracle base has been set to /u01/app/oracle
[HOST01 ADMIN] $

13. Back in your second terminal window, examine the scripts that you will soon use to execute
the practice application. Notice that both scripts execute the same application code (in
actest.jar). The only difference is that each script references a different properties file.
[oracle@host01 less_10]$ cat runnoreplay
java -
classpath ./actest.jar:$ORACLE_HOME/ucp/lib/ucp.jar:$ORACLE_HOME
/jdbc/lib/ojdbc8.jar actest.ACTest actest_noreplay.properties
[oracle@host01 less_10]$

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

202 Practices for Lesson 10: High Availability for Connections and Applications
[oracle@host01 less_10]$ cat runreplay
java -
classpath ./actest.jar:$ORACLE_HOME/ucp/lib/ucp.jar:$ORACLE_HOME
/jdbc/lib/ojdbc8.jar actest.ACTest actest_replay.properties

[oracle@host01 less_10]$
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

14. Examine the properties files. Notice that the only difference is the datasource
specification.
[oracle@host01 less_10]$ cat actest_noreplay.properties
username=scott
password=tiger
autoCommit=false
a ble
f e r
ans
# Use standard 12.2 datasource no replay
n - t r
datasource=oracle.jdbc.pool.OracleDataSource
a no
h a s
) ideฺ
url=jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=
m
cluster01-
l e ฺco t Gu
scan.cluster01.example.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NA
ME=actest)))
o rac uden
a @ S t
# UCP setting: o an thi s
e
ucp_pool_size=2

n use
c arm se to
ucp_validate_connection_on_borrow=true
(
na licen
ucp_connection_wait_timeout=60
a
n O
r m e # Think Time taken to process the results from the database.
C a Time in milliseconds.
# -1 means no sleep.
thread_think_time=20

# Number of concurrent threads running in the application


# UCP is tuned to have MAX and MIN limit set to this
number_of_threads=6

verbose=true

[oracle@host01 less_10]$

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

Practices for Lesson 10: High Availability for Connections and Applications 203
[oracle@host01 less_10]$ cat actest_replay.properties
username=scott
password=tiger
autoCommit=false
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

# Use new 12.2 replay datasource


datasource=oracle.jdbc.replay.OracleDataSourceImpl

url=jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=
cluster01-
scan.cluster01.example.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NA
ME=actest)))

a ble
# UCP setting:
f e r
ucp_pool_size=2
ans
ucp_validate_connection_on_borrow=true
n - t r
ucp_connection_wait_timeout=60
a no
h a s
# Think Time taken to process the results
m ฺ database.
) fromidethe
Time in milliseconds.
l e ฺco t Gu
# -1 means no sleep.
o r ac den
thread_think_time=20
a @ S tu
o an thi s
e ฺ
# Number of concurrent e
n usthreads running in the application
# UCP is a r m o
tuned to thave MAX and MIN limit set to this
a ( c n se
number_of_threads=6
an lic e
n O
r m e verbose=true
C a
[oracle@host01 less_10]$

[oracle@host01 less_10]$ diff actest_replay.properties


actest_noreplay.properties
5,6c5,6
< # Use new 12.2 replay datasource
< datasource=oracle.jdbc.replay.OracleDataSourceImpl
---
> # Use standard 12.2 datasource no replay
> datasource=oracle.jdbc.pool.OracleDataSource

[oracle@host01 less_10]$

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

204 Practices for Lesson 10: High Availability for Connections and Applications
Next, you will execute the practice Java application twice. Once without the benefit of
Application Continuity, and once with Application Continuity enabled. Notice that you will
execute the same application and the only difference is the JDBC data source that is used
on each occasion. The source files containing the application code are contained in the src
directory. Feel free to examine the application code if you like.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

15. Execute the practice application without the benefit of Application Continuity. Notice that
while the application runs, a periodic status message is displayed.
[oracle@host01 less_10]$ ./runnoreplay
######################################################
Connecting to
jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=clus
ter01-
a ble
scan.cluster01.example.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NA
f e r
ME=actest)))
ans
# of Threads : 6
n - t r
UCP pool size : 2
a no
Thread think time : 20 ms
h a s
) ideฺ
######################################################
m
l e ฺco t Gu
2 active connections, avg response
o rac udtime en from db 38 ms
2 active connections, avg
a @ S
response t time from db 23 ms
o an thi s
e ฺ
n touexecute
s e in the primary window, return to your ADMIN
arm
16. While the application continues
c e o which node is running the actest service. Then, abort
tabout
(
session and remind
nons the host running the actest service (host01 in the example
yourself
a na instance
the database c e
li that you abort the instance on the node running the service and not
n O below). Ensure
shown
rmethe other database node.
Ca [HOST01 ADMIN] $ srvctl status service -db orcl -service actest
Service actest is running on nodes: host01

[HOST01 ADMIN] $ srvctl status database -db orcl


Instance orcl_4 is running on node host02
Instance orcl_5 is running on node host01

[HOST01 ADMIN] $ ssh host01 pkill -9 -f pmon_orcl_5


[HOST01 ADMIN] $

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

Practices for Lesson 10: High Availability for Connections and Applications 205
17. Return to your primary window and you should see a series of errors caused by aborting
the database instance. This is typical of applications that do not use Application Continuity.
Press Ctrl + C to abort the application.
...
at
oracle.ucp.jdbc.oracle.OracleJDBCConnectionPool.borrowConnection
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

(OracleJDBCConnectionPool.java:1441)
at
oracle.ucp.jdbc.oracle.OracleConnectionConnectionPool.borrowConn
ection(OracleConnectionConnectionPool.java:81)
at
oracle.ucp.jdbc.PoolDataSourceImpl.getConnection(PoolDataSourceI
mpl.java:1027)
... 4 more
a ble
.Exception occurred while getting connection:
f e r
oracle.ucp.UniversalConnectionPoolException: Cannot get
ans
Connection from Datasource: java.sql.SQLRecoverableException:
n - t r
Listener refused the connection with the following error:
a no
h a s
ORA-12514, TNS:listener does not currently know of service
requested in connect descriptor
m ) ideฺ
.
l e ฺco t Gu
rac uden
0 active connections, avg response time from db 150418377 ms
o
^C
a @ S t
[oracle@host01 less_10]$
o an thi s
e ฺ
n use
m tinstances
ardatabase o
( c
18. Confirm both RAC
s e are up and running again.
na licen less_10]$ srvctl status database -db orcl
[oracle@host01
a
e n OInstance orcl_4 is running on node host02
rm Instance orcl_5 is running on node host01
Ca
[oracle@host01 less_10]$

19. Reexamine the status of the actest service. You should observe that the service is
running on a different node compared to what you observed earlier. This is because the
service was migrated when you aborted the database instance earlier in the practice.
[oracle@host01 less_10]$ srvctl status service -db orcl -service
actest
Service actest is running on nodes: host02

[oracle@host01 less_10]$

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

206 Practices for Lesson 10: High Availability for Connections and Applications
20. Execute the practice application with Application Continuity enabled. You should see the
same period status messages as before while the application is running.
[oracle@host01 less_10]$ ./runreplay
######################################################
Connecting to
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=clus
ter01-
scan.cluster01.example.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NA
ME=actest)))
# of Threads : 6
UCP pool size : 2
Thread think time : 20 ms
######################################################
a ble
2 active connections, avg response time from db 44 ms f e r
ans
2 active connections, avg response time from db 23 ms
n - t r
a no
a
21. While the application continues to execute in the primary window,
h sreturn to your ADMIN
session and remind yourself about which node is now running
m e ฺ service. Then,
) theidactest
ฺco (which
abort the database instance running the actest service
l e t G uis now host02 in the
o r
example shown below). Ensure that you abort acthe instance
d e n on the node running the service
and not the other database node. @
a S tu
[HOST01 ADMIN] $ srvctl o an status
t s
hi service -db orcl -service actest

n running e
Service actesteis
r m t o us on nodes: host02
[HOST1 a ca ns$ esrvctl status database -db orcl
(ADMIN]
O an liorcl_4
Instance ce is running on node host02
n
rme Instance orcl_5 is running on node host01
Ca [HOST01 ADMIN] $ ssh host02 pkill -9 -f pmon_orcl_4
[HOST01 ADMIN] $

22. Return to your primary window and you should see that the application continued in spite of
the aborted database instance. You should see a pause and then a brief spike in the
response time, which coincides with the time when the database instance was aborted.
Now you have seen how Application Continuity masks the effect of database instance loss
in a RAC database environment. Press Ctrl + C to abort the application.
2 active connections, avg response time from db 44 ms
2 active connections, avg response time from db 23 ms
2 active connections, avg response time from db 20 ms
2 active connections, avg response time from db 16 ms
2 active connections, avg response time from db 14 ms
2 active connections, avg response time from db 12 ms

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

Practices for Lesson 10: High Availability for Connections and Applications 207
2 active connections, avg response time from db 12 ms
2 active connections, avg response time from db 15 ms
2 active connections, avg response time from db 125 ms
2 active connections, avg response time from db 16 ms
2 active connections, avg response time from db 13 ms
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

2 active connections, avg response time from db 12 ms


2 active connections, avg response time from db 12 ms
2 active connections, avg response time from db 13 ms
^C
[oracle@host01 less_10]$

23. Confirm that both instances are running and the service migrated to the other node as
expected. a ble
f e r
[oracle@host01 less_10]$ srvctl status database -db orcl
ans
Instance orcl_4 is running on node host02
n - t r
Instance orcl_5 is running on node host01
a no
h a s
[oracle@host01 less_10]$ srvctl status service
m ) ide-db ฺ orcl -service
actest
l e ฺco t Gu
Service actest is running on a c host01
r nodes: e n
o tu d
a @ s S
[oracle@host01 less_10]$
ฺ o an thi
e n use
m andtoremove it.
arservice
( c
24. Stop the actest
a n se
a n e
lic less_10]$ srvctl stop service -db orcl -service
[oracle@host01
n Oactest
rme
Ca [oracle@host01 less_10]$ srvctl remove service -db orcl -service
actest
[oracle@host01 less_10]$

25. Close all terminal windows opened for this practice.

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

208 Practices for Lesson 10: High Availability for Connections and Applications
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
a no
h a s
Practices for
m ) ideฺ 11:
Lesson
Oracle
l e ฺcoRAC
t G u Node
One
o rac uden
a @ S t
o an thi s
e ฺ
n use
( c arm se to
ana licen
n O
r m e
C a
Practices for Lesson 11: Overview

Overview
In this practice, you will create a RAC One Node database by converting the exiting RAC
database. You will perform an online database relocation. Finally, you will convert the RAC One
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Database to an Oracle RAC database.

a b le
f e r
an s
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

210 Practices for Lesson 11: Oracle RAC One Node


Practice 11-1: RAC One Node

Overview
In this practice, you will create a RAC One Node database by converting the exiting RAC
database. You will perform an online database relocation. Finally, you will convert the RAC One
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Database to an Oracle RAC database.

1. Open a terminal window to connect to host01 as the oracle user. Set the environment
and check the status of the database. Note: Your instance names may be different.
[oracle@dns ~]$ ssh oracle@host01
oracle@host01's password:

a ble
[oracle@host01 ~]$ . oraenv
f e r
ORACLE_SID = [oracle] ? orcl
ans
The Oracle base has been set to /u01/app/oracle n - t r
a no
[oracle@host01 ~]$ srvctl status database -db
h a s orcl
Instance orcl_4 is running on node host02 m ) ideฺ
o Gu
ฺchost01
Instance orcl_5 is running on node
c l e n t
r a e
tud
[oracle@host01 ~]$
@ o
a
n this S
o a
e nฺ Verify
2. Stop the instance on host02.
u s ethe database status.
[oracle@host01
( c arm s~]$
e tosrvctl stop instance -f -db orcl -node host02

a na licen ~]$ srvctl status database -db orcl


n OInstance orcl_5 is running on node host01
[oracle@host01

rm e
Ca Instance orcl_4 is not running on node host02
[oracle@host01 ~]$

3. An active service is needed to convert the RAC database to RACONENODE. Create a


service called SERV1.
[oracle@host01 ~]$ srvctl add service -db orcl -service SERV1 -
serverpool orcldb
[oracle@host01 ~]$

4. Attempt to convert the RAC database to RACONENODE. What do you observe?


[oracle@host01 ~]$ srvctl convert database -db orcl -dbtype
RACONENODE
PRCD-1155 : Failed to convert the configuration of cluster
database orcl into its equivalent RAC One Node database

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

Practices for Lesson 11: Oracle RAC One Node 211


configuration because cluster database has more than one server
pool [ora.orcldb, ora.RACLEAF] to control its placement
[oracle@host01 ~]$

5. Remove the components that were added for the Reader Nodes and convert the RAC
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

database to RACONENODE.
[oracle@host01 ~]$ srvctl remove service -db orcl –service
leafsvc
[oracle@host01 ~]$ srvctl remove srvpool -serverpool RACLEAF

[oracle@host01 ~]$ srvctl modify database -db orcl –serverpool


orcldb
[oracle@host01 ~]$ srvctl convert database -db orcl –dbtype
a b le
f e r
RACONENODE
an s
[oracle@host01 ~]$
n - t r
a no
a s using the srvctl
6. From the oracle terminal session, check your database configuration
h
utility. m ) ideฺ
ฺco t G-db
[oracle@host01 ~]$ srvctl configledatabase
u orcl
Database unique name: orcl ora
c e n
tu d
Database name: orcl a @ s S
ฺ o an thi
Oracle home: /u01/app/oracle/product/12.2.0/dbhome_1
e n use
Oracle user:moracle
Spfile:(c ar se to
+DATA/ORCL/PARAMETERFILE/spfile.267.959256577
ana lifile:
Password c en +DATA/ORCL/PASSWORD/pwdorcl.257.959256207
e n ODomain:
rm Start options: open
Ca Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: orcldb
Disk Groups: FRA,DATA
Mount point paths:
Services: actest,OLTPSVC,SERV1
Type: RACOneNode
Online relocation timeout: 30
Instance name prefix: orcl
Candidate servers:
OSDBA group: dba
OSOPER group: oper
Database instances: orcl_1
CSS critical: no

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

212 Practices for Lesson 11: Oracle RAC One Node


CPU count: 0
Memory target: 0
Maximum memory: 0
Default network number for database services:
Database is policy managed
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

[oracle@host01 ~]$

7. Use the srvctl utility to check the status of the orcl database.
[oracle@host01 ~]$ srvctl status database -db orcl
Instance orcl_5 is running on node host01
Online relocation: INACTIVE
a ble
[oracle@host01 ~]$
f e r
ans
n - t r
8.
a no
Execute srvctl relocate database –help to view command usage.
[oracle@host01 ~]$ srvctl relocate database -help
h a s
m ) ideฺ
Initiate online relocation of the RAC
ฺ c o GNode
One u database.

r a cle ent
Usage: srvctl relocate database
a @
<target>] [-timeout <timeout>]
o -db
S tud<db_unique_name>
[-stopoption
{[-node
<stop_option>] | -
o a n this
abort [-revert]} [-verbose]
e nฺ use
-db <db_unique_name> Unique name of database to
relocate arm t o
a (c <target>
-node n se Target node to which to
an l i c e
nO
relocate database

r m e -timeout <timeout> Online relocation timeout in


C a minutes
-abort Abort failed online
relocation
-revert Remove target node of failed
online relocation request from the candidate server list of
administrator-managed RAC One Node database
-stopoption <stop_option> Override default shutdown
option for running instance (only NORMAL allowed)
-verbose Verbose output
-help Print usage
[oracle@host01 ~]$

9. Open another terminal window as oracle to prepare for monitoring the migration process.
[oracle@dns ~]$ ssh oracle@host01
oracle@host01's password:

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

Practices for Lesson 11: Oracle RAC One Node 213


[oracle@host01 ~]$ . oraenv
ORACLE_SID = [oracle] ? orcl
The Oracle base has been set to /u01/app/oracle
[oracle@host01 ~]$
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

10. Switch to the first terminal window. In this example, the orcl_5 instance was running
initially on host01. Use srvctl to perform an online database relocation from host01 to
host02. Immediately after issuing the command, proceed to the next step!
[oracle@host01 ~]$ srvctl relocate database -db orcl -node
host02 -timeout 15 -verbose

<<< Immediately go to the next step>>>

a b le
Configuration updated to two instances
f e r
Instance orcl_1 started
an s
Services relocated n - t r
Waiting for up to 15 minutes for instance orcl_5 to stop ... a no
Instance orcl_5 stopped
h a s
Configuration updated to one instance m ) ideฺ
l e ฺco t Gu
[oracle@host01 ~]$
o rac uden
a @ S t
o n and
awindow t s
hirun the srvctl status database -db
11. Switch to the second terminal
orcl command severaletimes

n toumonitor e
s the migration process until the relocation
r m t o
(ca in nthesfirst
command finishes
a e terminal. Did you wait for 15 minutes to complete the
a n lice
migration process?
O
n [oracle@host01 ~]$ srvctl status database -db orcl
rm e Instance orcl_5 is running on node host01
Ca Online relocation: ACTIVE
Source instance: orcl_5 on host01
Destination instance: orcl_1 on host02

[oracle@host01 ~]$ srvctl status database -db orcl


Instance orcl_5 is running on node host01
Online relocation: ACTIVE
Source instance: orcl_5 on host01
Destination instance: orcl_1 on host02

[oracle@host01 ~]$ srvctl status database -db orcl


Instance orcl_1 is running on node host02
Online relocation: INACTIVE
[oracle@host01 ~]$

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

214 Practices for Lesson 11: Oracle RAC One Node


Note: In our environment, the migration process would take about 1 minute even though
the timeout was set to 15 minutes. The timeout option in step 10 is the amount of time
after the relocated database starts and services are migrated, before the former instance of the
database stops. This configured amount of time is not an upper bound on the amount of time
taken by the entire operation, but only controls how long the relocated database waits for
connections to migrate from the former instance to the new instance, before stopping the former
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

instance.

12. Let’s convert the RAC One Node database to a RAC database. First, shut down the RAC
One Node database.
[oracle@host01 ~]$ srvctl stop database -db orcl
[oracle@host01 ~]$

a b le
e r
a n sf
13. Use srvctl to convert the database to RAC and restart the database. Check the database
status to make sure that both the instances are up.
n - tr
[oracle@host01 ~]$ srvctl convert database -db orcl
a no -dbtype RAC
h a s
[oracle@host01]$ srvctl start database -db
m ) orcl d e ฺ
ฺco t Gu i
l e
[oracle@host01]$ srvctl status
o racdatabase
d e n -db orcl
Instance orcl_1 is running
a @ on node
S tuhost02
Instance orcl_2 is a
o running s
n thoni node host01
e ฺ
n use
( c arm se to
[oracle@host01]$

a na licen
n O the srvctl status service command to view the services configuration.
14. Execute
e
rm Note that the serv1 service is running on all nodes. Stop the service and remove it.
Ca [oracle@host01 ~]$ srvctl status service -db orcl -service serv1
Service SERV1 is running on nodes: host01,host02

[oracle@host01 ~]$ srvctl stop service -db orcl -service serv1

[oracle@host01 ~]$ srvctl remove service -db orcl -service serv1


[oracle@host01 ~]$

15. Execute the srvctl config database command to view the database configuration.
[oracle@host01 ~]$ srvctl config database -db orcl
Database unique name: orcl
Database name: orcl
Oracle home: /u01/app/oracle/product/12.2.0/dbhome_1
Oracle user: oracle

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

Practices for Lesson 11: Oracle RAC One Node 215


Spfile: +DATA/ORCL/PARAMETERFILE/spfile.267.959256577
Password file: +DATA/ORCL/PASSWORD/pwdorcl.257.959256207
Domain:
Start options: open
Stop options: immediate
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Database role: PRIMARY


Management policy: AUTOMATIC
Server pools: orcldb
Disk Groups: FRA,DATA
Mount point paths:
Services: OLTPSVC
Type: RAC
Start concurrency:
a b le
Stop concurrency: f e r
an s
OSDBA group: dba
n - t r
OSOPER group: oper o
Database instances:
s an
Configured nodes: ) ha eฺ
CSS critical: no
ฺ c om Guid
CPU count: 0
r a cle ent
Memory target: 0
a @ o
S tud
Maximum memory: 0
o a n this
nฺ use
Default network number for database services:
e
( c arm se to
Database is policy managed

ana licen ~]$


[oracle@host01
e nO
r m
a 16. Exit all terminal windows opened for this practice.
C

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

216 Practices for Lesson 11: Oracle RAC One Node


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
a no
h a s
Practices for
m ) ideฺ 12:
Lesson
Oracle
l e ฺcoDatabase
t G u In-Memory
o rinacRAC d e n
a @ S tu
o an thi s
e ฺ
n use
( c arm se to
ana licen
n O
r m e
C a
Practices for Lesson 12: Overview

Overview
In this practice, you will reconfigure your practice environment in preparation for the CDB
practices.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

218 Practices for Lesson 12: Oracle Database In-Memory in RAC


Practice 12-1: Reconfiguring the Environment

Overview
In this practice, you will reconfigure your practice environment in preparation for the CDB
practices.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

1. Open a terminal window to connect to host01 as root user to start Oracle Clusterware
on host03.
[oracle@dns ~]$ ssh root@host01
root@host01’s Password:
[root@host01 ~]# . oraenv
ORACLE_SID = [root] ? +ASM1
a ble
The Oracle base has been set to /u01/app/grid f e r
ans
[root@host01 ~]# crsctl start cluster –n host03
n - t r
CRS-2672: Attempting to start 'ora.evmd' on 'host03' o
an
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'host03'
s
) ha eฺ
CRS-2676: Start of 'ora.cssdmonitor' on 'host03' succeeded

ฺ c om Guid
CRS-2672: Attempting to start 'ora.cssd' on 'host03'

r a cle ent
CRS-2672: Attempting to start 'ora.diskmon' on 'host03'

a @ o
S tud
CRS-2676: Start of 'ora.diskmon' on 'host03' succeeded

o a n this
CRS-2676: Start of 'ora.evmd' on 'host03' succeeded
nฺ use
CRS-2676: Start of 'ora.cssd' on 'host03' succeeded
e
( c arm se to
CRS-2672: Attempting to start 'ora.ctssd' on 'host03'
CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on
ana licen
'host03'
n O
CRS-2676: Start of 'ora.ctssd' on 'host03' succeeded
r m e
C a CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'host03'
succeeded
CRS-2672: Attempting to start 'ora.asm' on 'host03'
CRS-2676: Start of 'ora.asm' on 'host03' succeeded
CRS-2672: Attempting to start 'ora.storage' on 'host03'
CRS-2676: Start of 'ora.storage' on 'host03' succeeded
CRS-2672: Attempting to start 'ora.crsd' on 'host03'
CRS-2676: Start of 'ora.crsd' on 'host03' succeeded

[root@host01 ~]#

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

Practices for Lesson 12: Oracle Database In-Memory in RAC 219


2. Open a new terminal window to connect to host01 as the oracle user to remove the
existing RAC database. Navigate to
/u01/app/oracle/product/12.2.0/dbhome_1/bin and execute DBCA.
[oracle@dns ~]# ssh -X oracle@host01
oracle@host01's password:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

[oraclec@host01 ~]# cd /u01/app/oracle/product/12.2.0/dbhome_1/bin

[oracle@host01 bin]$ ./dbca

Step Screen/Page Description Choices or Values

a ble
2-1 Database Operation Select Delete Database. Click Next.
f e r
2-2 Source Database Select orcl and Enter the SYS user’s ans
Password and Click Next n - t r
a no
2-3 De-register Management Options
h a s Click Next.
2-4 Summary Clickm ) ideฺ
Finish.

l e coaretinformed
ฺYou G u that the instances and
rac udatafiles
2-5 Database Configuration Assistant
dialog box o d en will be deleted. Click Yes to
a @ S t proceed.
o an thi s
2-6 Finish
e ฺ
n use You are informed that database deletion

( c arm se to is complete. Click Close

ana licen
3.
e n O the orcldb server pool.
Remove
rm
Ca
[oracle@host01 bin]$ /u01/app/12.2.0/grid/bin/srvctl remove srvpool
-serverpool orcldb

[oracle@host01 bin]$ /u01/app/12.2.0/grid/bin/srvctl status srvpool


Server pool name: Free
Active servers count: 3
Server pool name: Generic
Active servers count: 0

[oracle@host01 bin]$

4. Start DBCA and perform the following steps.


[oracle@host01 bin]$ ./dbca

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

220 Practices for Lesson 12: Oracle Database In-Memory in RAC


5. On the “Select Database Operation” page, select Create a database and click Next.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 12: Oracle Database In-Memory in RAC 221


6. On The “Select Database Creation Mode” page, select “Advanced configuration” and click
Next.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

222 Practices for Lesson 12: Oracle Database In-Memory in RAC


7. On the “Select Database Deployment Type” page, select “Oracle Real Application Cluster
(RAC) database” from the Database type pull-down list and “Policy Managed” from the
Configuration type pull-down list. Select the “General Purpose or Transaction Processing”
template and click Next.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 12: Oracle Database In-Memory in RAC 223


8. On the Select Server Pool Option page, specify cdb1pool for the Server pool Name and
set its cardinality to 3. Click Next to proceed
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

224 Practices for Lesson 12: Oracle Database In-Memory in RAC


9. Ensure the Global database name is cdb1.
 Select “Create as Container Database.”
 Select “Use Local Undo tablespace for PDBs
 Select “Create a Container database with one or more PDBs
 Select 1 for Number of PDBs
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

 Enter pdb1 for PDB Name.


Click Next to continue.

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 12: Oracle Database In-Memory in RAC 225


10. On the Select Database Storage Option page, click the “Use following for the database
storage attributes” button. Make sure “Automatic Storage Management (ASM)” is selected
from the Database files storage type pull down list and the Database files location is
+DATA/{DB_UNIQUE_NAME}. Make sure the “Use Oracle-Managed Files (OMF)” check
box is selected and click Next.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

226 Practices for Lesson 12: Oracle Database In-Memory in RAC


11. On the Select Fast Recovery page, click Next to continue.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 12: Oracle Database In-Memory in RAC 227


12. On the Select Oracle Data Vault Config Option page, click Next.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

228 Practices for Lesson 12: Oracle Database In-Memory in RAC


13. On the Specify Configuration Options page, set Memory Size (SGA and PGA) to around
3000. Click Next.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 12: Oracle Database In-Memory in RAC 229


14. On the Management Options screen, uncheck both Run Cluster Verification Utility (CVU)
Checks Periodically and Configure EM Database Express. Click next to continue.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

230 Practices for Lesson 12: Oracle Database In-Memory in RAC


15. On the Specify database User Credentials page, click the “Use the same administrative
password for all accounts” button. Enter the sys password (please refer to the Course
Practice Environment: Security Credentials page for account passwords) in both the
Password and Confirm Password fields and click Next.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 12: Oracle Database In-Memory in RAC 231


16. On the Select Database Creation Options page, make sure the “Create database” check
box is selected and click Next.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

232 Practices for Lesson 12: Oracle Database In-Memory in RAC


17. Wait while a series of prerequisite checks are performed.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 12: Oracle Database In-Memory in RAC 233


18. On the Summary page, review the information and click Finish.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

234 Practices for Lesson 12: Oracle Database In-Memory in RAC


19. Wait a few moments and follow the database creation process on the Progress Page. It
takes about 20min to complete the rest of steps.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
O
n Close to dismiss DBCA.
20.eClick
r m
a 21. Close all terminal windows opened for this practice.
C

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

Practices for Lesson 12: Oracle Database In-Memory in RAC 235


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

236 Practices for Lesson 12: Oracle Database In-Memory in RAC


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
a no
h a s
Practices for
m ) ideฺ 13:
Lesson
l e ฺco t G
Multitenant u
Architecture and
a c n
o rRAC
t u de
n a @ s S
a h i
e nฺo use t
( c arm se to
ana licen
n O
r m e
C a
Practices for Lesson 13: Overview

Overview
In this practice, you will explore the architecture and structures of cdb1 and its pluggable
databases in RAC.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

In this practice, you will clone the pdb1 PDB into a new PDB named pdb2 in the cdb1 CDB.
This operation requires to close and open PDBs on multiple instances of the CDB.
In this practice, you will “affinitize” connections to a PDB to one or particular CDB instances.
Because server pools determine which services run together or separately, you can configure
and maintain required affinity or isolation.
In this practice, you will drop a PDB in the CDB and verify that the services and data files are
deleted.
a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

238 Practices for Lesson 13: Multitenant Architecture and RAC


Practice 13-1: Exploring CDB Architecture and Structures in RAC

Overview
In this practice, you will explore the architecture and structures of cdb1 and its pluggable
databases in RAC.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

1. Open a terminal window to connect to host01 as grid user and set up the environment
variables using the oraenv script.
[oracle@dns ~]$ ssh grid@host01
grid@host01’s password:

[grid@host01 ~]$ . oraenv


a ble
ORACLE_SID = [grid] ? +ASM1 f e r
ans
The Oracle base has been set to /u01/app/grid
n - t r
o
[grid@host01 ~]$ s an
) ha eฺ

2. Check the cdb1pool server pool and its cardinality. c om Guid
a le nt
csrvpool
[grid@host01 ~]$ srvctl status
o r
t u de
Server pool name: Freea@ S
a n t h i s
nฺoGeneric
Active servers count: 0
Server pool name: e u s e
a r m count:
t o
a ( c nse
Active servers 0

O an pool
Server
lice count: 3
name: cdb1pool
n Active servers
rme
Ca [grid@host01 ~]$ srvctl status srvpool -serverpool cdb1pool
Server pool name: cdb1pool
Active servers count: 3

[grid@host01 ~]$

3. Open a terminal window to connect to host01 as oracle user. Use SRVCTL to know on
which nodes the instances of the CDB are running, as you traditionally do for any non-CDB.
[oracle@dns ~]$ ssh oracle@host01
oracle@host01’s Password:

[oracle@host01 ~]$ export


ORACLE_HOME=/u01/app/oracle/product/12.2.0/dbhome_1
[oracle@host01 ~]$ export PATH=$PATH:$ORACLE_HOME/bin

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

Practices for Lesson 13: Multitenant Architecture and RAC 239


[oracle@host01 ~]$ srvctl status database -db cdb1
Instance cdb1_1 is running on node host03
Instance cdb1_2 is running on node host02
Instance cdb1_3 is running on node host01
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

[oracle@host01 ~]$ pgrep -l cdb1_3


23622 ora_pmon_cdb1_3
23630 ora_clmn_cdb1_3
23632 ora_psp0_cdb1_3
23635 ora_ipc0_cdb1_3
23637 ora_vktm_cdb1_3
23641 ora_gen0_cdb1_3
23643 ora_mman_cdb1_3
a ble
23647 ora_scmn_cdb1_3 f e r
ans
23651 ora_diag_cdb1_3
n - t r
23653 ora_scmn_cdb1_3 o
23657 ora_dbrm_cdb1_3
s an
23659 ora_vkrm_cdb1_3 ) ha eฺ
23661 ora_ping_cdb1_3
ฺ c om Guid
23663 ora_svcb_cdb1_3
r a cle ent
23665 ora_acms_cdb1_3
a @ o
S tud
o a n this
23667 ora_pman_cdb1_3
nฺ use
23669 ora_dia0_cdb1_3
e
( c arm se to
23671 ora_lmon_cdb1_3
23673 ora_lmd0_cdb1_3
ana licen
23675 ora_lms0_cdb1_3
n O
r m e 23679 ora_rmv0_cdb1_3

C a 23681 ora_rms0_cdb1_3
23683 ora_lmhb_cdb1_3
23685 ora_lck1_cdb1_3
23687 ora_dbw0_cdb1_3
23689 ora_lgwr_cdb1_3
23691 ora_ckpt_cdb1_3
23693 ora_lg00_cdb1_3
23695 ora_smon_cdb1_3
23697 ora_lg01_cdb1_3
23699 ora_smco_cdb1_3
23701 ora_reco_cdb1_3
23703 ora_w000_cdb1_3
23705 ora_lreg_cdb1_3
23707 ora_w001_cdb1_3
23709 ora_pxmn_cdb1_3

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

240 Practices for Lesson 13: Multitenant Architecture and RAC


23711 ora_rbal_cdb1_3
23713 ora_asmb_cdb1_3
23715 ora_fenc_cdb1_3
23717 ora_mmon_cdb1_3
23719 ora_mmnl_cdb1_3
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

23721 ora_d000_cdb1_3
23723 ora_s000_cdb1_3
23725 ora_imr0_cdb1_3
23728 ora_scm0_cdb1_3
23730 ora_lck0_cdb1_3
23734 ora_rsmn_cdb1_3
23736 ora_tmon_cdb1_3
23740 ora_mark_cdb1_3
a ble
23763 ora_o000_cdb1_3 f e r
ans
24048 ora_tt00_cdb1_3
n - t r
24050 ora_tt01_cdb1_3 o
24052 ora_tt02_cdb1_3
s an
24069 ora_gtx0_cdb1_3 ) ha eฺ
24071 ora_rcbg_cdb1_3
ฺ c om Guid
24073 ora_aqpc_cdb1_3
r a cle ent
24077 o
ora_o001_cdb1_3
a @ S tud
24084 n this
ora_p000_cdb1_3
o a
24086 nฺ use
ora_p001_cdb1_3
e
24089
(
24097 c arm se to
ora_p002_cdb1_3
ora_p003_cdb1_3
ana licen
24099 ora_p004_cdb1_3
n O
r m e 24101 ora_p005_cdb1_3

C a 24103 ora_p006_cdb1_3
24105 ora_p007_cdb1_3
24108 ora_cjq0_cdb1_3
24240 ora_qm02_cdb1_3
24251 ora_qm05_cdb1_3
24256 ora_q002_cdb1_3
24261 ora_qm03_cdb1_3
24269 ora_q004_cdb1_3
24807 ora_w002_cdb1_3
24909 ora_gcr0_cdb1_3
25577 ora_w003_cdb1_3
25770 ora_w004_cdb1_3
26737 ora_w005_cdb1_3
28105 ora_ppa7_cdb1_3
28116 ora_ppa6_cdb1_3

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

Practices for Lesson 13: Multitenant Architecture and RAC 241


28325 ora_p008_cdb1_3
28327 ora_p009_cdb1_3

[oracle@host01 bin]$
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

4. Use LSNRCTL to list the CDB instances on two nodes of the server pool.
a. Check the services on the first node.
[oracle@host01 ~]$ lsnrctl status

LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 09-NOV-


2017 15:04:52

a b le
Copyright (c) 1991, 2016, Oracle. All rights reserved.
f e r
a n s
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
n -t r
o
STATUS of the LISTENER
s an
------------------------
) ha eฺ
Alias
Version
LISTENER
c
TNSLSNR ฺfor
om G
Linux:u d
iVersion 12.2.0.1.0
c l e nt
- Production
o ra ude14:29:38
Start Date
a @ t
01-NOV-2017
S
Uptime
o an t8hdayss
i 0 hr. 35 min. 15 sec
Trace Level ฺ
en us off e
Security a r m to ON: Local OS Authentication
SNMP a ( c s e
a en
n liParameter
c
OFF

n O
Listener File

r m e /u01/app/12.2.0/grid/network/admin/listener.ora

C a Listener Log File


/u01/app/grid/diag/tnslsnr/host01/listener/alert/log.x
ml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.0.2.101)(PORT=1521
)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.0.2.254)(PORT=1521
)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this
service...
Service "+ASM_DATA" has 1 instance(s).

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

242 Practices for Lesson 13: Multitenant Architecture and RAC


Instance "+ASM1", status READY, has 1 handler(s) for this
service...
Service "+ASM_FRA" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this
service...
Service "+ASM_MGMT" has 1 instance(s).
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Instance "+ASM1", status READY, has 1 handler(s) for this


service...
Service "5d8efa95565c5e5ee053650200c04cd5" has 1 instance(s).
Instance "cdb1_3", status READY, has 1 handler(s) for this
service...
Service "cdb1" has 1 instance(s).
Instance "cdb1_3", status READY, has 1 handler(s) for this
service...
a ble
Service "cdb1XDB" has 1 instance(s). f e r
ans
Instance "cdb1_3", status READY, has 1 handler(s) for this
service... n - t r
Service "pdb1" has 1 instance(s). a no
h a s
Instance "cdb1_3", status READY, has 1 handler(s) for this
service... m ) ideฺ
l
The command completed successfully e ฺco t Gu
o rac uden
[oracle@host01 ~]$ a @ S t
o an thi s
e ฺ
n use
arm sonethe
b. Check the services
( c tosecond node.
a n a cen ~]$ ssh host02
[oracle@host01
OLast li Mon Sep 2 01:17:02 2014 from 192.0.2.1
login:
n
rme
[oracle@host02 ~]$ . oraenv

Ca ORACLE_SID = [oracle] ? cdb1_2


ORACLE_HOME = [/home/oracle] ?
/u01/app/oracle/product/12.2.0/dbhome_1
The Oracle base has been set to /u01/app/oracle

[oracle@host02 ~]$ lsnrctl status

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.2.0.1.0
- Production
Start Date 01-NOV-2017 14:40:09
Uptime 8 days 0 hr. 27 min. 9 sec
Trace Level off

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

Practices for Lesson 13: Multitenant Architecture and RAC 243


Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File
/u01/app/12.2.0/grid/network/admin/listener.ora
Listener Log File
/u01/app/grid/diag/tnslsnr/host02/listener/alert/log.xml
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Listening Endpoints Summary...


(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.0.2.102)(PORT=1521
)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.0.2.231)(PORT=1521
)))
a ble
Services Summary...
f e r
Service "+ASM" has 1 instance(s). ans
Instance "+ASM3", status READY, has 1 handler(s) for this n - t r
o
service...
s an
Service "+ASM_DATA" has 1 instance(s).
) ha eฺ
service... ฺ c om Guid
Instance "+ASM3", status READY, has 1 handler(s) for this

r a cle ent
Service "+ASM_FRA" has 1 instance(s).
@ o
S tud
Instance "+ASM3", status READY, has 1 handler(s) for this
a
service...
o a n this
e nฺ use
Service "+ASM_MGMT" has 1 instance(s).

( c arm se to
Instance "+ASM3", status READY, has 1 handler(s) for this

ana licen
service...
Service "5d8efa95565c5e5ee053650200c04cd5" has 1 instance(s).
n O
r m e Instance "cdb1_2", status READY, has 1 handler(s) for this

C a service...
Service "cdb1" has 1 instance(s).
Instance "cdb1_2", status READY, has 1 handler(s) for this
service...
Service "cdb1XDB" has 1 instance(s).
Instance "cdb1_2", status READY, has 1 handler(s) for this
service...
Service "pdb1" has 1 instance(s).
Instance "cdb1_2", status READY, has 1 handler(s) for this
service...
The command completed successfully

[oracle@host02 ~]$ exit


logout
Connection to host02 closed.
[oracle@host01 ~]$

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

244 Practices for Lesson 13: Multitenant Architecture and RAC


5. Use SRVCTL to stop and restart the CDB as you traditionally would do for any non-CDB.
[oracle@host01 ~]$ . oraenv
ORACLE_SID = [oracle] ? cdb1_3
ORACLE_HOME = [/home/oracle] ?
/u01/app/oracle/product/12.2.0/dbhome_1
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

The Oracle base has been set to /u01/app/oracle

[oracle@host01 ~]$ srvctl stop database -db cdb1

[oracle@host01 ~]$ srvctl status database -db cdb1


Instance cdb1_1 is not running on node host03
Instance cdb1_2 is not running on node host02
Instance cdb1_3 is not running on node host01
a ble
f e r
[oracle@host01 ~]$ srvctl start database -db cdb1 ans
n - t r
[oracle@host01 ~]$ a no
srvctl status database -db cdb1
h a s
Instance cdb1_1 is
) ideฺ
running on node host03
m
Instance cdb1_2 is
ฺco t Gu
running on node host02
l e
rac uden
Instance cdb1_3 is running on node host01
o
@ s St
[oracle@host01 ~]$ na
ฺ o a
e t hi
r m en us
c e o instances of the cdb1 CDB, check the UNDO tablespaces
6. Use SQL*Plus toaconnect to tthe
(
and the groups
a enslog files, and verify the existence of the pdb1 PDB.
na loficredo
a. O
e n Check the UNDO tablespaces created in the CDB.
rm [oracle@host01 ~]$ sqlplus / as sysdba
Ca
SQL*Plus: Release 12.2.0.1.0 Production on Thu Nov 9 15:10:40
2017

Copyright (c) 1982, 2016, Oracle. All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 -
64bit Production

SQL> SELECT name, cdb, con_id FROM v$database;

NAME CDB CON_ID


--------- --- ----------

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

Practices for Lesson 13: Multitenant Architecture and RAC 245


CDB1 YES 0

SQL> SELECT instance_name, con_id FROM v$instance;

INSTANCE_NAME CON_ID
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

---------------- ----------
cdb1_3 0

SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT a ble
f e r
ans
SQL> SELECT tablespace_name, con_id
n - t r
o
FROM cdb_tablespaces
WHERE contents = 'UNDO'; s an
) ha eฺ
TABLESPACE_NAME ฺ c om Guid
CON_ID
a le nt
c----------
------------------------------
o r
t u de 1
UNDOTBS1
n a @ s S
UNDOTBS2 o a t h i 1
e n ฺ s e
UNDOTBS3
r m o u 1

( c a se t
na licen
SQL>
a
O
r m en
C a b. Check the groups of redo log files created for the three CDB instances.
SQL> SELECT group#, con_id FROM v$logfile order by 1;

GROUP# CON_ID
---------- ----------
1 0
2 0
3 0
4 0
5 0
6 0
7 0
8 0
9 0

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

246 Practices for Lesson 13: Multitenant Architecture and RAC


9 rows selected.

SQL>

c. Check the PDB created in the CDB and its open mode. If the PDB is not opened, open
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

it.
SQL> COL pdb_name format a10
SQL> SELECT pdb_id, pdb_name, guid, status FROM cdb_pdbs;

PDB_ID PDB_NAME GUID STATUS


---------- ---------- -------------------------------- ----------
3 PDB1 5D8EFA95565C5E5EE053650200C04CD5 NORMAL
2 PDB$SEED 5D8EDD1013E04888E053650200C02A7D NORMAL a ble
f e r
ans
SQL> SELECT name, open_mode FROM v$pdbs;
n - t r
o
NAME OPEN_MODE s an
------------------------------ ---------- ) ha eฺ
c m uid
oONLY
PDB$SEED ฺ
READ
le nt G
a c
or tude
PDB1 MOUNTED

n @ S
aCONTAINER=pdb1;
s
SQL> ALTER SESSION a SET h i
e nฺo use t
( c arm se to
Session altered.

anashowliccon_name
en
e nO
SQL>

a r m
C CON_NAME
------------------------------
PDB1

SQL> CONNECT / AS SYSDBA


Connected.

SQL> SELECT name FROM cdb_services;

NAME
---------------------------------------------------------------
SYS$BACKGROUND
SYS$USERS
cdb1XDB
cdb1

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

Practices for Lesson 13: Multitenant Architecture and RAC 247


SQL> ALTER PLUGGABLE DATABASE pdb1 OPEN;

Pluggable database altered.


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

SQL> SELECT name, open_mode FROM v$pdbs;

NAME OPEN_MODE
------------------------------ ----------
PDB$SEED READ ONLY
PDB1 READ WRITE

SQL>
a b le
f e r
an s
d. Check the services.
n - t r
SQL> SELECT name FROM v$services;
a no
h a s
NAME m ) ideฺ
e ฺco t Gu
---------------------------------------------------------------
l
pdb1
o rac uden
cdb1XDB a @ S t
cdb1 o an thi s
SYS$BACKGROUNDen
ฺ s e
u
SYS$USERS
( c arm se to
a na licen
n OSQL> EXIT
r m e Disconnected from Oracle Database 12c Enterprise Edition Release
C a 12.2.0.1.0 - 64bit Production
[oracle@host01 ~]$

7. Switch to the second node to verify the open mode of the PDB in the second instance of the
CDB.
[oracle@host01 ~]$ ssh host02
[oracle@host02 ~]$ . oraenv
ORACLE_SID = [oracle] ? cdb1_2
ORACLE_HOME = [/home/oracle] ?
/u01/app/oracle/product/12.2.0/dbhome_1
The Oracle base has been set to /u01/app/oracle

[oracle@host02 ~]$ sqlplus / as sysdba

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

248 Practices for Lesson 13: Multitenant Architecture and RAC


SQL*Plus: Release 12.2.0.1.0 Production on Thu Nov 9 15:15:56
2017

Copyright (c) 1982, 2016, Oracle. All rights reserved.

Connected to:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 -


64bit Production

SQL> SELECT name, cdb, con_id FROM v$database;

NAME CDB CON_ID


--------- --- ----------
a ble
CDB1 YES 0
f e r
ans
SQL> SELECT instance_name, con_id FROM v$instance; n - t r
n o
s a
INSTANCE_NAME CON_ID
) h a ฺ
---------------- ----------
c o m uide
cdb1_2 0 ฺ
le nt G
a c
@ or tude
SQL> show con_name
n a i s S
a h
CON_NAME e nฺo use t
( c arm se to
------------------------------
na licen
CDB$ROOT
a
e nO
a r m SQL> SELECT name, open_mode FROM v$pdbs;
C
NAME OPEN_MODE
------------------------------ ----------
PDB$SEED READ ONLY
PDB1 MOUNTED

SQL> ALTER SESSION SET CONTAINER=pdb1;

Session altered.

SQL> SELECT name FROM v$services;

NAME
---------------------------------------------------------------
pdb1

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

Practices for Lesson 13: Multitenant Architecture and RAC 249


SQL> exit
[oracle@host02 ~]$ exit
logout
Connection to host02 closed.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

[oracle@host01 ~]$

8. Verify that the pdb1 service is accessible from instance cdb1_3 on the first node but also
from cdb1_2 instance on the second node and from cdb1_1 instance on the third node.
First restart the listener.
[oracle@host01 ~]$ su - grid
Password:
a b le
f e r
[grid@host01 ~]$ . oraenv
an s
ORACLE_SID = [grid] ? +ASM1
n - t r
The Oracle base has been set to /u01/app/grid
a no
h a s
[grid@host01 ~]$ srvctl stop listener m -listener ฺ
) ideLISTENER
l e ฺco t Gu
[grid@host01 ~]$ srvctl start c
ralistener e n-listener LISTENER
o tu d
a @ s S
o
[grid@host01 ~]$ exit
ฺ an thi
logout e n use
( c arm se to
na licen ~]$ sqlplus /nolog
[oracle@host01
a
e n OSQL*Plus: Release 12.2.0.1.0 Production on Thu Nov 9 15:17:54
a r m 2017
C
Copyright (c) 1982, 2016, Oracle. All rights reserved.

SQL> CONNECT system@"host01:1521/pdb1"


Enter password:
Connected.
SQL> SELECT instance_name, con_id FROM v$instance;

INSTANCE_NAME CON_ID
---------------- ----------
cdb1_3 0

SQL> show con_name

CON_NAME

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

250 Practices for Lesson 13: Multitenant Architecture and RAC


------------------------------
PDB1

SQL> CONNECT system@"host02:1521/pdb1"


Enter password:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

ERROR:
ORA-01033:ORACLE initialization or shutdown in progress
Process ID: 0
Session ID: 0 Serial Number: 0

Warning: You are no longer connected to ORACLE.


SQL>
Notice that the connection does not complete because pdb1 was opened for instance
a ble
f e r
cdb1_3 on host01 only. Remember that the clause INSTANCES was not used in the
ans
ALTER PLUGGABLE DATABASE OPEN statement in the previous task.
n - t r
a no
SQL> CONNECT / AS SYSDBA
h a s
Connected. m ) ideฺ
o INSTANCES=('cdb1_2');
ฺcOPEN G u
SQL> ALTER PLUGGABLE DATABASE pdb1
l e t
o rac uden
a @
Pluggable database altered. S t
o an thi s
e ฺ
n use
SQL> CONNECTmsystem@"host02:1521/pdb1"
( c ar se to
Enter password:
ana licen
Connected.
e nO
a r m SQL> SELECT instance_name, con_id FROM v$instance;
C
INSTANCE_NAME CON_ID
---------------- ----------
cdb1_2 0

SQL> show con_name

CON_NAME
------------------------------
PDB1

SQL> CONNECT system@"host03:1521/pdb1"


Enter password:
ERROR:
ORA-01033:ORACLE initialization or shutdown in progress

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

Practices for Lesson 13: Multitenant Architecture and RAC 251


Process ID: 0
Session ID: 0 Serial Number: 0

Warning: You are no longer connected to ORACLE.


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

SQL> EXIT
The connection does not complete on host03 because pdb1 was opened for instance
cdb1_3 on host01 and cdb1_2 on host02 only.

9. Close all terminal windows opened for this practice.

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

252 Practices for Lesson 13: Multitenant Architecture and RAC


Practice 13-2: Cloning a PDB in the RAC CDB

Overview
In this practice, you will clone the pdb1 PDB into a new PDB named pdb2 in the cdb1 CDB.
This operation requires to close and open PDBs on multiple instances of the CDB.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Tasks
1. Open a terminal window connected to host01 as the oracle user.
[oracle@dns ~]$ ssh oracle@host01
oracle@host01’s password:

[oracle@host01 ~]$
a ble
f e r
ans
2. Connect to the root of the multitenant container database cdb1 on any of the three
n - t r
instances.
a no
[oracle@host01 ~]$ . oraenv
h a s
ORACLE_SID = [cdb1] ? cdb1_3
m ) ideฺ
ORACLE_HOME = [/home/oracle] ?
l e ฺ co t Gu
o r ac den
/u01/app/oracle/product/12.2.0/dbhome_1

a @ S tu
The Oracle base has been set to /u01/app/oracle

o an thi s
[oracle@host01 ~]$
e ฺ
n sqlplus
s e / as sysdba
u
( c arm se to
ana licRelease
SQL*Plus:
2017 en 12.2.0.1.0 Production on Fri Nov 10 07:45:57

n O
r m e
C a Copyright (c) 1982, 2016, Oracle. All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 -
64bit Production
SQL>

3. Use Oracle Managed Files to locate the data files of the new pdb2.
SQL> SHOW PARAMETER db_create_file_dest

NAME TYPE VALUE


------------------------------------ ----------- --------------
db_create_file_dest string +DATA

SQL>

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

Practices for Lesson 13: Multitenant Architecture and RAC 253


4. Create pdb2 from pdb1.
a. Use the CREATE PLUGGABLE DATABASE command to create pdb2.
SQL> CREATE PLUGGABLE DATABASE pdb2 FROM pdb1;

Pluggable database created.


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

SQL> SELECT name, open_mode FROM v$pdbs;

NAME OPEN_MODE
------------------------------ ----------
PDB$SEED READ ONLY
PDB1 READ WRITE
PDB2 MOUNTED a b le
f e r
an s
SQL>
n - t r
a no
b. Now, open both PDBs in READ WRITE mode on all the h a
CDB sinstances.
m ) IMMEDIATE
d e ฺ
SQL> ALTER PLUGGABLE DATABASE pdb1 CLOSE
ฺco t Gu i
INSTANCES=ALL; l e
o rac uden
Pluggable database altered.a @ S t
o an thi s
e ฺ e
n uDATABASE
s
a r m to
SQL> ALTER PLUGGABLE ALL OPEN READ WRITE INSTANCES=ALL;

a (c nse
an
Pluggable e
licdatabase altered.
n O
rme SQL> SELECT name, open_mode FROM v$pdbs;
Ca
NAME OPEN_MODE
------------------------------ ----------
PDB$SEED READ ONLY
PDB1 READ WRITE
PDB2 READ WRITE

SQL> SELECT pdb_id, pdb_name, guid, status FROM cdb_pdbs;

PDB_ID PDB_NAME GUID STATUS


---------- ---------- -------------------------------- --------
3 PDB1 5D8F3DBBBF1449ACE053660200C0ED13 NORMAL
2 PDB$SEED 5D8F1F2AA1223683E053650200C0DCF8 NORMAL
4 PDB2 5D9D2399A0A130DBE053650200C0C9CD NORMAL

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

254 Practices for Lesson 13: Multitenant Architecture and RAC


SQL> ALTER SESSION SET CONTAINER=pdb2;

Session altered.

SQL> SELECT name FROM dba_services;


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

NAME
---------------------------------------------------------------
pdb2

SQL> EXIT

c. Use LSNRCTL to verify that the new pdb2 service associated to the new PDB in the
a ble
f e r
CDB instance is automatically started after the PDB is opened. Because the PDB is
ans
opened in all the CDB instances, the pdb2 PDB service is started in all the CDB
n - t r
instances.
a no
[oracle@host01 ~]$ lsnrctl status
h a s
m ) ideฺ
LSNRCTL for Linux: Version 12.2.0.1.0
l e ฺco - tProduction
G u on 10-NOV-
2017 07:50:47 c
ra ude n
@ o t
a s
n tOracle.S
Copyright (c) 1991,a2016,
ฺ o e hi All rights reserved.

r m en us
Connecting
( c e to
a to s(ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
na oflicthe
STATUS
a e n LISTENER
e n O------------------------
a r m Alias LISTENER
C Version
- Production
TNSLSNR for Linux: Version 12.2.0.1.0

Start Date 09-NOV-2017 12:42:01


Uptime 0 days 19 hr. 8 min. 46 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File
/u01/app/12.2.0/grid/network/admin/listener.ora
Listener Log File
/u01/app/grid/diag/tnslsnr/host01/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.0.2.101)(PORT=1521
)))

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

Practices for Lesson 13: Multitenant Architecture and RAC 255


(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.0.2.242)(PORT=1521
)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

service...
Service "+ASM_DATA" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this
service...
Service "+ASM_MGMT" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this
service...
Service "5d8f3dbbbf1449ace053660200c0ed13" has 1 instance(s).
a ble
Instance "cdb1_3", status READY, has 1 handler(s) for this f e r
service... ans
Service "5d9d2399a0a130dbe053650200c0c9cd" has 1 instance(s). n - t r
o
an
Instance "cdb1_3", status READY, has 1 handler(s) for this
s
service...
) ha eฺ
Service "cdb1" has 1 instance(s).
ฺ c om Guid
service... r a cle ent
Instance "cdb1_3", status READY, has 1 handler(s) for this

@ o
S tud
Service "cdb1XDB" has 1 instance(s).
a
o a n this
Instance "cdb1_3", status READY, has 1 handler(s) for this
service... e nฺ use
( c arm se to
Service "pdb1" has 1 instance(s).

ana licen
Instance "cdb1_3", status READY, has 1 handler(s) for this
service...
n O
r m e Service "pdb2" has 1 instance(s).

C a Instance "cdb1_3", status READY, has 1 handler(s) for this


service...
The command completed successfully

[oracle@host01 ~]$

5. Use the net service name to connect to pdb2 as system user on any of the three
instances of the CDB.
[oracle@host01 ~]$ sqlplus /nolog
SQL> CONNECT system@"host01:1521/pdb2"
Enter password:
Connected.

SQL> show con_name


CON_NAME

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

256 Practices for Lesson 13: Multitenant Architecture and RAC


------------------------------
PDB2

SQL> CONNECT system@"host02:1521/pdb2"


Enter password:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Connected.

SQL> CONNECT system@"host03:1521/pdb2"


Enter password:
Connected.

SQL> EXIT

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 13: Multitenant Architecture and RAC 257


Practice 13-3: Affinitizing PDB Services to CDB Instances

Overview
In this practice, you will “affinitize” connections to a PDB to one or particular CDB instances.
Because server pools determine which services run together or separately, you can configure
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

and maintain required affinity or isolation.

Task 1: Affinitize connections to pdb1 to all the CDB instances


1. Check the configuration of the server pools.
[oracle@host01 ~]$ srvctl status srvpool
Server pool name: Free
Active servers count: 0
a b le
Server pool name: Generic f e r
Active servers count: 0 an s
n - t r
Server pool name: cdb1pool
Active servers count: 3 a no
h a s
[oracle@host01 ~]$
m ) ideฺ
l e ฺco t -serverpool
G u
Server pool name: cdb1pool or
ac den
[oracle@host01 ~]$ srvctl config srvpool cdb1pool

a @ S tu
an thi
Importance: 0, Min: 0, Max: 3s
Category: hub nฺo e
e u s
( c arm s~]$
Candidate server
[oracle@host01 e to
names:

ana licen
nO
2. eCheck the services. You notice that the default services created at PDB creation are not
a r m
C managed by the clusterware.
[oracle@host01 ~]$ srvctl status service -db cdb1

[oracle@host01 ~]$ srvctl config service -db cdb1


[oracle@host01 ~]$

3. Create a dynamic PDB service for the pdb1 PDB in the CDB which will “affinitize”
connections to pdb1 to all the CDB instances uniformly.
a. Create the service from the connection on the first node of the server pool.
[oracle@host01 ~]$ srvctl add service -db cdb1 -pdb pdb1 -
service mypdb1serv -policy automatic -serverpool cdb1pool -
cardinality uniform

[oracle@host01 ~]$ srvctl config service -db cdb1


Service name: mypdb1serv

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

258 Practices for Lesson 13: Multitenant Architecture and RAC


Service is enabled
Server pool: cdb1pool
Cardinality: UNIFORM
Disconnect: false
Service role: PRIMARY
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Management policy: AUTOMATIC


DTP transaction: false
AQ HA notifications: false
Global: false
Commit Outcome: false
Failover type:
Failover method:
TAF failover retries:
a ble
TAF failover delay: f e r
ans
Connection Load Balancing Goal: LONG
n - t r
Runtime Load Balancing Goal: NONE o
TAF policy specification: NONE
s an
Edition: ) ha eฺ
Pluggable database name: pdb1
ฺ c om Guid
Maximum lag time: ANY
r a cle ent
SQL Translation Profile:
a @ o
S tud
o a n this
Retention: 86400 seconds
nฺ use
Replay Initiation Time: 300 seconds
e
( c arm se to
Session State Consistency:
Service is enabled on nodes:
ana licen
Service is disabled on nodes:
n O
r m e
C a [oracle@host01 ~]$

b. Check that the PDB service is also created on the two other nodes of the server pool.
[oracle@host01 ~]$ ssh host02
[oracle@host02 ~]$
[oracle@host02 ~]$ . oraenv
ORACLE_SID = [oracle] ? cdb1_2
ORACLE_HOME = [/home/oracle] ?
/u01/app/oracle/product/12.2.0/dbhome_1
The Oracle base has been set to /u01/app/oracle

[oracle@host02 ~]$ srvctl config service -db cdb1


Service name: mypdb1serv
Service is enabled

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

Practices for Lesson 13: Multitenant Architecture and RAC 259


Server pool: cdb1pool
Cardinality: UNIFORM
Disconnect: false
Service role: PRIMARY
Management policy: AUTOMATIC
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

DTP transaction: false


AQ HA notifications: false
Global: false
Commit Outcome: false
Failover type:
Failover method:
TAF failover retries:
TAF failover delay:
a ble
Connection Load Balancing Goal: LONG f e r
ans
Runtime Load Balancing Goal: NONE
n - t r
TAF policy specification: NONE o
Edition:
s an
Pluggable database name: pdb1
) ha eฺ
Maximum lag time: ANY
ฺ c om Guid
SQL Translation Profile:
r a cle ent
Retention: 86400 seconds
a @ o
S tud
o a n this
Replay Initiation Time: 300 seconds
nฺ use
Session State Consistency:
e
( c arm se to
Service is enabled on nodes:
Service is disabled on nodes:
ana licen
[oracle@host02 ~]$ exit
n O
r m e logout

C a Connection to host02 closed.


[oracle@host01 ~]$

c. You can reiterate the same verification on the third node of the server pool.
[oracle@host01 ~]$ ssh host03

[oracle@host03 ~]$ . oraenv


ORACLE_SID = [oracle] ? cdb1_1
ORACLE_HOME = [/home/oracle] ?
/u01/app/oracle/product/12.2.0/dbhome_1
The Oracle base has been set to /u01/app/oracle
[oracle@host03 ~]$ srvctl config service -db cdb1
Service name: mypdb1serv
Service is enabled
Server pool: cdb1pool

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

260 Practices for Lesson 13: Multitenant Architecture and RAC


Cardinality: UNIFORM
Disconnect: false
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: false
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

AQ HA notifications: false
Global: false
Commit Outcome: false
Failover type:
Failover method:
TAF failover retries:
TAF failover delay:
Connection Load Balancing Goal: LONG
a ble
Runtime Load Balancing Goal: NONE f e r
ans
TAF policy specification: NONE
n - t r
Edition: o
Pluggable database name: pdb1
s an
Maximum lag time: ANY
) ha eฺ
SQL Translation Profile:
ฺ c om Guid
Retention: 86400 seconds
r a cle ent
a @ o
S tud
Replay Initiation Time: 300 seconds

o a n this
Session State Consistency:
nฺ use
Service is enabled on nodes:
e
( c arm se to
Service is disabled on nodes:
[oracle@host03 ~]$ exit
ana licen
Logout
n O
r m e Connection to host03 closed.

C a
[oracle@host01 ~]$

4. Close the PDB. You will verify that restarting the CDB automatically starts the dynamic PDB
service and opens the associated PDB.
[oracle@host01 ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Fri Nov 10 08:00:30


2017

Copyright (c) 1982, 2016, Oracle. All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 -
64bit Production

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

Practices for Lesson 13: Multitenant Architecture and RAC 261


SQL> ALTER PLUGGABLE DATABASE pdb1 CLOSE IMMEDIATE
INSTANCES=ALL;
Pluggable database altered.

SQL> SELECT name, open_mode FROM v$pdbs;


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

NAME OPEN_MODE
------------------------------ ----------
PDB$SEED READ ONLY
PDB1 MOUNTED
PDB2 READ WRITE

a b le
SQL> EXIT
f e r
Disconnected from Oracle Database 12c Enterprise Edition Release an s
12.2.0.1.0 - 64bit Production n - t r
[oracle@host01 ~]$
a no
h a s
m ) ideฺ
5. Stop and restart the CDB.
l e ฺ co t Gu
[oracle@host01 ~]$ srvctl stop cdatabase
o ra uden -db cdb1
[oracle@host01 ~]$
a @ S t
[oracle@host01 ~]$ srvctl
o a n thi s
start database -db cdb1 -eval
Database cdb1 will
e nฺ beustarted
s e on nodes host03,host02,host01

( c arm se towill be started on nodes host03,host02,host01


Service mypdb1serv

ana licen ~]$ srvctl start database -db cdb1


nO
[oracle@host01

rm e
Ca [oracle@host01 ~]$
Instance cdb1_1 is
srvctl status database -db cdb1
running on node host02
Instance cdb1_2 is running on node host03
Instance cdb1_3 is running on node host01

[oracle@host01 ~]$

6. Verify that the new dynamic PDB service is started and the PDB opened automatically. It
may take a few moments for the service to be started on all hosts. (If you do not wish to
wait, use SRVCTL to start the service: srvctl start service -d cdb1 -service
mypdb1serv).
[oracle@host01 ~]$ srvctl status service -db cdb1
Service mypdb1serv is running on nodes: host03,host02,host01.

[oracle@host01 ~]$ sqlplus / as sysdba

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

262 Practices for Lesson 13: Multitenant Architecture and RAC


SQL*Plus: Release 12.2.0.1.0 Production on Fri Nov 10 08:04:10
2017

Copyright (c) 1982, 2016, Oracle. All rights reserved.


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 -
64bit Production

SQL> SELECT name, open_mode FROM v$pdbs;

a ble
NAME OPEN_MODE
f e r
------------------------------ ----------
ans
PDB$SEED READ ONLY n - t r
PDB1
a no READ WRITE
PDB2
h a s MOUNTED
m ) ideฺ
SQL> SELECT name FROM v$services;eฺc
o Gu
a c l n t
r e
NAME a @ o
S tud
o a n this
---------------------------------------------------------------
mypdb1serv e nฺ use
pdb2
( c arm se to
na licen
pdb1
a
e n Ocdb1XDB
a r m cdb1
C SYS$BACKGROUND
SYS$USERS

7 rows selected.

SQL> exit
[oracle@host01 ~]$
Notice that PDBs are automatically opened by clusterware in all the instances in which
the service is started. There is therefore no need to create a trigger AFTER STARTUP
ON DATABASE to open PDBs as it is the case in non-RAC CDBs.

7. You can also stop and restart the service manually.


[oracle@host01 ~]$ srvctl stop service -db cdb1 -service
mypdb1serv

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

Practices for Lesson 13: Multitenant Architecture and RAC 263


[oracle@host01 ~]$ srvctl status service -db cdb1 -service
mypdb1serv
Service mypdb1serv is not running.

[oracle@host01 ~]$ srvctl start service -db cdb1 -service


mypdb1serv
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

[oracle@host01 ~]$ srvctl status service -db cdb1 -service


mypdb1serv
Service mypdb1serv is running on nodes: host03,host02,host01

[oracle@host01 ~]$ lsnrctl status

a b le
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 10-NOV-
f e r
2017 08:06:05
an s
n - t r
Copyright (c) 1991, 2016, Oracle.
a no All rights reserved.

h a s
) ideฺ
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
m
STATUS of the LISTENER
l e ฺco t Gu
------------------------
o r ac den
Alias
a @ LISTENER
S tu
Version
o s
an tTNSLSNR
hi for Linux: Version 12.2.0.1.0
- Production ฺ e
en us 09-NOV-2017 12:42:01
Start Date rm to
Uptime ( c a s e 0 days 19 hr. 24 min. 4 sec
a n a c e n
li
OTrace Level off
e n Security ON: Local OS Authentication
a r m SNMP OFF
C Listener Parameter File
/u01/app/12.2.0/grid/network/admin/listener.ora
Listener Log File
/u01/app/grid/diag/tnslsnr/host01/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.0.2.101)(PORT=1521
)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.0.2.242)(PORT=1521
)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this
service...

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

264 Practices for Lesson 13: Multitenant Architecture and RAC


Service "+ASM_DATA" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this
service...
Service "+ASM_MGMT" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this
service...
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Service "5d8f3dbbbf1449ace053660200c0ed13" has 2 instance(s).


Instance "cdb1_3", status READY, has 1 handler(s) for this
service...
Instance "cdb1_3", status READY, has 2 handler(s) for this
service...
Service "5d9d2399a0a130dbe053650200c0c9cd" has 1 instance(s).
Instance "cdb1_3", status READY, has 1 handler(s) for this
service...
a ble
Service "cdb1" has 1 instance(s). f e r
ans
Instance "cdb1_3", status READY, has 1 handler(s) for this
service... n - t r
o
Service "cdb1XDB" has 1 instance(s).
s an
ha eฺ
Instance "cdb1_3", status READY, has 1 handler(s) for this
)
service...
ฺ c om Guid
r a cle ent
Service "mypdb1serv" has 2 instance(s).

tud
Instance "cdb1_3", status READY, has 1 handler(s) for this
@ o
service...
a
n this S
o a
Instance "cdb1_3", status READY, has 2 handler(s) for this
service... e nฺ use
( c arm se to
Service "pdb1" has 2 instance(s).

ana licen
Instance "cdb1_3", status READY, has 1 handler(s) for this
service...
n O
r m e Instance "cdb1_3", status READY, has 2 handler(s) for this

C a service...
Service "pdb2" has 1 instance(s).
Instance "cdb1_3", status READY, has 1 handler

[oracle@host01 ~]$

8. Use the service to connect to the PDB on any of the CDB instances.
[oracle@host01 ~]$ sqlplus /nolog

SQL> CONNECT system@"host01/mypdb1serv"


Enter password:
Connected.

SQL> SELECT name, open_mode FROM v$pdbs;

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

Practices for Lesson 13: Multitenant Architecture and RAC 265


NAME OPEN_MODE
------------------------------ ----------
PDB1 READ WRITE

SQL> SELECT name FROM v$services;


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

NAME
---------------------------------------------------------------
mypdb1serv
pdb1

SQL> CONNECT system@"host02/mypdb1serv"


Enter password:
a b le
Connected. f e r
an s
n - t r
SQL> SELECT name FROM v$services;
a no
h a s
NAME
m ) ideฺ
l e ฺco t Gu
---------------------------------------------------------------

rac uden
mypdb1serv
pdb1
@ o t
a s S
ฺ o an thi
n use
SQL> CONNECT system@"host03/mypdb1serv"
e
c a rm e to
Enter password:
(
na licens
Connected.
O a
n SQL> SELECT name FROM v$services;
rme
Ca NAME
---------------------------------------------------------------
mypdb1serv
pdb1

SQL> exit
[oracle@host01 ~]$

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

266 Practices for Lesson 13: Multitenant Architecture and RAC


Task 2: Affinitize connections to pdb2 to a single CDB instance
1. Create and start the service for pdb2.
[oracle@host01 ~]$ srvctl add service -db cdb1 -pdb pdb2 -
service singpdb2serv -policy automatic -serverpool cdb1pool -
cardinality singleton
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

[oracle@host01 ~]$ srvctl start service -db cdb1 -service


singpdb2serv -eval
Service singpdb2serv will be started on node host01

[oracle@host01 ~]$ srvctl start service -db cdb1 -service


singpdb2serv

a ble
[oracle@host01 ~]$ srvctl status service -db cdb1 -service f e r
singpdb2serv
ans
Service singpdb2serv is running on nodes: host01 n - t r
[oracle@host01 ~]$ a no
h a s
m ) ideฺ
2. Check that you can use the service to connect to pdb2
ฺ c o G
only on u
host01 and that the PDB
is opened in the CDB instance on host01 only.
r a cle ent
[oracle@host01 ~]$ sqlplus @ o/nologtud
n a i s S
a h
e nฺo use t
SQL> CONNECT system@"host01/singpdb2serv"

( c arm se to
Enter password:
na licen
Connected.
a
e n OSQL> SELECT name, open_mode FROM v$pdbs;
rm
Ca
NAME OPEN_MODE
------------------------------ ----------
PDB2 READ WRITE

SQL> SELECT name FROM v$services;

NAME
---------------------------------------------------------------
singpdb2serv
pdb2

SQL>

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

Practices for Lesson 13: Multitenant Architecture and RAC 267


3. Check that you cannot use the service to connect to pdb2 on host02 nor host03 and
that the PDB is closed in the CDB instances on host02 and host03.
SQL> CONNECT system@"host02/singpdb2serv"
Enter password:
ERROR:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

ORA-12514: TNS:listener does not currently know of service


requested in connect descriptor

Warning: You are no longer connected to ORACLE.

SQL> CONNECT system@"host03/singpdb2serv"


Enter password:
ERROR:
a ble
ORA-12514: TNS:listener does not currently know of service
f e r
requested in connect descriptor
ans
n - t r
Warning: You are no longer connected to ORACLE. o
s an
SQL> CONNECT system@"host02/cdb1"
) ha eฺ
Enter password:
ฺ c om Guid
Connected.
r a cle ent
@ o
S ud
tv$pdbs;
a a
SQL> select name, open_mode
n this from
o
nฺ use
NAME
r m e OPEN_MODE
t o
a (ca nse
------------------------------ ----------

a n lice
PDB$SEED READ ONLY

e n OPDB1 READ WRITE

a r m PDB2 MOUNTED
C
SQL> CONNECT system@"host03/cdb1"
Enter password:
Connected.

SQL> select name, open_mode from v$pdbs;

NAME OPEN_MODE
------------------------------ ----------
PDB$SEED READ ONLY
PDB1 READ WRITE
PDB2 MOUNTED

SQL> exit
[oracle@host01 ~]$

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

268 Practices for Lesson 13: Multitenant Architecture and RAC


Practice 13-4: Dropping a PDB

Overview
In this practice, you will drop a PDB in the CDB and verify that the services and data files are
deleted.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Tasks
1. To drop the pdb2, first stop and remove the service from the resources configuration.
[oracle@host01 ~]$ srvctl stop service -db cdb1 -service
singpdb2serv

[oracle@host01 ~]$ srvctl remove service -db cdb1 -service


a ble
singpdb2serv
f e r
[oracle@host01 ~]$
ans
n - t r
o
2. Drop the pdb2 PDB.
s an
[oracle@host01 ~]$ ~]$ sqlplus /nolog ) ha eฺ
ฺ c om Guid
SQL> CONNECT system@"host01/pdb2"
r a cle ent
Enter password:
a @ o
S tud
Connected.
o a n this
e nฺ use
SQL> SELECTrm to v$datafile;
( c a namee
FROM

ana licens
n O
NAME

r m e ---------------------------------------------------------------------------

C a +DATA/CDB1/5D9D2399A0A130DBE053650200C0C9CD/DATAFILE/system.291.959672879
+DATA/CDB1/5D9D2399A0A130DBE053650200C0C9CD/DATAFILE/sysaux.292.959672879
+DATA/CDB1/5D9D2399A0A130DBE053650200C0C9CD/DATAFILE/undotbs1.288.959672879
+DATA/CDB1/5D9D2399A0A130DBE053650200C0C9CD/DATAFILE/undo_3.289.959672879
+DATA/CDB1/5D9D2399A0A130DBE053650200C0C9CD/DATAFILE/undo_4.290.959672879
+DATA/CDB1/5D9D2399A0A130DBE053650200C0C9CD/DATAFILE/users.287.959672879

6 rows selected.

SQL> CONNECT / AS SYSDBA


Connected.

SQL> SELECT name FROM v$services;

NAME
---------------------------------------------------------------

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

Practices for Lesson 13: Multitenant Architecture and RAC 269


mypdb1serv
pdb2
pdb1
cdb1XDB
cdb1
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

SYS$BACKGROUND
SYS$USERS

7 rows selected.

SQL> DROP PLUGGABLE DATABASE pdb2 INCLUDING DATAFILES;


*
ERROR at line 1:
a b le
ORA-65025: Pluggable database PDB2 is not closed on all
f e r
instances.
an s
n - t r
SQL> ALTER PLUGGABLE DATABASE pdb2 CLOSE INSTANCES=ALL;
a no
h a s
Pluggable database altered.
m ) ideฺ
l e ฺ co t Gu
SQL> DROP PLUGGABLE DATABASE pdb2
o rac uINCLUDING
d en DATAFILES;
a @ S t
Pluggable database dropped.
o an thi s
e ฺ
n use
arm se to
SQL>
( c
a nathe data
l i c n
efiles
n O
3. Verify that are deleted.

rme SQL> SELECT name FROM v$datafile;


Ca NAME
------------------------------------------------------------------------------
+DATA/CDB1/DATAFILE/system.258.959612481
+DATA/CDB1/DATAFILE/sysaux.259.959612551
+DATA/CDB1/DATAFILE/undotbs1.260.959612587
+DATA/CDB1/4700A987085B3DFAE05387E5E50A8C7B/DATAFILE/system.268.959612679
+DATA/CDB1/4700A987085B3DFAE05387E5E50A8C7B/DATAFILE/sysaux.267.959612679
+DATA/CDB1/DATAFILE/users.261.959612589
+DATA/CDB1/4700A987085B3DFAE05387E5E50A8C7B/DATAFILE/undotbs1.269.959612679
+DATA/CDB1/DATAFILE/undotbs2.278.959613169
+DATA/CDB1/DATAFILE/undotbs3.279.959613171
+DATA/CDB1/5D8F3DBBBF1449ACE053660200C0ED13/DATAFILE/system.281.959613189
+DATA/CDB1/5D8F3DBBBF1449ACE053660200C0ED13/DATAFILE/sysaux.282.959613189

NAME
------------------------------------------------------------------------------
+DATA/CDB1/5D8F3DBBBF1449ACE053660200C0ED13/DATAFILE/undotbs1.280.959613189

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

270 Practices for Lesson 13: Multitenant Architecture and RAC


+DATA/CDB1/5D8F3DBBBF1449ACE053660200C0ED13/DATAFILE/undo_3.284.959613231
+DATA/CDB1/5D8F3DBBBF1449ACE053660200C0ED13/DATAFILE/undo_4.285.959613233
+DATA/CDB1/5D8F3DBBBF1449ACE053660200C0ED13/DATAFILE/users.286.959613235

15 rows selected.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

SQL>
Note that all files related to pdb2 are removed. The UNDO datafile is associated to the
instance, and not to any PDB.

4. Verify that the services are deleted. Check in V$SERVICES view and with LSNRCTL.
SQL> SELECT name FROM v$services;
a ble
f e r
NAME
ans
---------------------------------------------------------------
n - t r
o
an
mypdb1serv
pdb1 s
ha eฺ
cdb1XDB )
cdb1 ฺ c om Guid
SYS$BACKGROUND
r a cle ent
SYS$USERS
a @ o
S tud
o a n this
e
6 rows selected. nฺ use
( c arm se to
SQL> aexit
an licen ~]$ lsnrctl status
e nO
[oracle@host01

a r m
C LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 10-NOV-
2017 08:19:46

Copyright (c) 1991, 2016, Oracle. All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.2.0.1.0
- Production
Start Date 09-NOV-2017 12:42:01
Uptime 0 days 19 hr. 37 min. 45 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF

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

Practices for Lesson 13: Multitenant Architecture and RAC 271


Listener Parameter File
/u01/app/12.2.0/grid/network/admin/listener.ora
Listener Log File
/u01/app/grid/diag/tnslsnr/host01/listener/alert/log.x ml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.0.2.101)(PORT=1521
)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.0.2.242)(PORT=1521
)))
Services Summary...
Service "+ASM" has 1 instance(s).
a ble
Instance "+ASM1", status READY, has 1 handler(s) for this
f e r
service...
ans
Service "+ASM_DATA" has 1 instance(s). n - t r
o
an
Instance "+ASM1", status READY, has 1 handler(s) for this
s
service...
Service "+ASM_MGMT" has 1 instance(s). ) ha eฺ
ฺ c om Guid
Instance "+ASM1", status READY, has 1 handler(s) for this
service...
r a cle ent
@ o tud
Service "5d8f3dbbbf1449ace053660200c0ed13" has 2 instance(s).
a S
a n this
Instance "cdb1_3", status READY, has 2 handler(s) for this
o
service...
e nฺ use
( c arm se to
Instance "cdb1_3", status READY, has 1 handler(s) for this
service...
ana licen
Service "cdb1" has 1 instance(s).
n O
r m e Instance "cdb1_3", status READY, has 1 handler(s) for this
service...
C a Service "cdb1XDB" has 1 instance(s).
Instance "cdb1_3", status READY, has 1 handler(s) for this
service...
Service "mypdb1serv" has 2 instance(s).
Instance "cdb1_3", status READY, has 2 handler(s) for this
service...
Instance "cdb1_3", status READY, has 1 handler(s) for this
service...
Service "pdb1" has 2 instance(s).
Instance "cdb1_3", status READY, has 2 handler(s) for this
service...
Instance "cdb1_3", status READY, has 1 handler(s) for this
service...

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

272 Practices for Lesson 13: Multitenant Architecture and RAC


The command completed successfully

[oracle@host01 ~]$

5. Close all terminal windows opened for this practice.


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Lesson 13: Multitenant Architecture and RAC 273


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

274 Practices for Lesson 13: Multitenant Architecture and RAC


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
a no
h a s
m ) ideฺ
Practices for Appendix A:
Cleanup
l e ฺco and
t G u
Catchup
o ac den for Practices
rProcedures
a @ S tu
o an thi s
e ฺ
n use
( c arm se to
ana licen
n O
r m e
C a
Appendix A-1: Cleanup Script

Estimated Time: 20~25min

Assumption
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

 You have NOT configured the ASM disk groups with Oracle ASM Filter Driver (AFD). If
you have configured, use asmca to fix the issue first working with your instructor.
1. Open a terminal window to connect to host01 as root user. Run the reset01.sh script.
[oracle@dns ~] ssh root@host01
root@host01’s Password:

[root@host01 ~]# cd /stage/RAC/solutions/less_01/catchup a ble


f e r
ans
[root@host01 catchup]# ./reset01.sh
n - t r
##########################################
a no
Task 1 of 6: Stop Clusterware on all nodes
h a s
##########################################
m ) ideฺ
Fri Feb 2 06:58:11 UTC 2018
l e ฺco t Gu
o r ac den
CRS-2673: Attempting to @
a S tu
stop 'ora.crsd' on 'host05'
CRS-2673: Attempting
o anto stop
t s
hi 'ora.crsd' on 'host04'

en shutdown
CRS-2790: Starting e
s of Cluster Ready Services-managed
resources onr mservert o u
'host05'
( c aAttempting
s e
a n a cen
CRS-2673: to stop 'ora.chad' on 'host05'
CRS-2790:li Starting shutdown of Cluster Ready Services-managed
e n Oresources on server 'host04'
a r m CRS-2673: Attempting to stop 'ora.chad' on 'host04'
C CRS-2677: Stop of 'ora.chad' on 'host05' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources
on 'host05' has completed
CRS-2677: Stop of 'ora.chad' on 'host04' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources
on 'host04' has completed
CRS-2677: Stop of 'ora.crsd' on 'host05' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on
'host05'
CRS-2673: Attempting to stop 'ora.ctssd' on 'host05'
CRS-2673: Attempting to stop 'ora.evmd' on 'host05'
CRS-2673: Attempting to stop 'ora.storage' on 'host05'
CRS-2677: Stop of 'ora.crsd' on 'host04' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on
'host04'

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

276 Practices for Appendix A: Cleanup and Catchup Procedures for Practices
CRS-2673: Attempting to stop 'ora.ctssd' on 'host04'
CRS-2673: Attempting to stop 'ora.evmd' on 'host04'
CRS-2673: Attempting to stop 'ora.storage' on 'host04'
CRS-2677: Stop of 'ora.storage' on 'host05' succeeded
CRS-2677: Stop of 'ora.storage' on 'host04' succeeded
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

CRS-2677: Stop of 'ora.ctssd' on 'host05' succeeded


CRS-2677: Stop of 'ora.evmd' on 'host05' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'host04' succeeded
CRS-2677: Stop of 'ora.evmd' on 'host04' succeeded
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'host05'
succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'host05'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'host04'
a ble
succeeded
f e r
CRS-2673: Attempting to stop 'ora.cssd' on 'host04'
ans
CRS-2677: Stop of 'ora.cssd' on 'host05' succeeded n - t r
CRS-2677: no
Stop of 'ora.cssd' on 'host04' succeeded
a
CRS-2673: a s
Attempting to stop 'ora.crsd' on 'host03'
h
CRS-2673: m ) ideฺ
Attempting to stop 'ora.crsd' on 'host02'
CRS-2673: l e ฺco t Gu
Attempting to stop 'ora.crsd' on 'host01'
CRS-2790: rac uden
Starting shutdown of Cluster Ready Services-managed
o
resources @ S
on server 'host03'
a t
CRS-2673: an thi s
Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on
o
'host03' e ฺ
n use
CRS-2673:
c rm e to to stop 'ora.LISTENER.lsnr' on 'host03'
aAttempting
( ns
ana licAttempting
CRS-2673:
e to stop 'ora.DATA.dg' on 'host03'

n OCRS-2673:Attempting to stop 'ora.FRA.dg' on 'host03'

r m e CRS-2673: Attempting to stop 'ora.MGMT.dg' on 'host03'


C a CRS-2673: Attempting to stop 'ora.chad' on 'host03'
CRS-2677: Stop of 'ora.FRA.dg' on 'host03' succeeded
CRS-2790: Starting shutdown of Cluster Ready Services-managed
resources on server 'host02'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN2.lsnr' on
'host02'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'host02'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'host02'
CRS-2673: Attempting to stop 'ora.FRA.dg' on 'host02'
CRS-2673: Attempting to stop 'ora.MGMT.dg' on 'host02'
CRS-2673: Attempting to stop 'ora.chad' on 'host02'
CRS-2677: Stop of 'ora.DATA.dg' on 'host03' succeeded
CRS-2677: Stop of 'ora.MGMT.dg' on 'host03' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'host03'
CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'host03'
succeeded

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

Practices for Appendix A: Cleanup and Catchup Procedures for Practices 277
CRS-2673: Attempting to stop 'ora.scan1.vip' on 'host03'
CRS-2677: Stop of 'ora.MGMT.dg' on 'host02' succeeded
CRS-2677: Stop of 'ora.FRA.dg' on 'host02' succeeded
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'host03' succeeded
CRS-2673: Attempting to stop 'ora.host03.vip' on 'host03'
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

CRS-2677: Stop of 'ora.DATA.dg' on 'host02' succeeded


CRS-2673: Attempting to stop 'ora.asm' on 'host02'
CRS-2677: Stop of 'ora.asm' on 'host03' succeeded
CRS-2673: Attempting to stop 'ora.ASMNET1LSNR_ASM.lsnr' on
'host03'
CRS-2677: Stop of 'ora.LISTENER_SCAN2.lsnr' on 'host02'
succeeded
CRS-2673: Attempting to stop 'ora.scan2.vip' on 'host02'
a ble
CRS-2790: Starting shutdown of Cluster Ready Services-managed
f e r
resources on server 'host01'
ans
CRS-2673: Attempting to stop 'ora.qosmserver' on 'host01'
n - t r
CRS-2673: Attempting to stop 'ora.gns' on 'host01'
a no
CRS-2673: a s
Attempting to stop 'ora.LISTENER_SCAN3.lsnr' on
h
'host01'
m ) ideฺ
CRS-2673: Attempting to stop 'ora.cvu'
l e ฺco ont G'host01'
u
CRS-2677:
o r ac den
Stop of 'ora.LISTENER.lsnr' on 'host02' succeeded
CRS-2673: Attempting to @
a tu
stop 'ora.host02.vip'
S on 'host02'
CRS-2677: an thon
Stop of 'ora.cvu'
o s
i 'host01' succeeded
CRS-2677: Stopeofฺ s e
n 'ora.LISTENER_SCAN3.lsnr' on 'host01'
succeeded r m t o u
( c
CRS-2673:
aAttempting
s e to stop 'ora.scan3.vip' on 'host01'
ana licStop
CRS-2677: en of 'ora.chad' on 'host02' succeeded
n O
r m e CRS-2677: Stop of 'ora.asm' on 'host02' succeeded

C a CRS-2673: Attempting to stop 'ora.ASMNET1LSNR_ASM.lsnr' on


'host02'
CRS-2677: Stop of 'ora.gns' on 'host01' succeeded
CRS-2673: Attempting to stop 'ora.gns.vip' on 'host01'
CRS-2673: Attempting to stop 'ora.chad' on 'host01'
CRS-2677: Stop of 'ora.chad' on 'host03' succeeded
CRS-2677: Stop of 'ora.scan1.vip' on 'host03' succeeded
CRS-2677: Stop of 'ora.scan3.vip' on 'host01' succeeded
CRS-2677: Stop of 'ora.scan2.vip' on 'host02' succeeded
CRS-2677: Stop of 'ora.host03.vip' on 'host03' succeeded
CRS-2677: Stop of 'ora.host02.vip' on 'host02' succeeded
CRS-2677: Stop of 'ora.ASMNET1LSNR_ASM.lsnr' on 'host03'
succeeded
CRS-2677: Stop of 'ora.chad' on 'host01' succeeded
CRS-2673: Attempting to stop 'ora.mgmtdb' on 'host01'
CRS-2677: Stop of 'ora.gns.vip' on 'host01' succeeded

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

278 Practices for Appendix A: Cleanup and Catchup Procedures for Practices
CRS-2673: Attempting to stop 'ora.ons' on 'host03'
CRS-2677: Stop of 'ora.ons' on 'host03' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'host03'
CRS-2677: Stop of 'ora.net1.network' on 'host03' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources
on 'host03' has completed
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

CRS-2677: Stop of 'ora.ASMNET1LSNR_ASM.lsnr' on 'host02'


succeeded
CRS-2677: Stop of 'ora.crsd' on 'host03' succeeded
CRS-2673: Attempting to stop 'ora.ctssd' on 'host03'
CRS-2673: Attempting to stop 'ora.evmd' on 'host03'
CRS-2673: Attempting to stop 'ora.storage' on 'host03'
CRS-2673: Attempting to stop 'ora.ons' on 'host02'
a ble
CRS-2677: Stop of 'ora.storage' on 'host03' succeeded
f e r
CRS-2673: Attempting to stop 'ora.asm' on 'host03'
ans
CRS-2677: Stop of 'ora.ons' on 'host02' succeeded n - t r
o
an
CRS-2673: Attempting to stop 'ora.net1.network' on 'host02'
s
ha eฺ
CRS-2677: Stop of 'ora.net1.network' on 'host02' succeeded
)
on 'host02' has completed ฺ c om Guid
CRS-2792: Shutdown of Cluster Ready Services-managed resources

r a cle ent
CRS-2677: Stop of 'ora.ctssd' on 'host03' succeeded
@ o
S tud
CRS-2677: Stop of 'ora.evmd' on 'host03' succeeded
a
a n this
CRS-2677: Stop of 'ora.crsd' on 'host02' succeeded
o
e nฺ use
CRS-2673: Attempting to stop 'ora.ctssd' on 'host02'
c arm se to
CRS-2673: Attempting to stop 'ora.evmd' on 'host02'
(
na licen
CRS-2673: Attempting to stop 'ora.storage' on 'host02'
a
n OCRS-2677: Stop of 'ora.storage' on 'host02' succeeded
r m e CRS-2677: Stop of 'ora.qosmserver' on 'host01' succeeded
C a CRS-2677: Stop of 'ora.mgmtdb' on 'host01' succeeded
CRS-2673: Attempting to stop 'ora.MGMTLSNR' on 'host01'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'host01'
CRS-2673: Attempting to stop 'ora.FRA.dg' on 'host01'
CRS-2673: Attempting to stop 'ora.MGMT.dg' on 'host01'
CRS-2677: Stop of 'ora.DATA.dg' on 'host01' succeeded
CRS-2677: Stop of 'ora.MGMT.dg' on 'host01' succeeded
CRS-2677: Stop of 'ora.FRA.dg' on 'host01' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'host01'
CRS-2673: Attempting to stop 'ora.asm' on 'host02'
CRS-2677: Stop of 'ora.ctssd' on 'host02' succeeded
CRS-2677: Stop of 'ora.evmd' on 'host02' succeeded
CRS-2677: Stop of 'ora.MGMTLSNR' on 'host01' succeeded
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'host01'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'host01' succeeded

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

Practices for Appendix A: Cleanup and Catchup Procedures for Practices 279
CRS-2673: Attempting to stop 'ora.host01.vip' on 'host01'
CRS-2677: Stop of 'ora.host01.vip' on 'host01' succeeded
CRS-2677: Stop of 'ora.asm' on 'host03' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on
'host03'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'host03'
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'host03'
CRS-2677: Stop of 'ora.asm' on 'host02' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on
'host02'
CRS-2677: Stop of 'ora.cssd' on 'host03' succeeded
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'host02'
succeeded a ble
f e r
CRS-2673: Attempting to stop 'ora.cssd' on 'host02'
ans
CRS-2677: Stop of 'ora.cssd' on 'host02' succeeded
n - t r
o
an
CRS-2677: Stop of 'ora.asm' on 'host01' succeeded
s
CRS-2673: Attempting to stop 'ora.ASMNET1LSNR_ASM.lsnr' on
ha eฺ
'host01' )
c om Guid
CRS-2677: Stop of 'ora.ASMNET1LSNR_ASM.lsnr' on 'host01'

succeeded
r a cle ent
a @ o
S tud
CRS-2673: Attempting to stop 'ora.ons' on 'host01'

o a n this
CRS-2677: Stop of 'ora.ons' on 'host01' succeeded
nฺ use
CRS-2673: Attempting to stop 'ora.net1.network' on 'host01'
e
( c arm se to
CRS-2677: Stop of 'ora.net1.network' on 'host01' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources
na licen
on 'host01' has completed
a
n O
CRS-2677: Stop of 'ora.crsd' on 'host01' succeeded
r m e CRS-2673: Attempting to stop 'ora.ctssd' on 'host01'
C a CRS-2673: Attempting to stop 'ora.evmd' on 'host01'
CRS-2673: Attempting to stop 'ora.storage' on 'host01'
CRS-2677: Stop of 'ora.storage' on 'host01' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'host01'
CRS-2677: Stop of 'ora.evmd' on 'host01' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'host01' succeeded
CRS-2677: Stop of 'ora.asm' on 'host01' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on
'host01'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'host01'
succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'host01'
CRS-2677: Stop of 'ora.cssd' on 'host01' succeeded
CRS-2791: Starting shutdown of Oracle High Availability
Services-managed resources on 'host01'

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

280 Practices for Appendix A: Cleanup and Catchup Procedures for Practices
CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'host01'
CRS-2673: Attempting to stop 'ora.gpnpd' on 'host01'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'host01'
CRS-2673: Attempting to stop 'ora.crf' on 'host01'
CRS-2677: Stop of 'ora.drivers.acfs' on 'host01' succeeded
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

CRS-2677: Stop of 'ora.gpnpd' on 'host01' succeeded


CRS-2677: Stop of 'ora.crf' on 'host01' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'host01'
CRS-2677: Stop of 'ora.mdnsd' on 'host01' succeeded
CRS-2677: Stop of 'ora.gipcd' on 'host01' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed
resources on 'host01' has completed
CRS-4133: Oracle High Availability Services has been stopped.
a ble
CRS-2791: Starting shutdown of Oracle High Availability
f e r
Services-managed resources on 'host02'
ans
CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'host02' n - t r
o
an
CRS-2673: Attempting to stop 'ora.gpnpd' on 'host02'
s
ha eฺ
CRS-2673: Attempting to stop 'ora.crf' on 'host02'
)
ฺ c om Guid
CRS-2673: Attempting to stop 'ora.mdnsd' on 'host02'

r a cle ent
CRS-2677: Stop of 'ora.drivers.acfs' on 'host02' succeeded

tud
CRS-2677: Stop of 'ora.gpnpd' on 'host02' succeeded
@ o
a S
CRS-2677: Stop of 'ora.crf' on 'host02' succeeded
n this
o a
e nฺ use
CRS-2673: Attempting to stop 'ora.gipcd' on 'host02'
CRS-2677: Stop of 'ora.mdnsd' on 'host02' succeeded
( c arm se to
CRS-2677: Stop of 'ora.gipcd' on 'host02' succeeded
na licen
CRS-2793: Shutdown of Oracle High Availability Services-managed
a
n Oresources on 'host02' has completed
r m e CRS-4133: Oracle High Availability Services has been stopped.
C a CRS-2791: Starting shutdown of Oracle High Availability
Services-managed resources on 'host03'
CRS-2673: Attempting to stop 'ora.gpnpd' on 'host03'
CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'host03'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'host03'
CRS-2673: Attempting to stop 'ora.crf' on 'host03'
CRS-2677: Stop of 'ora.drivers.acfs' on 'host03' succeeded
CRS-2677: Stop of 'ora.gpnpd' on 'host03' succeeded
CRS-2677: Stop of 'ora.mdnsd' on 'host03' succeeded
CRS-2677: Stop of 'ora.crf' on 'host03' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'host03'
CRS-2677: Stop of 'ora.gipcd' on 'host03' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed
resources on 'host03' has completed
CRS-4133: Oracle High Availability Services has been stopped.

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

Practices for Appendix A: Cleanup and Catchup Procedures for Practices 281
CRS-2791: Starting shutdown of Oracle High Availability
Services-managed resources on 'host04'
CRS-2673: Attempting to stop 'ora.crf' on 'host04'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'host04'
CRS-2673: Attempting to stop 'ora.gpnpd' on 'host04'
CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'host04'
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

CRS-2677: Stop of 'ora.crf' on 'host04' succeeded


CRS-2673: Attempting to stop 'ora.gipcd' on 'host04'
CRS-2677: Stop of 'ora.drivers.acfs' on 'host04' succeeded
CRS-2677: Stop of 'ora.gpnpd' on 'host04' succeeded
CRS-2677: Stop of 'ora.gipcd' on 'host04' succeeded
CRS-2677: Stop of 'ora.mdnsd' on 'host04' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed
a ble
resources on 'host04' has completed
f e r
CRS-4133: Oracle High Availability Services has been stopped.
ans
CRS-2791: Starting shutdown of Oracle High Availability n - t r
o
Services-managed resources on 'host05'
s an
) ha eฺ
CRS-2673: Attempting to stop 'ora.crf' on 'host05'
CRS-2673: Attempting to stop 'ora.gpnpd' on 'host05'
ฺ c om Guid
CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'host05'
r a cle ent
CRS-2673: Attempting to stop 'ora.mdnsd' on 'host05'
@ o
S tud
CRS-2677: Stop of 'ora.drivers.acfs' on 'host05' succeeded
a
a n this
CRS-2677: Stop of 'ora.crf' on 'host05' succeeded
o
e nฺ use
CRS-2677: Stop of 'ora.gpnpd' on 'host05' succeeded
c arm se to
CRS-2673: Attempting to stop 'ora.gipcd' on 'host05'
(
na licen
CRS-2677: Stop of 'ora.mdnsd' on 'host05' succeeded
a
n O
CRS-2677: Stop of 'ora.gipcd' on 'host05' succeeded
r m e CRS-2793: Shutdown of Oracle High Availability Services-managed
C a resources on 'host05' has completed
CRS-4133: Oracle High Availability Services has been stopped.

###########################################
Task 2 of 6: Blunt force execution of ohasd
###########################################
Fri Feb 2 07:00:49 UTC 2018

sh: cannot set terminal process group (-1): Inappropriate ioctl


for device
sh: no job control in this shell
sh: cannot set terminal process group (-1): Inappropriate ioctl
for device
sh: no job control in this shell
sh: cannot set terminal process group (-1): Inappropriate ioctl
for device

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

282 Practices for Appendix A: Cleanup and Catchup Procedures for Practices
sh: no job control in this shell
sh: cannot set terminal process group (-1): Inappropriate ioctl
for device
sh: no job control in this shell

######################################################
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Task 3 of 6: Blast the Grid Home and asst. directories


######################################################
Fri Feb 2 07:00:50 UTC 2018

####################################
Task 4 of 6: remove OHASD init files
a ble
####################################
f e r
Fri Feb 2 07:01:22 UTC 2018 ans
n - t r
a no
h a s
###########################################################
m ) idifeฺthey exist
ฺco t Gu
Task 5 of 6: remove /etc/oratab /etc/oracle/*
l e
###########################################################
Fri Feb 2 07:01:23 UTC 2018 o rac uden
a @ S t
o an thi s
e ฺ
n use
c
Task 6 (of
rmReconfigure
##################################
a6: e to
n a e n s ASM Disks
a lic
O##################################
e n Fri Feb 2 07:01:31 UTC 2018
a r m
C File is /dev/c1_DATA1_dsk1
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 17.515 s, 29.9 MB/s
File is /dev/c1_DATA1_dsk10
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 14.5236 s, 36.1 MB/s
File is /dev/c1_DATA1_dsk11
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 15.849 s, 33.1 MB/s
File is /dev/c1_DATA1_dsk12
500+0 records in
500+0 records out

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

Practices for Appendix A: Cleanup and Catchup Procedures for Practices 283
524288000 bytes (524 MB) copied, 14.9201 s, 35.1 MB/s
File is /dev/c1_DATA1_dsk13
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 15.412 s, 34.0 MB/s
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

File is /dev/c1_DATA1_dsk14
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 14.6569 s, 35.8 MB/s
File is /dev/c1_DATA1_dsk2
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 16.1129 s, 32.5 MB/s
a ble
File is /dev/c1_DATA1_dsk3 f e r
ans
500+0 records in
n - t r
500+0 records out
524288000 bytes (524 MB) copied, a no 15.522 s, 33.8 MB/s
h a s
File is /dev/c1_DATA1_dsk4
m ) ideฺ
500+0 records in
l e ฺco t Gu
rac 15.8241 n
500+0 records out
o d e
524288000 bytes (524 MB) copied,
a @ S tu s, 33.1 MB/s

o a n this
File is /dev/c1_DATA1_dsk5
nฺ use
500+0 records in
e
( arm se to
500+0 records out
c
524288000 bytes (524 MB) copied, 15.9136 s, 32.9 MB/s
ana licen
File is /dev/c1_DATA1_dsk6
n O
r m e 500+0 records in

C a 500+0 records out


524288000 bytes (524 MB) copied, 15.836 s, 33.1 MB/s
File is /dev/c1_DATA1_dsk7
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 15.1377 s, 34.6 MB/s
File is /dev/c1_DATA1_dsk8
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 15.6603 s, 33.5 MB/s
File is /dev/c1_DATA1_dsk9
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 15.3633 s, 34.1 MB/s
File is /dev/c1_FRA_dsk1

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

284 Practices for Appendix A: Cleanup and Catchup Procedures for Practices
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 16.0668 s, 32.6 MB/s
File is /dev/c1_FRA_dsk10
500+0 records in
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

500+0 records out


524288000 bytes (524 MB) copied, 15.0152 s, 34.9 MB/s
File is /dev/c1_FRA_dsk11
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 16.1954 s, 32.4 MB/s
File is /dev/c1_FRA_dsk12
500+0 records in
a ble
500+0 records out f e r
ans
524288000 bytes (524 MB) copied, 15.6662 s, 33.5 MB/s
n - t r
File is /dev/c1_FRA_dsk13
500+0 records in a no
h a s
500+0 records out
m ) ideฺ
524288000 bytes (524 MB) copied,
ฺ c o s,
16.0708
G u32.6 MB/s
File is /dev/c1_FRA_dsk14
r a cle ent
500+0 records in
a @ o
S tud
500+0 records out
o a n this
e nฺ use
524288000 bytes (524 MB) copied, 15.3648 s, 34.1 MB/s

( c arm se to
File is /dev/c1_FRA_dsk2
500+0 records in
ana licen
500+0 records out
n O
r m e 524288000 bytes (524 MB) copied, 15.8046 s, 33.2 MB/s

C a File is /dev/c1_FRA_dsk3
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 15.8509 s, 33.1 MB/s
File is /dev/c1_FRA_dsk4
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 15.1068 s, 34.7 MB/s
File is /dev/c1_FRA_dsk5
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 16.2474 s, 32.3 MB/s
File is /dev/c1_FRA_dsk6
500+0 records in
500+0 records out

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

Practices for Appendix A: Cleanup and Catchup Procedures for Practices 285
524288000 bytes (524 MB) copied, 15.1595 s, 34.6 MB/s
File is /dev/c1_FRA_dsk7
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 16.0715 s, 32.6 MB/s
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

File is /dev/c1_FRA_dsk8
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 15.2109 s, 34.5 MB/s
File is /dev/c1_FRA_dsk9
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 15.8876 s, 33.0 MB/s
a ble
File is /dev/c1_SPARE_dsk1 f e r
ans
500+0 records in
n - t r
500+0 records out
524288000 bytes (524 MB) copied, a no 15.6668 s, 33.5 MB/s
h a s
File is /dev/c1_SPARE_dsk10
m ) ideฺ
500+0 records in
l e ฺco t Gu
rac 15.924 n
500+0 records out
o d e
524288000 bytes (524 MB) copied,
a @ S tu s, 32.9 MB/s

o a n this
File is /dev/c1_SPARE_dsk11
nฺ use
500+0 records in
e
( arm se to
500+0 records out
c
524288000 bytes (524 MB) copied, 15.4294 s, 34.0 MB/s
ana licen
File is /dev/c1_SPARE_dsk12
n O
r m e 500+0 records in

C a 500+0 records out


524288000 bytes (524 MB) copied, 16.2076 s, 32.3 MB/s
File is /dev/c1_SPARE_dsk13
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 14.9914 s, 35.0 MB/s
File is /dev/c1_SPARE_dsk14
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 15.7853 s, 33.2 MB/s
File is /dev/c1_SPARE_dsk15
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 15.9972 s, 32.8 MB/s
File is /dev/c1_SPARE_dsk2

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

286 Practices for Appendix A: Cleanup and Catchup Procedures for Practices
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 16.051 s, 32.7 MB/s
File is /dev/c1_SPARE_dsk3
500+0 records in
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

500+0 records out


524288000 bytes (524 MB) copied, 14.903 s, 35.2 MB/s
File is /dev/c1_SPARE_dsk5
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 15.6917 s, 33.4 MB/s
File is /dev/c1_SPARE_dsk6
500+0 records in
a ble
500+0 records out f e r
ans
524288000 bytes (524 MB) copied, 15.2228 s, 34.4 MB/s
n - t r
File is /dev/c1_SPARE_dsk7
500+0 records in a no
h a s
500+0 records out
m ) ideฺ
524288000 bytes (524 MB) copied,
ฺ c o s,
16.0492
G u32.7 MB/s
File is /dev/c1_SPARE_dsk8
r a cle ent
500+0 records in
a @ o
S tud
500+0 records out
o a n this
e nฺ use
524288000 bytes (524 MB) copied, 15.3851 s, 34.1 MB/s

( c arm se to
File is /dev/c1_SPARE_dsk9
500+0 records in
ana licen
500+0 records out
n O
r m e 524288000 bytes (524 MB) copied, 15.9991 s, 32.8 MB/s

C a File is /dev/c1_MGMT_dsk1
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 15.3728 s, 34.1 MB/s
File is /dev/c1_MGMT_dsk10
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 15.4536 s, 33.9 MB/s
File is /dev/c1_MGMT_dsk11
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 15.1812 s, 34.5 MB/s
File is /dev/c1_MGMT_dsk12
500+0 records in
500+0 records out

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

Practices for Appendix A: Cleanup and Catchup Procedures for Practices 287
524288000 bytes (524 MB) copied, 15.8596 s, 33.1 MB/s
File is /dev/c1_MGMT_dsk13
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 14.9365 s, 35.1 MB/s
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

File is /dev/c1_MGMT_dsk14
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 121.667 s, 4.3 MB/s
File is /dev/c1_MGMT_dsk2
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 15.3671 s, 34.1 MB/s
a ble
File is /dev/c1_MGMT_dsk3 f e r
ans
500+0 records in
n - t r
500+0 records out
524288000 bytes (524 MB) copied, a no 15.4773 s, 33.9 MB/s
h a s
File is /dev/c1_MGMT_dsk4
m ) ideฺ
500+0 records in
l e ฺco t Gu
rac 15.2824 n
500+0 records out
o d e
524288000 bytes (524 MB) copied,
a @ S tu s, 34.3 MB/s

o a n this
File is /dev/c1_MGMT_dsk5
nฺ use
500+0 records in
e
( arm se to
500+0 records out
c
524288000 bytes (524 MB) copied, 15.9853 s, 32.8 MB/s
ana licen
File is /dev/c1_MGMT_dsk6
n O
r m e 500+0 records in

C a 500+0 records out


524288000 bytes (524 MB) copied, 15.3184 s, 34.2 MB/s
File is /dev/c1_MGMT_dsk7
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 15.623 s, 33.6 MB/s
File is /dev/c1_MGMT_dsk8
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 15.1113 s, 34.7 MB/s
File is /dev/c1_MGMT_dsk9
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 15.8357 s, 33.1 MB/s

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

288 Practices for Appendix A: Cleanup and Catchup Procedures for Practices
#####################
All 6 Tasks Completed
#####################
Fri Feb 2 07:17:51 UTC 2018
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Elapsed Real Time: 19:40.14

[root@host01 catchup]#

2. Optionally, delete the large files in the /var/log directory.


[root@host01 catchup]# ssh host01 rm -f /var/log/mess*
[root@host01 catchup]# ssh host02 rm -f /var/log/mess*
[root@host01 catchup]# ssh host03 rm -f /var/log/mess*
a ble
[root@host01 catchup]# ssh host04 rm -f /var/log/mess* f e r
[root@host01 catchup]# ssh host05 rm -f /var/log/mess*
ans
[root@host01 catchup]#
n - t r
[root@host01 catchup]# ssh host01
a no rm -rf /tmp/*
[root@host01 catchup]# ssh host02
h a s rm -rf /tmp/*
[root@host01
[root@host01
catchup]#
catchup]#
ssh
ssh m ) ideฺ
host03
host04
rm
rm
-rf
-rf
/tmp/*
/tmp/*
[root@host01 catchup]#
l e
ssh ฺco t Gu
host05 rm -rf /tmp/*
[root@host01 catchup]#
o rac uden
a @ S t
anthat are
3. Optionally, purge the deleted files
o t s
i open to reclaim disk space.
hheld
ฺ e
en uslsof |grep delete
[root@host01 catchup]#
java a r m
4322 to root /u01/app/12.2.0/grid/jdk/jre/bin/java
txt REG 202,2
7734 ( c745648se
ana licen
(deleted)
e nO...
rm [root@host01 catchup]# kill -9 4322
Ca [root@host01 catchup]# lsof |grep delete
[root@host01 catchup]#
[root@host01 catchup]# ssh host02 lsof|grep delete
java 29466 root txt REG 202,2
7734 986836 /u01/app/12.2.0/grid/jdk/jre/bin/java (deleted)
...
[root@host01 catchup]# ssh host02 kill -9 29466
[root@host01 catchup]# ssh host02 lsof |grep delete
[root@host01 catchup]#
[root@host01 catchup]# ssh host03 lsof|grep delete
java 20160 root txt REG 202,2
7734 1518544 /u01/app/12.2.0/grid/jdk/jre/bin/java (deleted)
...
[root@host01 catchup]# ssh host03 kill -9 20160
[root@host01 catchup]# ssh host03 lsof|grep delete
[root@host01 catchup]#
[root@host01 catchup]# ssh host04 lsof|grep delete
nautilus 3002 oracle 19r REG 202,2
524 1581093 /home/oracle/.local/share/gvfs-metadata/home

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

Practices for Appendix A: Cleanup and Catchup Procedures for Practices 289
(deleted)
nautilus 3002 oracle 20r REG 202,2
32768 1583605 /home/oracle/.local/share/gvfs-metadata/home-
cdd03e8e.log (deleted)
java 23432 root txt REG 202,2
7734 360449 /u01/app/12.2.0/grid/jdk/jre/bin/java (deleted)
...
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

[root@host01 catchup]# ssh host04 kill -9 3002 23432


[root@host01 catchup]# ssh host04 lsof|grep delete
[root@host01 catchup]#
[root@host01 catchup]# ssh host05 lsof|grep delete
java 14322 root txt REG 202,2
7734 114768 /u01/app/12.2.0/grid/jdk/jre/bin/java (deleted)
...
tail 21883 grid 3r REG 202,2
5800 1430917
a ble
/u01/app/12.2.0/grid/install/root_host05.example.com_2018-01-
f e r
27_11-36-01-428452867.log (deleted)
ans
[root@host01 catchup]# ssh host05 kill -9 14322 21883
n - t r
[root@host01 catchup]# ssh host05 lsof|grep delete
[root@host01 catchup]# a no
h a s
m )availabled ฺ
espace
4. Make sure the root file system (/) has enough space.oThe
ฺ c u i should be close
enough to the one in the output. cle ent G
r a
[root@host01 catchup]# ssh o
a @ host01 S tudfd-hMounted on
Filesystem Size nUsed
o a t h is 6% /
Avail Use%
/dev/xvda2
e ฺ
128G
n6.0G 7.2G
s
114G
e 6.0G 1% /dev/shm
tmpfs
/dev/xvda1arm 488M
u 76K
to 133M 330M 29% /boot
( c e
na licens 12G 6.5G 4.7G 58% /stage
/dev/xvdf1
a
e nO[root@host01 catchup]# ssh host02 df -h
rm Filesystem Size Used Avail Use% Mounted on
Ca /dev/xvda2
tmpfs
29G
6.0G
5.6G
0
22G
6.0G
21%
0%
/
/dev/shm
/dev/xvda1 488M 133M 330M 29% /boot
/dev/xvdf1 12G 6.5G 4.7G 58% /stage

[root@host01 catchup]# ssh host03 df -h


Filesystem Size Used Avail Use% Mounted on
/dev/xvda2 29G 5.4G 23G 20% /
tmpfs 4.9G 0 4.9G 0% /dev/shm
/dev/xvda1 488M 107M 356M 24% /boot
/dev/xvdf1 12G 6.5G 4.7G 58% /stage

[root@host01 catchup]# ssh host04 df -h


Filesystem Size Used Avail Use% Mounted on
/dev/xvda2 29G 5.4G 23G 20% /
tmpfs 4.9G 76K 4.9G 1% /dev/shm
/dev/xvda1 488M 108M 356M 24% /boot
/dev/xvdf1 12G 6.5G 4.7G 58% /stage

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

290 Practices for Appendix A: Cleanup and Catchup Procedures for Practices
[root@host01 catchup]# ssh host05 df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda2 29G 5.5G 22G 20% /
tmpfs 4.8G 76K 4.8G 1% /dev/shm
/dev/xvda1 488M 117M 346M 26% /boot
/dev/xvdf1 12G 6.5G 4.7G 58% /stage
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

[root@host01 catchup]#

5. Now, you can run the catchup script (less01_catchup.sh) to install and configure the
Grid Infrastructure software.
 Refer to Appendix A-2: Catchup for Practice 1

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Appendix A: Cleanup and Catchup Procedures for Practices 291
Appendix A-2: Catchup Script for Practice 1

Estimated Time: 60min


1. Open a terminal window to connect to host01 as root user. Make sure the
/u01/app/12.2.0/grid directory is empty.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

[oracle@dns ~] ssh root@host01


root@host01’s Password:

[root@host01 ~]# ssh host01 ls -l /u01/app/12.2.0/grid


ls: cannot access /u01/app/12.2.0/grid: No such file or directory

[root@host01 ~]# ssh host02 ls -l /u01/app/12.2.0/grid


ls: cannot access /u01/app/12.2.0/grid: No such file or directory
a ble
[root@host01 ~]# ssh host03 ls -l /u01/app/12.2.0/grid f e r
ls: cannot access /u01/app/12.2.0/grid: No such file or directory ans
n - t r
[root@host01 ~]# ssh host04 ls -l /u01/app/12.2.0/grid
a no
h a s
ls: cannot access /u01/app/12.2.0/grid: No such file or directory

m ) ideฺ
ls: cannot access /u01/app/12.2.0/grid: l e ฺcosucht G
[root@host01 ~]# ssh host05 ls -l /u01/app/12.2.0/grid
No
u
file or directory
o r ac den
[root@host01 ~]#
a @ S tu
o an thi s
e
2. Run the less01_catchup.shฺ
n script.
s e
m to u
[root@host01 ~]#arcd /stage/RAC/solutions/less_01/catchup
[root@host01a ( c n se
~]# ./less01_catchup.sh
an l ic e
O
r m en
##########################################
Task 1 of 7: Creating software directories
C a ##########################################
Fri Feb 2 17:42:03 UTC 2018

#############################
Task 2 of 7: Configuring NSCD
#############################
Fri Feb 2 17:42:08 UTC 2018

#####################################
Task 3 of 7: Configuring shell limits
#####################################
Fri Feb 2 17:42:11 UTC 2018

bash_profile 100% 194 0.2KB/s 00:00


bash_profile 100% 194 0.2KB/s 00:00
limits.conf 100% 1400 1.4KB/s 00:00

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

292 Practices for Appendix A: Cleanup and Catchup Procedures for Practices
profile 100% 1308 1.3KB/s 00:00
profile 100% 1308 1.3KB/s 00:00
bash_profile 100% 194 0.2KB/s 00:00
bash_profile 100% 194 0.2KB/s 00:00
limits.conf 100% 1400 1.4KB/s 00:00
profile 100% 1308 1.3KB/s 00:00
profile 100% 1308 1.3KB/s 00:00
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

bash_profile 100% 194 0.2KB/s 00:00


bash_profile 100% 194 0.2KB/s 00:00
limits.conf 100% 1400 1.4KB/s 00:00
profile 100% 1308 1.3KB/s 00:00
profile 100% 1308 1.3KB/s 00:00
bash_profile 100% 194 0.2KB/s 00:00
bash_profile 100% 194 0.2KB/s 00:00
limits.conf 100% 1400 1.4KB/s 00:00
profile 100% 1308 1.3KB/s 00:00
a ble
profile 100% 1308 1.3KB/s 00:00
f e r
bash_profile 100% 194 0.2KB/s 00:00
ans
bash_profile 100% 194 0.2KB/s -
00:00
n t r
limits.conf
profile a no
100%
100%
1400
1308
1.4KB/s
1.3KB/s
00:00
00:00
profile h a s100% 1308 1.3KB/s 00:00
m ) ideฺ
l e ฺco t Gu
#################################################
rac uden SW
Task 4 of 7: Unzipping the Grid Infrastructure
o
a @ S t
#################################################
Fri Feb 2 17:42:16 UTC 2018
o an thi s
e ฺ
n use
Archive: /stage/clusterware.zip
a rm e to
creating: /u01/app/12.2.0/grid/addnode/
c
( ns
ana /u01/app/12.2.0/grid/addnode/addnode_oraparam.ini.sbs
inflating:
inflating: li c e
/u01/app/12.2.0/grid/addnode/addnode.pl
n O
inflating: /u01/app/12.2.0/grid/addnode/addnode.sh
r m einflating: /u01/app/12.2.0/grid/addnode/addnode_oraparam.ini
C a creating: /u01/app/12.2.0/grid/assistants/
creating: /u01/app/12.2.0/grid/assistants/jlib/
inflating: /u01/app/12.2.0/grid/assistants/jlib/initconfig
inflating: /u01/app/12.2.0/grid/assistants/jlib/appfwk.jar
...

/u01/app/12.2.0/grid/lib/libodm12.so -> libodmd12.so


/u01/app/12.2.0/grid/lib/libagtsh.so -> libagtsh.so.1.0
/u01/app/12.2.0/grid/lib/libclntsh.so -> libclntsh.so.12.1
/u01/app/12.2.0/grid/lib/libocci.so -> libocci.so.12.1

####################################
Task 5 of 7: Installing cvuqdisk RPM
####################################
Fri Feb 2 17:44:29 UTC 2018

Preparing...
########################################### [100%]
package cvuqdisk-1.0.10-1.x86_64 is already installed

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

Practices for Appendix A: Cleanup and Catchup Procedures for Practices 293
Preparing...
##################################################
package cvuqdisk-1.0.10-1.x86_64 is already installed
Preparing...
##################################################
package cvuqdisk-1.0.10-1.x86_64 is already installed
Preparing...
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

##################################################
package cvuqdisk-1.0.10-1.x86_64 is already installed
Preparing...
##################################################
package cvuqdisk-1.0.10-1.x86_64 is already installed

3. After a few moments, the Oracle Grid Infrastructure Setup Wizard is launched.
a ble
f e r
##########################################
ans
Task 6 of 7: Run OUI to create the cluster
n - t r
##########################################
Fri Feb 2 17:44:34 UTC 2018 a no
h a s
Launching Oracle Grid Infrastructure Setup Wizard...
m ) ideฺ
o Gu
You can find the log of this install c l eฺc nat:
session t
r a e
02_05-44-34PM.log a @ o
S tud
/tmp/GridSetupActions2018-02-02_05-44-34PM/gridSetupActions2018-02-

o a n this
e nฺ use
( c arm se to
a n a window
4. Open a terminal
c e n connected to host01 as the root user and monitor the
O progress.
installation li The following tasks are performed in this stage.
n
e Installing Oracle Grid Infrastructure on host01 to host05
a r m
C  Creating the MGMT database
 Running the CLUVFY utility
[oracle@dns ~]$ ssh root@host01
root@host01’s password:

[root@host01 ~]# tail -f /tmp/GridSetupActions2018-02-02_05-44-


34PM/gridSetupActions2018-02-02_05-44-34PM.log

...

INFO: [Timestamp] Successfully executed the flow in SILENT mode


INFO: [Timestamp] Finding the most appropriate exit status for the
current application
INFO: [Timestamp] inventory location is/u01/app/oraInventory
INFO: [Timestamp] Finding the most appropriate exit status for the
current application
INFO: [Timestamp] Exit Status is 0

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

294 Practices for Appendix A: Cleanup and Catchup Procedures for Practices
INFO: [Timestamp] Shutdown Oracle Grid Infrastructure 12c Release 2
Installer

5. Switch to the first terminal window to monitor the rest of tasks.

You can find the log of this install session at:


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

/tmp/GridSetupActions2018-02-02_05-44-34PM/gridSetupActions2018-02-
02_05-44-34PM.log

Successfully Setup Software


Moved the install session logs to :
/u01/app/oraInventory/logs/GridSetupActions2017-12-07_01-16-57PM

As a root user, execute the following script(s):


1. /u01/app/oraInventory/orainstRoot.sh
a ble
2. /u01/app/12.2.0/grid/root.sh
f e r
ans
Execute /u01/app/oraInventory/orainstRoot.sh on the following nodes:
n - t r
[host01, host02, host03, host04, host05]
a
Execute /u01/app/12.2.0/grid/root.sh on the following nodes:no
[host01, host02, host03, host04, host05]
h a s
m ) ideฺ
Execute the script on the local node first.
l coAfter
eฺparallel
t G usuccessful
completion, you can execute th scriptcin n on all other nodes.
r a e
executing the script on LEAF anodes. S tudon all HB nodes before
Oracle recommends that the scriptoexecutes
@
o a n this
e nฺ use
Successfully Setup Software.

(
configuration. c a m se tothe following command to complete the
As install user, rexecute

ana licen
/u01/app/12.2.0/grid/gridSetup.sh -executeConfigTools -
O
responseFile /stage/RAC/soluions/less_01/catchup/less01_grid.rsp [-
r m en
silent]
C a
Moved the install session logs to:
/u01/app/oraInventory/logs/GridSetupActions2018-02-02_05-44-34PM
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.


The execution of the script is complete.
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.


The execution of the script is complete.
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

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

Practices for Appendix A: Cleanup and Catchup Procedures for Practices 295
Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Changing groupname of /u01/app/oraInventory to oinstall.


The execution of the script is complete.
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.


The execution of the script is complete.
Check /u01/app/12.2.0/grid/install/root_host01.example.com_2018-02-
a ble
02_18-00-22-350262475.lo for the output of root script
f e r
Check /u01/app/12.2.0/grid/install/root_host02.example.com_2018-02-
ans
02_18-13-48-077925368.lo for the output of root script
n - t r
02_18-19-28-852096296.lo for the output of root script a no
Check /u01/app/12.2.0/grid/install/root_host03.example.com_2018-02-

h a s
Check /u01/app/12.2.0/grid/install/root_host04.example.com_2018-02-
m
02_18-25-05-782707676.lo for the output of root script ) ideฺ
l e ฺco t Gu
Check /u01/app/12.2.0/grid/install/root_host05.example.com_2018-02-
rac uden
02_18-28-50-031415660.lo for the output of root script
o
a @ S t
s
antoolsthtoi complete cluster config
############################################################
o
Task 7 of 7: Run the config
e ฺ
n use
############################################################

( c armUTC
Fri Feb 2 18:32:32
e to
2018

Setting anainvPtrLoc
c e ns to /u01/app/12.2.0/grid/oraInst.loc
O the li
e n
a r m
perform - mode is starting for action: configure
C
perform - mode finished for action: configure

You can see the log file:


/u01/app/12.2.0/grid/cfgtoollogs/oui/configActions2018-02-02_06-3-34-
PM.log

Post configuration completed successfully

Fri Feb 2 18:34:50 UTC 2018


Elapsed Real Time: 52:46.75

[root@host01 catchup]#

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

296 Practices for Appendix A: Cleanup and Catchup Procedures for Practices
6. Open a new terminal window connected to host01 as the grid user. Check the status of
the cluster. Ensure that all the listed services are online on all cluster nodes.
[oracle@dns ~]$ ssh grid@host01
grid@host01’s password:

[grid@host01 ~]$ . oraenv


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

ORACLE_SID = [grid] ? +ASM1


The oracle base has been set to /u01/app/grid

[grid@host01 ~]$ crsctl check cluster -all

**************************************************************
host01:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
a ble
CRS-4533: Event Manager is online
f e r
**************************************************************
ans
host02:
n - t r
CRS-4537: Cluster Ready Services is online o
CRS-4529: Cluster Synchronization Services is online
s an
CRS-4533: Event Manager is online
) ha eฺ
**************************************************************
host03:
ฺ c om Guid
r a cle ent
CRS-4537: Cluster Ready Services is online

a @
CRS-4533: Event Manager is online
o
S tud
CRS-4529: Cluster Synchronization Services is online

a n this
**************************************************************
o
host04: e nฺ use
( c arm se to
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
na licen
CRS-4533: Event Manager is online
a
O
**************************************************************
n
r m e
host05:
C a CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************

[grid@host01 ~]$ crsctl stat res -t

---------------------------------------------------------------------
Name Target State Server State details
---------------------------------------------------------------------
Local Resources
---------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr
ONLINE ONLINE host01 STABLE
ONLINE ONLINE host02 STABLE
ONLINE ONLINE host03 STABLE
ora.DATA.dg
ONLINE ONLINE host01 STABLE
ONLINE ONLINE host02 STABLE

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

Practices for Appendix A: Cleanup and Catchup Procedures for Practices 297
ONLINE ONLINE host03 STABLE
ora.LISTENER.lsnr
ONLINE ONLINE host01 STABLE
ONLINE ONLINE host02 STABLE
ONLINE ONLINE host03 STABLE
ora.LISTENER_LEAF.lsnr
OFFLINE OFFLINE host04 STABLE
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

OFFLINE OFFLINE host05 STABLE


ora.MGMT.dg
ONLINE ONLINE host01 STABLE
ONLINE ONLINE host02 STABLE
ONLINE ONLINE host03 STABLE
ora.chad
ONLINE ONLINE host01 STABLE
ONLINE ONLINE host02 STABLE
ONLINE ONLINE host03 STABLE
a ble
ONLINE ONLINE host04 STABLE
f e r
ONLINE ONLINE host05 STABLE
ans
ora.net1.network
n - t r
o
an
ONLINE ONLINE host01 STABLE
ONLINE ONLINE host02 STABLE
ONLINE ONLINE host03
s
ha eฺ STABLE
)
ora.ons
ONLINE ONLINE host01 ฺ c om Guid STABLE
ONLINE ONLINE a cle ent
host02
r STABLE
ONLINE ONLINE
a @ ohost03
S tud STABLE
ora.proxy_advm
o a n this
e nฺ use
OFFLINE OFFLINE
OFFLINE OFFLINE
host01
host02
STABLE
STABLE

( c arm se to
OFFLINE OFFLINE host03 STABLE

ana licen
---------------------------------------------------------------------
Cluster Resources
n O
---------------------------------------------------------------------
r m e
ora.LISTENER_SCAN1.lsnr
C a 1 ONLINE ONLINE host03 STABLE
ora.LISTENER_SCAN2.lsnr
1 ONLINE ONLINE host02 STABLE
ora.LISTENER_SCAN3.lsnr
1 ONLINE ONLINE host01 STABLE
ora.MGMTLSNR
1 ONLINE ONLINE host01 169.254.2.192
192.168.1.101
192.168.2.101
,STABLE
ora.asm
1 ONLINE ONLINE host01 Started,STABLE
2 ONLINE ONLINE host03 Started,STABLE
3 ONLINE ONLINE host02 Started,STABLE
ora.cvu
1 ONLINE ONLINE host01 STABLE
ora.gns
1 ONLINE ONLINE host01 STABLE
ora.gns.vip

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

298 Practices for Appendix A: Cleanup and Catchup Procedures for Practices
1 ONLINE ONLINE host01 STABLE
ora.host01.vip
1 ONLINE ONLINE host01 STABLE
ora.host02.vip
1 ONLINE ONLINE host02 STABLE
ora.host03.vip
1 ONLINE ONLINE host03 STABLE
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

ora.mgmtdb
1 ONLINE ONLINE host01 Open,STABLE
ora.qosmserver
1 ONLINE ONLINE host01 STABLE
ora.scan1.vip
1 ONLINE ONLINE host03 STABLE
ora.scan2.vip
1 ONLINE ONLINE host02 STABLE
ora.scan3.vip
a ble
1 ONLINE ONLINE host01 STABLE
f e r
---------------------------------------------------------------------
ans
n - t r
[grid@host01 ~]$
a no
h a s
m ) ideฺOracle database SW
7. Now, you can run the catchup script (less03_catchup.sh) to install
and create the orcl database.
l e ฺco t Gu
rac u3 den
 Refer to Appendix A-3: Catchup for Practice
o
a @ S t
o an thi s
e ฺ
n use
( c arm se to
ana licen
e nO
rm
Ca

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

Practices for Appendix A: Cleanup and Catchup Procedures for Practices 299
Appendix A-3: Catchup Script for Practice 3

Estimated Time: 40min

1. Open a terminal window to connect to host01 as root user. Make sure that the root file
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

system (/) has at least 8GB of free space.


[oracle@dns ~] ssh root@host01
root@host01’s Password:
[root@host01 ~]# ssh host01 df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda2 128G 18G 104G 15% /
tmpfs 6.0G 641M 5.4G 11% /dev/shm
/dev/xvda1 488M 133M 330M 29% /boot
a ble
/dev/xvdf1 12G 6.5G 4.7G 58% /stage
f e r
[root@host01 ~]#
ans
[root@host01 ~]# ssh host02 df -h
n - t r
Filesystem Size Used Avail Use% Mounted on o
/dev/xvda2 29G 15G 14G 52%
s an /
tmpfs
/dev/xvda1
6.0G 640M 5.4G 11%
488M 133M 330M 29% ) ha eฺ /dev/shm
/boot
/dev/xvdf1 12G 6.5G 4.7G 58%
ฺ c om Guid /stage
[root@host01 ~]#
r a cle ent
tud on
o Mounted
[root@host01 ~]# ssh host03 df -h
Filesystem a @
Size Used Avail Use%
n this / S
/dev/xvda2 29G 15G
o a
14G 52%
tmpfs nฺ use
4.9G 640M 4.3G 13%
e /dev/shm
/dev/xvda1 r m to
488M 107M 356M 24%
a /boot
/dev/xvdf1
a (c nse
12G 6.5G 4.7G 58% /stage
n
[root@host01 ~]#
lic e
Oa
[root@host01 ~]# ssh host04 df -h
n
r m e
Filesystem Size Used Avail Use% Mounted on
C a /dev/xvda2 29G 15G 14G 52% /
tmpfs 4.9G 76K 4.9G 1% /dev/shm
/dev/xvda1 488M 108M 356M 24% /boot
/dev/xvdf1 12G 6.5G 4.7G 58% /stage
[root@host01 ~]#
[root@host01 ~]# ssh host05 df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda2 29G 15G 14G 52% /
tmpfs 4.8G 76K 4.8G 1% /dev/shm
/dev/xvda1 488M 117M 346M 26% /boot
/dev/xvdf1 12G 6.5G 4.7G 58% /stage
[root@host01 ~]#

2. Run the less03_catchup.sh script.


[root@host01 ~]# cd /stage/RAC/solutions/less_03/catchup
[root@host01 catchup]# ./less03_catchup.sh

############################################

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

300 Practices for Appendix A: Cleanup and Catchup Procedures for Practices
Task 1 of 5: Create and mount FRA disk group
############################################
Fri Dec 8 09:13:34 UTC 2017

##############################################
Task 2 of 5: Change the permission on /u01/app
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

##############################################
Fri Dec 8 09:13:38 UTC 2017

###########################################
Task 3 of 5: Run OUI to install DB software
###########################################
Fri Dec 8 09:13:39 UTC 2017
a ble
Starting Oracle Universal Installer...
f e r
ans
Checking Temp space: must be greater than 500 MB. Actual 106913 MB
n - t r
Passed
Checking swap space: must be greater than 150 MB. a no
Actual 10699 MB
Passed h a s
m ) ideฺ
Preparing to launch Oracle Universal Installer from
l e ฺco t Gu
/tmp/OraInstall2017-12-08_09-13-39AM. Please wait ...You can find the
log of this install session at:
o rac uden
a @ S t
/u01/app/oraInventory/logs/installActions2017-12-08_09-13-39AM.log

o an thi s
Prepare in progress.
e ฺ
n use
.................................................. 7% Done.
r m t o
a (ca nse
Prepare successful.
O an lice
Copyn files in progress.
rm e
.................................................. 14% Done.
Ca ..................................................
..................................................
20%
25%
Done.
Done.
.................................................. 30% Done.
.................................................. 36% Done.
.................................................. 45% Done.
.................................................. 50% Done.
.................................................. 55% Done.
.................................................. 60% Done.
.................................................. 65% Done.
..........
Copy files successful.

Link binaries in progress.


....................
Link binaries successful.

Setup files in progress.


....................
Setup files successful.

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

Practices for Appendix A: Cleanup and Catchup Procedures for Practices 301
Setup Inventory in progress.

Setup Inventory successful.

Finish Setup successful.


The installation of Oracle Database 12c was successful.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

Please check '/u01/app/oraInventory/logs/silentInstall2017-12-08_09-


13-39AM.log' for more details.

Copy Files to Remote Nodes in progress.

Copy Files to Remote Nodes successful.


.................................................. 85% Done.

Prepare in progress.
a ble
f e r
Prepare successful.
ans
..........
n - t r
Setup in progress.
.................... a no
Setup successful. h a s
m ) ideฺ
The Cluster Node Addition of /u01/app/oracle/product/12.2.0/dbhome_1
was successful.
l e ฺco t Gu
rac uden
Please check '/u01/app/oraInventory/logs/silentInstall2017-12-08_09-
o
13-39AM.log' for more details.
a @ S t
o an thi s
e ฺ
Setup Oracle Base in progress.
n use
Setup Oracle Base
c a rm to
successful.
e
(
a na licens
.................................................. 97% Done.
O user, execute the following script(s):
As an root
rm e 1. /u01/app/oracle/product/12.2.0/dbhome_1/root.sh
Ca Execute /u01/app/oracle/product/12.2.0/dbhome_1/root.sh on the
following nodes:
[host01, host03, host02, host04, host05]

.................................................. 100% Done.


Successfully Setup Software.
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 500 MB. Actual 99149 MB
Passed
Checking swap space: must be greater than 150 MB. Actual 10684 MB
Passed
Preparing to launch Oracle Universal Installer from
/tmp/OraInstall2017-12-08_09-33-46AM. Please wait ...

#############################
Task 4 of 5: Run root scripts

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

302 Practices for Appendix A: Cleanup and Catchup Procedures for Practices
#############################
Fri Dec 8 09:33:59 UTC 2017

Check
/u01/app/oracle/product/12.2.0/dbhome_1/install/root_host01.example.co
m_2017-12-08_09-33-59-216859428.log for the output of root script
Check
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

/u01/app/oracle/product/12.2.0/dbhome_1/install/root_host02.example.co
m_2017-12-08_09-34-00-356267198.log for the output of root script
Check
/u01/app/oracle/product/12.2.0/dbhome_1/install/root_host03.example.co
m_2017-12-08_09-34-00-809833542.log for the output of root script
Check
/u01/app/oracle/product/12.2.0/dbhome_1/install/root_host04.example.co
m_2017-12-08_09-34-01-219757557.log for the output of root script
Check
a ble
/u01/app/oracle/product/12.2.0/dbhome_1/install/root_host05.example.co
f e r
m_2017-12-08_09-34-01-674218372.log for the output of root script
ans
n - t r
########################################
Task 5 of 5: Run DBCA to create database a no
######################################## h a s
Fri Dec 8 09:34:01 UTC 2017 m ) ideฺ
l e ฺco t Gu
You can find the logs of this session
o racat:uden
/u01/app/oraInventory/logs
a @ S t
[FATAL] [INS-32601] The ฺo an thhas
Installer
s
i detected that there are no
config tools to executeen for uthee
s specified Oracle home.
r m
a snode
[WARNING] [DBT-12504] t
For oPolicy Managed database, database instance
may come upaon(clocal e
a
schema on c en will be configured
nlocallinode depending on node availability. Sample
only when database instance
O
rm en database files
comes up
Copying
on local node.

Ca 1% complete
2% complete
15% complete
27% complete
Creating and starting Oracle instance
29% complete
32% complete
36% complete
40% complete
43% complete
44% complete
45% complete
47% complete
Creating cluster database views
49% complete
65% complete
Completing Database Creation
66% complete
67% complete

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

Practices for Appendix A: Cleanup and Catchup Procedures for Practices 303
70% complete
71% complete
73% complete
74% complete
Executing Post Configuration Actions
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/orcl/orcl.log"
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

for further details.

Fri Dec 8 09:46:10 UTC 2017

[root@host01 catchup]#

3. Optionally, delete the large files in the /var/log directory.


[root@host01 catchup]# ssh host01 rm -f /var/log/mess*
a ble
[root@host01 catchup]# ssh host02 rm -f /var/log/mess*
f e r
[root@host01 catchup]# ssh host03 rm -f /var/log/mess*
ans
[root@host01 catchup]# ssh host04 rm -f /var/log/mess*
n - t r
[root@host01
[root@host01
catchup]#
catchup]#
ssh host05 rm -f
a no
/var/log/mess*

[root@host01 catchup]# ssh host01 rm -rf /tmp/* has


[root@host01 catchup]# ssh host02 rm -rf /tmp/* m ) ideฺ
[root@host01 catchup]# o Gu
ssh host03 rm -rfฺc/tmp/*
[root@host01 catchup]# l e
ssh host04 rm c-rf /tmp/* n t
[root@host01 catchup]# ssh host05 r a e
o rm -rftud/tmp/*
[root@host01 catchup]#
n a @ s S
a t h i
e nฺofilesuthat
s e are
r m
4. Optionally, purge the deleted
t o held open to reclaim disk space.
ca nse lsof |grep delete
[root@host01 (catchup]#
a
java n 4322lice root txt REG 202,2
7734 Oa 745648 /u01/app/12.2.0/grid/jdk/jre/bin/java

r m en
(deleted)
C a ...
[root@host01 catchup]# kill -9 4322
[root@host01 catchup]# lsof |grep delete
[root@host01 catchup]#
[root@host01 catchup]# ssh host02 lsof|grep delete
java 29466 root txt REG 202,2
7734 986836 /u01/app/12.2.0/grid/jdk/jre/bin/java (deleted)
...
[root@host01 catchup]# ssh host02 kill -9 29466
[root@host01 catchup]# ssh host02 lsof |grep delete
[root@host01 catchup]#
[root@host01 catchup]# ssh host03 lsof|grep delete
java 20160 root txt REG 202,2 7734
1518544 /u01/app/12.2.0/grid/jdk/jre/bin/java (deleted)
...
[root@host01 catchup]# ssh host03 kill -9 20160
[root@host01 catchup]# ssh host03 lsof|grep delete
[root@host01 catchup]#
[root@host01 catchup]# ssh host04 lsof|grep delete

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

304 Practices for Appendix A: Cleanup and Catchup Procedures for Practices
nautilus 3002 oracle 19r REG 202,2
524 1581093 /home/oracle/.local/share/gvfs-metadata/home
(deleted)
nautilus 3002 oracle 20r REG 202,2
32768 1583605 /home/oracle/.local/share/gvfs-metadata/home-
cdd03e8e.log (deleted)
java 23432 root txt REG 202,2
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

7734 360449 /u01/app/12.2.0/grid/jdk/jre/bin/java (deleted)


...
[root@host01 catchup]# ssh host04 kill -9 3002 23432
[root@host01 catchup]# ssh host04 lsof|grep delete
[root@host01 catchup]#
[root@host01 catchup]# ssh host05 lsof|grep delete
java 14322 root txt REG 202,2 7734
114768 /u01/app/12.2.0/grid/jdk/jre/bin/java (deleted)
...
a ble
tail 21883 grid 3r REG 202,2 5800
f e r
1430917 /u01/app/12.2.0/grid/install/root_host05.example.com_2018-
ans
01-27_11-36-01-428452867.log (deleted)
n - t r
[root@host01 catchup]# ssh host05 kill -9 14322 21883
[root@host01 catchup]# ssh host05 lsof|grep delete a no
[root@host01 catchup]# h a s
m ) ideฺ
o Gu
ฺcspace
5. Make sure the root file system (/) has enough free
c l e n t
(5GB+). The available space
r a
should be close enough to the one in theooutput. de
[root@host01 ~]# ssh host01na @
df -h s S
t u
o a t i Mounted on
hUse%
Filesystem
/dev/xvda2
Size Used ฺ
128Gen 22G u100G
Avail
s e 18% /
tmpfs r m
6.0G t
641M o
a se133M 330M 29% 5.4G 11% /dev/shm
/dev/xvda1 a (c 488M n 6.5G 4.7G 58% /boot
a
/dev/xvdf1 n lice12G /stage
O
en
[root@host01
rm[root@host01
~]#
~]# ssh host02 df -h
Ca Filesystem
/dev/xvda2
Size Used Avail Use% Mounted on
29G 22G 6.4G 77% /
tmpfs 6.0G 641M 5.4G 11% /dev/shm
/dev/xvda1 488M 133M 330M 29% /boot
/dev/xvdf1 12G 6.5G 4.7G 58% /stage
[root@host01 ~]#
[root@host01 ~]# ssh host03 df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda2 29G 23G 5.2G 82% /
tmpfs 4.9G 641M 4.3G 13% /dev/shm
/dev/xvda1 488M 107M 356M 24% /boot
/dev/xvdf1 12G 6.5G 4.7G 58% /stage
[root@host01 ~]#
[root@host01 ~]# ssh host04 df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda2 29G 23G 5.2G 82% /
tmpfs 4.9G 76K 4.9G 1% /dev/shm
/dev/xvda1 488M 108M 356M 24% /boot
/dev/xvdf1 12G 6.5G 4.7G 58% /stage

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

Practices for Appendix A: Cleanup and Catchup Procedures for Practices 305
[root@host01 ~]#
[root@host01 ~]# ssh host05 df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda2 29G 23G 5.2G 82% /
tmpfs 4.8G 76K 4.8G 1% /dev/shm
/dev/xvda1 488M 117M 346M 26% /boot
/dev/xvdf1 12G 6.5G 4.7G 58% /stage
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

[root@host01 catchup]#

6. Open a terminal window connected to host01 as the oracle user and check the
database status and configuration details.
[oracle@dns ~]$ ssh oracle@host01
oracle@host01’s password:
a ble
[oracle@host01 ~]$ export
f e r
ORACLE_HOME=/u01/app/oracle/product/12.2.0/dbhome_1
ans
n - t r
o
an
[oracle@host01 ~]$ export PATH=$PATH:$ORACLE_HOME/bin

h
[oracle@host01 ~]$ srvctl status database -db orcl
s
a ฺ
Instance orcl_1 is running on node host02 )
m uide
Instance orcl_2 is running on node host03ฺco
a c
Instance orcl_3 is running on node host01le nt G
@ or tude
[oracle@host01 ~]$ srvctl config
n i S -db orcl
a database
s
a
ฺo se t
Database unique name: orcl h
Database name: orcl en
a r m to u
Oracle home: /u01/app/oracle/product/12.2.0/dbhome_1
a
Oracle user: (c nse
oracle
Spfile: an l i ce
+DATA/ORCL/PARAMETERFILE/spfile.297.958993403
O
n file: +DATA/ORCL/PASSWORD/pwdorcl.284.958993065
Password
e
C arm
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: orcldb
Disk Groups: FRA,DATA
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
OSDBA group: dba
OSOPER group: oper
Database instances:
Configured nodes:
CSS critical: no
CPU count: 0
Memory target: 0
Maximum memory: 0

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

306 Practices for Appendix A: Cleanup and Catchup Procedures for Practices
Default network number for database services:
Database is policy managed

[oracle@host01 ~]$

7. Now, you can move to Practice 4.


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

8. Close all terminals opened for this practice.

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

Practices for Appendix A: Cleanup and Catchup Procedures for Practices 307
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2018, Oracle and/or its affiliatesฺ

a ble
f e r
ans
n - t r
o
s an
) ha eฺ
ฺ c om Guid
r a cle ent
a @ o
S tud
o a n this
e nฺ use
( c arm se to
ana licen
n O
r m e
C a

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

308 Practices for Appendix A: Cleanup and Catchup Procedures for Practices

Das könnte Ihnen auch gefallen