Vous êtes sur la page 1sur 176

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

e to
c ens
le li
r a b
s f e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
aza us
y ( n
Zak
b i l
Na
Oracle WebLogic Server 12c:
Administration I

Activity Guide
D80149GC20
Edition 2.0 | April 2016 | D94538
Learn more from Oracle University at oracle.com/education/
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Disclaimer

This document contains proprietary information and is protected by copyright and other intellectual property laws. You may copy and
print this document solely for your own 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 use, share, download, upload, copy, print, display,
perform, reproduce, publish, license, post, transmit, or distribute this document in whole or in part without the express authorization
of Oracle.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

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, 500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not
warranted to be error-free.

Restricted Rights Notice

If this documentation is delivered to the United States Government or anyone using the documentation on behalf of the United
States Government, the following notice is applicable:

U.S. GOVERNMENT RIGHTS


The U.S. Government’s rights to use, modify, reproduce, release, perform, display, or disclose these training materials are restricted
e to
ns
by the terms of the applicable Oracle license agreement and/or the applicable U.S. Government contract.

Trademark Notice
li c e
a ble
Oracle and Java are registered trademarks of Oracle Corporation and/or its affiliates. Other names may be trademarks of their
respective owners.
f e r
a n s
Authors
n -t r
o
a n eฺ
Al Saganich, Bill Bell, Elio Bonazzi, Luis Celis and TJ Palazzolo
s
Technical Contributors and Reviewers
) ha Guid
Mark Lindros, Will Lyons, Serge Moiseev,o
c m eSlingsby,
Matthew nt Angelika Krupp, Kevin Tate,
ฺ d
oo Stu Juan Quezada, Radek Felcman, Matt Heimer,
Takyiu Liu, Tom Eliason, Jenny Wongtangswad,
a h
y thand
Saskia Nehls, Juan Adauco Quezada
@ is Eric Gross
Editors z a ky use
( n aAju Kumar
Z a ky
Nikita Abraham,

l
N abiGraphic Designer
Prakash Dharmalingam

Publishers
Pavithran Adka, Sumesh Koshy, Raghunath M

This book was published using: Oracle Tutor

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

Oracle WebLogic Server 12c: Administration I Table of Contents


Table of Contents
Practices for Lesson 1: Course Overview .....................................................................................................1-1
Practices for Lesson 1....................................................................................................................................1-2
Practices for Lesson 2: WebLogic Server: Overview ...................................................................................2-1
Practices for Lesson 2....................................................................................................................................2-2
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Practices for Lesson 3: Installing and Patching WebLogic Server .............................................................3-1


Practices for Lesson 3: Overview ...................................................................................................................3-2
Practice 3-1: Installing WebLogic Server .......................................................................................................3-3
Solution 3-1: Installing WebLogic Server .......................................................................................................3-6
Practice 3-2: Patching WebLogic Server........................................................................................................3-8
Solution 3-2: Patching WebLogic Server........................................................................................................3-13
Practices for Lesson 4: Creating Domains ....................................................................................................4-1

e
Practices for Lesson 4: Overview ...................................................................................................................4-2to
Practice 4-1: Creating a New Domain ............................................................................................................4-3 ns
l
Solution 4-1: Creating a new Domain.............................................................................................................4-7 i ce
a ble
Practice 4-2: Copying a Domain to a New Machine .......................................................................................4-8
r
s fe
Solution 4-2: Copying a Domain to a New Machine .......................................................................................4-11
n
t r a
Practices for Lesson 5: Starting Servers .......................................................................................................5-1
-
on
Practices for Lesson 5: Overview ...................................................................................................................5-2
n
a ฺ
Practice 5 -1: Starting and Stopping Servers .................................................................................................5-3
s e
a i d
m ) h .........................................................................6-1
t G u
Solution 5-1: Starting and Stopping Servers ..................................................................................................5-9
Practices for Lesson 6: Using the Administration
o ฺ co den Console

o forSConfiguration tu
Practices for Lesson 6: Overview ...................................................................................................................6-2
ahConsole
@ y
Practice 6-1: Using the Administration
t h s
i for Configuration..................................................................6-3
k y
Solution 6-1: Using the Administration
s e Console ..................................................................6-7
Practices for Lesson
n a za7: Configuring
u JDBC....................................................................................................7-1
Practices for( Lesson 7: Overview ...................................................................................................................7-2
a ky7-1: Configuring a JDBC Data Source..............................................................................................7-3
Practice
Z
l
N abi Solution 7-1: Configuring a JDBC Data Source..............................................................................................7-6
Practices for Lesson 8: Monitoring a Domain ...............................................................................................8-1
Practices for Lesson 8: Overview ...................................................................................................................8-2
Practice 8-1: Working with WebLogic Server Logs ........................................................................................8-3
Solution 8-1: Working with WebLogic Server Logs ........................................................................................8-8
Practice 8-2: Monitoring WebLogic Server .....................................................................................................8-9
Solution 8-2: Monitoring WebLogic Server .....................................................................................................8-15
Practices for Lesson 9: Node Manager ..........................................................................................................9-1
Practices for Lesson 9: Overview ...................................................................................................................9-2
Practice 9-1: Configuring and Using Node Manager ......................................................................................9-3
Solution 9-1: Configuring and Using Node Manager ......................................................................................9-7
Practices for Lesson 10: Deploying Applications .........................................................................................10-1
Practices for Lesson 10: Overview .................................................................................................................10-2
Practice 10-1: Deploying an Application.........................................................................................................10-3
Solution 10-1: Deploying an Application.........................................................................................................10-7
Practice 10-2: Load Testing an Application ....................................................................................................10-8
Solution 10-2: Load Testing an Application ....................................................................................................10-13

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

Oracle WebLogic Server 12c: Administration I Table of Contents


Practices for Lesson 11: Network Channels and Virtual Hosts ...................................................................11-1
Practices for Lesson 11: Overview .................................................................................................................11-2
Practice 11-1: Configuring a Network Channel ..............................................................................................11-3
Solution 11-1: Configuring a Network Channel ..............................................................................................11-5
Practice 11-2: Configuring the Administration Port.........................................................................................11-6
Solution 11-2: Configuring the Administration Port.........................................................................................11-11
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Practice 11-3: Creating a Virtual Host ............................................................................................................11-12


Solution 11-2: Creating a Virtual Host ............................................................................................................11-15
Practices for Lesson 12: Clusters – Overview, Creation, and Configuration .............................................12-1
Practices for Lesson 12: Overview .................................................................................................................12-2
Practice 12-1: Configuring a Cluster ..............................................................................................................12-3
Solution 12-1: Configuring a Cluster ..............................................................................................................12-5
Practice 12-2: Configuring a Dynamic Cluster ...............................................................................................12-6
Solution 12-2: Configuring a Dynamic Cluster ...............................................................................................12-9
e to
ns
Practices for Lesson 13: Clusters: Proxies and Sessions ...........................................................................13-1
Practices for Lesson 13: Overview .................................................................................................................13-2
li c e
a b le
Practice 13-1: Installing OHS (Optional) ........................................................................................................13-3

f e r
Solution 13-1: Installing OHS (Optional) ........................................................................................................13-6

a n s
Practice 13-2: Configuring a Cluster Proxy ....................................................................................................13-7

-t r
Solution 13-2: Configuring a Cluster Proxy ....................................................................................................13-11
n
o
Practice 13-3: Configuring Replication Groups ..............................................................................................13-12
a n eฺ
Solution 13-3: Configuring Replication Groups ..............................................................................................13-15
s
Practices for Lesson 14: Clusters: Communication, Planning,
) uid
ha andGTroubleshooting ...............................14-1
m n t
co..........................................................................................14-3
Practices for Lesson 14: Overview .................................................................................................................14-2
e
o ฺ d
ahoChannel
Practice 14-1: Configuring a Replication Channel
S tu
Solution 14-1: Configuring a Replication
@ y t hi s ..........................................................................................14-7

y
Practices for Lesson 15: Transactions
e ..........................................................................................................15-1
a15:kOverviewu.................................................................................................................15-2
s
z
Practices for Lesson
a
(nConfiguring Transaction Persistence ......................................................................................15-3
Practice 15-1:
y
l Z ak 15-1: Configuring Transaction Persistence ......................................................................................15-8
Solution

N abiPractices for Lesson 16: WebLogic Server Security ....................................................................................16-1


Practices for Lesson 16: Overview .................................................................................................................16-2
Practice 16-1: Configuring an Authentication Provider ...................................................................................16-3
Solution 16-1: Configuring an Authentication Provider ...................................................................................16-10
Practices for Lesson 17: Backing Up a Domain and Upgrading WebLogic Server....................................17-1
Practices for Lesson 17: Overview .................................................................................................................17-2
Practice 17-1: Backing Up and Restoring a Domain ......................................................................................17-3
Solution 17-1: Backing Up and Restoring a Domain ......................................................................................17-6
Appendix A: Connecting to the Environment ................................................................................................18-1
Overview ........................................................................................................................................................18-2

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

Oracle WebLogic Server 12c: Administration I Table of Contents


Course Practice Environment: Security Credentials

For OS usernames and passwords, see the following:


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

• If you are attending a classroom-based or live virtual class, ask your instructor or LVC
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.

For product-specific credentials used in this course, see the following table:
e to
c ens
li
Product-Specific Credentials
r a ble
Product/Application Username fe
Password
n s
Oracle WebLogic Server
on
weblogic -traWelcome1
Oracle Database a n ฺ Oracle Welcome1
a s i d e
Oracle HTTP Server ) h t Gu
weblogic
m Welcome1

LDAP o ฺ co den
tu
ho s Soracle
Welcome1

Host 01 VNC Authentication ya


y @ e t hi oracle

a ak us
Host 02 VNC Authentication
z oracle oracle

y ( n
Za k
i l
N ab

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

Practices for Lesson Intro: Course Practice Environment


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

Na
b i l
k Za
y ( n a
za k y
y
us
o
@ e th

aho is St
m
u
a
co den
s a n
) h t Gu i d
on
e
-

t r an
sf e r a b
le
li c ens e to
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
s f e
r a n
Practices for
o n -tLesson 1:
Course n ฺ
a Overview
h a s
u i de
m )Chaptert1G
ฺ c o d e n
o u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 1: Course Overview


Chapter 1 - Page 1
Practices for Lesson 1

There are no practices for this lesson.


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

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 1: Course Overview


Chapter 1 - Page 2
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
s f e
r a n
Practices for
o n -tLesson 2:
WebLogic
s a n Server:
e ฺ Overview
ha i d
Chapter 2 Gu
)
ฺ c om dent
a h oo Stu
@ y this
y e
n a zak us
y (
Za k
b i l
Na

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

Practices for Lesson 2: WebLogic Server: Overview


Chapter 2 - Page 1
Practices for Lesson 2

There are no practices for this lesson.


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

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 2: WebLogic Server: Overview


Chapter 2 - Page 2
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
s f e
r a n
Practices for
o n -tLesson 3:
s a n and
Installing
e ฺ Patching
d
ha Gui Server
WebLogic
)
ฺ c om Chapter
d e nt3
a h oo Stu
@ y this
y e
n a zak us
y (
Za k
b i l
Na

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

Practices for Lesson 3: Installing and Patching WebLogic Server


Chapter 3 - Page 1
Practices for Lesson 3: Overview
Practices Overview
In these practices, you install Oracle WebLogic Server 12c and apply a patch to it.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 3: Installing and Patching WebLogic Server


Chapter 3 - Page 2
Practice 3-1: Installing WebLogic Server
Overview
In this practice, you install the Java Development Kit (JDK) and WebLogic Server.
Both the JDK and WebLogic Server have already been installed on both hosts. You will rename
the installation directory on host01 to gain installation practice. If something goes wrong during
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

the installation on host01, you can revert to the preinstalled version of the products by changing
the directories back to their original names.

Assumptions
None

Tasks
1. Connect to host01.
e to
a. Refer to the instructions in Appendix A: Connecting to the Environment to connect to
c ens
your machine.
le li
b. Unless stated otherwise, you will be working within host01 for the remainder of this
r a b
practice.
sf e
2. Rename the installation directories.
- t r an
on
a. Open a Terminal window, and navigate to /u01/app.
n
s a e ฺ
Tip: There is a launcher for a Terminal window in the panel at the top of the desktop.
a i d
$ cd /u01/app
m ) h t Gu
o ฺ co den
b. Rename the FMW installation directory.
$ mv fmw fmw-orig ho
a S tu
y hi s
c. Create a new, empty fmw directory.
@ t
$ mkdir afmw y
k us e
a z
d. Rename
y (n the JDK installation directory.
ak $ mv jdk jdk-orig
li3. ZInstall
b the JDK.
Na a. In the Terminal window, navigate to /install/java.
$ cd /install/java
b. Unzip the tar file by running the tar command.
$ tar xvf jdk-8u60-linux-x64.tar.gz –C /u01/app
Command options:
− x: Extract
− v: Verbose output
− f: File to extract
− C: The tar command changes the current directory to the one specified before
performing any operations. (Note that this is a capital “C.”)
c. Rename the JDK installation directory to something more generic. In a Terminal
window, navigate back to /u01/app.
$ cd /u01/app
$ mv jdk1.8.0_60 jdk

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

Practices for Lesson 3: Installing and Patching WebLogic Server


Chapter 3 - Page 3
Note: The exact name of the directory created by unzipping the tar file may be different,
depending upon the version of the JDK. Rename whatever the directory name is to jdk.
4. Install WebLogic Server.
a. In the Terminal window, navigate to /install/weblogic.
$ cd /install/weblogic
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

b. Set the JAVA_HOME variable to where the JDK is installed.


$ export JAVA_HOME=/u01/app/jdk
c. Set the PATH to include the bin directory of the JDK.
$ export PATH=$JAVA_HOME/bin:$PATH
d. Run the Java virtual machine with the jar option to run the generic installer.
Note: The exact name of the JAR file may be different. Use the name of the generic
installer JAR file in your system. The –D option ensures that the WebLogic installer
performs a 64-bit product installation.
e to
$ java –d64 -jar fmw_12.2.1.0.0_wls.jar
c ens
Extracting files.....
le li
... r a b
s
Note: If any of the installation requirements fail, continue with the installation anyway by f e
r a n
o n -t
answering y when you are asked if you want to continue. There really is not a problem; the
installer might get confused because host01 is a virtual machine.
s a n eฺ
e. After the files are extracted, the graphical installer appears. Use the guidelines in the
ha Guid
following table to install the software:
)
Step ฺ
Window/Page Description c om dent Choices or Values
o u
a. Welcome
y aho is St Click Next.
b. y @ e th
Auto Updates
k Confirm Skip Auto Updates is selected and click
a u s
( n az Next.
c. y Specify Oracle Inventory This screen appears when you install the first Oracle
a k
bilZ Directory product. If it appears, enter
/u01/app/oraInventory and click Next.
Na If it does not appear, move to the next step.
d. Installation Location Enter /u01/app/fmw and click Next.
e. Installation Type Select Complete with Examples.
Click Next.
f. Prerequisite Checks When all prerequisite checks are 100% successful,
click Next.
g. Security Updates Deselect I wish to receive security updates via My
Oracle Support. (In your training environment, you
do not want to associate the installations with a
specific user.)
Click Next.
In the dialog box that opens, click Yes.
h. Installation Summary Click Install.

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

Practices for Lesson 3: Installing and Patching WebLogic Server


Chapter 3 - Page 4
Step Window/Page Description Choices or Values
i. Installation Progress Note the progress and successful completion of the
installation. (This step may take several minutes.)
Click Next.
j. Installation Complete Deselect Automatically Launch the Quickstart
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Configuration Wizard.
Click Finish.
f. Close the Terminal window.

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 3: Installing and Patching WebLogic Server


Chapter 3 - Page 5
Solution 3-1: Installing WebLogic Server
There is no scripted solution for this practice. If you did not do the practice, there is nothing for
you to do, the products are already installed.
If you started the practice, but did not complete it, you revert to the preinstalled version of the
products by deleting any new directories you created and renaming the original installation
directories back to their previous names.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Assumptions
You started the practice but did not complete it.

Solution Tasks
Important: Do these tasks only if you started the practice but did not complete it.
1. Connect to host01.
a. Refer to the instructions in Appendix A: Connecting to the Environment to connect to e to
your machine.
c ens
b. Unless stated otherwise, you will be working within host01 for the remainder of this
le li
practice.
r a b
2. Check that the preinstalled FMW directory is there. Delete the new FMW installation sf e
t r an
directory that you created. Rename the preinstalled directory back to its original name.
-
n on
a. Open a Terminal window, and navigate to /u01/app. Then, list the directories to
s a e ฺ
ensure that the fmw-orig directory is present. Check that this preinstalled directory
a i d
has valid contents.
m ) h t Gu
$ cd /u01/app
o ฺ co den
u
aho is St
$ ls
y
@ e th
fmw ... fmw-orig ...
k y
za us
$ ls fmw-orig
n a
cfgtoollogs coherence ...
(
k y
b. Ensure that you are in the proper directory. Remove the new installation directory that
i l Za you created.
b
Na $ pwd
/u01/app
$ rm –rf fmw
Warning: This command permanently deletes the directory, all its subdirectories, and files.
Use with caution.
c. Rename the preinstalled directory back to its original name.
$ mv fmw-orig fmw
3. Check that the preinstalled JDK directory is there. Delete the new JDK directory that you
created. Rename the preinstalled directory back to its original name.
a. In a Terminal window, navigate to /u01/app. Then list the directories to ensure that
the jdk-orig directory is present.
$ cd /u01/app
$ ls
jdk ... jdk-orig ...

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

Practices for Lesson 3: Installing and Patching WebLogic Server


Chapter 3 - Page 6
b. Ensure that you are in the proper directory. Remove the new installation directory that
you created.
$ pwd
/u01/app
$ rm –rf jdk
Warning: This command permanently deletes the directory, all its subdirectories, and files.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Use with caution.


c. Rename the preinstalled directory back to its original name.
$ mv jdk-orig jdk
4. Close the Terminal window.

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 3: Installing and Patching WebLogic Server


Chapter 3 - Page 7
Practice 3-2: Patching WebLogic Server
Overview
In this practice, you apply a WebLogic patch to the WebLogic Server environment installed in
the previous practice. Optionally, you can also roll back the patch at the end of this practice.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Assumptions
You completed “Practice 3-1: Installing WebLogic Server” and WebLogic Server has been
successfully installed.
No instances of WebLogic Server are running.

Tasks
1. Connect to host01.
Note: If a connection for host01 is already available, you can continue to use it.
e to
2. Access the patch zip file (p22248372_122100_Generic.zip).
c ens
a. Open a Terminal window, and navigate to /install/weblogicpatch. le li
r a b
$ cd /install/weblogicpatch
s f e
3. Define the PATCH_TOP environment variable.
t r a n
a. Define the PATCH_TOP variable and assign it the value
o n -/install/weblogicpatch.
$ export PATCH_TOP=/install/weblogicpatch
s a n eฺ
b. Print the variable to the screen to make h a you set
sure u d PATCH_TOP correctly.
iup
)
m ent G
$ echo $PATCH_TOP
c o
/install/weblogicpatch
h o oฺ tud
4. Define (or redefine) the y
@
a
t h
ORACLE_HOME is Senvironment variable.
a. In a Fusion
z a ky useenvironment, the ORACLE_HOME variable should point to the
Middleware
( n a where WebLogic Server has been installed (/u01/app/fmw).
top directory

Z a ky$ export ORACLE_HOME=/u01/app/fmw


l b. Print the variable to the screen to make sure you set up ORACLE_HOME correctly.
N abi $ echo $ORACLE_HOME
/u01/app/fmw
5. Define (or redefine) the JAVA_HOME environment variable.
a. The JDK used to run OPatch must be the JDK installed in $ORACLE_HOME.
$ export JAVA_HOME=/u01/app/jdk
b. Print the variable to the screen to make sure you set up JAVA_HOME correctly.
$ echo $JAVA_HOME
/u01/app/jdk
6. Add the directory where the OPatch utility resides to the Linux PATH.
a. The executable shell file opatch resides in the OPatch directory. The OPatch
directory must be added to the PATH so that the shell will be able to invoke it.
$ export PATH=$ORACLE_HOME/OPatch:$PATH
Note: Notice that the “O” and “P” in the “OPatch” directory name are capitalized.

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

Practices for Lesson 3: Installing and Patching WebLogic Server


Chapter 3 - Page 8
b. Confirm that the opatch executable appears in your system PATH.
$ which opatch
/u01/app/fmw/OPatch/opatch
7. Unzip the patch zip file into the PATCH_TOP directory.
a. Use the unzip utility to expand the zip file p22248372_122100_Generic.zip.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Note: If asked to replace an existing file, enter A for “All.”


$ unzip –d $PATCH_TOP p22248372_122100_Generic.zip
Archive: p22248372_122100_Generic.zip
creating: 22250572/
creating: 22250572/etc/
creating: 22250572/etc/config/
inflating: 22250572/etc/config/actions.xml
inflating: 22250572/etc/config/inventory.xml
inflating: 22250572/etc/config/patchdeploy.xml
e to
creating: 22250572/files/Set your current directory to the
c ens
directory where the patch is located.
le li
. . .
r a b
$ cd $PATCH_TOP/22250572
sf e
b. Make sure that your default directory is correct.
- t r an
$ pwd
n on
/install/weblogicpatch/22248372 s a e ฺ
a i d
8. ) h t Gu
Before applying the patch, view the patch README file.
m
o ฺ co den
a. In the patch directory, find the README file.
u
aho is St
$ ls README*
README.txt y
@ e th
k y
za us
b. Open the file in the editor. Briefly look at the instructions. The directions in this practice
a
are based on the directions in this file.
y ( n
l Z ak Close the editor without making any changes to the file.
$ gedit README.txt

bi c.
Na 9. Run the OPatch utility with the lsinventory parameter, which finds the Oracle WebLogic
inventory and prints out all the components found.
a. Run opatch with the lsinventory parameter.
$ opatch lsinventory -jdk $JAVA_HOME
Oracle Interim Patch Installer version...
. . .
Oracle Home : /u01/app/fmw
Central Inventory : /u01/app/oraInventory
from : /u01/app/fmw/oraInst.loc
. . .
OPatch succeeded.
$ opatch lsinventory -jdk $JAVA_HOME | grep –i interim
Oracle Interim Patch Installer version 13.3.0.0.0
Interim patches (6) :
Note: WebLogic 12.2.1 ships with six interim patches pre-installed.

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

Practices for Lesson 3: Installing and Patching WebLogic Server


Chapter 3 - Page 9
10. Apply the patch.
a. Run the OPatch utility to apply the patch.
When asked if you want to proceed enter y.
When asked if the local system is ready for patching, enter y.
Note: This can take a while to complete.
$ opatch apply -jdk $JAVA_HOME
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Oracle Interim Patch Installer version ...


...

Oracle Home : /u01/app/fmw


Central Inventory : /u01/app/oraInventory
from : /u01/app/fmw/oraInst.loc

e to
...
c ens
le li
Applying interim patch ‘22250572’to OH '/u01/app/fmw'
r a b
Verifying environment and performing prerequisite checks... sf e
All checks passed. - t r an
n on
a
Please shutdown Oracle instances srunning e ฺ of
a i d out this ORACLE_HOME
on the local system.
m ) h t Gu
ฺ co den
(Oracle Home = '/u01/app/fmw')
o
Backing up files...
y a ho s Stu
...
y @ e t hi
Verifying
a z ak us
the update...
( n
Patch 22250572 successfully applied

l Zaky...
abi
OPatch succeeded.
N $
11. Rerun the OPatch utility with the lsinventory parameter. This time opatch should find
the interim patch you just applied, and print its information to the screen.
a. Run opatch with lsinventory.
$ opatch lsinventory -jdk $JAVA_HOME
Oracle Interim Patch Installer version ...
...
Oracle Home : /u01/app/fmw
Central Inventory : /u01/app/oraInventory
from : /u01/app/fmw/oraInst.loc
...
--------------------------------------------
Interim patches (7) :

Interim patches (7) :


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

Practices for Lesson 3: Installing and Patching WebLogic Server


Chapter 3 - Page 10
Patch 22250572 : applied on Mon Dec 07 09:40:25 PST 2015
Unique Patch ID: 19585367
Patch description: "One-off"
Created on 23 Nov 2015, 15:55:10 hrs PST8PDT
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Bugs fixed:
22175246, 22200449, 21495475, 22247869
. . .
----------------------------------------------------
OPatch succeeded.
$
Note: This time the lsinventory output states that there are seven interim patch,
including the newly applied patch 22250572.
e to
12. Roll back the applied patch. If an issue occurred while applying a patch, your system could
c ens
be left in an unstable state, with a few files already uploaded and other files missing. In this
le li
case, the best course of action is to roll back the patch.
r a b
Note: This can take a while to complete.
sf e
r an
a. Use OPatch to roll back the patch. When you are asked whether the local system is
- t
ready for patching, enter y.
n on
s a e
$ opatch rollback -id 22250572 -jdk $JAVA_HOME ฺ
a i d
) h t Gu
Oracle Interim Patch Installer version ...
m
...
o ฺ co den
u
aho is St
RollbackSession rolling back interim patch 22250572' from OH
'/u01/app/fmw' y
@ e th
k y
a
Please z a
shutdownusOracle instances running out of this ORACLE_HOME
on(n
k y the local system.
a (Oracle Home = '/u01/app/fmw')
l Z
N abi
Is the local system ready for patching? [y|n]
y
User Responded with: Y
...
RollbackSession removing interim patch ‘22250572' from inventory
...
OPatch succeeded.
$

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

Practices for Lesson 3: Installing and Patching WebLogic Server


Chapter 3 - Page 11
13. Make sure that the patch has been removed.
a. Run the OPatch utility with the lsinventory parameter one more time to show that
no interim patches are found.
$ opatch lsinventory -jdk $JAVA_HOME | grep –i interim
...
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Oracle Interim Patch Installer version 13.3.0.0.0


Interim patches (6) :

$
Note: As expected, the lsinventory output shows that only the prior patches are
installed. The interim patch installed and subsequently rolled back is no longer there.
14. Close the Terminal window.

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 3: Installing and Patching WebLogic Server


Chapter 3 - Page 12
Solution 3-2: Patching WebLogic Server
There is no solution for this practice. This practice is not required and can be skipped.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 3: Installing and Patching WebLogic Server


Chapter 3 - Page 13
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 3: Installing and Patching WebLogic Server


Chapter 3 - Page 14
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
s f e
r a n
Practices for
o n -tLesson 4:
Creating
s a nDomains
e ฺ
a
h 4Gu i d
m )Chapter
ฺ c o dent
a h oo Stu
@ y this
y e
n a zak us
y (
Za k
b i l
Na

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

Practices for Lesson 4: Creating Domains


Chapter 4 - Page 1
Practices for Lesson 4: Overview
Practices Overview
In these practices, you create a new WebLogic Server domain. You then move the domain to a
second machine by using the pack and unpack utilities.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

The following is a diagram of the domain:

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 4: Creating Domains


Chapter 4 - Page 2
Practice 4-1: Creating a New Domain
Overview
In this practice, you create a new WebLogic Server domain by using the Configuration Wizard.
As you create the domain, you create and configure some domain resources.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Assumptions
You completed “Practice 3-1: Installing WebLogic Server” and the installation was successful.

Tasks
1. Connect to host01.
a. Unless stated otherwise, you will be working within host01 for the remainder of this
practice.
e to
2. Run the Configuration Wizard in graphical mode.
c ens
a. Open a new Terminal window.
le li
b. Remove the pre-created domain directory. r a b
s f e
$ rm –rf /u01/domains/part1/wlsadmin
r a n
Warning: This command permanently deletes the directory,
o n -t its subdirectories, and files.
all
Use with caution.
a n ฺ
a
c. Navigate to the location of the Configuration
h s de the common/bin directory
Wizard iscript,
u
under the Oracle Common directory: )
c o m ent G
h o oฺ tud
/u01/app/fmw/oracle_common/common/bin.

istheSTab key to auto-complete directory and file names


$ cd /u01/app/fmw/oracle_common/common/bin
Note: Remember that @ yacan tuse
you h
as you type them.
z a ky use
d. Runnthe
( a Configuration Wizard.
y$ ./config.sh
l Zak
bi e. After the graphical wizard opens, use the guidelines in the following table to create the
Na domain:
Step Window/Page Description Choices or Values
a. Create Domain Select Create a new domain.
Enter the Domain Location:
/u01/domains/part1/wlsadmin
Click Next.
b. Templates Ensure that Create Domain Using Product
Templates is selected.
Click Next.
Note: Basic WebLogic Server Domain is selected
automatically and cannot be deselected.
c. Administrator Account Enter these values for the following fields:
(Use credentials for WebLogic Server)
• Name: *******

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

Practices for Lesson 4: Creating Domains


Chapter 4 - Page 3
Step Window/Page Description Choices or Values
• Password: *******
• Confirm Password: *******
Note: The password displays as ●●●●●●●●.
Click Next.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

d. Domain Mode and JDK Under Domain Mode, select Production.


Under JDK, ensure that Oracle HotSpot is selected
(whatever version you have).
Click Next.
e. Advanced Configuration Select Administration Server and Managed
Servers, Clusters, and Coherence.
Click Next.
e to
Note: Although Node Manager can be set up at this
c ens
li
time, you will wait to configure it after it has been
discussed.
r a ble
f. Administration Server Enter or select these values
n s fefor the following fields:
• Server Name:
- t r aAdminServer
• Listenn n host01.example.com
oAddress:
a e
• sListen iPort:
ฺ7001
a d
m ) h • tEnable
G u SSL: Deselected
o ฺ co de•n SSL Listen Port: (Disabled)
u
y aho is St Click Next.
k y @ e th
g. Managed
z a u s
Servers Click the Add button. Then, in the row, enter or

( n a select these values for the following fields:


ky • Server Name: server1
i l Za • Listen Address: host01.example.com
b
Na • Listen Port: 7011
• Enable SSL: Deselected
• SSL Listen Port: (Disabled)
Click the Add button again. Then, in the row, enter or
select these values for the following fields:
• Server Name: server2
• Listen Address: host02.example.com
• Listen Port: 7011
• Enable SSL: Deselected
• SSL Listen Port: (Disabled)
Click Next.
h. Clusters Click the Add button. Then, in the row, enter or
select these values for the following fields:
• Cluster Name: cluster1
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Creating Domains


Chapter 4 - Page 4
Step Window/Page Description Choices or Values
• Cluster Address: (leave blank)
Click Next.
i. Assign Servers to Clusters Under Servers, select server1. Then, under
Clusters, ensure cluster1 is selected and click the
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

right arrow button.


Repeat to move server2 under cluster1.
The Clusters column should then resemble:

Click Next. e to
c ens
j. Machines Click the Machine tab.
le li
r a b
Click the Add button. Then, in the row, enter or
f e
select these values for the following fields:
s
r a n • Name: machine1
• Node o n -t Listen Address:
Manager
s a n e.example.com
host01 ฺ
a i d
m ) h • tNode
G umanager listen port: 5556
o ฺ co Click
d e nthe Add button again. Then, in the row, enter or
u these values for the following fields:
y aho is St select
y @ e t h • Name: machine2

n azak us • Node Manager Listen Address:

y ( host02.example.com
Za k • Node manager listen port: 5556
b i l
Na
Click Next.
k. Assign Servers to Machines Under Machines, select machine1. Then under
Servers, select AdminServer and click the right
arrow button.
Under Machines, ensure machine1 is selected.
Then under Servers, select server1 and click the
right arrow button.
Under Machines, select machine2. Then under
Servers, select server2 and click the right arrow
button.
The Machines column should then resemble:

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

Practices for Lesson 4: Creating Domains


Chapter 4 - Page 5
Step Window/Page Description Choices or Values
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Click Next.
l. Configuration Summary Review the domain.
Click Create.
m. Configuration Progress When the progress bar reaches 100%, click Next.
e to
n. Configuration Success Click Finish.
c ens
f. The Configuration Wizard closes. Close the terminal window. le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 4: Creating Domains


Chapter 4 - Page 6
Solution 4-1: Creating a new Domain
Perform the following tasks if you did not complete this practice and want to use the finished
solution.

Assumptions
You completed “Practice 3-1: Installing WebLogic Server” and the installation was successful or
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

you did not do Practice 3-1 at all (the products are pre-installed).

Solution Tasks
1. Connect to host01. Delete the domain directory you created or was pre-created for you.
a. Open a Terminal window and navigate to the parent directory of the domain directory.
Then remove the domain directory.
$ cd /u01/domains/part1
$ rm –rf wlsadmin e to
Warning: This command permanently deletes the directory, all its subdirectories, and files.
c ens
Use with caution.
b l e li
2. Run the solution script.
s f era
a. In a Terminal window, navigate to the practice directory.
- t r an
on
$ cd /practices/part1/practice04-01
b. Run the solution script.
a n ฺ
a s i d e
) h Tool
$ ./solution.sh
G u
m
Note: This script starts the WebLogic Scripting t
cothe newdedomain
(WLST) passing it the WLST script
n for you. The WLST script prints out
create_domain.py, which creates
o ฺ u take some time, so be patient and do not close
messages. When it writes the
y a hodomain,
s Sit tcan
the Terminal window until you see
y @ e t hithe message:
>>>Domain
z a k us
created successfully at /u01/domains/part1/wlsadmin
3. Close the
( n a
Terminal window.

Z a ky
l
N abi

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

Practices for Lesson 4: Creating Domains


Chapter 4 - Page 7
Practice 4-2: Copying a Domain to a New Machine
Overview
In this practice, you use the pack and unpack utilities to copy the domain to another machine, so
a managed server of the domain can run there.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Assumptions
You completed “Practice 4-1: Creating a New Domain” successfully.

Tasks
1. Connect to host01.
a. Unless stated otherwise, you will be working within host01 for the remainder of this
practice.
2. Create a managed server template by using the pack utility and the domain you just
e to
created.
c ens
a. Open a Terminal window and navigate to the location of the pack.sh script.
le li
$ cd /u01/app/fmw/oracle_common/common/bin r a b
sf e
b.
server template in your home directory: - t r an
Run the pack.sh script with the options to use your domain and create a managed

n on
Note: Enter the command on one line. It is on multiple lines here due to space limitations.
s a e ฺ
a i d
$ ./pack.sh –domain=/u01/domains/part1/wlsadmin

m ) h t Gu
-template=/home/oracle/managedserver.jar
ฺ co den
-template_name=wlsadmin_managed
o u
aho is St
-managed=true
y
k y @ e th
<< read domain from "/u01/domains/part1/wlsadmin"
za us
>> succeed: read domain from "/u01/domains/part1/wlsadmin"
a
( n
..............................................
y
Za k
>> succeed: write template to "/home/oracle/managedserver.jar"
b i l
Na
<< close template
>> succeed: close template
$
3. Copy the template JAR file over to host02.
a. In the Terminal window, navigate to the location of the new JAR file.
$ cd /home/oracle
b. Use secure copy to copy the file onto host02.
$ scp managedserver.jar oracle@host02.example.com:/home/oracle
managedserver.jar ... 100% 63KB 62.5KB/s 00:00
$
c. Close the Terminal window.

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

Practices for Lesson 4: Creating Domains


Chapter 4 - Page 8
4. Connect to host02.
a. Unless stated otherwise, you will be working within host02 for the remainder of this
practice.
5. Create a copy of the domain on host02 by using the unpack utility.
a. Open a Terminal window. Verify that the domain does not already exist on this host.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

$ ls /u01/domains/part1
Note: Note the pre-created domain.
b. Remove the pre-created domain.
$ rm -rf /u01/domains/part1/wlsadmin
c. Warning: This command permanently deletes the directory, all its subdirectories, and
files. Use with caution.
d.
e to
e. Navigate to the location of the unpack.sh script.
c ens
$ cd /u01/app/fmw/oracle_common/common/bin
le li
f. Run the unpack.sh script with the options to use the managed server template to
r a b
create your domain on this host.
sf e
r an
Note: Enter the command on one line. It is on multiple lines here due to space limitations.
- t
n on
$ ./unpack.sh –domain=/u01/domains/part1/wlsadmin
s a e ฺ
-template=/home/oracle/managedserver.jar
a i d
) h t Gu
<< read template from "/home/oracle/managedserver.jar"
m
ฺ co den
>> succeed: read template from "/home/oracle/managedserver.jar"
o u
aho is St
<< set config option DomainName to "wlsadmin"
y
@ e th
>> succeed: set config option DomainName to "wlsadmin"
k y
za us
<< write Domain to "/u01/domains/part1/wlsadmin"
a
( n
....................................................
y
Za k
>> succeed: write Domain to "/u01/domains/part1/wlsadmin"

b i l << close template


Na >> succeed: close template
$
Note: Notice that the domain on host02 is placed in the same location as it is on host01.
This is the recommended practice.

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

Practices for Lesson 4: Creating Domains


Chapter 4 - Page 9
6. Confirm domain directories on host02.
a. In the same Terminal window, navigate to the domain directory and look around by
using the cd and ls commands.
$ cd /u01/domains/part1/wlsadmin
$ ls
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

bin fileRealm.properties lib security startWebLogic.sh


...
$ cd bin
$ ls
nodemanager setDomainEnv.sh ...
...
7. Close the Terminal window.

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 4: Creating Domains


Chapter 4 - Page 10
Solution 4-2: Copying a Domain to a New Machine
Perform the following tasks if you did not complete this practice and want to use the finished
solution.

Assumptions
You completed “Practice 4-1: Creating a New Domain” successfully.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Solution Tasks
1. Connect to host02.
Note: Notice you are going to host02 (not host01).
2. Delete the pre-created domain directory on host02.
Note: Do not delete the domain directory on host01.
a. Open a Terminal window and navigate to the parent directory of the domain directory.
Then remove the domain directory. e to
c ens
$ cd /u01/domains/part1
li
$ rm –rf wlsadmin
r a ble
Use with caution. n s fe
Warning: This command permanently deletes the directory, all its subdirectories, and files.

- t r a
3. Run the solution script.
n on
a
a. In a Terminal window, navigate to the practice directory.
s e ฺ
a i d
$ cd /practices/part1/practice04-02
b. Run the solution script. m ) h t Gu
o ฺ co den
$ ./solution.sh
ho utility,
S u
twhich
y
Note: This script runs the aunpack s
ihost02. The uses a previously created managed server
@
template, to createythe
e h
domain ton command can take a little while, so wait for
the messages z a k unpack
that u ssucceeded in writing the domain and that the template file was
n a you close the Terminal window.
closed,(before
a ky the Terminal window.
4. Close
Z
bil
Na

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

Practices for Lesson 4: Creating Domains


Chapter 4 - Page 11
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 4: Creating Domains


Chapter 4 - Page 12
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
s f e
r a n
Practices for
o n -tLesson 5:
Starting
s a nServers
e ฺ
a
h 5Gu i d
m )Chapter
ฺ c o dent
a h oo Stu
@ y this
y e
n a zak us
y (
Za k
b i l
Na

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

Practices for Lesson 5: Starting Servers


Chapter 5 - Page 1
Practices for Lesson 5: Overview
Job Title*
The Job Title [list@YourCompany.com?Subject=Practices for Lesson 5: Starting Servers:
EDAG0002 - Copy.docx] is responsible for ensuring this document is necessary, reflects actual
practice, and supports corporate policy.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Practices Overview
In this practice, you start and stop instances of WebLogic Server by using the scripts supplied
with the domain. You also update a start script to modify the CLASSPATH of the servers.

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 5: Starting Servers


Chapter 5 - Page 2
Practice 5 -1: Starting and Stopping Servers
Overview
In this practice, you start the administration server by using the domain start script. You create a
boot identity file for the administration server so you do not have to enter a username and
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

password each time you start and stop the server. You start a managed server by using the
domain start script. You also stop servers by using domain stop scripts. Finally, you update a
script to add to the servers’ CLASSPATH.

Assumptions
You completed “Practice 4-1: Creating a New Domain” and “Practice 4-2: Copying a Domain to
a New Machine” so that the domain is created and installed on both hosts.

e to
Tasks
c ens
1. Connect to host01.
le li
a. Unless stated otherwise, you will be working within host01 for the remainder of this
r a b
practice. s f e
r a n
2. Start the administration server by using the script supplied with
o n -t the domain.
a. Open a Terminal window and navigate to the domain
a n ฺ Then run the
directory.
startWebLogic.sh script.
h a s i d e
u
$ cd /u01/domains/part1/wlsadmin
$ ./startWebLogic.sh ฺco
m) ent G
Note: Remember that you can h o o Tab
use theS t udkey to auto-complete directory and file names
as you type them.
@ ya this
a
b. When prompted
z ky for utheseusername, and password from the credentials section, for
n a
example:
(
Z a ky...
l
N abi Enter username to boot WebLogic server: weblogic username
Enter password to boot WebLogic server: weblogic password
...
Note: The password does not display.
c. Messages will appear in the window. When the server successfully completes its
startup process, it writes the following message to the window:
<The server started in RUNNING mode>

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

Practices for Lesson 5: Starting Servers


Chapter 5 - Page 3
Notes
− To remember that this is the window in which the administration server is running,
you might want to change the title of the Terminal window. In the window’s menu,
select Terminal, and then Set Title. Enter the title of AdminServer and click OK.
− If you close the window in which a server is running, you kill the server. Minimize the
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

window, if desired.
3. Create a boot identity file for the administration server.
a. Open a new Terminal window and navigate to the AdminServer directory in the
domain:
$ cd /u01/domains/part1/wlsadmin
$ cd servers/AdminServer
b. Create the security subdirectory under the AdminServer directory:
e to
$ mkdir security
c e ns
e li
c. Create a text file in this security directory called boot.properties and edit it. In this
example, the gedit text editor is used. b l
$ cd security s f era
$ gedit boot.properties
- t r an
n on from the credentials section
d. Add the following two lines to the file: Use the credentials
s a e ฺ
username=weblogic username a
h Gu i d
password=weblogic password )
c m
o dent
For example: ฺ
oo Stu
a h
y this
@
ky use
a z a
( n
e. ky
Save the file (select File > Save, or click Ctrl + S). Close the text editor.
Z a
bil f. Leave the terminal window open for the next task.
Na
4. Stop the administration server and restart it. Observe the server’s use of the boot identity
file.
a. In the Terminal window, navigate to the bin directory under the domain directory, and
run the script to stop the administration server:
$ cd /u01/domains/part1/wlsadmin/bin
$ ./stopWebLogic.sh

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

Practices for Lesson 5: Starting Servers


Chapter 5 - Page 4
Notes
− Notice that the script uses the WebLogic Scripting Tool (WLST).
− You can also stop a server by pressing Ctrl + C in the window in which it is running.
− You must enter the correct username and password (credentials used in the
boot.properties file).
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

b. When the stop script finishes, find the Terminal window in which the administration
server was running. You can see that it has been shut down. Close this window.
c. Return to the other Terminal window, navigate to the domain directory, and once again
run the script to start the administration server:
$ cd /u01/domains/part1/wlsadmin
$ ./startWebLogic.sh
...
e to
Note: If you were successful in creating the boot.properties file you will not be prompted for
c ens
the username and password.
le li
d. Messages will appear in the window. When the server successfully completes its
r a b
startup process, it writes the following message to the window: s f e
r a n
<The server started in RUNNING mode>
o n -t
Notes
a n ฺ
− If you examine the messages in the window,
h a s i desee the message about
you can
u
storing the boot identity: <Storing m ) boott identity
G in the file: ...>. It
was at this point that the o c o
ฺ found
server e n
dthe boot.properties file, used the
h o t u
S credentials were valid, encrypted the credentials
y a because
credentials in it, and
i s those
@
y se
./sain the file. t h
− Youamayz akhave u that the stop script you used earlier did not prompt you for
noticed
y n
(the username and password. That script normally does, but it too can use the
Za k
l boot.properties file. It, however, does not encrypt the username and password,
N abi as the start script does.
e. Leave the administration server running. Give the Terminal window the title of
AdminServer and minimize it, if you want.
5. Start a managed server by using the script supplied with the domain.
a. In a new Terminal window, navigate to the bin directory under the domain directory,
and run the script to start the managed server called server1:
$ cd /u01/domains/part1/wlsadmin/bin
$ ./startManagedWebLogic.sh server1 host01.example.com:7001
Note: Notice that this script takes two parameters: the name of the managed server and the
URL of the domain’s administration server.
b. When prompted for the username enter the Oracle Database credentials from the
credentials section. For example:
...
Enter username to boot WebLogic server: Weblogic username
Enter password to boot WebLogic server: Weblogic password
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Starting Servers


Chapter 5 - Page 5
Note: The password does not display.
c. Messages will appear in the window. When the server successfully completes its
startup process, it writes the following message to the window:
<The server started in RUNNING mode>
Notes
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

− To remember that this is the window in which server1 is running, you might want to
change the title of the Terminal window. In the window’s menu, select Terminal,
and then Set Title. Enter the title of server1 and click OK.
− If you close the window in which a server is running, you kill the server. Minimize the
window, if you want.
− If you want to skip being prompted for the username and password when starting
this server too, create a boot.properties file for it as you did for the
e to
administration server. (Create the security directory under the server1 directory
c ens
and create a new boot.properties file there.)
le li
d. Leave the managed server running. r a b
s f e
e. Minimize the host01 desktop window to use it later.
r a n
6. Start a managed server on the other host, host02. o n -t
a. Connect to host02.
s a n eฺ
b. Open a Terminal window, navigate to )the
a directory
hbin u id under the domain directory,
o m server
n G server2:
tcalled
c
and run the script to start the managed
oฺ tud e
h o
ya this S server2 host01.example.com:7001
$ cd /u01/domains/part1/wlsadmin/bin
@
$ ./startManagedWebLogic.sh
y scriptsetakes two parameters: the name of the managed server and the
kthis
a
Note: Noticezthat u
adomain’s administration
y n
URL of(the server.

l Z ak When prompted for the username, enter the WebLogic Server credentials from the
c.

abi
credentials section.
N ...
Enter username to boot WebLogic server: weblogic username
Enter password to boot WebLogic server: weblogic password
Note: The password does not display.
d. Messages will appear in the window. When the server successfully completes its
startup process, it writes the following message to the window:
<The server started in RUNNING mode>
Notes
− You might want to set the title of the Terminal window to server2.
− If you close the window in which the server is running, you kill the server. Minimize
the window, if you want.
− If you want to, you could create a boot.properties file for this server, too.
e. Leave the managed server running.

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

Practices for Lesson 5: Starting Servers


Chapter 5 - Page 6
7. Add a new JAR file to the CLASSPATH of all servers.
a. Return to the host01 desktop.
Note: If you closed the window, then you must open it again.
b. Open a new Terminal window and copy the JAR file from the current practice directory
to the /home/oracle directory.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

$ cd
$ cp /practices/part1/practice05-01/sample.jar .
c. Navigate to the bin directory of the domain and create the setUserOverrides.sh
file.
Note: The setUserOverrides.sh file is invoked by the setDomainEnv.sh script if
the file exists. It is a best practice to set environmental changes in the override file
instead of making changes directly to WebLogic Server startup scripts. This avoids
your changes getting overwritten when new domain templates or Oracle product
installations are introduced that affect your domains. e to
$ cd /u01/domains/part1/wlsadmin/bin
c ens
$ gedit setUserOverrides.sh le li
r a b
d. Add the following line to the file:
s f e
$ export PRE_CLASSPATH=/home/oracle/sample.jar
r a n
e. Save the file and exit the editor. o n -t
n ฺ host.
8. Use SCP to copy the updated script and the JARsfileato the other
h a u i deupdated script to other host
a. In the same Terminal window, start SFTP
m ) put thet G
and copy the
(replacing the script that is there).
ฺ c oAlso,
d e n JAR file onto the other host (in the
same relative location).
a h oo Stu
y this
$ scp setUserOverrides.sh
@
z a ky use ... 100% 45 0.0KB/s 00:00
oracle@host02:/u01/domains/part1/wlsadmin/bin

n
$ (scp
a /home/oracle/sample.jar oracle@host02:/home/oracle
setUserOverrides.sh

Z a kysample.jar ... 100% 1027 1.0KB/s 00:00


l
N abi $
9. Stop and restart a server. These instructions will use server1.
a. In a Terminal window, navigate to the bin directory under the domain directory, and
run the script to stop the managed server, server1. If you created a boot identity file
for this server, you will not be prompted for the username and password. If you did not,
when prompted for them, enter the WebLogic username and password.
$ cd /u01/domains/part1/wlsadmin/bin
$ ./stopManagedWebLogic.sh server1 host01.example.com:7001
...
Note: Notice that this script takes two parameters: the name of the managed server
and the URL for the domain’s administration server.

b. From a Terminal window, restart server1. You can use the window you were in, the
window in which the server was previously running, or a new window. Again, if
prompted for the username and password, enter the WebLogic username and
password .
$ cd /u01/domains/part1/wlsadmin/bin
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Starting Servers


Chapter 5 - Page 7
$ ./startManagedWeblogic.sh server1 host01.example.com:7001
...
<The server started in RUNNING mode>
c. Leave the window open in which the server is running.
10. Notice the CLASSPATH update.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a. Scroll up in the window in which the server is running until you find the print out of the
CLASSPATH.
...
ClASSPATH=/home/oracle/sample.jar:...
...
Note: Notice the new JAR file at the front of the CLASSPATH.
b. Minimize the server window, if you want.
c. Leave all servers running for now.
e to
Note: Only one server was stopped and restarted, so only that server picked up the
c ens
addition to the CLASSPATH. The others will pick it up the next time they are stopped and
le li
started again. Because the JAR file code is not used by anything, it does not matter that the
r a b
other servers do not yet have access to it. sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 5: Starting Servers


Chapter 5 - Page 8
Solution 5-1: Starting and Stopping Servers
There is no solution for this practice. It primarily involves starting and stopping servers. The
modification of the domain script is not required, so not completing this practice has no effect on
completing subsequent practices.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 5: Starting Servers


Chapter 5 - Page 9
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 5: Starting Servers


Chapter 5 - Page 10
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
s f e
r a n
Practices for
o n -tLesson 6: Using
s a n eฺ
the Administration Console
ha i d
Chapter 6 Gu
)
ฺ c om dent
a h oo Stu
@ y this
y e
n a zak us
y (
Za k
b i l
Na

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

Practices for Lesson 6: Using the Administration Console


Chapter 6 - Page 1
Practices for Lesson 6: Overview
Job Title*
The Job Title [list@YourCompany.com?Subject=Practices for Lesson 6: Using the
Administration Console: EDAG0002 - Copy.docx] is responsible for ensuring this document is
necessary, reflects actual practice, and supports corporate policy.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Practices Overview
In this practice, you access the WebLogic Server administration console. You then use the
console to create and configure some domain resources.

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 6: Using the Administration Console


Chapter 6 - Page 2
Practice 6-1: Using the Administration Console for Configuration
Overview
In this practice, you access the WebLogic Server administration console. You use the console
to create and configure some resources in the domain.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Assumptions
You completed “Practice 5-1: Starting and Stopping Servers.”
All servers in the domain are currently running.
Note: If you did not complete “Practice 5-1: Starting and Stopping Servers,” but completed
“Practice 4-1: Creating a New Domain,” and “Practice 4-2: Copying a Domain to a New
Machine,” and then start the servers in the domain, you can still do this practice.

Tasks e to
c ens
1. Connect to host01.
le li
2. Access the WebLogic Server administration console from the host01 machine.
r a b
a. On the host01 machine, click the Mozilla Firefox web browser icon in the launch bar
s f e
near the top of the screen. r a n
Note: You can make Firefox the default browser if you n onto.
want
-t
s a
b. In the web browser, enter the URL to the administration e ฺ
console:
a i d
http://host01.example.com:7001/console
m ) h t Gu
c. On the console welcome page, ฺ o thedeWebLogic
center n Server credentials from the
o o t u
credentials section, then
y ahclick iLogin.
s S
@ t h
Note: You can have
d. Look at z a
the
ky Firefoxseremember
layout ofuthe
the password if you want to.
administration console.
( n a
a k y
− At the top left is the Change Center.
l Z
bi − Below that is the Domain Structure (the hierarchy of domain resources).
Na − The large area to the right displays information about the element selected in the
Domain Structure.
− Above that display area are links for the Home page, to Log Out, to access the
Preferences, and to access the administration console Help.
3. Update an administration console preference.
a. At the top of the administration console, click the Preferences link.

b. Under Preferences ensure that the User Preferences tab is selected.


c. Scroll down to the Paths To Remember field. Change the number to 8.
Note: If the check box above this, Remember Last Used Path, is selected, the deployment
file browser remembers the last path you used to find a deployment. The number of
Recently Used Paths displayed in the file browser depends upon the Paths To
Remember field.
d. Scroll up (or down) to find the Save button. Click the Save button.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Using the Administration Console


Chapter 6 - Page 3
e. Notice the message at the top: “Settings updated successfully.”
4. Update the configuration of an existing domain resource.
a. Lock the configuration. In the Change Center, click the Lock & Edit button.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

b. In the Domain Structure, expand Environment (click the “+” sign) and then select
Servers.
e to
c ens
le li
r a b
s f e
r a n
c. On the right, in the Servers table, select AdminServer(admin)o n -t in the Name column.
When “Settings for AdminServer” is displayed, click
s a ntheeLogging
ฺ tab. Ensure that the
a i d
General subtab is selected.
m ) h t Gu
d. Scroll down to find the “Rotation
o ฺ cofile size”defield.
n Enter 7500.
e. Click the Save button. ho
a S tu
Note: Notice the message
@ y at the
t s
i “Settings updated successfully.” Also notice in the
hhave
top:
a y
k us
Change Center that the e
buttons been modified.
n
f. In the
z
aChange Center, click Activate Changes.
y (
l Zak
bi
Na

Notes
− Notice the message at the top: “All changes have been activated. No restarts are
necessary.” This change occurred without having to restart the affected server.
Many configuration changes can be completed on a running server without a server
restart.
− Also notice that the configuration is no longer locked.

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

Practices for Lesson 6: Using the Administration Console


Chapter 6 - Page 4
5. Create a new domain resource. To illustrate the capabilities of the Change Center, the
creation of this new resource will not be activated, so no change will actually take place in
the domain configuration.
a. Lock the configuration. In the Change Center, click the Lock & Edit button.
b. In the Domain Structure, expand Environment (click the “+” sign) and then select
Servers.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

c. On the right, above the Servers table, click the New button.
Note: This allows you to create a new instance of WebLogic Server.
d. The wizard for creating a new server starts. Use the guidelines in the following table to
create a new server:
Step Window/Page Choices or Values
Description
e to
a. Create a New Server:
Server Properties
Enter or select these values for the following fields:
c ens
• Server Name: server3
le li
• Server Listen Address: r a b
s f e
r a n host02.example.com

n -t Port: 7013
• Server Listen
o
a n thiseฺserver belong to a cluster? Select
• Should
s
ha Yes, u d this server a member of
imake
)
m entanGexisting cluster.
c o
h o oฺ tud • Select a cluster: cluster1
@ ya this S Click Next.
b. aky a New
zCreate
a Review Choices
e
usServer: Review the choices made.
y ( n Click Finish.
ak Although the new server has been saved, the changes have not yet been activated.
l ZNote:
bi
Na That means they are pending, and the configuration has not actually been updated. You
have decided not to update the configuration with this new server at this time.

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

Practices for Lesson 6: Using the Administration Console


Chapter 6 - Page 5
e. In the Change Center, click Undo All Changes.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Note: Notice that the new server is no longer in the Servers table and the configuration is
no longer locked.
6. (Optional – if you are interested and have time) Access the administration console Help.
Return to the Logging > General page of the admin server. Scroll down to find the
e to
“Rotation type” field. It is currently set to: By Size. Notice to the right of this (and
c ens
every) field there is a short description of the field. At the end of the description of the le li
“Rotation type” field is a link: More info… To learn more about how log files can be r a b
s f e
rotated, click that link.
r a n
The More info… link takes you to the administration console
o n -t help on the appropriate
field. The help opens in a new browser windowa (orn
tab). ฺ
Read a little about log file rotation. Thenh a s
close the u i de (or tab).
window
m ) t Gyou are still on the Logging > General
c
Back on the administration console, o ensuree n
that
tabs of the admin server.h o oฺ the Help
Click t u dlink (at the top). Notice the help is context
S about server logging.
yatakenthtoishelp
sensitive, and you are
y @ e find the Contents tab. Ensure that it is selected and look
On the leftaofkthe helpstext,
z u
athe help contents. Select some other help topic of interest.
( n
around

l ZakyNotice the other tab: Search. Click the Search tab. Enter gridlink in the Search field
N abi and click the Go button. Notice all the topics that display below the field. Select one
and you are taken to that help content.
Close the help window (or tab).

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

Practices for Lesson 6: Using the Administration Console


Chapter 6 - Page 6
Solution 6-1: Using the Administration Console for Configuration
There is no solution for this practice. Any domain configuration changes made in the practice
are not required, so not completing the practice has no effect on subsequent practices.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 6: Using the Administration Console


Chapter 6 - Page 7
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 6: Using the Administration Console


Chapter 6 - Page 8
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
s f e
r a n
Practices for
o n -tLesson 7:
a n eฺJDBC
Configuring
s
ha
Chapter 7 Gu
) id
ฺ c om dent
a h oo Stu
@ y this
y e
n a zak us
y (
Za k
b i l
Na

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

Practices for Lesson 7: Configuring JDBC


Chapter 7 - Page 1
Practices for Lesson 7: Overview
Practices Overview
In this practice, you create and configure a JDBC data source.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 7: Configuring JDBC


Chapter 7 - Page 2
Practice 7-1: Configuring a JDBC Data Source
Overview
In this practice, you create and configure a generic JDBC data source by using the
administration console.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Assumptions
You completed “Practice 5-1: Starting and Stopping Servers.”
All servers in the domain are currently running.
Note: If you did not complete “Practice 5-1: Starting and Stopping Servers,” but completed
“Practice 4-1: Creating a New Domain,” and “Practice 4-2: Copying a Domain to a New
Machine,” and then start the servers in the domain, you can still do this practice.

Tasks
e to
1. Connect to host01.
c ens
2. Open the WebLogic Server administration console.
le li
3. Create a generic JDBC data source. r a b
s
a. Lock the configuration. In the Change Center, click the Lock & Edit button. f e
r a n
o n -t
b. In the Domain Structure, expand Services (click the “+” sign) and then select Data

a n eฺ
Sources.
s
c. On the right, above the Data Sources table, click the New button and select Generic
ha Guid
Data Source. )
c om dent
d. The “create a data source” wizard starts. Use the guidelines in the following table to

a h oo Stu
create a new generic data source:
Step y this
Window/Page
@ Choices or Values
y
ak us
Descriptione
a z
a.(n Create a New JDBC Enter or select these values for the following fields:
ak y Data Source: JDBC • Name: datasource1
l Z Data Source
N abi Properties (page 1) • JNDI Name: datasource1
• Database Type: Oracle
Note: The name and the JNDI name do not have to
match, that is just the choice made in this example.
Click Next.
b. Create a New JDBC Select this value for the following field:
Data Source: JDBC • Database Driver: *Oracle’s Driver (Thin
Data Source XA) for Instance connections;
Properties (page 2) Versions:Any
Click Next.
c. Create a New JDBC Click Next.
Data Source: Note: Because an XA driver was selected, there are no
Transaction Options transaction options to choose.
d. Create a New JDBC Enter or select these values for the following fields:
Data Source: Use the credentials marked Oracle Database for
Connection
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Configuring JDBC


Chapter 7 - Page 3
Step Window/Page Choices or Values
Description
Properties username and password
• Database Name: orcl
Note: That is a lowercase “L” on the end.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

• Host Name: host02.example.com


• Port: 1521
• Database User Name: Oracle user
• Password: Oracle password
• Confirm Password: Oracle password
•oracle.jdbc.DRCPConnectionClass: (leave
blank)
e to
Click Next.
c ens
e. Create a New JDBC Click the Test Configuration button.
le li
Data Source: Test When the message “Connection test succeeded.” r a b
Database s
displays, click Next. f e
Connection r a n
o n -t
Note: If the test fails, click the Back button and check
your entries. Correct any mistakes and return to this
s a n eฺ
page and test again.
f. Create a New JDBC ha G
Under )Clusters, uidcluster1.
select
Data Source: Select c
ฺ om that
Ensure
d e nAllt servers in the cluster is selected.
Targets
a h oo Click S u
tFinish.
@ y
e. In the Change Center, clickth
i s
Activate Changes.
y
akmessage e
Note: Noticezthe
a usat the top: “All changes have been activated. No restarts are
(n This data source was created and targeted without having to restart the
necessary.”
y
Z a k servers.
affected
bil f. Verify the JNDI name is set on the servers in the cluster. Expand Environments, click
Na Servers, click server1, and click View JNDI Tree. You should see datasource1 as an
entry in the list. Repeat for server2.
4. Tune the new generic data source.
Note: The scenario for the database is this:
− The database has intermittent peak usage and the database should be allowed to
shrink every five minutes.
− The DBA has determined that each connection pool should start with one
connection and grow to a maximum of five connections.
− Prepared and callable statements are used. The DBA has calculated that each
connection pool should cache 15 statements.
− The DBA wants connections to be tested before they are given to applications.
− The DBA wants to test unused connections every four minutes.
− Even though connections are tested, performance impact is to be minimized by
trusting idle connections for one minute.
a. Lock the configuration again by clicking Lock & Edit in the Change Center.

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

Practices for Lesson 7: Configuring JDBC


Chapter 7 - Page 4
b. In the Domain Structure, expand Services and then select Data Sources. In the Data
Sources table, select the new data source, datasource1.
c. Click the Configuration tab and then the Connection Pool subtab.
d. Use the guidelines in the following table to set some of the connection pool attributes:
Step Field and Value Reason
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a. Initial Capacity: 1 The initial value from the DBA


Note: With intermittent peak usage, the initial
capacity should be smaller than the maximum.
b. Maximum Capacity: 5 The maximum value from the DBA
Note: Remember when setting this value that
the actual maximum number of connections that
can be retrieved from the database is this
maximum times the number of target servers.
e to
c. Minimum Capacity: 1 The same as the initial capacity
c ens
Note: This number is used in pool shrinking le li
calculations. r a b
s f e
d. Statement Cache Type: LRU
r a n
This algorithm keeps statements used frequently

o n -t
in the cache.
e. Statement Cache Size: 15 The cache n value
a size ฺ from the DBA
s
ha Gui d e
e. Click Save. )
f. Click Advanced. Use the guidelines
ฺ c omin dtheefollowing
nt table to set the rest of the
connection pool attributes:oo
y a h s Stu
Step
@ t i
Field andhValue Reason
y
akConnectionse
s On Reserve:
a.
aTest
z u Test connections before they are

y ( n Selected distributed
k b. Test Frequency: 240
li Za
Test unused connections every four
b minutes
Na c. Seconds to Trust an Idle Pool Trust idle connections for one minute
Connection: 60
d. Shrink Frequency: 300 Allow the database to shrink every
five minutes
g. Click Save.
h. In the Change Center, click Activate Changes.
Note: Notice the message at the top: “All changes have been activated. No restarts are
necessary.”
5. Log out of the administration console.
a. Click the Log Out link.
b. Close the web browser.

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

Practices for Lesson 7: Configuring JDBC


Chapter 7 - Page 5
Solution 7-1: Configuring a JDBC Data Source
Perform the following tasks if you did not complete this practice and want to use the finished
solution.
Note: If you started creating the data source, saved and activated the changes, this script
will not work. To run the script in that case: access the administration console, lock the
configuration, select the check box next to datasource1, click the Delete button, click
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Yes, and activate the changes.

Assumptions
You completed “Practice 5-1: Starting and Stopping Servers.”
All servers in the domain are currently running.
Note: If you did not complete “Practice 5-1: Starting and Stopping Servers,” but completed
“Practice 4-1: Creating a New Domain,” and “Practice 4-2: Copying a Domain to a New
Machine,” and then start the servers in the domain, you can still run this solution.
e to
c ens
Solution Tasks
le li
1. Connect to host01.
r a b
2. Run the solution script. s f e
r a n
o n -t
a. Open a Terminal window and navigate to the practice directory.

a n eฺ
$ cd /practices/part1/practice07-01
b. Run the solution script. s
ha Guid
$ ./solution.sh )
m eTool

Note: This script starts the WebLogic c oScripting
d nt (WLST) passing it the WLST script
create_data_source.py,
a h oo creates
which
S tu the new generic data source for you. The
@ y
WLST script prints out messages.
t h i
Bes patient and do not close the Terminal window until
aky use
you see these messages:
... az
y (n source created successfully!
Zak
>>>Data

bi l
Na 3.
Exiting WebLogic Scripting Tool.
Close the Terminal window.

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

Practices for Lesson 7: Configuring JDBC


Chapter 7 - Page 6
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
s f e
r a n
Practices for
o n -tLesson 8:
a n eaฺ Domain
Monitoring
s
ha
Chapter 8 Gu
) id
ฺ c om dent
a h oo Stu
@ y this
y e
n a zak us
y (
Za k
b i l
Na

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

Practices for Lesson 8: Monitoring a Domain


Chapter 8 - Page 1
Practices for Lesson 8: Overview
Practices Overview
In these practices, you use the administration console to access and configure WebLogic
Server log files. You also use the monitoring capabilities of the admin console and the
Monitoring Dashboard to monitor various aspects of WebLogic Server.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 8: Monitoring a Domain


Chapter 8 - Page 2
Practice 8-1: Working with WebLogic Server Logs
Overview
In this practice, you access a WebLogic Server log file by using the administration console. You
search the server log file by using an editor. You create a log filter and apply it to one of the
logging outputs.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Assumptions
You completed “Practice 7-1: Configuring a JDBC Data Source.”
All servers in the domain are currently running.

Tasks
1. Connect to host01.
2. Open the WebLogic Server administration console.
e to
3. In the admin console, locate the server log file for server1.
c ens
a. In the Domain Structure, expand Diagnostics (click the “+” sign), and then select Log le li
Files. r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na
b. In the Log Files table, select the ServerLog option for server1. Then click the View
button.

Note: If you do not see this log on the first page of the table, click the Next link.

c. The Server Log Entries table displays.


Note: There may be no rows in the table. The table settings determine what to display.

d. Click the Customize this table link.


e. Use the drop-down list to update Time Interval. Choose Last 2 day(s) or some
other interval that will display quite a few messages. Also, use the drop-down list to
change the Number of rows displayed per page to 25 (or a number of your choice).
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Monitoring a Domain


Chapter 8 - Page 3
f. Click the Apply button.
g. Select the option button next to a message and click the View button to see the details
of one of the messages.
h. Use the breadcrumbs at the top of the page to go back to the log by clicking Server
Log.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

i. Scroll up and down and look at the log messages. Click the Next and Previous links.
Note: You may notice that the administration console does not provide a log search
capability. Because it does not, next you will open the log file in an editor.
e to
c e ns
e li
4. In a Terminal window, navigate to the location of the log file and edit it. Use the editor to
search the log file.
b l
a. Open a Terminal window and navigate to the logs directory underfe raserver1
the
directory. List the directory contents.
a n s
- t r
$ cd /u01/domains/part1/wlsadmin/servers/server1/logs
n on
$ ls
s a e ฺ
a i d
) h in your u
access.log diagnostic_images server1.log
Note: There may be more files and directoriesm
o den t G logs directory than listed here.
ฺ c
fileoin an editor.
b. Open the server1.log o
a h S tu
$ gedit server1.log
@ y t h i s
c. Use the search y
ak Press e
capabilities of the gedit editor to find messages placed in the log by the
JDBCa z
subsystem. us Ctrl + F to use the editor’s search capabilities. Enter <jdbc>
(n search field and click the Find button.
in the
y
l Z ak Read the first found message. Continue to click the Find button and look at other from
d.

N abi the JDBC subsystem. Can you find a message that gives which JDBC driver is being
used for the data source?
Hint: You can do find again, this time find: jdbc driver.
e. Close the Find window. Close the editor. Close the Terminal window.

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

Practices for Lesson 8: Monitoring a Domain


Chapter 8 - Page 4
5. Use the admin console to create a log filter.
Note: Here is the scenario: Let us say that you are having issues with server2 and
clustering. You want to temporarily have server2 only publish messages from the Cluster
subsystem into its log, so it is easier to look through the log and find the problem. You
create and apply a log filter that accomplishes this.
a. In the Change Center, click Lock & Edit.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
b. In the Domain Structure, select the domain, wlsadmin.
r a b
sf e
- t r an
n on
c. Click the Configuration tab and then the Log s a subtab.
Filtersd e ฺ
a
) h t Gu i
m
co den
o ฺ u
y aho is St
k y @ e th
a z a us
d. (n the Log Filters table, click the New button.
yAbove
l Z ak For the name of the filter, enter clusterfilter. Click OK.
e.
bi f. In the Log Filters table, click the name of the new filter, clusterfilter.
Na g. On the Configuration tab of the filter, click the Add Expressions button.
h. Enter or select these values for the following fields, and then click OK:
− Message Attribute: SUBSYSTEM
− Operator: LIKE
− Value: Cluster
i. Click OK.
j. In the Change Center, click Activate Changes.
6. Apply the new log filter to the server log of server2.
a. In the Change Center, click Lock & Edit.
b. In the Domain Structure, expand Environment and then select Servers.
c. In the servers table, select server2.
d. Click the Logging tab. Ensure that the General subtab is selected.
e. Scroll down to find the Advanced link. Right above this link is the Rotate log file on
startup check box. Select this check box to enable this feature.

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

Practices for Lesson 8: Monitoring a Domain


Chapter 8 - Page 5
Notes
− In production systems, this is disabled by default. You enable it here so it is easier
to see the log filter at work.
− Notice that this attribute change does not take effect until the server is restarted.
f. Click Save.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

g. Click Advanced.
h. Scroll down to the “Message destination(s)” area. Under “Log file” use the Filter drop-
down list to select clusterfilter.
i. Also under “Log file,” change the value of Log File Buffer to 2.
Notes
− This will ensure that the log file is written to more often. This is probably too small
for the buffer in a real production system.
− Notice that this attribute change also does not take effect until the server is
e to
restarted.
c ens
j. Click the Save button.
le li
k. In the Change Center, click Activate Changes.
r a b
7. Check that the filter is working. First, stop and restart server2, then go look at the server2 sf e
log file.
- t r an
on
a. In the admin console, in the Domain Structure, expand Environment, then select
n
Servers. Click the Control tab.
s a e ฺ
a i d
Force Shutdown Now. m ) h t Gu
b. Select the check box next to server2. Then click the Shutdown button and select

o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na
c. When asked to confirm the shutdown, click Yes.
d. Connect to host02.
e. Find the Terminal window on host02 that was running server2. You should see that
server2 has shut down. Start it again by pressing the up arrow key to retrieve the
command you used to previously start it, and pressing Enter.
Notes
− Remember to enter the username and password if you do not have a boot identity
file for server2.
− If you closed the previous Terminal Window, open a new window and start server2
there:
$ cd /u01/domains/part1/wlsadmin/bin
$ ./startManagedWebLogic.sh server2 host01.example.com:7001
f. When you see the message <The server started in RUNNING mode.>,
minimize the Terminal window.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Monitoring a Domain


Chapter 8 - Page 6
g. Open a new Terminal window and navigate to the location of server2’s log file. List the
server2 log files.
$ cd /u01/domains/part1/wlsadmin/servers/server2/logs
$ ls server2.*
server2.log server2.log00001
Note: You may have more than one older server2 log file. The newest server log file has no
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

digits in its extension.


h. Edit the newest log file.
$ gedit server2.log
i. Look at the log file in the editor. The subsystem is after the timestamp and severity
level. When server2 first comes up, the log filter has not yet been engaged. But soon it
is, and from that point on, you notice that all messages are from the Cluster
subsystem.
... e to
22, 2013 11:57:06 AM UTC> <Info> <WebLogicServer>...en
s
####<Feb
c
####<Feb 22, 2013 11:57:27 AM UTC> <Notice> <Cluster>...
b l e li
####<Feb 22, 2013 11:57:36 AM UTC> <Info> <Cluster>...
s f era
...
- t r an
####<Feb 22, 2013 11:57:37 AM UTC> <Info>
n on <Cluster>...
Note: The timestamps in your log file will be different.
s a The severity
e ฺ levels may be different.
a i d
j. Exit the editor.
m ) h t Gu
k. Close the Terminal window.
o ฺ co den
8. Remove the filter from server2. o Stu
ahonly
@ y
Note: A filter like this would
t be
h isused temporarily. After you remedied whatever the
cluster issue was,
a k y se
you would remove the filter. Without the usual messages going to the
server log, itz u
would be difficult to debug new problems as they arise.
a. y (nato the web browser with the admin console.
Return

l Z ak In the Change Center, click Lock & Edit.


b.

N abi c. In the Domain Structure, expand Environment and then select Servers.
d. In the servers table, select server2.
e. Click the Logging tab. Ensure that the General subtab is selected.
f. Click Advanced.
g. Scroll down to the “Message destination(s)” area. Under “Log file” use the Filter drop-
down list to select None.
h. Click the Save button.
i. In the Change Center, click Activate Changes.
j. If you are not proceeding to the next practice, log out of the admin console, and close
the web browser.

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

Practices for Lesson 8: Monitoring a Domain


Chapter 8 - Page 7
Solution 8-1: Working with WebLogic Server Logs
Perform the following tasks if you did not complete this practice and want to use the finished
solution.

Assumptions
You completed “Practice 7-1: Configuring a JDBC Data Source.”
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

All servers in the domain are currently running.

Solution Tasks
1. Connect to host01.
2. Run the solution script.
a. In a Terminal window, navigate to the practice directory.
$ cd /practices/part1/practice08-01
e to
b. Run the solution script.
c ens
$ ./solution.sh
le li
Note: This script starts the WebLogic Scripting Tool (WLST) passing it the WLST script
r a b
create_logfilter.py, which creates the log filter. It does not apply the filter, because
sf e
- t r an
this filter is removed at the end of the practice. Also note that the WLST script does not

necessary. n on
change any server2 log settings that would require a server restart, nor are those settings

s a e ฺ
3. Close the Terminal window. a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 8: Monitoring a Domain


Chapter 8 - Page 8
Practice 8-2: Monitoring WebLogic Server
Overview
In this practice, you use the monitoring capabilities of the admin console and the Monitoring
Dashboard to monitor various aspects of WebLogic Server.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Assumptions
You completed “Practice 7-1: Configuring a JDBC Data Source.” (“Practice 8-1: Working with
WebLogic Server Logs” is not required for this or any other practice.)
All servers in the domain are currently running.

Tasks
1. Connect to host01.
2. Access the WebLogic Server administration console.
e to
3. Use the admin console to monitor server health.
c ens
a. In the Domain Structure, expand Environment (click the “+” sign), and then select
le li
Servers. r a b
b. Before doing anything else, notice the Servers table. By default it displays each sf e
t r an
server’s state and health. Other columns of information can be added to the table by
-
using the Customize this table link.
n on
c. In the Servers table, select server2.s a e ฺ
a i d
) h t Gu
d. Click the Monitoring tab. Ensure that the General subtab is selected. Notice the
m
o ฺ co den
information available, such as when the server started, the version of WebLogic
Server, which JVM and version WebLogic Server is running under, the operating
u
aho is St
system and version, and so on.
y
y @ e th
e. Click the Health subtab under the Monitoring tab. Some of the WebLogic Server
k
za us
subsystems are listed along with their health.
a
( n
f. Stay on the Monitoring tab of the server for the next task.
y
4.
Za k
Modify the information displayed by a monitoring table. You will use this table later.
b i l a. Click the JDBC subtab under the server’s Monitoring tab.
Na b. Click the Customize this table link. In the Chosen column, select Active
Connections Average Count and Active Connections High Count. Click the left
arrow ( ) to move these attributes to the Available column. In the Available column,
select Current Capacity and Num Available, and click the right arrow ( ) to move
them to the Chosen column. Click the Apply button.
5. Before monitoring a data source, check on some of its settings.
a. In the admin console, select the data source (in the Domain Structure, expand
Services, select Data Sources, and select datasource1).
b. Select Configuration > Connection Pool. Make note of the Maximum Capacity.
Note: It should be set to 5. But if it is something different, that is OK. Just remember it.
c. Still on this data source, click the Monitoring > Statistics tabs. Ensure that the data
source is enabled and running on both servers.
Note: If not, then perhaps one of the servers has not been started. Start it now.
d. Minimize the web browser. You will be using it later.

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

Practices for Lesson 8: Monitoring a Domain


Chapter 8 - Page 9
6. Connect to host02. From there, run the script that sets up the database with a table and
loads it with some data. Then, run the script that calls a Java client. This client uses the
data source to retrieve a connection to the database, accesses the database, and loops to
do it again.
Note: Notice that this is host02, not host01.
a. Open a Terminal window and navigate to the practice directory. Set a couple of
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

environment variables and run the script that sets up the database.
Notes
• The ORACLE_HOME variable needs to point to where the database is installed.
ORACLE_SID (Oracle System ID) is the unique name of this particular database.
$ cd /practices/part1/practice08-02
$ export ORACLE_HOME=/u01/app/db11g/product/11.2.0/dbhome_1
$ export ORACLE_SID=orcl
e to
ns
$ ./setup.sh
...
li c e
1 row created
a ble
f e r
a n s
Commit complete.
n -t r
...
o
$
s a n eฺ
• The SQL script drops the table (and sequence) d so you can run it multiple
ha Guit icreates,
)
mscriptenis trun, it produces messages that no such
times. Therefore, the first time the
c o
h o oฺ those
table or sequence exist. Ignore
t u dmessages if you see them.
b. Now, run the script that
ya callstothe S client. When you run the script, you pass it the
Java
isaccess
number of times@ you want itth the database. The first time it accesses the
database,a it k y outssome
prints e data it retrieves. It then loops, accessing the database, in
a
total,nthe znumber ofutimes you entered. The client then pauses. You let the client wait,
k still( running, and go see what is happening with the data source.
y
a
bil ZImportant: The number you enter when you run the script should be TWO TIMES the
Na Maximum Capacity you made note of earlier. Why double it? Because the data source is
targeted to the cluster, and there are two servers in the cluster, there are two instances of
the data source. Therefore, the number of available connections is twice the data source
connection pool Maximum Capacity.
Note: This Java client is written poorly on purpose. Each time the client code wants to
access the database, it asks for a connection from the data source. When the code is
finished with the connection, the code does not close that connection. Therefore, that
connection is not returned to the connection pool.
$ ./runclient.sh 10
...
Your environment has been set.
>>>Obtained initial context
>>>Data source named datasource1 retrieved
>>>Querying data source...
Contacts from database:
1 Homer Simpson 742...

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

Practices for Lesson 8: Monitoring a Domain


Chapter 8 - Page 10
...
This client is still running...
When you are ready to stop it, press Enter.
Note: Do NOT press Enter yet!
c. Go back to the admin console on host01.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

d. Navigate to the Monitoring > JDBC tab of server2 (in the Domain Structure expand
Environment and select Servers. Select server2. Click the Monitoring > JDBC tabs).
Refresh the web browser (you can press F5).
e. Notice that Active Connections Current Count is equal to the Maximum Capacity
you noted earlier. The Current Capacity value is also the Maximum Capacity. And
Num Available is 0. The bad code in the client has used up each one of the database
connections.
f. In the Terminal window on host02 where the Java client is running, press the Enter
key. The client code completes.
e to
7. View the kinds of messages that the JDBC subsystem places in a server log.
c ens
a. Open a Terminal window and navigate to the logs directory under the server2
le li
directory. Edit the server log. r a b
s f e
$ cd /u01/domains/part1/wlsadmin/servers/server2/logs
r a n
$ gedit server2.log
o n -t
b. In the editor, scroll all the way to the bottom of the n log file. Then use the search
s
capabilities of the gedit editor to find messages aplaced e
in ฺthe log by the JDBC
a i d
the end of the file, select Searcho m ) h tsearch
subsystem. Press Ctrl + F to use the editor’s
G u capabilities. Because you are at
ฺ c backwards.
d e n Enter <jdbc> in the search field and
click the Find button.
a h oo Stu
c. You should see some
@ y messages
t h is earlier.
that connections have been closed. This happened

z a ky use
when the client stopped running

( n a
####...<JDBC>...<Connection
closed.>
for pool "datasource1" has been

k y
a Close the Find window. Close the editor.
d.
il Z
b 8. Use the admin console to enable JDBC debugging. This increases the number of
Na messages about JDBC sent to the server log.
a. Go back to the admin console on host01.
b. In the Change Center, click Lock & Edit.
c. Select server2. (In the Domain Structure, click Environment > Servers and then
select server2 in the table).
d. Click the Debug tab.
e. In the table, expand weblogic. Then, select the box next to jdbc. Click the Enable
button. Notice that jdbc is now “Enabled,” as well as all of its children.
f. In the Change Center, click Activate Changes. Notice that no restarts are necessary.

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

Practices for Lesson 8: Monitoring a Domain


Chapter 8 - Page 11
9. Run the Java database client again on host02.
a. In a Terminal window on host02, once again navigate to the practice directory and run
the script to call the Java database client. This time you can press Enter right away to
stop the client.
$ cd /practices/part1/practice08-02
$ ./runclient.sh 10
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

...
>>>Obtained initial context
>>>Data source named datasource1 retrieved
>>>Querying data source...
Contacts from database:
1 Homer Simpson 742...
...
e to
This client is still running...
c ens
When you are ready to stop it, press Enter.
le li
r a b
$ s f e
r a n
10. View the server2 log to see the debug messages.
o n -t
a n eฺ
a. In a Terminal window, navigate to the logs directory under the server2 directory and
edit the server log. s
) ha Guid
$ cd /u01/domains/part1/wlsadmin/servers/server2/logs
$ gedit server2.log
ฺ c om dent
b. In the editor, scroll all the
h o to thetbottom
oway u of the log file. Then use the search
y
capabilities of the gedita s
editor ito S debug
find messages placed in the log by the JDBC
@ t h
the end zofa
ky useSearch backwards.search
subsystem. Press Ctrl +
the file, select
F to use the editor’s capabilities. Because you are at
Type <debug> in the search field and
(
clickn a
the Find button.
Z a ky
Notes
bil − Notice that there are many messages of the “debug” severity level. They are from
Na various JDBC-related subsystems.
− The “info” level messages you found before from the JDBC subsystem, about
connections closing, are still there. In addition, there are quite a few debug
messages around each one of those.
− As you are editing this file, the editor may interrupt you with a message that the file
has “changed on disk” and ask if you want to reload the file. You can reload it if you
want to. Because many debug messages are being sent to the log, it is possible that
the file changes as you are viewing it.
c. See whether you can find debug messages that show connection testing. Scroll to the
bottom of the file, use the find, and search backwards for the word dual.
Note: The default Test Table Name setting for a data source connection pool using an
Oracle database is SQL SELECT 1 FROM DUAL.
d. Close the Find window. Close the editor.
e. Close the Terminal window.

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

Practices for Lesson 8: Monitoring a Domain


Chapter 8 - Page 12
11. Turn off debugging.
a. Return to the admin console.
b. In the Change Center, click Lock & Edit.
c. Select server2. (In the Domain Structure, click Environment > Servers and then
select server2 in the table).
d. Click the Debug tab.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e. In the table, expand weblogic. Then, select the box next to jdbc. Click the Disable
button.
f. In the Change Center, click Activate Changes. Notice that no restarts are necessary.
12. Monitor a data source by using the Monitoring Dashboard. You will run the database client
one more time.
a. Go to the home page of the admin console. (You can use the link.)
b. Under “Charts and Graphs,” click the Monitoring Dashboard link. The dashboard
e to
opens in a new window (or tab).
c ens
c. In the Monitoring Dashboard View List, expand server2. Select the view JDBC Data
Sources on server2. le li
r a b
d. Above the view list, press the Start button ( ).
sf e
e. r an
In a Terminal window on host02, navigate to the practice directory and run the script to
- t
continue to run. n on
call the Java database client. When the client is waiting, do not press Enter, let it

s a e ฺ
a i d
) h t Gu
$ cd /practices/part1/practice08-02
$ ./runclient.sh 10 m
co den
o ฺ u
aho is St
...
y
This client is still running...
@ e th
k y
When you are ready to stop it, press Enter.
f. za us
Return to the Monitoring Dashboard. You should notice changes in the “datasource1
a
y ( n
Capacity” chart (top left). Your chart may not look exactly like this one, but the “Number
Za k Available” should go to 0.
b i l
Na

g. In the “datasource1 Connections” chart, you should also notice that the “Active
Connections Current Count” goes up.
h. Above the View List, click the Stop button ( ).
i. Close the Monitoring Dashboard window (or tab). When asked whether you are sure,
click the Leave Page button.

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

Practices for Lesson 8: Monitoring a Domain


Chapter 8 - Page 13
j. Log out of the admin console.
k. Close the web browser.
l. In the Terminal window on host02 that is running the Java client, press Enter. Once the
client stops, close the Terminal window.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 8: Monitoring a Domain


Chapter 8 - Page 14
Solution 8-2: Monitoring WebLogic Server
There is no solution for this practice.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 8: Monitoring a Domain


Chapter 8 - Page 15
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 8: Monitoring a Domain


Chapter 8 - Page 16
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
s f e
r a n
Practices for
o n -tLesson 9: Node
Manager
s a n eฺ
ha
Chapter 9 Gu
) id
ฺ c om dent
a h oo Stu
@ y this
y e
n a zak us
y (
Za k
b i l
Na

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

Practices for Lesson 9: Node Manager


Chapter 9 - Page 1
Practices for Lesson 9: Overview
Practices Overview
In this practice, you configure Node Manager and start it on both machines. You then start
managed servers through it by using the administration console.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 9: Node Manager


Chapter 9 - Page 2
Practice 9-1: Configuring and Using Node Manager
Overview
In this practice, you configure the Java-based Node Manager on one of the machines. You start
that Node Manager. Once it is running, you use the administration console to start the managed
server that runs on that machine. Then you perform the same tasks on the other machine.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Assumptions
You completed “Practice 7-1: Configuring a JDBC Data Source.”
The administration server is currently running.

Tasks
1. Connect to host01.
2. Access the WebLogic Server administration console on host01.
e to
3. Stop the managed servers that are running.
c ens
a. In the Domain Structure, expand Environment and then select Servers.
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
b. o
On the right, click the Controlฺ co den
tab.
u
y aho is St
k y @ e th
a z a us
y (n
k Select the check box next to any managed servers that are running. Click the
i l Zc.a
b Shutdown button and select Force Shutdown Now. When asked to confirm, click
Na Yes.

d. Wait a moment and refresh the screen. Ensure that the State column in the table
confirms that all managed servers are shut down.

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

Practices for Lesson 9: Node Manager


Chapter 9 - Page 3
4. Update the configuration of the machines.
a. In the Change Center, click Lock & Edit.
b. In the Domain Structure, under Environment, select Machines.
c. Select machine1.
d. Click the Configuration tab and the Node Manager subtab.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e. Use the drop-down list to change the Type to Plain.


f. Ensure that Listen Address is host01.example.com and the Listen Port is 5556.
g. Click Save.
h. Click the Configuration > Servers tab. Ensure that server1 is assigned to machine1.
i. Return to the Machines table and select machine2.
j. Once again, click the Configuration tab and the Node Manager subtab. Use the drop-
down list to change the Type to Plain. Ensure the Listen Address is
host02.example.com and the Listen Port is 5556.
e to
k. Click Save again.
c ens
l. Click the Configuration > Servers tab. Ensure that server2 is assigned to machine2.
le li
m. In Change Center, click Activate Changes. r a b
sf e
- t an
Note: You will note that one restart is required. Because the admin server is assigned to
r
machine1, it must be restarted for the machine’s configuration changes to take effect.
5. n on
Stop and restart the administration server running on host01.
s a e ฺ
a d
a. Find the Terminal window in which server1 was running and close it.
i
) h t Gu
Note: Even if you do not have the Terminal window titles set, you can tell in which window
m
ฺ co den
server1 was running, because you stopped server1. You can see “shut down” messages,
o u
aho is St
and the window shows the prompt again. Close the server1 window.
y
b. Find the Terminal window in which the admin server is running.
@ e th
k y
a za us
c. Press Ctrl + C in the admin server window.

y ( n
Note: This is not as bad as it seems. It has the same effect as Force Shutdown Now.
k
d. Use the up arrow to bring back the command issued to start the admin server, and
Za
b i l start it again.
Na $ ./startWebLogic.sh
6. View the files needed by Node Manager on host01. Update one of them.
a. Open a new Terminal window on host01. Navigate to the domain’s Node Manager
directory. List the files there.
$ cd /u01/domains/part1/wlsadmin/nodemanager
$ ls
nodemanager.domains nodemanager.properties
b. List the contents of the nodemanager.domains file. Notice that the only entry is the
name of your domain and its location. This Node Manager is for the wlsadmin
domain.
$ cat nodemanager.domains
...
wlsadmin=/u01/domains/part1/wlsadmin
Note: The comments at the top of the file are not shown here.

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

Practices for Lesson 9: Node Manager


Chapter 9 - Page 4
c. Edit the nodemanager.properties file.
$ gedit nodemanager.properties
d. Examine the following properties and their values:
− ListenAddress=host01.example.com
− ListenPort=5556
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

− StartScriptEnabled=true
− StartScriptName=startWebLogic.sh
Notes
− This Node Manager runs at the listen address and listen port listed.
− Using a start script to start servers is recommended, and it is the default.
− Notice that the start script listed is startWebLogic.sh. Even though the script
startManagedWeblogic.sh is the one you used to start managed servers, it is
e to
there as a convenience. It calls startWebLogic.sh, which does the real work of
starting a server. c ens
e. Find the property SecureListener and change its value to false. le li
r a b
SecureListener=false
sf e
f. Save the file and close the editor.
- t r an
g. Leave the Terminal window open.
n on
7. Start the Node Manager on host01. s a e ฺ
a i d
) h t Gu
a. Run the Node Manager start script in the bin directory of the domain:
m
ฺ co den
$ cd /u01/domains/part1/wlsadmin/bin
o u
aho is St
$ ./startNodeManager.sh
... y
@ e th
k y
za us
... <INFO> Plain socket listener started on port 5556, host
a
y ( n
host01.example.com>

Za k
b. Do not close this window. This is where the Node Manager is running. Minimize the
window, if you want. You may want to change the title of the Terminal window to Node
b i l
Na 8.
Manager.
Start server1 through Node Manager by using the administration console.
a. In the Domain Structure, expand Environment, then select Servers. Click the Control
tab. Select the check box next to server1 and click the Start button. When asked
whether you are sure, click Yes.
b. Wait a moment, and refresh the browser. Wait until server1’s State is RUNNING.
9. View the files needed by Node Manager on host02. Update one of them. Then start Node
Manager on host02.
a. Connect to host02.
b. Find the Terminal window in which server2 was running and close it.
c. Open a new Terminal window. Navigate to the domain’s Node Manager directory. Edit
the nodemanager.properties file.
$ cd /u01/domains/part1/wlsadmin/nodemanager
$ gedit nodemanager.properties
d. Find the property SecureListener and change its value to false.
SecureListener=false
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Node Manager


Chapter 9 - Page 5
e. Save the file and close the editor.
f. Run the Node Manager start script in the bin directory of the domain:
$ cd /u01/domains/part1/wlsadmin/bin
$ ./startNodeManager.sh
...
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

...<INFO> <Plain socket listener started on port 5556, host


host02.example.com>
g. Do not close this window. This is where the Node Manager is running. Minimize the
window, if you want. You may want to change the title of the Terminal window to Node
Manager.

10. Start server2 through Node Manager by using the administration console.
a. Open the web browser running the administration console.
e to
b. In the Domain Structure, expand Environment, then select Servers. Click the Control
c ens
tab. Select the check box next to server2 and click the Start button. When asked
whether you are sure, click Yes. le li
r a b
c. Wait a moment, and refresh the browser. Wait until server2’s State is RUNNING.
sf e
d. Log out of the admin console and close the web browser.
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 9: Node Manager


Chapter 9 - Page 6
Solution 9-1: Configuring and Using Node Manager
Perform the following tasks if you did not complete this practice and want to use the finished
solution.

Assumptions
You completed “Practice 7-1: Configuring a JDBC Data Source.”
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

The administration server is currently running.

Solution Tasks
1. Connect to host01.
2. Run the solution script for host01.
a. Open a Terminal window and navigate to the practice directory.
$ cd /practices/part1/practice09-01
e to
b. Run the host01 solution script.
c ens
$ ./solution-host01.sh
le li
Note: This script copies the correct nodemanager.properties file to the domain’s
r a b
nodemanager directory. It then starts the WebLogic Scripting Tool (WLST) passing it the
sf e
- t r an
WLST script update_machines.py, which updates the two machines for you.
c. Close the Terminal window.
n on
3. a
Stop the admin server and the managed server on host01.
s e ฺ
a i d
) h t Gu
Note: You want to stop the admin server so that Node Manager is running when it comes
m
o ฺ co den
up again. You want to stop the managed server because from this point forward you will
start it through Node Manager by using the admin console.
u
aho is St
a. Find the Terminal window in which the admin server is running. Press Ctrl + C.
y
y @ e th
b. Minimize this Terminal window. You will use it later.
k
za us
c. Find the Terminal window in which server1 is running. Press Ctrl + C.
a
y ( n
d. Close this Terminal window.
4. Za k
Start the Node Manager on host01.
b i l
Na a. Open a new Terminal window.
b. Navigate to the bin directory of the domain and run the Node Manager start script:
$ cd /u01/domains/part1/wlsadmin/bin
$ ./startNodeManager.sh
...
... <INFO> Plain socket listener started on port 5556, host
host01.example.com>
c. Do not close this window. This is where the Node Manager is running.
d. If you want to, set the title of the window to “Node Manager” by using the window’s
Terminal > Set Title option.
e. Minimize this Terminal window.
5. Restart the administration server.
a. Find the Terminal window in which the admin server was running.
b. Press the up arrow to bring up the last command (startWebLogic.sh). Press Enter
to run it again.
$ ./startWebLogic.sh
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Node Manager


Chapter 9 - Page 7
c. If you do not have a boot identity file, when you are prompted, enter the username and
password ( Use the WebLogic Server credentials from the credentials section). Wait for
the server to indicate it is in RUNNING mode.
d. Minimize this Terminal window.
6. Connect to host02.
7. Stop the managed server on host02.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Note: You want to stop the managed server because from this point forward you will start it
through Node Manager by using the admin console.
a. Find the Terminal window in which server2 is running. Press Ctrl + C.
b. Close this Terminal window.
8. Run the solution script for host02.
a. Open a new Terminal window and navigate to the practice directory.
$ cd /practices/part1/practice09-01
e to
b. Run the host02 solution script.
c ens
$ ./solution-host02.sh
le li
Note: This script copies the correct nodemanager.properties file to the domain’s
r a b
nodemanager directory.
sf e
c. Close the Terminal window.
- t r an
9. Start the Node Manager on host02.
n on
s a e ฺ
a. Open a new Terminal window and navigate to the bin directory of the domain. Run the
a i d
Node Manager start script:
m ) h t Gu
o ฺ co den
$ cd /u01/domains/part1/wlsadmin/bin
u
aho is St
$ ./startNodeManager.sh
... y
@ e th
k y
za us
... <INFO> Plain socket listener started on port 5556, host

( n a
host02.example.com>
y
b. Do not close this window. This is where the Node Manager is running. If you want to,
k
i l Za set the title of the window to “Node Manager” by using the window’s Terminal > Set
b Title option.
Na c. Minimize this Terminal window.
10. Restart the managed servers through Node Manager by using the admin console.
a. In the Domain Structure, expand Environment and then select Servers. Click the
Control tab. Select the check boxes next to server1 and server2. Click the Start
button. When asked whether you are sure, click Yes.
b. Wait a little while, and refresh the browser. Ensure that the state of both managed
servers is RUNNING.
c. Close the web browser.

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

Practices for Lesson 9: Node Manager


Chapter 9 - Page 8
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
s f e
r a n
Practices for
o n -tLesson 10:
s a n Applications
Deploying
e ฺ
a
h 10Gu i d
m )Chapter
ฺ c o dent
a h oo Stu
@ y this
y e
n a zak us
y (
Za k
b i l
Na

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

Practices for Lesson 10: Deploying Applications


Chapter 10 - Page 1
Practices for Lesson 10: Overview
Practices Overview
In these practices, you deploy, redeploy, and undeploy an application. You also load test an
application by using The Grinder.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 10: Deploying Applications


Chapter 10 - Page 2
Practice 10-1: Deploying an Application
Overview
In this practice, you deploy, redeploy, and undeploy an application by using the administration
console.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Assumptions
You completed “Practice 9-1: Configuring and Using Node Manager.”
All servers are currently running.

Tasks
1. Create a new directory from which to deploy applications. Copy the application from the
practice directory to this new directory.
a. Connect to host01.
e to
b. Open a new Terminal window and navigate to the domain directory. Create a new
c ens
subdirectory called apps from which you will deploy applications.
le li
$ cd /u01/domains/part1/wlsadmin r a b
s f e
$ mkdir apps
r a n
o n -tthis directory.
c. Copy the application from the current practice directory to
$ cd apps
s a n eฺ
a
$ cp /practices/part1/practice10-01/benefits.war
h u i d .
d. Leave the Terminal window open. m) tG
c o e n
3. Deploy the application. ah
ooฺ Stud
2. Open the WebLogic Server administration console.

@
a. In the ChangeyCenter,
is & Edit.
y clickthLock
z a k use
( n a
Z a ky
l
N abi

b. In the Domain Structure, select Deployments.

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

Practices for Lesson 10: Deploying Applications


Chapter 10 - Page 3
c. Above the Deployments table, click the Install button.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

d. Use the links next to and below Current Location to navigate to:
host01.example.com/u01/domains/part1/wlsadmin/apps

e to
Note: This fills in the Path field as you click links.
c ens
e. When the path is correct, select the option button next to benefits.war. le li
r a b
s f e
r a n
o n -t
f. Click the Next button.
s a n eฺ
ha Guand
g. Select Install this deployment as an application
) id click Next.
ฺ c om Ensure
h. Select the check box next to cluster1.
d e nt that the All servers in the cluster
a h oo Stu
option button is selected. Click Next.

@ y this
z a ky use
( n a
Z a ky
bil
Na

i. Leave all the Optional Settings at their default values. Click Next.

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

Practices for Lesson 10: Deploying Applications


Chapter 10 - Page 4
j. Select No, I will review the configuration later. Click Finish.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

k. In the Change Center, click Activate Changes.


Note: Notice the message that the changes have been activated and no restarts are
necessary.
4. Start the application.
e to
a. Ensure that the Control tab has been selected.
c ens
b. In the Deployments table, select the check box next to the benefits application.
le li
c. Click the Start button and select Servicing all requests. r a b
d. When asked to confirm, click Yes. sf e
- t r an
Note: Notice that the State of the benefits application is now “Active.”
5. Test the application. n on
s a e ฺ
a i d
a. In the Deployments table, click the link that is the name of the newly deployed
application, benefits.
m ) h t Gu
b. Click the Testing tab.
o ฺ co den
u
aho is St
c. Click any of the test links.
y
k y @ e th
d. The benefits application opens in a new window or tab.
za us
e. Try the application by selecting things and clicking buttons or links.
a
y ( n
Za k
b i l
Na

f. When you are finished trying the application, close the Benefits window or tab.
6. Obtain an updated version of the application.
a. Open a Terminal window on host01 and navigate to the current practice directory. List
the contents of the directory. Then list the contents of the update subdirectory.
$ cd /practices/part1/practice10-01
$ ls
... benefits.war ... update
$ ls update
benefits.war

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

Practices for Lesson 10: Deploying Applications


Chapter 10 - Page 5
Note: The update directory has an updated version of the benefits application.
b. Navigate to the apps directory. Rename the current benefits archive. Copy the
updated version to its location.
$ cd /u01/domains/part1/wlsadmin/apps
$ mv benefits.war benefits.old
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

$ cp /practices/part1/practice10-01/update/benefits.war .
c. Close the Terminal window.
7. Redeploy the application.
a. Return to the administration console.
b. In the Change Center, click Lock & Edit.
c. In the Domain Structure, select Deployments.
d. Select the check box next to the benefits application.
e. Click the Update button.
e to
f. Leave the “Source path” as it is. There is no deployment plan, so the empty
c ens
“Deployment plan path” is correct. Click Next.
le li
g. On the next page, click Finish. r a b
h. In the Change Center, click Activate Changes. sf e
- t r an
Note: Notice the message that the changes have been activated and no restarts are
n on
necessary. Also notice that the State of the benefits application is “Active,” even though you
did not explicitly start it. s a e ฺ
a i d
) h t Gu
i. Follow the earlier steps to test the application again. When you have finished, close the
m
Benefits window or tab.
o ฺ co den
u
aho is St
8. Stop the application, so you can undeploy it.
y
a. Return to the administration console.
@ e th
k y
b. In the Domain Structure, select Deployments.
a za us
c. Select the Control tab.
y ( n
k
d. Select the check box next to the benefits application.
Za
b i l e. Click the Stop button and select Force Stop Now.
Na f. When asked to confirm, click Yes.
Note: Notice the State of the benefits application is no longer “Active.”
9. Undeploy the application.
a. In the Change Center, click Lock & Edit.
Note: If it is already locked, skip this step.
b. In the Domain Structure, select Deployments.
c. Select the check box next to the benefits application.
d. Click the Delete button.
e. When asked to confirm, click Yes.
f. In the Change Center, click Activate Changes.
Note: Notice the message that the changes have been activated and no restarts are
necessary. Also notice that the benefits application is no longer in the Deployments table.

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

Practices for Lesson 10: Deploying Applications


Chapter 10 - Page 6
Solution 10-1: Deploying an Application
Perform the following tasks if you did not complete this practice and want to use the finished
solution. Note that this solution leaves the application deployed, so you can use the application
if you want to. To have your domain in the same state as if you did this practice, do nothing.
(The final task of the practice is to undeploy the new application.)
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Assumptions
You completed “Practice 9-1: Configuring and Using Node Manager.”
All servers are currently running.

Solution Tasks
1. Connect to host01.
2. Run the solution script.
a. Open a Terminal window and navigate to the practice directory. e to
$ cd /practices/part1/practice10-01
c ens
b. Run the solution script. le li
r a b
$ ./solution.sh
s f e
Notes
r a n
− This script creates the apps directory under the domain
o n -t directory. It copies the
a n ฺ It then copies the
original benefits.war file there, calling it benefits.old.
updated benefits.war into the appsa
h s
u i dethe practice’s update
directory from
subdirectory. The script then starts
m )the WebLogic
t G Scripting Tool (WLST) passing it
o
ฺc uwhich
the WLST script deploy_app.py, n
de deploys the benefits application, targets it
o o t
y ah
to cluster1, and starts it.
is S in a different thread, ignore it
− If you get a warning
@ t
abouth closing
a ky use was called in a different thread...). It is a
(WLContext.close()
z
( n a issue with WLST deployment and does no harm.
known
kc. yDo not close the Terminal window.
bli Zd.a If you want to access the newly deployed application, enter the following URL in the
Na web browser:
http://host01.example.com:7011/benefits
e. Close the web browser when you are finished.

3. If you want to undeploy the application after you have looked at it, as the practice does, run
the undeploy.sh script.
a. In the same terminal window, run the undeploy script.
$ ./undeploy.sh
Note: The script starts the WebLogic Scripting Tool (WLST) passing it the WLST script
undeploy_app.py, which undeploys the benefits application.
b. Close the Terminal window.

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

Practices for Lesson 10: Deploying Applications


Chapter 10 - Page 7
Practice 10-2: Load Testing an Application
Overview
In this practice, you use The Grinder to load test an application running on WebLogic Server.
You then view the results in The Grinder console.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Assumptions
You completed “Practice 9-1: Configuring and Using Node Manager.”
“Practice 10-1: Deploying an Application” is not necessary for this practice.
All servers are currently running.

Tasks
1. Connect to host01. Run a script to deploy the application from which The Grinder script was
created.
e to
a. Open a Terminal window and navigate to the practice directory. Then, run the
c ens
deploy.sh script.
le li
$ cd /practices/part1/practice10-02 r a b
sf e
an
$ ./deploy.sh
- t r
on
...

a n
>>>Deploying application contacts. Please wait.

... a s i d e
m
>>>Application contacts deployed.) h t Gu
...
o ฺ co den
u
$
y aho is St
k y @ e th
2. Connect to host02. Run the database setup script. It initializes (or reinitializes) the database
za us
to create a table and put some data in it that the application requires.
a
( n
Note: Notice that this is host02, not host01.
y
Za k
a. Open a Terminal window and navigate to the practice directory. Set some environment
b i l variables. Then run the setup.sh script.
Na Notes
• The ORACLE_HOME variable points to where the database is installed. ORACLE_SID
(Oracle System ID) is the unique name of this particular database.
$ cd /practices/part1/practice10-02
$ export ORACLE_HOME=/u01/app/db11g/product/11.2.0/dbhome_1
$ export ORACLE_SID=orcl
$ ./setup.sh

SQL*Plus: Release 11.2...


...
1 row created.

Commit complete.
...

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

Practices for Lesson 10: Deploying Applications


Chapter 10 - Page 8
• The SQL script drops the table (and sequence) it creates, so you can run it multiple
times. Therefore, the first time the script is run, it produces messages that no such
table or sequence exist. Ignore those messages if you see them.
3. Access the newly deployed application from the web browser. You will use the application
in the same way that it was used to create the grinder.py script. This script was
recorded for you by using The Grinder TCPProxy utility and using the contacts application
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

in a web browser.
Note: To record the script, the web browser first had to be configured. It was set to
communicate with the TCPProxy utility by setting a manual proxy configuration. The HTTP
Proxy field was set to localhost, and the Port field set to 8001. (That is the port on which
the TCPProxy utility runs.)
a. In the web browser, enter the URL for the application:
http://host01.example.com:7011/contacts
Note: This is the first request in The Grinder script (which will display in The Grinder
e to
console as “Page 1”).
c ens
b. On the home page, click the browse all contacts link.
le li
Note: This is the second request in the script (which will display in The Grinder console as
r a b
“Page 2”).
sf e
c. Click the [edit] link in the first row.
- t r an
on
Note: This is the third request in the script (which will display in The Grinder console as
n
“Page 3”).
s a e ฺ
a i d
d. View the data on the edit screen.
m ) h t Gu
“Page 4”). o ฺ co den
Note: This is the fourth request in the script (which will display in The Grinder console as
u
4. aho is St
Install The Grinder on host02.
y
y @ e th
a. Open a Terminal window on host02 and navigate to /install/grinder. Then, list
k
za us
the contents of the directory.
a
y ( n
$ cd /install/grinder
Za k
$ ls
b i l
Na
grinder-3.11-binary.zip
b. Unzip the zip file to /home/oracle.
$ unzip grinder-3.11-binary.zip –d /home/oracle
Archive: grinder-3.11-binary.zip
creating: /home/oracle/grinder-3.11/
inflating: /home/oracle/grinder-3.11/CHANGES
...
c. Leave the Terminal window open for later.
5. Install The Grinder on host01.
a. Open a Terminal window on host01 and navigate to /install/grinder.
$ cd /install/grinder
b. Unzip the zip file to /home/oracle.
$ unzip grinder-3.11-binary.zip –d /home/oracle
Archive: grinder-3.11-binary.zip
creating: /home/oracle/grinder-3.11/

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

Practices for Lesson 10: Deploying Applications


Chapter 10 - Page 9
inflating: /home/oracle/grinder-3.11/CHANGES
...
6. Examine the grinder.properties file and start The Grinder console.
a. In the Terminal window on host02, navigate to the practice directory.
$ cd /practices/part1/practice10-02
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

b. View the grinder.properties file in the editor.


$ gedit grinder.properties
c. Scroll down past the comments and notice the following attributes and their values:
− grinder.script = grinder.py
− grinder.processes = 2
− grinder.threads = 200
− grinder.runs = 0
e to
Note: What this means is that the agent starts two worker processes with 200 threads
c ens
each. It runs the script called grinder.py. It continues running until the console tells it to
stop. le li
r a b
d. Exit the editor without making any changes.
sf e
e. View the setgrinderenv.sh script.
- t r an
$ cat setgrinderenv.sh
n on
GRINDERPATH=/home/oracle/grinder-3.11
s a e ฺ
a i d
) h t Gu
GRINDERPROPS=/practices/part1/practice10-02/grinder.properties
m
o ฺ co den
CLASSPATH=$GRINDERPATH/lib/grinder.jar:$CLASSPATH
u
aho is St
JAVA_HOME=/u01/app/jdk
y
@ e th
PATH=$JAVA_HOME/bin:$PATH
k y
za us
export CLASSPATH PATH GRINDERPROPS
n a
Note: Notice this script sets various environment variables that The Grinder needs: where
(
y
The Grinder is, the location of its properties file, the CLASSPATH, and the PATH.
ak View the startconsole.sh script.
l Z
bi f.
Na $ cat startconsole.sh
source setgrinderenv.sh
java –classpath $CLASSPATH net.grinder.Console
Note: Notice this script calls the one that sets environment variables, and then it starts the
JVM with the net.grinder.Console class.
g. Start The Grinder console.
$ ./startconsole.sh
h. Leave the console open.
Note: Now that the console is running, when an agent is started, it waits for signals from
the console.
7. Start a Grinder agent on host01.
a. In the Terminal window on host01, navigate to the practice directory.
$ cd /practices/part1/practice10-02
b. Run the startagent.sh script to start a Grinder agent.
$ ./startagent.sh

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

Practices for Lesson 10: Deploying Applications


Chapter 10 - Page 10
... INFO agent: The Grinder 3.11
... INFO agent: connected to console at host02.example.com/...
... INFO agent: waiting for console signal
Note: The agent is running in this window and waiting for communication from the console.
c. Leave the Terminal window open.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

8. From The Grinder console on host02, signal the agent (worker processes) to start working.
Then view the data that comes back. After a while, stop collecting data and reset the agent
(worker processes).
a. Access The Grinder console on host02.
b. Click the button to “Start the worker processes” (the first button on the left).

e to
c ens
c. When the dialog box warns that you have not selected a properties file, click OK. le li
r a b
d. Click the Graphs tab. Watch the graphs go by for a while.
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na e. Click the Results tab. Watch the numbers update for a while.

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

Practices for Lesson 10: Deploying Applications


Chapter 10 - Page 11
f. Click the “Stop collecting statistics” button.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

g. Look at the numbers in the console on the Results tab. The “Mean Time” is the
number of milliseconds a request takes. Although the script has “think time” in it for
each web page accessed (like a real user would have), that is not included in the Mean
Time, which is just the time the HTTP request takes.
Note: Remember, this time is in milliseconds. You probably will see much lower than sub-
second response time for all the “pages.”
h. Next, click the “Reset the worker processes” button. When asked whether you also
want to reset the console, click No. (You did not reset the console in case you want to
continue to look at the numbers.) e to
c ens
le li
r a b
s f e
r a n
o n -t
i. When you have finished investigating the numbers,
a nclose ฺThe Grinder console.
Note: If you are interested, the raw data has been
h a s defiles in a newly created log
savediin
u
directory in the practices directory.
m ) tG
c o e n
h oฺ window.
j. Close the host02 Terminal window.
oagent t u d
istheSagent was running has various messages in it. You
9. Return to host01 and viewathe
a. The Terminal window@ y in which
t h
a
should notice
z kythat theusagent
e is no longer running. It stopped when it could no longer
n a with the console, which you closed.
communicate
(
Z a ky...
bil ... INFO agent: finished
Na $
b. Close the Terminal window.

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

Practices for Lesson 10: Deploying Applications


Chapter 10 - Page 12
Solution 10-2: Load Testing an Application
Perform the following tasks if you did not complete this practice and want to use the finished
solution. Note that this solution does not install The Grinder or run its load test. The solution just
deploys the application that was used in the load test.

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

You completed “Practice 9-1: Configuring and Using Node Manager.”


“Practice 10-1: Deploying an Application” is not necessary for this solution.
All servers are currently running.

Solution Tasks
1. Connect to host02 and run the practice setup script which initializes (or reinitializes) the
database to create a table and put some data in it that the application requires.
Note: Notice that this is host02, not host01. e to
a. Open a Terminal window and navigate to the practice directory. Set up some
c ens
environment variables, and then run the script.
le li
$ export ORACLE_HOME=/u01/app/db11g/product/11.2.0/dbhome_1 r a b
s f e
$ export ORACLE_SID=orcl
r a n
$ cd /practices/part1/practice10-02
o n -t
$ ./setup.sh
a n ฺ
Note: The SQL script drops the table (and sequence)
h a s i de so you can run it multiple
it creates,
u
times. Therefore, the first time the script is)run, it produces
G messages that no such table or
o m n t
sequence exist. Ignore those messages
o o ฺc ude if you see them.
b. Close the Terminal window.
y a h s St
2. Connect to host01 and
y @ e t hi to deploy the application from which The Grinder script
run the script
was created.
a z ak us
a. Open
( n a new Terminal window, navigate to the practice directory, and run the deploy

Z a ky
script.

b i l $ cd /practices/part1/practice10-02
N a $ ./deploy.sh
Note: If you get a warning from WLST about closing in a different thread, ignore it
(WLContext.close() was called in a different thread…). It is a known issue
with WLST deployment and does no harm.
b. Close the terminal window.

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

Practices for Lesson 10: Deploying Applications


Chapter 10 - Page 13
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 10: Deploying Applications


Chapter 10 - Page 14
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
s f e
r a n
Practices for
o n -tLesson 11:
Network
s a nChannels
e ฺ and Virtual
ha Gui
Hosts d
)
ฺ c om Chapter
d e nt11
a h oo Stu
@ y this
y e
n a zak us
y (
Za k
b i l
Na

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

Practices for Lesson 11: Network Channels and Virtual Hosts


Chapter 11 - Page 1
Practices for Lesson 11: Overview
Practices Overview
In these practices, you configure network channels, a domain-wide admin port, and a virtual
host.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 11: Network Channels and Virtual Hosts


Chapter 11 - Page 2
Practice 11-1: Configuring a Network Channel
Overview
By default, WebLogic Server uses a single network listening port for non-SSL traffic. The
combination of the IP addresses and the regular listening port is referred to as the default
channel. WebLogic Server receives requests on this channel and performs protocol
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

discrimination to determine which protocol the request is using.


WebLogic Server also allows you to separate network traffic for greater control. This is useful
when you want to separate traffic for high priority applications on faster networking hardware or
to separate internal server communication from user communication.

Assumptions
You completed “Practice 10-1: Deploying an Application.”
All servers are currently running.
e to
Tasks c ens
le li
1. Open the WebLogic Server administration console.
r a b
2. Deploy the benefits application again.
sf e
r an
Note: The application was undeployed in a previous practice. You can either deploy it again
- t
on
by using the admin console, or run the solution to the practice titled “Deploying an
n
s a
Application.” To deploy the application by using the admin console, perform the following
e ฺ
tasks: a i d
m ) h t Gu
a. In the Change Center, click Lock & Edit.
o ฺ co den
b. In the Domain Structure, select Deployments.
u
aho is St
c. Above the Deployments table, click the Install button.
y
y @ e th
d. Use the links next to and below Current Location to navigate to:
k
a za us
host01.example.com/u01/domains/part1/wlsadmin/apps
e. y ( n
When the path is correct, select the option button next to benefits.war.
Za
f.
k
Click the Next button.
b i l
Na g.
h.
Select Install this deployment as an application and click Next.
Select the check box next to cluster1. Ensure that the All servers in the cluster
option button is selected. Click Next.
i. Leave all the Optional Setting at their default values. Click Next.
j. Select No, I will review the configuration later. Click Finish.
k. In the Change Center, click Activate Changes.
l. In the Deployments table, select the check box next to the benefits application.
m. Click the Start button and select Servicing all requests.
n. When asked to confirm, click Yes.
Note: Do not close the web browser.
3. Test the benefits application.
a. Access the application to ensure that it is working as expected. Open a new tab or
window in the web browser and enter a URL to bring up the application:
http://host01.example.com:7011/benefits
Note: Or: http://host02.example.com:7011/benefits

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

Practices for Lesson 11: Network Channels and Virtual Hosts


Chapter 11 - Page 3
b. Try the application to see if it is working.
4. Configure a custom network channel by using the admin console.
a. Back in the admin console, in the Domain Structure, select Environment > Servers.
b. In the Server table, select server1.
c. Select the Protocols > Channels tabs.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

d. In the Change Center, click Lock & Edit.


e. Click the New button.
f. Enter or select the following values for these fields, then click Next.
Field Value
Name httpchannel-1
Protocol http
g. Enter or select the following values for these fields, then click Next.
e to
Field Value c ens
le li
Listen Address host01.example.com
r a b
Listen Port 4000 s f e
r a n
External Listen Address (blank)
o n -t
External Listen Port (blank)
s a n eฺ
ha so
Note: You are not working with external addresses
) u id should be blank.
those
h. When the next page is displayed,oleave
c t G (Enabled and HTTP Enabled for
m theendefaults
o
This Protocol are selected). ฺ Next.
oClick u d
h t
i. When the next pageyis
@
adisplayed,
t h i s Sleave the defaults (Two Way SSL Enabled and
a k y Enforced
Client Certificate
s e both are deselected). Click Finish.
u
azyour changes and verify that the channel is created.
j. Activate
y ( n
l Zak
bi
Na 5. Follow the same procedure to create a network channel for server2. Everything will be the
same except the channel will have the Name of httpchannel-2, and the Listen Address
of host02.example.com.
Note: Don’t forget to activate your changes.
6. Test the application by using one of the new network channels.
a. In a new web browser window or tab, test the application again. This time use the port
number of 4000 instead of 7011 in the URL. The application should work on the new
custom network channel.
http://host01.example.com:4000/benefits
Note: Or: http://host02.example.com:4000/benefits.
b. Try the application to see if it works through a new network channel.

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

Practices for Lesson 11: Network Channels and Virtual Hosts


Chapter 11 - Page 4
Solution 11-1: Configuring a Network Channel
Perform the following tasks if you did not complete this practice and want to use the finished
solution.

Assumptions
You completed “Practice 10-1: Deploying an Application.”
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

All servers are currently running.

Solution Tasks
1. Connect to host01.
2. Run the solution script.
a. Open a Terminal window and navigate to the practice directory.
$ cd /practices/part1/practice11-01
e to
b. Run the solution script.
c ens
$ ./solution.sh
le li
Note: This script calls two WLST scripts. The first creates a network channel on server1
r a b
and another on server2. The second deploys the benefits application to the cluster to which
sf e
these servers belong.
- t r an
c. Close the Terminal window.
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 11: Network Channels and Virtual Hosts


Chapter 11 - Page 5
Practice 11-2: Configuring the Administration Port
Overview
WebLogic Server allows you to create a separate administration channel (called the admin port)
that is dedicated to serving only administrative requests. The admin port allows you to start
servers in STANDBY mode, which allows administrators to work with them while not allowing
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

user requests. You can also start applications in Admin mode so you can test them prior to
giving users access to them. You should note that enabling the admin port of the domain also
requires enabling SSL for all servers in the domain.

Assumptions
No other practices are prerequisites for this practice. This practice uses a completely different
domain, so you do not have to access the admin console through a secure port in later
practices.
e to
Tasks
c ens
1. Connect to host01. le li
2. Run the setup script. r a b
s f e
a. Open a Terminal window and navigate to the practice directory.
r a n
$ cd /practices/part1/practice11-02
o n -t
b. Run the setup script. a n ฺ
$ ./setup.sh
h a s
u i de
Note: This script creates a new domainm
) t G It has an admin server named
called wlsadmin2.
c o e n
server1a (port 8011 on a h ooฺ Stud
AdminServer (port 8001 on host01.example.com)
host01.example.com)
and a managed server called
and server2a (port 8011 on
@ is
y Thesethmanaged servers are in a cluster called cluster1a.
k y
host02.example.com).
s e
3. Start the admin
n a zaserver ofuthe new domain.
a. In a
y ( terminal window, navigate to the new domain directory and run the script to start
Z k
a admin server of the domain.
the
l
N abi $ cd /u01/domains/part1/wlsadmin2
$ ./startWebLogic.sh
Note: When prompted for the username and password, enter the WebLogic Server
credentials.
b. Wait for the server to show it is in RUNNING mode.
c. To remember that this is the window in which the admin server of the new domain is
running, you might want to change the title of the Terminal window. In the window’s
menu, select Terminal, and then Set Title. Enter the title of AdminServer-domain2
and click OK. Minimize the window.
4. Open the WebLogic Server administration console of the new domain.
a. In the web browser, enter the URL to the administration console:
http://host01.example.com:8001/console
Note: Notice that the port is 8001.
5. Enable the domain-wide administration port.
a. In the Change Center, click Lock & Edit.
b. In the Domain Structure, click the domain name, wlsadmin2.

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

Practices for Lesson 11: Network Channels and Virtual Hosts


Chapter 11 - Page 6
c. Ensure that the Configuration > General tabs are selected.
d. Enter or select the following values and then click the Save button:
Field Value
Enable Administration Port Selected
Administration Port 9002
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e. In the Change Center, click Activate Changes.


Note: Notice that now you have been forced out of the admin console. That is because
once the domain-wide admin port is enabled, you must use SSL and the admin port to
access the admin console.
f. Close the web browser.
6. Access the WebLogic Server administration console of the new domain using SSL and the
admin port.
e to
a. Open a new web browser, enter the URL to access the administration console via the
admin port: c ens
https://host01.example.com:9002/console le li
r a b
Note: Notice the use of https and the admin port of 9002.
sf e
- t r an
b. When you get the warning about the “connection is untrusted,” click the link: I
Understand the Risks.
n on
s a
Note: Because you are using the demo certificates, the host name inside of them do not
e ฺ
match the host on which they are used. a i d
c. Click the Add Exception button. m ) h t Gu
o ฺ co den
d. In the “Add Security Exception” pop-up window, click Get Certificate.
u
aho is St
e. Ensure Permanently store this exception is selected and click Confirm Security
y
Exception.
k y @ e th
za us
f. On the console welcome page, enter the WebLogic Server credentials, then click
a
(
Login.
y n
7.
Za k
Override the admin port number of the managed server on the same machine as the admin
b i l server.
Na a. In the Change Center, click Lock & Edit.
b. In the Domain Structure, select Environment > Servers.
c. In the Server table, select server1a.
d. Ensure that the Configuration > General tabs are selected.
e. Scroll down and click the Advanced link.
f. For Local Administration Port Override enter 9003.
Note: Because the admin server and server1a are on the same machine, they cannot
both use the port number of 9002 for their admin port.
g. Click Save.
h. In the Change Center, click Activate Changes.
8. Start the managed server, server1a.
a. Open a new Terminal window on host01.
b. Navigate to the bin directory under the new domain directory, and run the script to
start the managed server called server1a:

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

Practices for Lesson 11: Network Channels and Virtual Hosts


Chapter 11 - Page 7
Note: Enter all commands on one line. Some are on multiple lines here due to space
limitations.
$ cd /u01/domains/part1/wlsadmin2/bin
$ ./startManagedWebLogic.sh server1a
https://host01.example.com:9002
Notes
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

− When prompted for the username and password, the WebLogic Server credentials.
− Notice that this script takes two parameters: the name of the managed server and
the URL of the domain’s administration server.
− Notice that the URL of the admin server is https and uses the admin port of 9002.
Now that there is an admin port, the managed servers must use it to communicate
with the admin server.
− Change the title of the Terminal window. In the window’s menu, select Terminal,
and then Set Title. Enter the title of server1a and click OK. Minimize the window. e to
c ens
e li
− Because this domain is only used temporarily, rather than set up Node Manager,
you start servers by running start scripts.
b l
9. Deploy an application to the managed servers in the new domain.
s f era
Note: Although there are two managed servers in the domain and
t r a nthe deployment is
targeted to the cluster (and therefore both of the managed n -
servers), you will never start the
server on host02. That is because you would first haven toomove the new domain over to
that host. s a e ฺ
a i d
) h tforGapplications
a. In a new Terminal window, create a directory
m
u in the new domain, and
copy an application there. o
ฺc ude n
o o
h s St
$ cd /u01/domains/part1/wlsadmin2
y a
$ mkdir apps
y @ e t hi
$ cd apps
a z ak us
n /practices/part1/practice10-01/benefits.war .
$ (cp
y
b. k Close this Terminal window.
bli Zc.a Access the WebLogic Server administration console of the new domain by entering the
Na following URL:
https://host01.example.com:9002/console
Note: Log in using the WebLogic Server credentials.
d. In the Change Center, click Lock & Edit.
e. In the Domain Structure, select Deployments.
f. Above the Deployments table, click the Install button.
g. Use the links next to and below Current Location to navigate to:
host01.example.com/u01/domains/part1/wlsadmin2/apps
h. When the path is correct, select the option button next to benefits.war.
i. Click the Next button.
j. Select Install this deployment as an application and click Next.
k. Select the check box next to cluster1a. Ensure that the All servers in the cluster
option button is selected. Click Next.
l. Leave all the Optional Settings at their default values. Click Next.
m. Select No, I will review the configuration later. Click Finish.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 11: Network Channels and Virtual Hosts


Chapter 11 - Page 8
n. In the Change Center, click Activate Changes.
10. Start the application in “Admin” mode and test it through the admin port.
a. Select the check box next to the benefits application.
b. Click the Start button and select Servicing only administration requests.
c. When asked to confirm, click Yes.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

d. Notice that the state of the application is “Admin.”


e. Open a new web browser window or tab and try to access the application on
server1a using its default channel:
http://host01.example.com:8011/benefits
Note: Notice you receive a 404 error. This application is not available to regular users
through the server’s normal host and port.
f. Now try to access the application on server1a using its admin port:
https://host01.example.com:9003/benefits
e to
Note: Notice the use of https and the admin port override port number of 9003. ns
(Remember, this server runs on the same machine as the admin server, so it had l i ceto
use a different port number for its admin port.)
r a ble
g. Perform the same procedure as before to create a security exception
n s fe for this demo
certificate.
- t r a
Note: Because the URL is different, the browser needs another
n on exception.
h. When prompted login using the WebLogic Server
Note: Why does this application require us tohlog a sin?aIt isionly
eฺaccessible to administrators
credentials.
d
) G u you must log in.
through the admin port. To prove you are m t
an administrator,
cowhile noe n clients have access. Try it. This is
i. You can now use the application o ฺ d regular
sometimes done as aa hocheck
final S tu
before an application is opened up to general users.
@ y t s
hiwindow or tab.
y
j. Close the application
ak youuhave
browser
e
s seen that the application works through the admin port, so
a z
11. As an administrator,
n for everyone to use.
open it (up
y
ak Return to the admin console.
a.
l Z
N abi b. In the Domain Structure, select Deployments.
c. Select the check box next to the benefits application.
d. Click the Start button and select Servicing all requests.
e. When asked to confirm, click Yes.
f. Notice the state of the application is “Active.”.
g. Open a new web browser window or tab and try to access the application on
server1a using its default channel:
http://host01.example.com:8011/benefits
h. The application comes up because it is now available to all users. Also notice you are
not asked to log in.
i. Close the web browser.
12. Shut down everything in the new domain and remove it.
a. Find the Terminal Window on host01 in which you started server1a of the new
domain.
b. Press Ctrl + C to stop the server. Close the Terminal window.
c. Find the Terminal window in which you started the admin server of the new domain.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 11: Network Channels and Virtual Hosts


Chapter 11 - Page 9
d. Press Ctrl + C to stop the server. Close the Terminal window.
e. Open a new Terminal window and navigate to the parent directory of the new domain
directory. List its contents.
$ cd /u01/domains/part1
$ ls
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

wlsadmin wlsadmin2
f. Delete the new domain directory (not the regular domain).
$ rm –rf wlsadmin2
Warning: This command permanently deletes the directory, all its subdirectories, and files.
Use with caution. DO NOT DELETE THE REGULAR DOMAIN!
g. Close the Terminal window.

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 11: Network Channels and Virtual Hosts


Chapter 11 - Page 10
Solution 11-2: Configuring the Administration Port
There is no solution to this practice. The new domain is used only in this one practice.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 11: Network Channels and Virtual Hosts


Chapter 11 - Page 11
Practice 11-3: Creating a Virtual Host
Overview
In this practice, you will configure a virtual host and deploy an application to it.

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

You completed “Practice 11-1: Configuring a Network Channel.”


All servers are currently running.

Tasks
1. Open the WebLogic Server administration console.
2. Create a new virtual host.
a. In the Change Center, click Lock & Edit.
b. In the Domain Structure, expand Environment and select Virtual Hosts. e to
c ens
c. Click the New button.
le li
d. Enter the Name of benefits.com. Click OK.
r a b
e. Select the name of the new virtual host, benefits.com.
sf e
f. Under Virtual Hosts Names enter:
- t r an
benefits.com
n on
g. Click Save. s a e ฺ
a i d
h. Click the Targets tab.
m ) h t Gu
i. Select cluster1. Select Part of
ฺ o cluster.
cthe d e nSelect server1.
o u
y aho is St
k y @ e th
a z a us
y (n
k
bli Za
Na
j. Click Save.
k. In the Change Center, click Activate Changes.
3. Undeploy the benefits application.
a. In the Domain Structure, select Deployments.
b. Select the Control tab.
c. Select the check box in front of the benefits application. Click the Stop button and
select Force Stop Now. When asked to confirm, click Yes.
d. In the Change Center, click Lock & Edit.
e. Select the Configuration tab.
f. Select the check box in front of the benefits application.
g. Click the Delete button. When asked to confirm, click Yes.
h. Activate the changes.

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

Practices for Lesson 11: Network Channels and Virtual Hosts


Chapter 11 - Page 12
4. Deploy the benefits application to the new virtual host and start it.
a. In the Change Center, click Lock & Edit.
b. In the Domain Structure, select Deployments.
c. Click the Install button.
d. Navigate to host01.example.com/u01/domains/part1/wlsadmin/apps.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e. Select the option button next to benefits.war and click Next.


f. Select Install this deployment as an application and click Next.
g. For the target, select the new virtual host, benefits.com. Click Next.
h. Leave all optional settings at their defaults. Click Next.
i. Select No, I will review the configuration later and click Finish.
j. Activate the changes.
k. Select the Control tab.
l. Select the check box in front of the benefits application. e to
m. Click Start. Select Servicing all requests. When asked to confirm, click Yes.
c ens
5. Add benefits.com to the hosts file on the host01 machine. le li
r a b
a. Open a new Terminal window on host01.
s f e
b. Navigate to the /etc directory.
r a n
$ cd /etc
o n -t
c. List the hosts file.
s a n eฺ
$ ls hosts –l
) ha Guid
-rw-r—r-- 1 root root ...
ฺ c omhosts nt
deuser.
o
Note: Notice that the file belongs
h sSo t u
to the root
d. Edit the hosts file. ya
y
$ sudo vikhosts
@ e thi
a z a user is unotsproperly configured to use the gedit text editor because the
y
desktop
(nGUI is rendered as the oracle user.
Note: The root
k
bli Ze.a Find the line with host01.example.com. Move the cursor to the end of that line with
Na the arrow keys. Click the a key for “append” mode. Add some spaces and then
benefits.com to the end of that line. Press Esc. When you are finished, it will
resemble:
192.0.X.Y host01.example.com host01 benefits.com
...
f. Save the file and exit the editor by entering the characters :wq and then press Enter.
g. View the file to ensure that line is what you want it to be:
$ cat hosts
...
192.0.X.Y host01.example.com host01 benefits.com
...
$
h. Close the Terminal window.

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

Practices for Lesson 11: Network Channels and Virtual Hosts


Chapter 11 - Page 13
6. Access the application through the virtual host.
a. Open the web browser again.
b. Enter this URL to access the application:
http://benefits.com:7011/benefits
c. Try the application.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

7. Use the admin console to remove the application from the virtual host. Deploy it to the
cluster.
Note: You will have no need for the virtual host later, but will be using the cluster.
a. Open the WebLogic administration console.
b. In the Change Center, click Lock & Edit.
c. In the Domain Structure, select Deployments.
d. Select the Control tab.
e. Select the check box in front of the benefits application. Click the Stop button and
e to
select Force Stop Now. When asked to confirm, click Yes.
c ens
f. Select the Configuration tab.
le li
g. Select the check box in front of the benefits application. Click the Delete button. When
r a b
asked to confirm, click Yes. s f e
r a n
h. Activate the changes.
i. Lock the configuration again. o n -t
j. Click the Install button. s a n eฺ
) ha Guid
k. Select the benefits.war application (under
ฺ c om dent
host01.example.com/u01/domains/part1/wlsadmin/apps). Click Next.
l. Click Next again.
a h oo Stu
m. Select cluster1. Ensure
@ is servers in the cluster is selected. Click Next.
y thatthAll
n. ky use
Click Finish.
z a
o. n a the changes.
Activate
(
k y
p. Select the Control tab.
i l Za
q. Select the check box in front of the benefits application. Click Start and select
b
Na Servicing all requests. When asked to confirm, click Yes.

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

Practices for Lesson 11: Network Channels and Virtual Hosts


Chapter 11 - Page 14
Solution 11-2: Creating a Virtual Host
There is no solution to this practice. The virtual host is not needed in any subsequent practice.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 11: Network Channels and Virtual Hosts


Chapter 11 - Page 15
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 11: Network Channels and Virtual Hosts


Chapter 11 - Page 16
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
s f e
r a n
Practices for
o n -tLesson 12:
Clusters
s a n– Overview,
e ฺ
a i d
h Gu and Configuration
m )Creation,
ฺ c o Chapter
d e nt12
a h oo Stu
@ y this
y e
n a zak us
y (
Za k
b i l
Na

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

Practices for Lesson 12: Clusters – Overview, Creation, and Configuration


Chapter 12 - Page 1
Practices for Lesson 12: Overview
Practices Overview
In these practices, you create a “regular” cluster and a dynamic cluster. You also deploy an
application to the dynamic cluster.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 12: Clusters – Overview, Creation, and Configuration


Chapter 12 - Page 2
Practice 12-1: Configuring a Cluster
Overview
In this practice, you create and configure a cluster. You start the servers in the cluster.

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

You completed “Practice 9-1: Configuring and Using Node Manager.”


The administration server is currently running.

Tasks
1. Open the WebLogic Server administration console.
2. Create and configure a cluster.
a. In the Change Center, click Lock & Edit.
b. In the Domain Structure, expand Environment and select Clusters. e to
c ens
c. Above the Clusters table, click the New button and select Cluster.
li
d. Enter or select the following values for these fields and then click OK.
r a ble
− Name: cluster3 (The name cluster2 is being reserved for faedynamic cluster.)
a n s
− Messaging Mode: Unicast.
n -t r
e. Click OK. o
n ฺ
f. Select the new cluster in the Clusters table. s a e
h a u i d
g. Select the Configuration > Servers tabs.
m ) G
tAdd
h. Scroll down to the Servers tableฺ c o
and click
d e n
the button.
o o t u
i.
y ah values
Select Create a new server and S
i s
add it to this cluster. Click Next.
j. @
Enter or select the
y t
following
e h for these fields, then click Finish.
− Serverz k server3
aName: us
a
n Listen Address: host01.example.com
y− (Server
ak − Server Listen Port: 7013
l Z
bi k. Click the Add button again.
Na l. Select Create a new server and add it to this cluster. Click Next.
m. Enter or select the following values for these fields and then click Finish.
− Server Name: server4
− Server Listen Address: host02.example.com
− Server Listen Port: 7013
n. Click the Add button again.
o. Select Create a new server and add it to this cluster. Click Next.
p. Enter or select the following values for these fields and then click Finish.
− Server Name: server5
− Server Listen Address: host01.example.com
− Server Listen Port: 7015
q. Click the Add button again.
r. Select Create a new server and add it to this cluster. Click Next.

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

Practices for Lesson 12: Clusters – Overview, Creation, and Configuration


Chapter 12 - Page 3
s. Enter or select the following values for these fields and then click Finish.
− Server Name: server6
− Server Listen Address: host02.example.com
− Server Listen Port: 7015
t. In the Change Center, click Activate Changes.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

3. Assign the new servers to the proper machines.


a. In the Change Center, click Lock & Edit.
b. In the Domain Structure, expand Environment and select Servers.
c. Ensure the Configuration tab is selected.
d. Click server3.
e. Ensure that the Configuration > General tabs are selected.
f. Use the Machine drop-down list to select machine1.
e to
g. Click the Save button.
c ens
h. Use the breadcrumbs and select Summary of Servers. Click server4. Ensure that the
Configuration > General tabs are selected. Use the Machine drop-down list to select le li
machine2. Click the Save button. r a b
s f e
i. a n
Use the breadcrumbs and select Summary of Servers. Click server5. Ensure that the
r
n -t
Configuration > General tabs are selected. Use the Machine drop-down list to select
o
machine1. Click the Save button.
a n ฺ
j. Use the breadcrumbs and select Summary
h a s i deClick server6. Ensure that the
of Servers.
u
) Use
Configuration > General tabs are selected.
m t Gthe Machine drop-down list to select
o
ฺc ude
machine2. Click the Save button. n
o o
h s St Changes.
k. In the Change Center, click Activate
y a i
4. Start the new servers
y @in the new
e t hcluster.
ak Structure,
a. In the Domain
a z us expand Environment and select Servers.
(n the Control tab.
b. Select
y
l Z ak Select the check boxes next to server3, server4, server5, and server6. Then
c.

abi
click Start. When asked to confirm, click Yes.
N d. Wait for a little while and refresh the web browser. Ensure that the state of the new
managed servers is “RUNNING.”

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

Practices for Lesson 12: Clusters – Overview, Creation, and Configuration


Chapter 12 - Page 4
Solution 12-1: Configuring a Cluster
Perform the following tasks if you did not do this practice and want to use the finished solution.

Assumptions
You completed “Practice 9-1: Configuring and Using Node Manager.”
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

The administration server is currently running.

Tasks
1. Connect to host01.
2. Run the solution script.
a. Open a Terminal window and navigate to the practice directory. Run the solution script.
$ cd /practices/part1/practice12-01
$ ./solution.sh
e to
Note
c e ns
i and
eall lthe
− This script calls a WLST script that creates the new servers, the new cluster,
b
adds the servers to the cluster. It then calls another WLST script to startl
servers in the new cluster.
s f era
− The WLST script that starts the servers can take a whilerto
- t anrun, so be patient.
b. Close the Terminal window.
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a z a us
y (n
k
bli Za
Na

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

Practices for Lesson 12: Clusters – Overview, Creation, and Configuration


Chapter 12 - Page 5
Practice 12-2: Configuring a Dynamic Cluster
Overview
In this practice, you create and configure a dynamic cluster. You start the servers in the cluster.
You also deploy an application to all the servers in the dynamic cluster.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Assumptions
You completed “Practice 9-1: Configuring and Using Node Manager.” (“Practice 12-1:
Configuring a Cluster” is not a prerequisite for this practice.)
The administration server is currently running.

Tasks
1. Connect to host02. From there, run a script that sets up the database with a table and loads
it with some data. This is required by the application you will deploy later in this practice.
e to
Note: Notice that this is host02, not host01.
c ens
a. Open a Terminal window and navigate to the practice directory. Set a couple of
le li
environment variables and run the script that sets up the database.
r a b
Note: The ORACLE_HOME variable points to where the database is installed. ORACLE_SID sf e
r an
(Oracle System ID) is the unique name of this particular database.
- t
$ cd /practices/part1/practice12-02
n on
s a e ฺ
$ export ORACLE_HOME=/u01/app/db11g/product/11.2.0/dbhome_1
a i d
$ export ORACLE_SID=orcl
m ) h t Gu
$ ./setup.sh
o ฺ co den
u
aho is St
...
1 row created y
@ e th
k y
a za us
y ( n
1 row created

Za k
b i l Commit complete.
Na ...
$
Note: The SQL script drops the table (and sequence) it creates, so you can run it multiple
times. Therefore, the first time the script is run, it produces messages that no such table or
sequence exist. Ignore those messages if you see them.
b. Close the Terminal window.
2. Connect to host01 and copy the application to the domain's application directory.
a. Open a Terminal window and navigate to the practice directory. Copy the application to
the domain's application directory.
$ cd /practices/part1/practice12-02
$ cp supplies.war /u01/domains/part1/wlsadmin/apps
b. Close the Terminal window.
3. Open the WebLogic Server administration console.
4. Create and configure a dynamic cluster.
a. In the Change Center, click Lock & Edit.

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

Practices for Lesson 12: Clusters – Overview, Creation, and Configuration


Chapter 12 - Page 6
b. In the Domain Structure, expand Environment and select Clusters.
c. Above the Clusters table, click the New button and select Dynamic Cluster.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

d. Enter or select the following values for these fields and then click Next.
− Name: cluster2
− Messaging Mode: Unicast.
e. Enter or select the following values for these fields and then click Next.
− Number of Dynamic Servers: 4
e to
− Server Name Prefix: cluster2server-
c ens
Note: That is a “dash” on the end of the prefix name. le li
r a b
f. Select Use any machine configured in this domain. Click Next.
s f e
a n
g. Enter or select the following values for these fields, then click Next:
r
n
− Assign each dynamic server unique listen ports: Selected
o -t
− Listen Port for First Server: 7099
s a n eฺ
− SSL Listen Port for First Server: )8099 ha Guid
c
h. Notice the details of this new dynamic
ฺ om cluster,
d e ntincluding the name of the new server
ooClickSFinish.
template that will be created.
a h tu
i. In the Change Center,
@ y i s
click Activate
t h Changes.

z a ky generated
5. View the new servers
u se for the dynamic cluster. Start those servers.
a. In the
( n aDomain Structure, expand Environment and select Servers. Ensure that the
a k y
Configuration tab is selected.

b i l Zb. inNotice the four new servers. Their names all start with “cluster2server-” and end
N a an index.
c. Notice their type is “Dynamic,” as opposed to the other servers, which are
“Configured.”
d. Also notice that the servers alternate between machine1 and machine2.
e. Click the Control tab.
f. First, so not many servers are running at one time, stop all other managed servers.
Select the check boxes next to all managed servers not in the new dynamic cluster.
Click Shutdown and select Force Shutdown Now. When asked to confirm, click Yes.
Note: You may have to click the Next link and do this more than once if not all servers are
displayed on the first page.
g. Next, start the new dynamic servers. Select the check boxes next to all the dynamic
servers: cluster2server-1, cluster2server-2, cluster2server-3, and
cluster2server-4. Then click Start. When asked to confirm, click Yes.
h. Wait for a little while and refresh the web browser. Ensure that the state of all the new
managed servers is “RUNNING,” and the state of the other managed servers is
“SHUTDOWN.”

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

Practices for Lesson 12: Clusters – Overview, Creation, and Configuration


Chapter 12 - Page 7
6. Change the data source target to include the new cluster.
a. In the Change Center, click Lock & Edit.
b. In the Domain Structure, expand Services and select Data Sources.
c. In the Data Sources table, click the name of datasource1.
d. Click the Targets tab.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e. Select the check box for cluster2. Ensure that All servers in the cluster is selected.
f. Click Save.
g. In the Change Center, click Activate Changes.
7. Deploy an application to the new cluster.
a. In the Change Center, click Lock & Edit.
b. In the Domain Structure, select Deployments.
c. Above the Deployments table, click the Install button.
d. Use the links next to and below Current Location to navigate to: e to
host01.example.com/u01/domains/part1/wlsadmin/apps
c ens
Note: This fills in the Path field as you click links. le li
r a b
e. When the path is correct, select the option button next to supplies.war. Click Next.
sf e
- t r an
f. Select Install this deployment as an application and click Next.
on
g. Select the check box next to cluster2. Ensure that the All servers in the cluster
n
option button is selected. Click Next.
s a e ฺ
a i d
m ) h t Gu
h. Leave all the Optional Setting at their default values. Click Next.
i. Select No, I will review the configuration later. Click Finish.
o ฺ co den
u
j. In the Change Center, click Activate Changes.
y aho is St
Note: Notice the message that the changes have been activated and no restarts are
necessary.
k y @ e th
8. za
Start the application.
a us
y ( n
a. In the Deployments table, select the check box next to the supplies application.
Za k
b. Click the Start button and select Servicing all requests.
b i l
Na c. When asked to confirm, click Yes.
Note: Notice that the State of the supplies application is now “Active.”

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

Practices for Lesson 12: Clusters – Overview, Creation, and Configuration


Chapter 12 - Page 8
Solution 12-2: Configuring a Dynamic Cluster
Perform the following tasks if you did not do this practice and want to use the finished solution.
Note: If you started the practice and created the dynamic cluster or the server template,
you must delete them before running this solution. Use the administration console. If any of
the dynamic servers were created and started, first stop them (Environment > Servers >
Control; select the servers and click Shutdown > Force Shutdown Now). Then delete the
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

dynamic cluster (Lock & Edit; Environment > Clusters; select cluster2 and click Delete,
then Yes; Activate Changes). Then delete the server template (Lock & Edit;
Environment > Clusters > Server Templates; select cluster2server-Template and click
Delete, then Yes; Activate Changes).

Assumptions
You completed “Practice 9-1: Configuring and Using Node Manager.” (“Practice 12-1:
Configuring a Cluster” is not a prerequisite for running this solution.)
e to
The administration server is currently running.
c ens
Solution Tasks le li
r a b
1. Connect to host02 and run the database setup script.
s f e
Note: Notice that this is host02, not host01.
r a n
n -t
a. Open a Terminal window and navigate to the practice directory. Set a couple of
o
a n eฺ
environment variables and run the script that sets up the database.
s
ha Guid
$ cd /practices/part1/practice12-02
)
ฺ c om dent
$ export ORACLE_HOME=/u01/app/db11g/product/11.2.0/dbhome_1

a h oo Stu
$ export ORACLE_SID=orcl
$ ./setup.sh
@ y this
k y window.
b. Close the Terminal e
z a
2. Connect toahost01 usthe
and run solution script.
a. y ( n
Open a Terminal window, navigate to the practice directory, and run the solution script.
a k
bil Z $ cd /practices/part1/practice12-02
Na Note
$ ./solution.sh

− This script calls a WLST script that creates the server template and the dynamic
cluster based on it. It then calls another WLST script to deploy the application to the
new cluster. It then calls a WLST script to stop all servers in the other two clusters.
Next, it calls a WLST script to start all the servers in the new cluster. Finally, it calls
a WLST script to target the data source to the new cluster.
− The WLST script that starts servers can take a while to run, so be patient.
b. Close the Terminal window.

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

Practices for Lesson 12: Clusters – Overview, Creation, and Configuration


Chapter 12 - Page 9
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 12: Clusters – Overview, Creation, and Configuration


Chapter 12 - Page 10
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
s f e
r a n
Practices for
o n -tLesson 13:
s a n Proxies
Clusters:
e ฺ and
ha Gui
Sessions d
)
ฺ c om Chapter
d e nt13
a h oo Stu
@ y this
y e
n a zak us
y (
Za k
b i l
Na

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

Practices for Lesson 13: Clusters: Proxies and Sessions


Chapter 13 - Page 1
Practices for Lesson 13: Overview
Practices Overview
In these practices, you install and create an instance of Oracle HTTP Server. You then
configure Oracle HTTP Server as the proxy to the dynamic cluster. You test the application
deployed to that cluster. You also configure replication groups in another cluster.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 13: Clusters: Proxies and Sessions


Chapter 13 - Page 2
Practice 13-1: Installing OHS (Optional)
Overview
In this practice, you install the Oracle HTTP Server (OHS) portion of Oracle Web Tier on host01.
You also create an instance of OHS on that host.
OHS is already installed and a Web Tier instance with an OHS process has been created on
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

host01. You will rename the installation directory (that also contains the instance) to gain OHS
installation practice. If something goes wrong during the installation, you can revert to the
preinstalled version of the product by changing the directory back to its original name.

Assumptions
You completed “Practice 12-2: Configuring a Dynamic Cluster.”

Tasks
e to
1. Connect to host01.
c ens
2. Rename the OHS installation directory and create a new, empty directory.
le li
a. Open a Terminal window, and navigate to /u01/app. Then rename the OHS
r a b
installation directory (that also contains the OHS instance).
s f e
r a n
$ cd /u01/app
o n -t
a n eฺ
$ mv ohs ohs-orig
$ mkdir ohs s
ha Guid
3. Install the OHS part of Web Tier. )
a. Navigate to the directory that holds
ฺ c omthe dWeb
e t installer and execute it.
nTier
$ cd /install/webtier
a h oo Stu
@ y this
$ ./fmw_12.2.1.0.0_ohs_linux64.bin
a ky use
0%..............................
z
Notes (na

Z a ky− If the installer file name is different (a different version of OHS), use that file name
bil instead.
Na − Wait for all the files to extract before the installer starts, which can take several
minutes.
b. Use the guidelines in the following table to install the software by using the graphical
installer:
Step Window/Page Description Directions
a. Welcome Click Next.
b. Auto Updates Click Next.
c. Installation Location Oracle Middleware Home: /u01/app/ohs
Click Next.
d. Installation Type Select Standalone HTTP Server and click
Next.
Note: The environment intentionally uses
separate OHS and WebLogic installation
locations so they can be maintained separately.

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

Practices for Lesson 13: Clusters: Proxies and Sessions


Chapter 13 - Page 3
Step Window/Page Description Directions
e. Prerequisite Checks Wait for the progress bar to reach 100% and all
checks to pass.
Click Next.
Note: Newer libraries may cause the
prerequisite check to fail.. If the check fails,
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

click Skip to ignore the error.


f. Security Updates Deselect I wish to receive security updates
via My Oracle Support.
Click Next.
g. Pop-up window Click Yes.
h. Installation Summary Click Install.
e to
i. Installation Progress Wait for the progress bar to reach 100%.
c ens
Click Next.
le li
Note: This can take a few minutes.
r a b
j. Installation Complete s
Click Finish. f e
r a n
4. Configure an OHS instance.
o n -t
a. Rename the current OHS domain directory.
a n ฺ
$ cd /u01/domains
h a s
u i de
$ mv ohs ohs-orig m ) tG
c o e n
h o oฺ tudWizard for OHS.
b. Navigate to the common Configuration
y a s S
$ cd /u01/app/ohs/oracle_common/common/bin
i
c. Run the Domain @ t h
y Configuration
e Wizard to create an OHS domain.
z a k u s
( n aOHS
$ ./config.sh

a k y
Note: The
components.
12c release provides a WebLogic domain template for FMW system

bil Zd. Use the guidelines in the following table to configure the OHS domain by using the
Na Configuration Wizard:
Step Window/Page Description Directions
a. Create Domain Select Create a new domain.
Enter /u01/domains/ohs as the domain
location.
Click Next.
b. Templates Select Oracle HTTP Server (Standalone) –
12.2.1 [ohs].
Click Next.
Note: The Basic Standalone System...
template is selected by default.
c. JDK Selection Select Oracle HotSpot 1.8.0_xx
/u01/app/ohs/oracle_common/jdk/jre.
Click Next.

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

Practices for Lesson 13: Clusters: Proxies and Sessions


Chapter 13 - Page 4
Step Window/Page Description Directions
d. System Components Leave all default values and click Next. Note
the system component name, ohs1.
e. OHS Server System Component: ohs1
Admin Host: host01.example.com
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Admin Port: 9999


Listen Address: host01.example.com
Listen Port: 7777
SSL Listen Port: 7778
Server Name: http://host01.example.com:7777
Click Next.
f. Node Manager Node Manager Type: Per Domain Default
e to
Location
c ens
Node Manager Credentials:
le li
Username: Weblogic username,
r a b
Password: WebLogic password
s f e
Click Next.
r a n
g. Configuration Summary o
Review and click n -t
Create.
a n ฺ
h. Configuration Progress
h a s
Wait for de bar to reach 100%.
the progress
u i
m )Click Next.
t Gcan take a few minutes.
c o e n
h o oฺ tud Note: This
i. Success
@ ya this S Click Finish.
e. kydomain
Verify that the
z use
files are in place.
a/u01/domains/ohs
$ ls a –l
(n
ydrwxr-x---
Za k drwxr-x--- 2 oracle oinstall 4096 Dec 2 09:52 bin

b i l 4 oracle oinstall 4096 Dec 2 09:52 config


Na drwxr-x--- 2 oracle oinstall 4096
drwxr-x--- 2 oracle oinstall 4096
Dec 2 09:52 init-info
Dec 2 09:52 nodemanager
. . .
drwxr-x--- 2 oracle oinstall 4096 Dec 2 09:52 security
...

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

Practices for Lesson 13: Clusters: Proxies and Sessions


Chapter 13 - Page 5
Solution 13-1: Installing OHS (Optional)
There is no scripted solution for this practice. If you did not do the practice, there is nothing for
you to do, the product is already installed and the OHS instance is created.
If you started the practice, but did not complete it, you revert to the preinstalled version of the
products by deleting any new directories you created and renaming the original installation
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

directory back to its previous name.

Solution Tasks
Important: You may execute this solution if lab was completed by hand or not. This lab
solution and the following solutions assume that OHS was installed into /u01/app/ohs.
1. Connect to host01.
2. Run the script.
a. Open a Terminal window and navigate to the practice directory. Then run the script.
e to
$ cd /practices/part1/practice13-01
c ens
$ ./solution.sh
le li
Note:
r a b
This script performs the following tasks: sf e
t r an
Checks if an existing OHS install exists and renames it to a saved directory if found
-
on
Runs the OHS installer in silent mode installing OHS into /u01/app/ohs.
n
a ฺ
Unpacks and otherwise prepares a partially complete OHS domain
s e
a
(requires updates per practice 13-02). i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 13: Clusters: Proxies and Sessions


Chapter 13 - Page 6
Practice 13-2: Configuring a Cluster Proxy
Overview
In this practice, you configure Oracle HTTP Server (OHS) to act as the proxy to the cluster
created in the previous practice. You access the application deployed to the cluster via the
proxy, and verify that in-memory session replication works.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Assumptions
You completed “Practice 12-2: Configuring a Dynamic Cluster.”
“Practice 13-1: Installing OHS” was completed or the solution scripts were executed
successfully.

The administration server and all managed servers in the new dynamic cluster are currently
running.
e to
Tasks c ens
le li
1. Connect to host01.
r a b
2. Edit the WebLogic plug-in configuration file for OHS.
s f e
r a n
a. Open a Terminal window and navigate to the configuration directory of the OHS
instance. Edit both httpd.conf and mod_wl_ohs.conf.o n -t
a n eฺ
$ cd /u01/domains/ohs/config/fmwconfig/components/OHS/instances/
s
ohs1
) ha Guid
ฺ c om dent
$ gedit httpd.conf mod_wl_ohs.conf
b. Check that httpd.conf o
h o thetuplug-in configuration file. Make sure the
includes
httpd.conf tab in the a
@
editor
yand click
t h s SFind button.
is selected.
ithe Press Ctrl + F and in the pop-up window enter
Notice the include directive that
mod_wl_ohs.conf
k y s e
n a za
includes this u
configuration file.
c. Close
y ( the Find pop-up window. Close the httpd.conf file (click the “X” in the tab)
k without making any changes to it.
bli Zd.a Edit the plug-in configuration file, mod_wl_ohs.conf. Notice that most lines are
Na commented out (they start with a “#”). Also notice the LoadModule line, which loads
the WebLogic plug-in.
e. In between <IfModule weblogic_module> and </IfModule> enter following
lines:
<Location />
WLSRequest On
WebLogicCluster
host01.example.com:7100,host02.example.com:7101
</Location>
Notes
− Enter the WebLogicCluster line on a single line in the file.
− This initial list does not include all servers in the cluster, nor does it have to. The
plug-in will be updated with the other servers in the cluster when the cluster
servers it uses return the “dynamic cluster list” to it.

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

Practices for Lesson 13: Clusters: Proxies and Sessions


Chapter 13 - Page 7
− The / parameter set in Location tells the proxy that requests for all locations
(“slash”) should go to the cluster, no matter what the context root of the web
applications
Tip: Make sure there is no space between the “/” and the “>” or the line will not work.
f. When finished editing this file, it should look like this:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

LoadModule weblogic_module
"${PRODUCT_HOME}/modules/mod_wl_ohs.so"
<IfModule weblogic_module>
# WebLogicHost <WEBLOGIC_HOST>
# WebLogicPort <WEBLOGIC_PORT>
<Location />
WLSRequest On
WebLogicCluster
e to
host01.example.com:7100,host02.example.com:7101
c ens
</Location>
le li
</IfModule>
r a b
s f e
r a n
#<Location /weblogic>
# SetHandler weblogic-handler o n -t
# PathTrim /weblogic
s a n eฺ
) ha Guid
# ErrorPage http:/WEBLOGIC_HOME:WEBLOGIC_PORT/
#</Location>
ฺ c om dent
Note: The file is shown withh
a oo of the
some
S u
tcomment lines removed. You can keep them, if
you prefer. Also, due to y
@ t h i s
space limitations, the LoadModule line is shown here on two lines,
y one line.
but in the file it iskon
a s e
g. Whena z u
you are satisfied that the file is correct, save it and exit the editor.
( n
Z a ky OHS Node Manager to use a non-SSL connection.
3. Configure

bil You have to modify two configuration settings to make Node Manager use a non-SSL
Na connection. Add one setting in the domain’s config.xml file and the other setting in the
nodemanager.properties file.
a. Open the domain’s config.xml file for editing.
$ gedit /u01/domains/ohs/config/config.xml
b. Add the <nm-type> line to the machine’s node-manager element, and then save and
close the file.
<machine>
<name>localmachine</name>
<node-manager>
<name>localmachine</name>
<nm-type>Plain</nm-type>
<listen-address>localhost</listen-address>
...

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

Practices for Lesson 13: Clusters: Proxies and Sessions


Chapter 13 - Page 8
c. Open the nodemanager.properties file for editing.
$ gedit /u01/domains/ohs/nodemanager/nodemanager.properties
d. Set the SecureListener property to false, and then save and close the file.
SecureListener=false
4. Start OHS.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a. Open a new Terminal window, name the window OHS NM, and navigate to the OHS
domain’s bin folder.
$ cd /u01/domains/ohs/bin
b. Execute the following commands to explore the bin folder and start the OHS Node
Manager.
$ ls
startComponent.sh startRSDaemon.sh stopNodeManager.sh
startNodeManager.sh stopComponent.sh stopRSDaemon.sh
e to
$ ./startNodeManager.sh
c ens
...
le li
ohs -> /u01/domains/ohs r a b
s f e
r a n
<Dec 24, 2015 4:40:35 AM PDT> <INFO> <Node-tmanager v12.2.1>
<Dec 24, 2015 4:40:36 AM PDT> <INFO> n on socket listener
<Plain
s a e ฺ
started on port 5556, host localhost>
Note: Wait for the command to finish.) h
a u i d
m
o thede t G
n OHS, and navigate to the OHS
c. Open a new Terminal window,ฺc name window
domain’s bin folder. ho o tu
y a s S
y @
$ cd /u01/domains/ohs/bin
e t hi
d. Execute the
a z akfollowinguscommand to start OHS.
( n
$ ./startComponent.sh ohs1

Z a kyStarting system Component ohs1 ...


bil ...
Na Reading domain from /u01/domains/ohs
Please enter Node Manager password:
e. Enter the WebLogic Server password as the Node Manager password.
Connecting to Node Manager ...
Successfully Connected to Node Manager.
Starting server ohs1 ...
Successfully started server ohs1 ...
Successfully disconnected from Node Manager.
...

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

Practices for Lesson 13: Clusters: Proxies and Sessions


Chapter 13 - Page 9
f. Execute the following command to check the status of OHS.
$ /u01/app/fmw/wlserver/common/bin/wlst.sh
/install/webtier/config/status.py
Connecting to Node Manager ...
Successfully Connected to Node Manager.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

RUNNING
Note: Make sure that the “status” is “RUNNING.”
5. Access the application deployed to the cluster through the OHS cluster proxy. Use the
application to ensure it creates a session for you.
a. Open your web browser and enter the OHS URL, followed by /supplies:
http://host01.example.com:7777/supplies
b. When the application home page displays, click the browse the catalog link.
e to
c. Click the [add] link next to a few items.
c ens
d. Scroll down and view the items in your shopping cart.
le li
Note: Remember what items are in your shopping cart.
r a b
e. Do not close the web browser window. For the admin console, use a different browser sf e
t r an
window. You will come back to this web browser window later.
-
6. on
Open the WebLogic Server administration console in a new tab or window.
n
7. s a e ฺ
Use the administration console to see which cluster server is servicing your requests. Stop
a i d
that server.
m ) h t Gu
o ฺ co den
a. Under Domain Structure, expand Environment and select Clusters.
u
aho is St
b. In the Clusters table, click cluster2.
y
c. Click the Monitoring tab.
@ e th
k y
a za us
d. Use the Primary column to determine which of the clustered servers is hosting your
current shopping cart session (the value should be greater than 0). Remember which
y ( n
server it is.
Za k
Tip: If you cannot tell which server is the primary, write down the Primary session count
b i l
Na
number for all the servers. Close all browsers. Open a new browser and access and use
the application again. In the admin console, come back to this table and see which Primary
number has increased. That is the server that currently holds your session and is servicing
your requests.
e. Stop the server that has your session. In the Domain Structure, expand Environment
and select Servers. Click the Control tab. Select the check box next to the server that
is hosting your session. Click the Shutdown button and select Force Shutdown Now.
When asked whether you are sure, click Yes.
f. Wait a little while and refresh the web browser. Ensure that the state of the server is
SHUTDOWN.
8. Ensure your shopping cart still has your items to show that in-memory session replication is
working.
a. Go back to the web browser in which you were using the application. Remember the
items that were in your shopping cart. Click the [add] link next to some new and
different item. Scroll down and view your shopping cart. The new item and all the old
items should display in the shopping cart.
9. Shut down all of the servers in cluster2.

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

Practices for Lesson 13: Clusters: Proxies and Sessions


Chapter 13 - Page 10
Solution 13-2: Configuring a Cluster Proxy
Perform the following tasks if you did not complete this practice and want to use the finished
solution.

Assumptions
You completed “Practice 12-2: Configuring a Dynamic Cluster.”
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

The administration server and all managed servers in the new dynamic cluster are currently
running.

Solution Tasks
1. Connect to host01.
2. Run the script.
a. Open a Terminal window and navigate to the practice directory. Then run the script.
e to
ns
$ cd /practices/part1/practice13-02
$ ./solution.sh
li c e
Note:
a ble
This script performs the following tasks: f e r
a n s
− Copies a completed WebLogic plug-in configuration file for OHS to the right location
n -t r
o
− Configures the OHS Node Manager to use a non-SSL connection
− Starts the OHS Node Manager s a n eฺ
− Starts OHS ) ha Guid
c om dent
− Checks the status of the OHS server

h
− You should see the print
a ooout inSthetuTerminal window that ohs1 is RUNNING.
b. Close the Terminal@ ywindow.this
a ky theuapplication
3. If you want tozaccess se deployed to the cluster (in a previous practice) through
the OHS( n a
proxy, use the web browser.
k y
li Za http://host01.example.com:7777/supplies
a. Enter this URL:
b
Na

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

Practices for Lesson 13: Clusters: Proxies and Sessions


Chapter 13 - Page 11
Practice 13-3: Configuring Replication Groups
Overview
In this practice, you configure replication groups in a cluster.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
s f e
r a n
Assumptions o n -t
You completed “Practice 12-1: Configuring a Cluster.”s a
n ฺ
h a u i de
The administration server is running.
m ) tG
c o e n
Tasks
h o oฺ tud
1. Connect to host01.
@ ya this S
2. Open the WebLogic
a k y Serversadministration
e console.
u
az groups and preferred secondary groups.
3. Set replication
( n
y This is not a realistic example because you would not want to set up replication
Note:
a k
Zpracticesoin that
groups a server’s secondary server was on its same machine. It does give you
i l
N ab configuring replication groups, however. And, if you do the optional task at the
end of this practice, it will prove that replication group settings take precedence over the
“choose a different machine” preference when a secondary server is selected.
a. First, stop all the servers in cluster3, if they are running. In the Domain Structure,
expand Environment and select Clusters. In the Clusters table, select cluster3. Click
the Control tab. Select the check box in front of all the servers in the cluster that are
RUNNING. Click Shutdown and select Force Shutdown Now. When asked to
confirm, click Yes.
Why? Changing a server’s replication group or preferred secondary group does not take
effect until the server restarts. You are shutting down these servers ahead of time and will
start them later.
b. In the Change Center, click Lock & Edit.
c. In the Domain Structure, expand Environment and select Servers.
d. In the Servers table, select server3.
e. Click the Configuration > Cluster tabs.
f. Enter the following values for these fields, then click Save.
− Replication Group: group1
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Clusters: Proxies and Sessions


Chapter 13 - Page 12
− Preferred Secondary Group: group2
g. Use the breadcrumbs to select Summary of Servers. In the Servers table, select
server5. Click the Configuration > Cluster tabs. Enter the following values for these
fields, then click Save.
− Replication Group: group2
− Preferred Secondary Group: group1
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Note: Notice that you are putting two servers on the same machine in different groups,
each preferring the other’s group.
h. Use the breadcrumbs to select Summary of Servers. In the Servers table, select
server4. Click the Configuration > Cluster tabs. Enter the following values for these
fields, then click Save.
− Replication Group: group3
− Preferred Secondary Group: group4
e to
i. Use the breadcrumbs to select Summary of Servers. In the Servers table, select ns
l
server6 (you may have to click the Next link to be able to select this server). Click i cethe
Configuration > Cluster tabs. Enter the following values for these fields and
Save. r a ble then click
− Replication Group: group4 n s fe
- t r a
− Preferred Secondary Group: group3
n on
j. In the Change Center, click Activate Changes.a ฺ
a s i d e
4. Start the servers in this cluster.
m ) h t Gu
ฺ o denrunning servers, stop all other managed
a. To cut down on the number of concurrently
cDomain
servers that are running. In
h o
the
tuthe
otab. Select Structure, expand Environment and select
a
Servers. Click the Control S
y this Click Shutdown check boxes next to all managed servers

k y @
not in cluster3 that are RUNNING.
e and select Force Shutdown Now.
za Structure,
When asked to s
confirm,
u click Yes.
(
b. In then a
Domain expand Environment and select Clusters.
y
ak In the Clusters table, select cluster3.
c.
l Z
N abi d. Click the Control tab.
e. Select the check box in front of all four servers. Click Start. When asked to confirm,
click Yes. Wait a while and refresh the page. Ensure that the State of all four servers is
RUNNING.
5. In the Change Center, click Lock & Edit.
a. In the Domain Structure, expand Services and select Data Sources.
b. In the Data Sources table, click on the name of datasource1.
c. Click the Targets tab.
d. Select the check box for cluster3. Ensure that All servers in the cluster is selected.
e. Click Save.
f. In the Domain Structure, select Deployments.
g. In the Deployments table, click the contacts application.
h. Click the Targets tab.
i. Select the check box next to cluster3. Ensure that the All servers in the cluster
option button is selected.
j. Click Save.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Clusters: Proxies and Sessions


Chapter 13 - Page 13
k. In the Change Center, click Activate Changes.
l. In the Domain Structure, select Deployments. Ensure the contacts application is
Active. If not, start servicing all requests.
m. Do not close the admin console.
n. In the web browser, open a new window or tab.
o. Enter the URL for the application running on server3:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

http://host01.example.com:7013/contacts
Note: A proxy for this cluster is not set up, so you are accessing the application directly on
server3.
p. Click the link browse all contacts.
q. Return to the admin console. In the domain structure, expand Environment and select
Clusters. In the Clusters table, select cluster3.
r. Click the Monitoring tab.
e to
s. In the server3 row, you should see a 1 in the Primary column.
c ens
e li
t. Examine the Groups column. Does the server order make sense given the configured
replication groups? b l
Note: Remember, server3 has “group1” as its replication group and “group2”
s f era as its
a
preferred secondary group. And server5 has “group2” as its replication
t r n group. So, even
-
though server5 is on the same machine as server3, it is stillnchosen as the secondary
server because of the replication group configuration. no
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a z a us
y (n
k
bli Za
Na

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

Practices for Lesson 13: Clusters: Proxies and Sessions


Chapter 13 - Page 14
Solution 13-3: Configuring Replication Groups
There is no solution for this practice. Setting the replication groups is not needed in the cluster.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 13: Clusters: Proxies and Sessions


Chapter 13 - Page 15
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 13: Clusters: Proxies and Sessions


Chapter 13 - Page 16
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
s f e
r a n
Practices for
o n -tLesson 14:
s a n Communication,
Clusters:
e ฺ
a
h Gu and i d
m )Planning,
ฺ c d e nt
o Troubleshooting
a h oo StuChapter 14
@ y this
y e
n a zak us
y (
Za k
b i l
Na

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

Practices for Lesson 14: Clusters: Communication, Planning, and Troubleshooting


Chapter 14 - Page 1
Practices for Lesson 14: Overview
Practices Overview
In this practice, you configure a replication channel for a cluster.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 14: Clusters: Communication, Planning, and Troubleshooting


Chapter 14 - Page 2
Practice 14-1: Configuring a Replication Channel
Overview
In this practice, you configure a replication channel for peer-to-peer communication in a cluster.

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

You completed “Practice 9-1: Configuring and Using Node Manager.”


The administration server is running.
To do the optional task of monitoring the replication channel, you must have also completed
“Practice 10-2: Load Testing an Application,” or deploy the contacts application manually.

Tasks
1. Connect to host01.
2. Open the WebLogic Server administration console. e to
3. So unnecessary servers are not running, shut down all managed servers.
c ens
Note: You are also shutting down servers you want to be running, because the changes le li
being made only take effect after a server restart, so you are shutting down these servers r a b
ahead of time. sf e
- t r an
a. In the Domain Structure, expand Environment and select Servers.
b. Click the Control tab. n on
s a e ฺ
a d
c. Select the check box in front of all RUNNING managed servers.
i
) h t Gu
d. Click Shutdown > Force Shutdown Now. Click Yes when asked to confirm. Wait for
m
ฺ co den
the State of the servers to be SHUTDOWN.
o u
aho is St
Note: You may need to click the Next link to access all the servers. Select any running
y
k y @ e th
managed servers on the next page and shut them down, too.
4.
za us
Configure a replication channel for each server in cluster1.
a
y ( n
a. In the Change Center, click Lock & Edit.
k
b. In the Domain Structure, expand Environment and select Servers.
Za
b i l c. Select server1 in the Servers table.
Na d. Click the Protocols > Channels tab.
e. Click the New button.
f. Enter or select the following values for these fields and then click Next.
− Name: ReplicationChannel
− Protocol: t3
Note: Case matters in this name, as you want it to match everywhere you enter it.
g. Enter or select the following values for these fields, then click Next.
− Listen Address: host01.example.com
− Listen Port: 6000
− External Listen Address: (blank)
− External Listen Port: (blank)
h. Enter or select the following values for these fields and then click Next.
− Enabled: Selected
− Tunneling Enabled: Not selected
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Clusters: Communication, Planning, and Troubleshooting


Chapter 14 - Page 3
− HTTP Enabled for This Protocol: Selected
− Outbound Enabled: Selected
i. Enter or select the following values for these fields and then click Finish.
− Two Way SSL Enabled: Not selected
− Client Certificate Enforced: Not selected
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

j. Use the breadcrumbs to select Summary of Servers. Select server2. Click the
Protocols > Channels tab. Click the New button. Go through the Create a New
Network Channel wizard again, using the following values:
Field Value
Name ReplicationChannel
Protocol t3
Listen Address host02.example.com
e to
Listen Port 6000
c ens
External Listen Address (blank) le li
r a b
External Listen Port (blank)
sf e
Enabled - t r an
Selected
Tunneling Enabled n
Not selectedon
s a e ฺ
a i d
HTTP Enabled for This Protocol
m ) h t Gu
Selected
Outbound Enabled
o ฺ co dSelected
e n
Two Way SSL Enabledho
a S tu Not selected
@
Client Certificate
y t
Enforced hi s Not selected
k y s e
k. In the a
n za Center,
Change u click Activate Changes.
y ( the cluster to use the new replication channel.
5. Configure
a k
bil Za. In the Change Center, click Lock & Edit.
Na b.
c.
In the Domain Structure, expand Environment and select Clusters.
Select cluster1 in the Clusters table.
d. Click the Configuration > Replication tab.
e. Ensure that ReplicationChannel is in the Replication Channel field.
f. Click the Save button.
g. In the Change Center, click Activate Changes.
Note: If you did not type into the field, then no changes were made and the Activate
Changes button will still say Release Configuration. If that is the case, click Release
Configuration.
6. Start all cluster1 servers.
a. In the Domain Structure, expand Environment and select Clusters.
b. Select cluster1 in the Clusters table.
c. Click the Control tab.
d. Select the check box in front of all cluster1 servers. Click Start. Click Yes when asked
to confirm. Wait for the State of the servers to be RUNNING.
e. Do not close the web browser.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Clusters: Communication, Planning, and Troubleshooting


Chapter 14 - Page 4
7. Verify that the replication channel started by looking at server1’s output.
a. Open a new Terminal window on host01 and navigate to the logs directory of server1.
Then edit the server1.out file.
$ cd /u01/domains/part1/wlsadmin/servers/server1/logs
$ gedit server1.out
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

b. Press Ctrl + F. In the Find pop-up window, enter ReplicationChannel in the


Search for field and press Enter.
c. You should see the message that this channel is listening on port 6000 for t3,
CLUSTER-BROADCAST, and http.
d. Close the Find window, and exit the editor.
e. Close the Terminal window.
8. (Optional if you have time and are interested) Monitor the replication channel after session
replication has taken place. To do this you need to target a data source to this cluster,
e to
deploy an application that uses in-memory session replication to this cluster, and run the
application. c ens
Note: If the data source and application are already targeted to cluster1 you can skip those le li
steps when you get to them. r a b
sf e
a. Return to the admin console.
- t r an
b. In the Change Center, click Lock & Edit.
n on
s a
c. In the Domain Structure, expand Services and select Data Sources.
e ฺ
a i d
e. Click the Targets tab. m ) h t Gu
d. In the Data Sources table, click the name of datasource1.

o ฺ co den
f. If the data source is already targeted to cluster1, move on to the next step. If not, select
u
aho is St
the check box for cluster1. Ensure All servers in the cluster is selected. Click Save.
y
y @ e th
g. In the Domain Structure, select Deployments.
k
za us
h. In the Deployments table, click the contacts application.
a
( n
i. Click the Targets tab.
y
Za k
j. If the application is already targeted to cluster1, move on to the next step. If not, select
b i l the check box next to cluster1. Ensure that the All servers in the cluster option
Na button is selected. Click Save.
k. In the Change Center, click Activate Changes.
Note: If the data source and the contacts application were both already targeted to cluster1,
instead click Release Configuration.
l. Do not close the admin console.
m. In the web browser, open a new window or tab.
n. Enter the URL for the application running on server1:
http://host01.example.com:7011/contacts
Note: A proxy for this cluster is not set up, so you are accessing the application directly on
server1.
o. Click the browse all contacts link.
p. Return to the admin console. In the Domain Structure, expand Environment and
select Servers. In the Servers table, select server1.
q. Click the Protocols > Channels tab.
r. In the Network Channels table, select the ReplicationChannel channel.

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

Practices for Lesson 14: Clusters: Communication, Planning, and Troubleshooting


Chapter 14 - Page 5
s. Click the Monitoring > Overview tab.
t. Review the statistics for the channel. You should see that messages have been sent
and received on the replication channel.
u. You can go view the statistics for the replication channel on server2, as well.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 14: Clusters: Communication, Planning, and Troubleshooting


Chapter 14 - Page 6
Solution 14-1: Configuring a Replication Channel
There is no solution for this practice. Setting a replication channel is not needed in this cluster.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 14: Clusters: Communication, Planning, and Troubleshooting


Chapter 14 - Page 7
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 14: Clusters: Communication, Planning, and Troubleshooting


Chapter 14 - Page 8
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
s f e
r a n
Practices for
o n -tLesson 15:
a n eฺ
Transactions
s
) ha Guid
Chapter 15
ฺ c om dent
a h oo Stu
@ y this
y e
n a zak us
y (
Za k
b i l
Na

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

Practices for Lesson 15: Transactions


Chapter 15 - Page 1
Practices for Lesson 15: Overview
Practices Overview
In this practice, you set up the servers in the dynamic cluster to store their transaction logs in a
database.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 15: Transactions


Chapter 15 - Page 2
Practice 15-1: Configuring Transaction Persistence
Overview
In this practice, you create a data source to be used for the transaction log of the servers in the
dynamic cluster. You then set the transaction log to use this data source. You also use an
application that uses transactions and then monitor those transactions.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Assumptions
You completed “Practice 13-2: Configuring a Cluster Proxy.”
The administration server is running.
The dynamic cluster managed servers do not have to be running. Whichever ones are, will be
stopped and restarted as part of this practice.
Oracle HTTP Server (OHS) is running.
e to
Tasks
c ens
1. Connect to host01.
le li
2. Open the WebLogic Server administration console. r a b
3. Create a new generic JDBC data source for the transaction log. s f e
r a n
o n -t
a. Lock the configuration. In the Change Center, click the Lock & Edit button.

a n eฺ
b. In the Domain Structure, expand Services and then select Data Sources.
s
) ha Guid
c. Above the Data Sources table, click the New button and select Generic Data Source.
d. The “create a data source” wizard starts. Use the guidelines in the following table to
ฺ c om dent
create a new generic data source:
Step a
Window/Page h oo Stu Choices or Values
@ y this
Description
a. z a kya NewuJDBC
Create se Enter or select these values for the following fields:
( n aData Source: JDBC
aky Data Source
• Name: tlogdatasource1

l Z • JNDI Name: tlogds1


abi
Properties (page 1)
N • Database Type: Oracle
Click Next.
b. Create a New JDBC For the Database Driver field, select:
Data Source: JDBC *Oracle’s Driver (Thin) for Instance
Data Source connections; Versions:Any
Properties (page 2)
Note: Data sources used for TLogs cannot use XA
drivers.
Click Next.
c. Create a New JDBC Deselect Supports Global Transactions.
Data Source: Click Next.
Transaction Options
Note: Data sources used for TLogs cannot support
global transactions.
d. Create a New JDBC Enter or select these values for the following fields:
Data Source: Enter the Oracle database username and password as

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

Practices for Lesson 15: Transactions


Chapter 15 - Page 3
Step Window/Page Choices or Values
Description
Connection credentials.
Properties • Database Name: orcl
• Host Name: host02.example.com
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

• Port: 1521
• Database User Name: Oracle Database
username
• Password: Oracle Database password
• Confirm Password: Oracle password
• oracle.jdbc.DRCPConnectionClass: (leave blank)
Click Next.
e to
e. Create a New JDBC Click the Test Configuration button.
c ens
Data Source: Test When the message “Connection test succeeded.”
l e li
Database displays, click Next. b
ra and check
Connection
s
Note: If the test fails, click the Back f ebutton
t
your entries. Correct and mistakes
- r an and come back to
onagain
this page and try the test
n
f. Create a New JDBC Under Clusters, s a cluster2.
select e ฺ Ensure that the All
Data Source: Select servers) in a
hthe cluster i d
u option button is selected.
m t G
Targets
o ฺ co Finish.
Click
d e n
ho Activate
e. In the Change Center, click
a S tuChanges.
@
Note: Notice the messagey t
at the s
i “All changes have been activated. No restarts are
htop:
necessary.” ak y s e
a z uStore
( n
4. Set the Transaction Log for each server in the dynamic cluster to be a JDBC store.
a. ky
In the Change Center, click Lock & Edit.
Z a
l b. In the Domain Structure, expand Environment, expand Clusters, and select Server
N abi Templates.
Note: Because you want to set the transaction log store for the servers that are in the
dynamic cluster, you change the template upon which they are based.
c. In the Server Templates table, click the name of the template, cluster2server-
Template.
d. Click the Configuration > Services tabs.
e. Scroll down to the Transaction Log Store area. Use the Type drop-down list to select
JDBC.
f. Use the Data Source drop-down list to select tlogdatasource1.
g. Update the Prefix Name to TLOG_c2s_${id}_.
Note that the generated prefix exceeds the maximum table name length allowed by
Oracle databases. Additionally note that the ${id} portion causes WebLogic Server to
generate a table name specific to each server instance.

h. Click Save.
i. In the Change Center, click Activate Changes.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 15: Transactions


Chapter 15 - Page 4
Note: If any of the four servers in the dynamic cluster are running, they need to be stopped
and restarted. If, after activating changes, the message says that some items must be
restarted, then stop and restart any servers running in this cluster. If the message says no
restarts are needed, you do not have to stop any servers, just start them.
j. If any servers in the cluster were running, in the Domain Structure, expand
Environment, and select Clusters. Click on the name of cluster2. Click the Control
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

tab. Select the check box in front of each of the servers in cluster2 that is RUNNING.
Click the Shutdown button and select Force Shutdown Now. When asked whether
you are sure, click Yes. Wait a little while and refresh the browser. Ensure that the
state of each of the servers in cluster2 is SHUTDOWN.
k. In the Domain Structure, expand Environment, and select Clusters. Click on the
name of cluster2. Click the Control tab. Select the check box in front of each of the
servers in cluster2. Click the Start button. When asked whether you are sure, click
Yes. Wait a little while and refresh the browser. Ensure the state of each of these
servers is RUNNING.
e to
l. Minimize the web browser to use later.
c ens
5. Verify the TLog tables have been created.
le li
a. Connect to host02. r a b
Note: Notice that this is host02, not host01. sf e
- t r an
b. Open a Terminal window. Set a couple of environment variables and access SQL*Plus
as the oracle user. n on
s a e ฺ
a d
$ export ORACLE_HOME=/u01/app/db11g/product/11.2.0/dbhome_1
i
$ export ORACLE_SID=orcl
m ) h t Gu
ฺ co den
$ $ORACLE_HOME/bin/sqlplus Oracle database username/Oracle
o u
aho is St
database password
y
SQL*Plus: Release 11...
@ e th
...
k y
SQL> a za us
c. y ( n
Within SQL*Plus, list all the oracle user’s tables. Notice the tables that end with
Za k “WLSTORE.” There is one for each server in cluster2. Each instance of WebLogic
b i l Server in that cluster, based on the server template you modified, created a table for its
Na TLog.
SQL> select table_name from user_tables;

TABLE_NAME
----------------------------
...
TLOG_C2S_1_WLSTORE
TLOG_C2S_2_WLSTORE
TLOG_C2S_3_WLSTORE
TLOG_C2S_4_WLSTORE
...
Note: Other tables are listed, but they have been omitted here. Also, the order in which
your tables are listed may be different.
d. Exit SQL*Plus.
SQL> exit
Disconnected from Oracle Database...
$
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 15: Transactions


Chapter 15 - Page 5
e. Close the Terminal window.
6. Update the contacts application with a new version. Target the application to the dynamic
cluster.
Note: This new version of the contacts application sometimes rolls back transactions.
a. Open a Terminal window on host01. Navigate to the current practice directory and
copy the new contacts.war file over the old one in the domain’s applications
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

directory.
$ cd /practices/part1/practice15-01
$ cp contacts.war /u01/domains/part1/wlsadmin/apps
b. Return to the web browser running the administration console.
c. In the Change Center, click Lock & Edit.
d. In the Domain Structure, select Deployments.
e. In the Deployments table, select the check box in front of the contacts application.
Click Update. e to
f. Click Next. c ens
le li
g. Click Finish.
r a b
h. In the Change Center, click Activate Changes.
sf e
i. Lock the configuration again.
- t r an
j. In the Domain Structure, select Deployments.
n on
a
k. Click on the name of the contacts application.
s e ฺ
a i d
l. Click the Targets tab.
m ) h t Gu
o ฺ co den
m. Select cluster2. Ensure that All servers in the cluster is selected. Click Save.
u
aho is St
Activate changes.
y
Note: If this application is already targeted to cluster2, you can skip this step.
@ e th
k y
n. Keep the administration console around, as you will need it shortly.
7. a za us
Use the application and edit some contacts.
y ( n
Za k
Note: The application has been modified so that when you edit a contact, half of the time
the transaction is committed, the other half of the time the application throws an exception
b i l
Na
and the transaction is rolled back. Using the modified version of the application will provide
you with committed and rolled backed transactions to monitor.
a. In the web browser, use the File menu and select either New Window or New Tab.

b. In the new web browser window or tab, enter the URL for the cluster proxy and the
contacts application:
http://host01.example.com:7777/contacts
c. The contacts application opens.
d. Click the browse all contacts link.

e. Click the [edit] link in one of the rows. When the edit window displays, change
something and click the Update button.
Note: Back on the browse window, check whether the change has taken place.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 15: Transactions


Chapter 15 - Page 6
f. Click the [edit] link in another row. When the edit window displays, change something
and click the Update button.
Note: Back in the browse window, check whether the change has taken place.
g. Do this a few more times.
8. View information on the transactions back in the administration console. (But first you need
to figure out which server in the cluster is handling your requests.)
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a. Return to the web browser running the administration console.


b. In the Domain Structure, expand Environment, and select Clusters.
c. In the Clusters table, select cluster2.
d. Click the Monitoring tab.
e. Use the Primary column to see which server has been servicing your requests. Click
on that server’s name in this table (this is the same as selecting its name in the Servers
table).
f. Under this server’s Monitoring tab, click the JTA subtab. e to
g. Notice under the Summary subtab, the number of transactions. Also notice the c ens
number of committed transactions (Transactions Committed Total Count). The other le li
transactions were rolled back (Transactions Rolled Back for Application Errors Total r a b
Count). s f e
r a n
9.
primary server’s “out” file. o n -t
(Optional) If you are interested and have time, you can see what happened by viewing your

s a n eฺ
a. Access the host where your primary server runs. (You figured out your primary server
) ha Guid
in the previous task.) You can use the Servers table in the admin console to see on

ฺ c om dent
which machine your primary server runs. If it runs on machine1, use host01. If it runs
o
on machine2, use host02. In either case the password is oracle.
b. Once on the propery host, Stu window and navigate to the servers
ahoopenisa Terminal
directory undery the domain:th
@
z a k u se
( n a
$ cd /u01/domains/part1/wlsadmin/servers

Z a
c.
kyThen cd into the directory for your primary server (for example, cluster2server-1):
bil
Na d.
$ cd cluster2server-1
Then cd into the logs directory:
$ cd logs
e. Edit the “out” file for this server (for example, cluster2server-1.out):
$ gedit cluster2server-1.out
Note: Remember, the “out” file is the standard out of a server started by Node Manager
(because it is not running in a Terminal window).
f. Scroll to the bottom. You should see some messages that the code printed out. You
can see that sometimes the code calls “commit” and sometimes “rollback.” These are
two methods added to the code in this application. The “commit” method does nothing,
which lets the code finish and commit the database changes. The “rollback” method
throws a RuntimeException, which forces the database to roll back.
g. Close the editor.
h. Close the Terminal window.

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

Practices for Lesson 15: Transactions


Chapter 15 - Page 7
Solution 15-1: Configuring Transaction Persistence
Perform the following tasks if you did not do this practice and want to use the finished solution.

Assumptions
You completed “Practice 13-2: Configuring a Cluster Proxy.”
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

The administration server is running.


The dynamic cluster managed servers do not have to be running. Whichever ones are, will be
stopped and restarted as part of this practice.
Oracle HTTP Server (OHS) is running.

Solution Tasks
1. Connect to host01.
2. Stop all managed servers in cluster2.
e to
a. Open the WebLogic Server administration console.
c ens
b. In the Domain Structure, expand Environment, and select Servers. Click the Control
tab. Select the check box in front of each of the servers in cluster2 that is RUNNING. le li
r a b
Click the Shutdown button and select Force Shutdown Now. When asked whether
s f e
you are sure, click Yes.
r a n
o n -t
c. Wait a little while and refresh the browser. Ensure the state of each of the servers in
cluster2 is SHUTDOWN.
s a n eฺ
3. Run the solution script.
) ha Guid
a. In a Terminal window, run the solution script.
ฺ c om dent
oo Stu
$ cd /practices/part1/practice15-01
$ ./solution.sh a h
y this
Notes @
kycalls auWLST
z a
− This script se script that creates a data source to be used for TLogs. It
( n
thenacalls another WLST script that modifies the server template (on which the
Z a ky dynamic servers are based) to use that data source for its TLogs. Finally, it calls a
bil WLST script that redeploys the contacts application with a new version. The new
Na version of the contacts application sometimes rolls back transactions, so there is
more interesting transaction data to monitor.
− If you get the WLContext.close() warning, ignore it.
b. Close the Terminal window.
4. Start all managed servers in cluster2.
a. Return to the admin console.
b. In the Domain Structure, expand Environment, and select Servers. Click the Control
tab. Select the check box in front of each of the servers in cluster2. Click the Start
button. When asked whether you are sure, click Yes.
c. Wait a little while and refresh the browser. Ensure the state of each of the servers in
cluster2 is RUNNING.

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

Practices for Lesson 15: Transactions


Chapter 15 - Page 8
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
s f e
r a n
Practices for
o n -tLesson 16:
WebLogic
s a n Server
e ฺ Security
ha Gui d
)
Chapter 16
ฺ c om dent
a h oo Stu
@ y this
y e
n a zak us
y (
Za k
b i l
Na

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

Practices for Lesson 16: WebLogic Server Security


Chapter 16 - Page 1
Practices for Lesson 16: Overview
Practices Overview
In this practice, you configure an external LDAP and set it as one of the authentication providers
of the WebLogic Server security realm.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 16: WebLogic Server Security


Chapter 16 - Page 2
Practice 16-1: Configuring an Authentication Provider
Overview
In this practice, you configure an external LDAP, OpenDS. You then set this LDAP, which is
installed on host02, as one of the authentication providers in your WebLogic domain. Finally,
you configure the authentication provider control flags.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Note: The default embedded LDAP continues as one of the authentication providers and
retains all the administrative users, groups, and roles. The external LDAP is used for all
other users, groups, and roles.

Assumptions
You completed “Practice 13-2: Configuring a Cluster Proxy.”
The administration server and the four servers in the dynamic cluster are currently running.
OHS is running.
e to
c ens
Tasks
le li
1. Create some LDAP users in the external LDAP system.
r a b
a. Connect to host02. s f e
r a n
Note: Notice that this is host02, not host01.
o n -t
a n eฺ
b. Open a Terminal window. Navigate to the bin directory under the installed OpenDS
s
LDAP system, and launch the OpenDS control panel:
ha Guid
$ cd /u01/app/ldap/bin )
$ ./control-panel
ฺ c om dent
h oo thatSthetuLocal Server is not running. Click OK to close it.
c. A dialog box appears warning
a
y this
d. Click the Start button.
@
z a ky use
( n a
Z a ky
bil
Na e. When prompted, enter the LDAP password, and click OK.
f. After the dialog box indicates that the LDAP server has successfully started, click the
Close button on the dialog box.
g. In the left menu, select Directory Data > Manage Entries.

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

Practices for Lesson 16: WebLogic Server Security


Chapter 16 - Page 3
h. Click the base node in the list on the left, dc=example,dc=com. Then right-click and
select New User.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

i. Enter or select the following values and then click OK.


Field Value
First Name Larry
Last Name Fine
Common Name Larry Fine
User ID larryf
e to
Password Welcome1
c ens
Password (Confirm) le li
Welcome1
r a b
E-mail larry.fine@example.com s f e
r a n
Naming Attribute uid
o n -t
Note: Leave blank any fields that are not listed.
s a n eฺ
) ha close
j. After the user has been successfully created,
u id “Entry created” dialog box.
the
Note: It may be behind other windows. m
c o e n tG
h o oฺ tud
k. Click the base node again, dc=example,dc=com. Right-click and select New User.

@ ya this S
Then enter or select the following values and click OK.

a k y se
Field Value
az
FirstnName
u Moe
y (
l Zak Last Name Howard
bi Common Name
Na
Moe Howard
User ID moeh
Password Welcome1
Password (Confirm) Welcome1
E-mail moe.howard@example.com
Naming Attribute uid
Note: Leave blank any fields that are not listed.
l. After the user has been successfully created, close the “Entry created” dialog box.
Note: It may be behind other windows.
m. Confirm that you have two new users within the base DN.

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

Practices for Lesson 16: WebLogic Server Security


Chapter 16 - Page 4
2. Create a group in the external LDAP system and add a user to it.
a. Click the base node, dc=example,dc=com again. Right-click and this time select New
Group.
b. For Name, enter boss.
c. Ensure that Static Group is selected.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

d. Click the Add Members button.


e. Select the moeh user and click OK.
f. Click OK again.
g. Close the “Entry created” dialog box.
Note: It may be behind other windows.
h. Close the Manage Entries dialog box.
i. Exit the control panel.
Tip: Click the “X” at the top right, or select File > Exit. e to
j. Close the Terminal window.
c ens
3. Open the WebLogic Server administration console. le li
r a b
4. Add the external LDAP system as an authentication provider to the domain’s security realm.
sf e
a. In the Change Center, click the Lock & Edit button.
- t r an
on
b. In the Domain Structure, select Security Realms.
n
c. In the Realms table, click myrealm.
s a e ฺ
a i d
) h t Gu
d. Click the Providers > Authentication tabs.
m
e. Click the New button.
o ฺ co den
y a ho s Stu
f. Enter or select the following, then click OK.
Field
y @ e t hi Value
Name
n azak us CompanyLDAP

y (
Type LDAPAuthenticator

l Zg.ak In the Authentication Providers table, click the name of the new provider.
bi
Na h.
i.
Click the Configuration > Provider Specific tabs.
Enter the following values, then click Save.
Field Value
Host host02.example.com
Port 7878
Principal cn=Directory Manager
Credential Welcome1
Confirm Credential Welcome1
User Base DN dc=example,dc=com
User Name Attribute uid
Group Base DN dc=example,dc=com
Static Group Name Attribute cn
Note: Any fields not mentioned should be left at their default values.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: WebLogic Server Security


Chapter 16 - Page 5
5. Adjust the authentication provider processing order and control flags.
a. Use the breadcrumbs (at the top of the administration console) to return to the
Authentication Providers table.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

b. Click the Reorder button.


c. Select providers and use the arrow buttons ( ) to put the authentication providers
in the following order:
− CompanyLDAP
− DefaultAuthenticator
− DefaultIdentityAsserter
d. Once the order is correct, click OK.
e to
e. In the Authentication Providers table, click the CompanyLDAP provider.
c ens
f. Ensure that the Configuration > Common tabs are selected.
le li
g. Set the Control Flag to Sufficient.
r a b
h. Click Save.
sf e
r an
i. Similarly, edit DefaultAuthenticator and set its Control Flag to Sufficient as well.
- t
Save that change.
n on
a
j. In the Change Center, click Activate Changes.
s e ฺ
a i d
m ) h t Gu
Note: Notice the message that some items must be restarted. You need to stop and start
all servers that are running. (The admin server and the managed servers need to access
the new external LDAP.) o ฺ co den
u
6. aho is St
Navigate to the practice folder and execute the following script to disable the user cache.
y
y @ e th
$ cd /practices/part1/practice16-01
k
za us
$ ./disable_cache.sh
a
7. ( n
Stop all the managed servers.
y
Za k
a. In the Domain Structure, expand Environment and then select Servers.
b i l
Na b. On the right, click the Control tab.
c. Select the check box next to any managed server that is running. Click the Shutdown
button and select Force Shutdown Now. When asked to confirm, click Yes.
d. Wait a moment and refresh the screen. Ensure that the “State” column in the table
confirms that all managed servers are shut down.
8. Stop and restart the administration server.
a. Connect to host01.
b. Find the Terminal window in which the admin server is running.
c. Press Ctrl + C in the admin server window.
Note: This has the same effect as Force Shutdown Now.
d. Use the up arrow to bring back the command issued to start the admin server, and
start it again.
$ ./startWebLogic.sh
9. Access the WebLogic Server administration console again.

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

Practices for Lesson 16: WebLogic Server Security


Chapter 16 - Page 6
10. Restart all the managed servers in cluster2.
a. In the Domain Structure, expand Environment and then select Clusters.
b. Click on the name of cluster2.
c. Click the Control tab.
d. Select the check box next to all the managed servers in cluster2. Click the Start button.
When asked to confirm, click Yes.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e. Wait a moment and refresh the screen. Ensure that the “State” column in the table
confirms that all these managed servers are RUNNING.
11. Deploy and start an application that uses role-based security. This application uses its
deployment descriptors to:
− Define a role called manager.
− Protect certain resources, which only users in the manager role are allowed to
access.
e to
− Map the manager role to a principal called boss.
c ens
Therefore, any user in the boss group should be allowed to access the protected
le li
resources.
r a b
a. Open a new Terminal window on host01 and navigate to the current practice directory.
s f e
a n
Copy the new application to the domain's application directory.
r
$ cd /practices/part1/practice16-01 o n -t
s a n eฺ
$ cp timeoff.war /u01/domains/part1/wlsadmin/apps
b. Return to the web browser running the admin
) ha console.
u id
c. In the Change Center, click Locko&m Edit. nt
G
c
oฺ Deployments.d e
o
d. In the Domain Structure, select
h t u
e. Above the Deployments
@ ya table,
t h isclickSInstall.
z a ky navigate
f. Using the links,
u seto:
( n a
host01.example.com/u01/domains/part1/wlsadmin/apps
g. ky
Select the option button in front of timeoff.war and click Next.
Z a
bil h. Ensure that Install this deployment as an application is selected. Click Next.
Na i. Select cluster2. Ensure that All servers in the cluster is selected. Click Next.
j. Do not change any optional settings. Click Next.
k. Select No, I will review the configuration later. Click Finish.
l. In the Change Center, click Activate Changes.
m. Return to the Deployments table. Select the check box in front of the timeoff
application.
n. Click Start and select Servicing all requests. Click Yes.
o. Ensure the state of the timeoff application is now “Active.”
p. Close the web browser. If any other web browsers are open, close them, too.
Why? You do not want to be logged in to anything.

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

Practices for Lesson 16: WebLogic Server Security


Chapter 16 - Page 7
12. Use the new application. Log in as a user that does not have the correct role to access the
protected resources.
a. Open the web browser.
b. In the web browser, enter the URL to access the new timeoff application:
http://host01.example.com:7777/timeoff
c. The timeoff application opens.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

d. Click the Request Time Off link.

e. Fill out the form and click the Submit Report button.
f. Click the Back to Home Page link.
Note: This part of the application is not protected, so it is open to anyone. e to
g. Now try the Close an Office link. c ens
le li
r a b
s f e
r a n
o n -t
s a n eฺ
) ha Guid
ฺ c om dent
oo S
h. When the “Log In” pagehdisplays,
a tu the username and password of the non-
enter
y
manager and then click
@ hi
Log In.
t s
y
ak us
− User Name: larryf e
n a z
− (Password: Welcome1
k y
bli Za
Na

i. Since Larry does not have the correct role, you get an error.

j. Close the web browser.

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

Practices for Lesson 16: WebLogic Server Security


Chapter 16 - Page 8
13. Use the new application again. This time, log in as a user that does have the correct role to
access the protected resources.
a. Open the web browser.
b. In the web browser, enter the URL to access the new timeoff application:
http://host01.example.com:7777/timeoff
c. The timeoff application opens.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

d. Click the Close an Office link.


e. When the “Log In” page displays, enter the username and password of the manager
and then click Log In.
− User Name: moeh
− Password: Welcome1
f. This time, because Moe is a manager, you are taken to the “Close an Office Form.”

e to
c ens
le li
r a b
s f e
r a n
o n -t
s a n eฺ
) h a u id
Note: The user Moe (uid: moeh) wasm
c o e n t Gboss group. The boss principal was
placed in the
mapped to the role manager byo
o ฺ application’s
the
u d deployment descriptor. The protected
resources (particular pages
a h
in the web S t
application) allow the role manager to have access.
g. Enter a Date and
y
@a Reason i s
thand click the Submit Form button.
k y s e
za page, click
h. On the next
n a u the Back to Home Page link.
( the web browser.
i. Close
y
Za k
bi l
Na

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

Practices for Lesson 16: WebLogic Server Security


Chapter 16 - Page 9
Solution 16-1: Configuring an Authentication Provider
Perform the following tasks if you did not do this practice and want to use the finished solution.

Assumptions
You completed “Practice 13-2: Configuring a Cluster Proxy.”
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

The administration server and the four servers in the dynamic cluster are currently running.
OHS is running.

Solution Tasks
1. Connect to host02.
Note: Notice that this is host02, not host01.
2. Run the solution script.
a. In a Terminal window, run the solution script.
e to
$ cd /practices/part1/practice16-01
c ens
$ ./solution.sh
le li
Note: This script runs an executable under the bin directory of the LDAP server that
r a b
imports users and a group. It then calls another executable that starts the LDAP server. sf e
r an
Next, it calls a WLST script that creates the external LDAP authentication provider within
- t
n on
the domain. Finally, it calls two more scripts: one stops all the servers in cluster2, the next
starts them up again. (Servers must be rebooted for the authentication provider changes to
s a e ฺ
a d
take effect.) Stopping and starting the servers can take a while, so be patient.
i
b. Close the Terminal window. m ) h t Gu
3. ฺ co den
Connect to host01. Run a script to deploy an application to the dynamic cluster. Then stop
o u
aho is St
and restart the administration server.
y
k y @ e th
a. In a Terminal window, run the deployment script.
za us
$ cd /practices/part1/practice16-01
a
( n
$ ./deploy.sh
y
l Z ak If you get the WLContext.close() warning, ignore it.
Note:
bi b. Close the Terminal window.
Na c. Find the window in which the admin server is running. Press Ctrl + C.
d. Once the server has stopped, use the up arrow to bring back the last command
entered (startWebLogic.sh). Press enter to run it.
$ ./startWebLogic.sh
Note: If you do not have a boot identity file, when prompted, enter the WebLogic username
and password from the credentials section of this guide.
e. Wait for the server to indicate it is in RUNNING mode.

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

Practices for Lesson 16: WebLogic Server Security


Chapter 16 - Page 10
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
s f e
r a n
Practices for
o n -tLesson 17:
Backing
s a nUpeaฺ Domain and
) ha GuidWebLogic Server
Upgrading
ฺ c om Chapter
d e nt17
a h oo Stu
@ y this
y e
n a zak us
y (
Za k
b i l
Na

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

Practices for Lesson 17: Backing Up a Domain and Upgrading WebLogic Server
Chapter 17 - Page 1
Practices for Lesson 17: Overview
Practices Overview
In this practice, you back up a domain. You then restore from that backup.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 17: Backing Up a Domain and Upgrading WebLogic Server
Chapter 17 - Page 2
Practice 17-1: Backing Up and Restoring a Domain
Overview
In this practice, you back up the domain. You stop servers and remove the existing domain
directories from one of the hosts. You restore the domain from the backup and restart the
servers on that machine to ensure the backup is working properly.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

You also set up the domain to automatically back up the configuration when changes are made.

Assumptions
You completed “Practice 13-2: Configuring a Cluster Proxy.”
The administration server and the four servers in the dynamic cluster are currently running.
OHS is running.

Tasks
e to
1. Lock the domain configuration by using the WebLogic administration console.
c ens
a. In the Change Center, click Lock & Edit.
le li
Note: Although in the classroom, no other administrator will be making configuration r a b
s
changes to your domain, in the real world this step is recommended to keep other f e
r a n
created. o n -t
administrators from making changes to the domain configuration while the backup is being

2. a n eฺ
Create a backup of the domain on host01.
s
) ha Guid
Note: You are just backing up the domain. This is just one of the tasks you would perform
in an online backup.
ฺ c om dent
a h oo Stu
a. Open a Terminal window on host01. Navigate to the directory that holds the domain:
y this
/u01/domains/part1.
@
aky thesdomain.
e
$ cd /u01/domains/part1
b. Createaazbackup of u
y n
$ (tar –zcpvf /home/oracle/wlsadminbackup.tarz wlsadmin
ak The options are:
li ZNote:
b
Na − z: Zip the archive
− c: Create archive
− p: Preserve file and directory permissions
− v: Verbose output
− f: File name
3. Use the admin console to set up automatic domain configuration backups.
a. Return to the admin console.
b. In the Domain Structure, click on the domain, wlsadmin.
c. Ensure that the Configuration and General tabs are selected.
d. Scroll down and click Advanced.
e. Scroll down again and select Configuration Archive Enabled.
f. Set Archive Configuration Count to 5.
g. Click the Save button.
h. In the Change Center, click Activate Changes.

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

Practices for Lesson 17: Backing Up a Domain and Upgrading WebLogic Server
Chapter 17 - Page 3
4. Make sure the cluster2 servers on host02 (machine2) are running.
a. In the Domain Structure, expand Environment and select Clusters.
b. In the Clusters table, select cluster2.
c. Click the Control tab.
d. Make sure the servers that run on machine2 are running. If not, select their check
boxes, click Start. Then click Yes.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

5. Stop all servers in the domain that are running on host01 (machine1).
a. In the Domain Structure, expand Environment and select Servers.
b. Click the Control tab.
c. Select the check box in front of any managed servers that are currently running on
machine1 (which is host01). Click Shutdown > Force Shutdown Now. Then click
Yes. Wait for a little while and refresh the web browser. Ensure that the State of the
servers is SHUTDOWN.
d. Now, select the check box in front of the admin server. Click Shutdown > Force e to
Shutdown Now. Then click Yes.
c ens
Note: Notice the message that you no longer have an administration console, because the le li
admin server is shutting down. r a b
sf e
6. Find the Node Manager running on host01 and stop it.
- t r an
Note: You want to stop Node Manager before removing its directory.
n on
a. Find the Terminal window on host01 that is running Node Manager. Stop it by pressing
s a e ฺ
a d
Ctrl + C in the window. Do not close this Terminal window, you will use it later.
i
7. ) h t Gu
Simulate a “media failure” by renaming the domain directory. (You could delete it, but we
m
ฺ co den
will rename it, just in case the backup does not work.)
o u
aho is St
a. Open a new Terminal window on host01. Rename the domain directory.
y
k y @ e th
Note: The command is shown on two lines due to space limitations. Enter it on one line.
za us
$ mv /u01/domains/part1/wlsadmin
a
y ( n /u01/domains/part1/wlsadminorig
8.
l Z ak restoring
Before the domain on host01 and starting the admin server and some managed
bi servers, notice that the servers on host02 (machine2) continue to run.
Na a. Return to the web browser. Use it to access an application running on the two
remaining cluster2 servers, which are both running on machine2. You will access them
through the OHS cluster proxy. Depending upon which practices you have completed,
you may have the contacts, supplies, or timeoff applications to try. Their URLs are:
http://host01.example.com:7777/contacts
http://host01.example.com:7777/supplies
http://host01.example.com:7777/timeoff
9. Restore the domain on host01 from the backup.
Note: You could alternatively use the Weblogic pack and unpack commands to back up
your domain. The entire domain must be shut down prior to using pack and unpack.
a. In the Terminal window on host01, navigate to the directory that contained the domain
directory.
$ cd /u01/domains/part1
b. Restore the domain directory.
$ tar –zxpvf /home/oracle/wlsadminbackup.tarz

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

Practices for Lesson 17: Backing Up a Domain and Upgrading WebLogic Server
Chapter 17 - Page 4
Note: The options are:
− z: Unzip the archive
− x: Extract the archive
− p: Preserve file and directory permissions
− v: Verbose output
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

− f: File name
10. Restart the Node Manager on host01.
a. Find the Terminal window on host01 in which Node Manager was running. Use the up
arrow to retrieve the last command entered. Start Node Manager again by entering the
command:
$ ./startNodeManager.sh.
11. Start the admin server.
a. Find the Terminal window in which the admin server was running. Use the up arrow to e to
retrieve the last command entered. Start the admin server by entering that command:
c ens
$ ./startWebLogic.sh
le li
Note: If the window has been closed, open a new Terminal window, navigate to the domain r a b
directory and start the admin server. s f e
r a n
$ cd /u01/domains/part1/wlsadmin
o n -t
$ ./startWebLogic.sh
a n ฺ
a
Note: Wait for the server to show it is in RUNNING s mode.ide
) h G u
12. Open the WebLogic administration console.m
co that e n t
13. Start the two managed servers in o ฺ
cluster2 d run on machine1 (and that use the domain
directories just restored). ho
a S tu
@ y
a. In the Domain Structure, t
expand
s
hi Environment, and select Servers.
y
ak tab. e
b. Click thezControl
a us
(n the check box in front of the two managed servers in cluster2 that are on
c. Select
y
l Z ak machine1 (which is host01).
N abi Note: The servers are cluster2server-1 and cluster2server-3.
d. Click Start. Then click Yes.
e. Wait for a little while and refresh the web browser. Ensure that the State of the servers
is RUNNING.
Note: You have restored the “missing” domain files from a backup and restarted the
servers running on that machine.

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

Practices for Lesson 17: Backing Up a Domain and Upgrading WebLogic Server
Chapter 17 - Page 5
Solution 17-1: Backing Up and Restoring a Domain
There is no solution to this practice.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Practices for Lesson 17: Backing Up a Domain and Upgrading WebLogic Server
Chapter 17 - Page 6
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e to
c ens
le li
r a b
s f e
r a n
Appendix A:
o n -tConnecting to
a n eฺ
the Environment
s
) ha Guid
Chapter 18
ฺ c om dent
a h oo Stu
@ y this
y e
n a zak us
y (
Za k
b i l
Na

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

Appendix A: Connecting to the Environment


Chapter 18 - Page 1
Overview

The set of Oracle WebLogic Server 12c courses are offered in multiple formats. Each format
requires a different form of connecting to the environment to work with the hands-on practices of
the course. To accommodate this, the connection instructions within each course generically tell
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

you to connect to your hosts and leave the connection details to this document. Refer to this
document and also ask your instructor whenever you have questions about connecting to your
lab environment.

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Appendix A: Connecting to the Environment


Chapter 18 - Page 2
Instructor-Led Training (ILT) or Live Virtual Class (LVC)

Environment: OVM

Primary Machine Connection: Ask your instructor to provide you with Oracle University’s
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

instructions for connecting to your environment.

Virtual Machine Instances: Connectivity is made by clicking the provided VNC shortcuts on
the primary machine’s desktop. Note that the password entered to connect via VNC is not the
operating system password, but rather it is the password used to connect to the VNC server.

1. Accessing host01.
From your gateway machine, double-click the VNC Viewer - host01 icon on the desktop. e to
Connect to host01 using the credentials for Host01 as described in the credentials section.
c ens
and press the Enter key.
le li
r a b
s f e
r a n
o n -t
s a n eฺ
) ha Guid
ฺ c om dent
a h oo Stu
2. Accessing host02.
@ y this
z akyusing
From your gateway
Connect toahost02
secredentials
machine,
uthe
double-click the VNC Viewer - host02 icon on the desktop.
for Host02 as described in the credentials section
( n
and press the Enter key.
Z a ky
bil
Na

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

Appendix A: Connecting to the Environment


Chapter 18 - Page 3
Training On Demand (TOD)

Environment: OVM

Primary Machine Connection: Ask your instructor to provide you with Oracle University’s
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

instructions for connecting to your environment.

Virtual Machine Instances: Ask your instructor to provide you with Oracle University’s
instructions for connecting to your environment.

e to
c ens
le li
r a b
sf e
- t r an
n on
s a e ฺ
a i d
m ) h t Gu
o ฺ co den
u
y aho is St
k y @ e th
a za us
y ( n
Za k
b i l
Na

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

Appendix A: Connecting to the Environment


Chapter 18 - Page 4

Vous aimerez peut-être aussi