Vous êtes sur la page 1sur 171

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

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c (z to
Raki
o
avk
Zdr
Oracle WebLogic Server 12c:
Administration I
Activity Guide
D80149GC12
Edition 1.2 | Dec 2014 | D89600

Learn more from Oracle University at oracle.com/education/


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

Bill Bell Disclaimer


Elio Bonazzi This document contains proprietary information and is protected by copyright and other
TJ Palazzolo 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
Steve Friedberg 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
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

document in whole or in part without the express authorization of Oracle.


Technical Contributors
and Reviewers 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
Mark Lindros Parkway, Redwood Shores, California 94065 USA. This document is not warranted to be error-
Will Lyons free.
Serge Moiseev Restricted Rights Notice
Matthew Slingsby
If this documentation is delivered to the United States Government or anyone using the
Angelika Krupp documentation on behalf of the United States Government, the following notice is applicable:
ns e
Kevin Tate
U.S. GOVERNMENT RIGHTS
li c e
Takyiu Liu
a b le
The U.S. Government’s rights to use, modify, reproduce, release, perform, display, or disclose
these training materials are restricted by the terms of the applicable Oracle license agreement
Jenny Wongtangswad
and/or the applicable U.S. Government contract.
fe r
Juan Quezada
a n s
Radek Felcman
Trademark Notice
n- t r
Matt Heimer no
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be
a
Saskia Nehls a s
trademarks of their respective owners.

Juan Adauco Quezada a ) h i d eฺ


Eric Gross b c ฺc t Gu
@ ci den
Graphic Editor k i c S tu
Seema Bopaiah k o ฺra this
d r av use
Editor
i c (z to
ak
Raj Kumar
R
a vko
Zdr Publishers
Joseph Fernandez
Michael Sebastian Almeida
Jayanthy Keshavamurthy
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© 2015, 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
Practice Solution: Installing WebLogic Server ................................................................................................3-6
Practice 3-2: Patching WebLogic Server........................................................................................................3-8
Practice Solution: Patching WebLogic Server ................................................................................................3-13
Practices for Lesson 4: Creating Domains ....................................................................................................4-1
Practices for Lesson 4: Overview ...................................................................................................................4-2 nse
Practice 4-1: Creating a New Domain ............................................................................................................4-3 li c e
a
Practice Solution: Creating a new Domain .....................................................................................................4-7 b le
Practice 4-2: Copying a Domain to a New Machine .......................................................................................4-8 fe r
a n s
n- t r
Practice Solution: Copying a Domain to a New Machine ...............................................................................4-11

a no
Practices for Lesson 5: Starting Servers .......................................................................................................5-1
Practices for Lesson 5: Overview ...................................................................................................................5-2
a s
a ) h i d eฺ
Practice 5-1: Starting and Stopping Servers ..................................................................................................5-3
u
ฺc.........................................................................6-1
Practice Solution: Starting and Stopping Servers...........................................................................................5-8
c G
Practices for Lesson 6: Using the Administration Console b
ci den t
@
c for Configuration tu ..................................................................6-3
Practices for Lesson 6: Overview ...................................................................................................................6-2
i
Practice 6-1: Using the Administration k
ฺra Console
Console S
is for Configuration ..........................................................6-7
Practice Solution: Using the k o
Administration t h
av uJDBC
Practices for Lesson 7:rConfiguring
d se ....................................................................................................7-1
c (z 7: Overview
Practices for Lesson
i to...................................................................................................................7-2
k Configuring a JDBC Data Source..............................................................................................7-3
a7-1:
Practice
R
oPractice Solution: Configuring a JDBC Data Source ......................................................................................7-6
a v k
Zdr
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
Practice Solution: Working with WebLogic Server Logs.................................................................................8-7
Practice 8-2: Monitoring WebLogic Server .....................................................................................................8-8
Practice Solution: Monitoring WebLogic Server .............................................................................................8-13
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
Practice Solution: Configuring and Using Node Manager ..............................................................................9-6
Practices for Lesson 10: Deploying Applications .........................................................................................10-1
Practices for Lesson 10: Overview .................................................................................................................10-2
Practice 10-1: Deploying an Application.........................................................................................................10-3
Practice Solution: Deploying an Application ...................................................................................................10-6
Practice 10-2: Load Testing an Application ....................................................................................................10-7
Practice Solution: Load Testing an Application ..............................................................................................10-13
Practices for Lesson 11: Network Channels and Virtual Hosts ...................................................................11-1
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Oracle WebLogic Server 12c: Administration I Table of Contents


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

Practice Solution: Creating a Virtual Host ......................................................................................................11-15


Practices for Lesson 12: Clusters ..................................................................................................................12-1
Practices for Lesson 12: Overview .................................................................................................................12-2
Practice 12-1: Configuring a Cluster ..............................................................................................................12-3
Practice Solution: Configuring a Cluster .........................................................................................................12-5
Practice 12-2: Configuring a Dynamic Cluster ...............................................................................................12-6
Practice Solution: Configuring a Dynamic Cluster ..........................................................................................12-9
Practices for Lesson 13: Clusters ..................................................................................................................13-1
nse
Practices for Lesson 13: Overview .................................................................................................................13-2
li c e
Practice 13-1: Installing OHS (Optional) ........................................................................................................13-3
a b le
Practice Solution: Installing OHS (Optional) ...................................................................................................13-6
fe r
n s
Practice 13-2: Configuring a Cluster Proxy ....................................................................................................13-8
a
n- t r
Practice Solution: Configuring a Cluster Proxy ..............................................................................................13-13
no
Practice 13-3: Configuring Replication Groups ..............................................................................................13-14
a
s
Practice Solution: Configuring Replication Groups.........................................................................................13-17
a
) h i d eฺ
Practices for Lesson 14: Clusters ..................................................................................................................14-1
a
c ฺc t Gu
Practices for Lesson 14: Overview .................................................................................................................14-2
b
Practice 14-1: Configuring a Replication Channelc i en
..........................................................................................14-3
Practice Solution: Configuring a Replicationic @
Channel t u d
....................................................................................14-7
r a k s S
v k thi
oฺ.................................................................................................................15-2
Practices for Lesson 15: Transactions ..........................................................................................................15-1
e
ra Transaction
Practices for Lesson 15: Overview
d u sPersistence ......................................................................................15-3
z o
c ( ConfiguringtTransaction Persistence.................................................................................15-8
Practice 15-1: Configuring

k i
Practice Solution:
afor Lesson 16: WebLogic Server Security ....................................................................................16-1
R
Practices
o
avk Practices for Lesson 16: Overview.................................................................................................................16-2
Zdr Practice 16-1: Configuring an Authentication Provider ...................................................................................16-3
Practice Solution: 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
Practice Solution: Backing Up and Restoring a Domain ................................................................................17-6
Appendix A: Connecting to the Environment ................................................................................................18-1
Overview ........................................................................................................................................................18-2
Course Practice Environment: Security Credentials

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

Oracle WebLogic Server 12c: Administration I Table of Contents


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

nse
li c e
a ble
fe r
a ns
n- t r
Practices for o
nLesson 1:
s a
c a Guid ) haOverview
Course eฺ

c ibcChapter
e n1t

k i c@ Stud
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

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

Practices for Lesson 1: Course Overview


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

nse
li c e
a ble
fe r
a ns
n- t r
Practices for o
nLesson 2:
s a
c a Guid ) ha Server:
WebLogic eฺ Overview

c ibcChapter
e n2t

k i c@ Stud
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
Practices for o
nLesson 3:
s a
a ) ha and
Installing
i d eฺPatching
ฺc t GuServer
cWebLogic
c ib en
k i tud 3
c@ SChapter
k o ฺra this
d r av use
c ( z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c ( z to
R aki
o
avk
Zdr

Copyright © 2014, 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 then 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© 2015, 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. nse
a. Refer to the instructions in Appendix A: Connecting to the Environment to connect to li c e
your machine. a ble
fe r
b. Unless stated otherwise, you will be working within host01 for the remainder of this
a ns
practice.
n- t r
2. Rename the installation directories.
a no
a. Open a Terminal window, and navigate to /u01/app.
a s
a ) h i d eฺ
Tip: There is a launcher for a Terminal window in the panel at the top of the desktop.
$ cd /u01/app
b c ฺc t Gu
ci den
b. Rename the FMW installation directory.
@
$ mv fmw fmw-orig kic S tu
o a directory.
ฺrfmw h is
k
c. Create a new, empty t
$ mkdirdfmwr av use
o
(zthe JDK tinstallation
i c
d. Rename
k directory.
a
R $ mv jdk jdk-orig
a v k3.o Install the JDK.
Z dr 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-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.7.0_67 jdk

Copyright © 2014, 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© 2015, 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. nse
li c e
$ java –d64 -jar fmw_12.1.3.0.0_wls.jar
a ble
Extracting files.....
fe r
...
a ns
Note: If any of the installation requirements fail, continue with the installation anyway by
n- t r
no
answering y when you are asked if you want to continue. There really is not a problem; the
a
s
installer might get confused because host01 is a virtual machine.
a
a ) h i d eฺ
e. After the files are extracted, the graphical installer appears. Use the guidelines in the

b c ฺc t Gu
following table to install the software:
Step Window/Page Description @ ci den Choices or Values
i c t u
k is S This screen appears when you install the first Oracle
a. r a
Specify Oracle Inventory

Directory ko
v e th product. If it appears, enter
a
dr to u s /u01/app/oraInventory and click Next.
( z
a k ic If it does not appear, move to the next step.

k o Rb. Welcome Click Next.

dr av c. Installation Location Enter /u01/app/fmw and click Next.


Z d. Installation Type Select Complete with Examples.
Click Next.
e. Prerequisite Checks When all prerequisite checks are 100% successful,
click Next.
f. 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.
g. Installation Summary Click Install.
h. Installation Progress Note the progress and successful completion of the
installation. (This step may take several minutes.)
Click Next.
Copyright © 2014, 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 Complete Deselect Automatically Launch the Quickstart
Configuration Wizard.
Click Finish.
f. Close the Terminal window.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

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

Practices for Lesson 3: Installing and Patching WebLogic Server


Chapter 3 - Page 5
Practice Solution: 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© 2015, 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.
nse
a. Refer to the instructions in Appendix A: Connecting to the Environment to connect to
li c e
your machine.
a ble
b. Unless stated otherwise, you will be working within host01 for the remainder of this
fe r
practice.
a ns
2. Check that the preinstalled FMW directory is there. Delete the new FMW installation
n- t r
no
directory that you created. Rename the preinstalled directory back to its original name.
a
s
a. Open a Terminal window, and navigate to /u01/app. Then, list the directories to
a
a ) h i d eฺ
ensure that the fmw-orig directory is present. Check that this preinstalled directory
has valid contents.
b c ฺc t Gu
$ cd /u01/app
@ ci den
$ ls k i c S tu
fmw ... fmw-orig ...
k o ฺra this
$ ls fmw-orig
d r av use
c ( z to
cfgtoollogs coherence ...
aki
b. Ensure that you are in the proper directory. Remove the new installation directory that
R
o you created.
avk
Zdr
$ 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 ...
b. Ensure that you are in the proper directory. Remove the new installation directory that
you created.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Installing and Patching WebLogic Server


Chapter 3 - Page 6
$ pwd
/u01/app
$ rm –rf jdk
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.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

$ mv jdk-orig jdk
4. Close the Terminal window.

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c ( z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, 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.
nse
Note: If a connection for host01 is already available, you can continue to use it.
li c e
2. Access the patch zip file (p19234430_121300_Generic.zip).
a ble
a. Open a Terminal window, and navigate to /install/weblogicpatch.
fe r
$ cd /install/weblogicpatch
a ns
3. Define the PATCH_TOP environment variable. n- t r
a. a no
Define the PATCH_TOP variable and assign it the value /install/weblogicpatch.
a s
$ export PATCH_TOP=/install/weblogicpatch
a ) h i d eฺ
c yout set
b. Print the variable to the screen to make ฺsure
c G uup PATCH_TOP correctly.
$ echo $PATCH_TOP b
ci den
i c @ tu
/install/weblogicpatch k S
ฺra this environment variable.
4. Define (or redefine) theoORACLE_HOME
k e
av usenvironment,
a. In a FusionrMiddleware the ORACLE_HOME variable should point to the
z d o
( wheret WebLogic Server has been installed (/u01/app/fmw).
top directory
k i c
R a$ export ORACLE_HOME=/u01/app/fmw
o b. Print the variable to the screen to make sure you set up ORACLE_HOME correctly.
avk
Zdr $ 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.
b. Confirm the opatch executable appears in your system PATH.
$ which opatch
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Installing and Patching WebLogic Server


Chapter 3 - Page 8
/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 p19234430_121300_Generic.zip.
Note: If asked to replace an existing file, enter A for “All.”
$ unzip –d $PATCH_TOP p19234430_121300_Generic.zip
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

Archive: p19234430_121300_Generic.zip
creating: 19234430/
creating: 19234430/files/
creating: . . .
inflating:
19234430/files/oracle.fmwconfig.common.wls.shared/12.1.3.0.0/fmw
config.common.symbol/modules/com.oracle.cie.config-
wls_8.1.0.0.jar/com/oracle/cie/domain/DomainNodeManagerHelper.cl
nse
ass
li c e
inflating: 19234430/README.txt
a ble
creating: 19234430/etc/ fe r
a ns
creating: 19234430/etc/config/
n- t r
inflating: 19234430/etc/config/actions.xml
a no
inflating: 19234430/etc/config/inventory.xml
a s
a ) h i d eฺ
b. Set your current directory to the directory where the patch is located.
$ cd $PATCH_TOP/19234430
b c ฺc t Gu
ci is correct.
c. Make sure that your default directory
@ d en
$ pwd k ic S t u
r a
oฺ e thi
/install/weblogicpatch/19234430 s
v k s the patch README file.
a patch,uview
8. Before applyingrthe
z d o
t find the README file.
a. In the (patch directory,
k i c
R a$ ls README*
o README.txt
avk
Zdr b. Open the file in the editor. Briefly look at the instructions. The directions in this practice
are based on the directions in this file.
$ gedit README.txt
c. Close the editor without making any changes to the file.
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
. . .
--------------------------------------------

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

Practices for Lesson 3: Installing and Patching WebLogic Server


Chapter 3 - Page 9
There are no Interim patches installed in this Oracle Home.

--------------------------------------------
OPatch succeeded.
$
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

Note: As expected, the lsinventory output states that no interim patches are currently
installed.
10. Apply the patch.
a. Run the OPatch utility to apply the patch. When you are asked if the local system is
ready for patching, enter y.
Note: This can take a while to complete.
$ opatch apply -jdk $JAVA_HOME
Oracle Interim Patch Installer version ... nse
... li c e
a ble
fe r
Oracle Home : /u01/app/fmw
a ns
Central Inventory : /u01/app/oraInventory
n- t r
from : /u01/app/fmw/oraInst.loc
a no
a s
... a ) h i d eฺ
b c ฺc t Gu
Applying interim patch@ ci dento OH '/u01/app/fmw'
k i S tu
'19234430'
c and performing
Verifying environment
o ฺ ra this prerequisite checks...

r a vk use
All checks passed.

( z d to
i c
Please
k shutdown Oracle instances running out of this ORACLE_HOME

o Raon the local system.


r a vk (Oracle Home = '/u01/app/fmw')

Z d
Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
...
Verifying the update...
Patch 19234430 successfully applied
...
OPatch succeeded.
$
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
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Installing and Patching WebLogic Server


Chapter 3 - Page 10
Oracle Interim Patch Installer version ...
...
Oracle Home : /u01/app/fmw
Central Inventory : /u01/app/oraInventory
from : /u01/app/fmw/oraInst.loc
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

...
--------------------------------------------
Interim patches (1) :

Patch 19234430 : applied on ...


Unique Patch ID: 17945590
Patch description: "One-off"
nse
Created on 14 Aug 2014, 13:47:02 hrs Asia/Calcutta
li c e
Bugs fixed:
a ble
19234430
fe r
----------------------------------------------------
a ns
OPatch succeeded.
n- t r
$
a no
Note: This time the lsinventory output states that a
h s is oneฺ interim patch, the one
there
you just applied, 19234430.
c a ) u i de
12. (Optional) Roll back the applied patch. Ifib
ฺ occurred
cissue
an t G while applying a patch, your
system could be left in an unstable@ c withd e n
i c state,
missing. In this case, the bestkcourse of S
action
a few files already uploaded and other files
tu is to roll back the patch.
o
Note: This can take a while
k ฺrato complete.
t h is
a. Use OPatchra
v usthee patch. When you are asked whether the local system is
to roll back
d
z patching,toenter y.
ready (for
i c
R a$k opatch rollback -id 19234430 -jdk $JAVA_HOME
v k o Oracle Interim Patch Installer version ...
a
Zdr
...
RollbackSession rolling back interim patch '19234430' from OH
'/u01/app/fmw'

Please shutdown Oracle instances running out of this ORACLE_HOME


on the local system.
(Oracle Home = '/u01/app/fmw')

Is the local system ready for patching? [y|n]


y
User Responded with: Y
...
RollbackSession removing interim patch '19234430' from inventory
...
OPatch succeeded.

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

Practices for Lesson 3: Installing and Patching WebLogic Server


Chapter 3 - Page 11
$
13. (Optional) 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
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

...
--------------------------------------------

There are no Interim patches installed in this Oracle Home.

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

nse
OPatch succeeded.
li c e
$
a ble
Note: As expected, the lsinventory output states that no interim patches are installed.
fe r
The interim patch installed and subsequently rolled back is no longer there.
a ns
14. Close the Terminal window.
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c ( z to
R aki
o
avk
Zdr

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

Practices for Lesson 3: Installing and Patching WebLogic Server


Chapter 3 - Page 12
Practice Solution: 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© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c ( z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c ( z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
Practices for o
nLesson 4:
s a
c a Guid ) ha Domains
Creating eฺ

c ibcChapter
e n4t

k i c@ Stud
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, Oracle and/or its affiliatesฺ

The following is a diagram of the domain:

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, Oracle and/or its affiliatesฺ

Assumptions
You completed “Practice 3-1: Installing WebLogic Server” and the installation was successful.
Completing “Practice 3-2: Patching WebLogic Server” is not required for this practice, but it is
OK if you did it.

Tasks
1. Connect to host01.
nse
a. Unless stated otherwise, you will be working within host01 for the remainder of this
practice. li c e
2. Run the Configuration Wizard in graphical mode. a ble
fe r
a. Open a new Terminal window. Navigate to the location of the Configuration Wizard
a ns
script, the common/bin directory under the Oracle Common directory:
n- t r
/u01/app/fmw/oracle_common/common/bin.
a no
$ cd /u01/app/fmw/oracle_common/common/bin
a s
a h
Note: Remember that you can use the Tab key to) auto-complete
i d eฺ directory and file names
as you type them.
b c ฺc t Gu
b. Run the Configuration Wizard. ci en
ic @ t u d
$ ./config.sh
r a k s S
c. After the graphicalo
v k ฺ opens,
wizard
e t hi use the guidelines in the following table to create the
domain:
z d ra o us
Step c (Window/Page
i t Description Choices or Values
a. a
k
o R Create Domain Select Create a new domain.

av k Enter the Domain Location:


Z dr /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:
• Name: weblogic
• Password: Welcome1
• Confirm Password: Welcome1
Note: The password displays as ●●●●●●●●.
Click Next.
d. Domain Mode and JDK Under Domain Mode, select Production.
Copyright © 2014, 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
Under JDK, ensure that Oracle HotSpot is selected
(whatever version you have).
Click Next.
e. Advanced Configuration Select Administration Server and Managed
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

Servers, Clusters, and Coherence.


Click Next.
Note: Although Node Manager can be set up at this
time, you will wait to configure it after it has been
discussed.
f. Administration Server Enter or select these values for the following fields:
• Server Name: AdminServer e
• Listen Address: host01.example.com c e ns
• Listen Port: 7001 le li
r a b
• Enable SSL: Deselected
ns fe
• SSL Listen Port: (Disabled) t r a
no
Click Next. n-
a
g. Managed Servers
h asvalues
Click the Add
select )these
button. Then, in the row, enter or
eforฺ the following fields:
a i d
uName: server1
b c ฺc• Server
t G
@ ci d•enListen Address: host01.example.com
k i c S tu • Listen Port: 7011
k o ฺra this
d r av use • Enable SSL: Deselected

ic (
z to • SSL Listen Port: (Disabled)

a k Click the Add button again. Then, in the row, enter or


o R select these values for the following fields:
av k • Server Name: server2
Z dr
• 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
• 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
right arrow button.
Do the same thing to move server2 under
Copyright © 2014, 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
cluster1.
The Clusters column should look like this:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

Click Next.
j. Machines Click the Machine tab.
Click the Add button. Then, in the row, enter or
select these values for the following fields:
• Name: machine1
nse
• Node Manager Listen Address: li c e
r a ble
host01.example.com
• Node manager listen port: 5556
n s fe
Click the Add button again.
- t r a in the row, enter or
Then,
onthe following fields:
select these values for
n
a
• Name: machine2
s
a
h Manager
• ) Node eฺ Listen Address:
a u i d
b c ฺc host02.example.com
t G
@ ci d•enNode manager listen port: 5556
k i c S u Next.
tClick
k. k o
Assign Servers
ฺtoraMachines
t h is Under Machines, select machine1. Then under
d r av use Servers, select AdminServer and click the right
( z t o arrow button.
a k ic Under Machines, ensure machine1 is still selected.
o R Then under Servers, select server1 and click the
av k
Z dr right arrow button.
Under Machines, select machine2. Then under
Servers, select server2 and click the right arrow
button.
The Machines column should look like this:

Click Next.
l. Configuration Summary Review the domain.
Click Create.

Copyright © 2014, 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
m. Configuration Progress When the progress bar reaches 100%, click Next.
n. Configuration Success Click Finish.
d. The Configuration Wizard closes. Close the terminal window.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

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

Practices for Lesson 4: Creating Domains


Chapter 4 - Page 6
Practice Solution: 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© 2015, Oracle and/or its affiliatesฺ

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

Solution Tasks
1. Connect to host01. If you partially completed the practice, delete the domain directory you
created.
a. Open a Terminal window and navigate to the parent directory of the domain directory.
Then remove the domain directory.
nse
$ cd /u01/domains/part1
li c e
$ rm –rf wlsadmin
a ble
Warning: This command permanently deletes the directory, all its subdirectories, and files.
fe r
Use with caution.
a ns
Note: If you did not start the practice, there is no domain directory to delete.
n- t r
2. Run the solution script.
a no
a s
a. In a Terminal window, navigate to the practice directory.
a ) h i d eฺ
ฺc t Gu
$ cd /practices/part1/practice04-01
b. Run the solution script. b c
@ ci den
$ ./solution.sh
Note: This script starts thera k ic Scripting
S tu Tool (WLST) passing it the WLST script
o ฺ WebLogic
t h isthe new domain for you. The WLST script prints out
create_domain.py, k which creates
aitvwrites uthesedomain, it can take some time, so be patient and do not close
messages. When
d r
the Terminal
i c to you see the message:
(zwindow until
k
a>>>Domain created successfully at /u01/domains/part1/wlsadmin
R
3.o Close the Terminal window.
avk
Zdr

Copyright © 2014, 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© 2015, 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.
nse
2. Create a managed server template by using the pack utility and the domain you just
created. li c e
a. Open a Terminal window and navigate to the location of the pack.sh script. a ble
fe r
$ cd /u01/app/fmw/oracle_common/common/bin
a n s
b. Run the pack.sh script with the options to use your domain and
n r
-tcreate a managed
server template in your home directory: n o
s ahere
Note: Enter the command on one line. It is on multiplealines due to space limitations.
h e ฺ
ฺ c a) Guid
$ ./pack.sh –domain=/u01/domains/part1/wlsadmin

i bc ent
-template=/home/oracle/managedserver.jar
c
i c @ tud
-template_name=wlsadmin_managed
r a k
-managed=true
ฺ i s S
<< read domain
v kofrom e th
"/u01/domains/part1/wlsadmin"
a
dr tread s
u domain from "/u01/domains/part1/wlsadmin"
z
>> succeed:
( o
a kic succeed: write template to "/home/oracle/managedserver.jar"
..............................................

o R >>

r a vk << close template


Z d >> succeed: close template
$
3. Send 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 SFTP to put the JAR file on host02. You use the username oracle. If you are
warned about the authenticity of host02 and asked if you want to continue, enter yes. If
asked for the password of the user, it is also oracle.
$ sftp oracle@host02.example.com
Connecting to host02.example.com...
The authenticity of host...
...
Are you sure you want to continue connecting (yes/no) ? yes
...
sftp> cd /home/oracle
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Creating Domains


Chapter 4 - Page 8
sftp> pwd
Remote working directory: /home/oracle
sftp> put managedserver.jar
Uploading managedserver.jar to /home/oracle/managedserver.jar
managedserver.jar 100% ...
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

sftp>
c. Exit SFTP.
sftp> bye
$
d. Close the Terminal window.
4. Connect to host02.
a. Unless stated otherwise, you will be working within host02 for the remainder of this
practice. nse
5. Create a copy of the domain on host02 by using the unpack utility. li c e
a. Open a Terminal window. Verify that the domain does not already exist on this host. a ble
fe r
$ ls /u01/domains/part1
a ns
$
n- t r
no
Note: Nothing displays because there are currently no files or directories there.
a
b. Navigate to the location of the unpack.sh script. a s
a ) h i d eฺ
cฺc tonuse Gtheumanaged server template to
$ cd /u01/app/fmw/oracle_common/common/bin
c. Run the unpack.sh script with theib options t
i c @c tude
create your domain on this host.
Note: Enter the commandron
ฺ a kone line.
i s ItSis on multiple lines here due to space limitations.
o t h
vk –domain=/u01/domains/part1/wlsadmin
$ ./unpack.sh
d r a u se
(z to -template=/home/oracle/managedserver.jar
<<icread template from "/home/oracle/managedserver.jar"
k succeed: read template from "/home/oracle/managedserver.jar"
a>>
o R
av k << set config option DomainName to "wlsadmin"
Z dr >> succeed: set config option DomainName to "wlsadmin"
<< write Domain to "/u01/domains/part1/wlsadmin"
....................................................
>> succeed: write Domain to "/u01/domains/part1/wlsadmin"
<< close template
>> 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.

6. Check out the 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
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Creating Domains


Chapter 4 - Page 9
bin fileRealm.properties lib security startWebLogic.sh
...
$ cd bin
$ ls
nodemanager setDomainEnv.sh ...
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

...
7. Close the Terminal window.

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

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

Practices for Lesson 4: Creating Domains


Chapter 4 - Page 10
Practice Solution: 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© 2015, Oracle and/or its affiliatesฺ

Solution Tasks
1. Connect to host02.
Note: Notice you are going to host02 (not host01).
2. If you partially completed the practice, delete the domain directory on host02. (If you did not
start the practice, skip this task.)
Note: Do not delete the domain directory on host01.
nse
a. Open a Terminal window and navigate to the parent directory of the domain directory.
li c e
Then remove the domain directory.
a ble
$ cd /u01/domains/part1
fe r
$ rm –rf wlsadmin
a n s
Warning: This command permanently deletes the directory, all itsn -t r
subdirectories, and files.
Use with caution. n o
s a to delete.
a
h ideฺ
Note: If you did not start the practice, there is no domain
)
directory
3. Run the solution script. a u
ฺc directory.
G
b c t
a. In a Terminal window, navigate to the
@ ci denpractice
i c
$ cd /practices/part1/practice04-02
k S tu
b. Run the solution script.
k o ฺra this
$ ./solution.sh
r a v use
d
z runs tthe
Note: This(script o unpack utility, which uses a previously created managed server
k i
template,c to create the domain on host02. The command can take a little while, so wait for
R
theamessages that unpack succeeded in writing the domain and that the template file was

a v ko closed, before you close the Terminal window.


Z dr 4. Close the Terminal window.

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

Practices for Lesson 4: Creating Domains


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

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

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

Practices for Lesson 4: Creating Domains


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

nse
li c e
a ble
fe r
a ns
n- t r
Practices for o
nLesson 5:
s a
c a Guid ) ha Servers
Starting eฺ

c ibcChapter
e n5t

k i c@ Stud
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

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

Practices for Lesson 5: Starting Servers


Chapter 5 - Page 1
Practices for Lesson 5: Overview
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.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

Copyright © 2014, 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
password each time you start and stop the server. You start a managed server by using the
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

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.

Tasks
nse
1. Connect to host01. li c e
a. Unless stated otherwise, you will be working within host01 for the remainder of this
a ble
practice. fe r
2. Start the administration server by using the script supplied with the domain. a ns
n- t r
startWebLogic.sh script. a no
a. Open a Terminal window and navigate to the domain directory. Then run the

a s
$ cd /u01/domains/part1/wlsadmin
a ) h i d eฺ
$ ./startWebLogic.sh
b c ฺc t Gu
Note: Remember that you can use the i key etonauto-complete directory and file names
cTab
as you type them.
k i c @
S tud
b. When prompted for the
k o ฺrausername,
t h is enter weblogic. When prompted for the password,
av use
enter Welcome1:
... zdr
i c ( usernametoto boot WebLogic server: weblogic
k
Enter
aEnter
o R password to boot WebLogic server: Welcome1
av k
Z dr ...
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>
Note
− 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
window, if you want.
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

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

Practices for Lesson 5: Starting Servers


Chapter 5 - Page 3
b. Create the security subdirectory under the AdminServer directory:
$ mkdir security
c. Create a text file in this security directory called boot.properties and edit it. In this
example, the gedit text editor is used.
$ cd security
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

$ gedit boot.properties
d. Add the following two lines to the file:
username=weblogic
password=Welcome1

nse
e. Save the file (select File > Save, or click Ctrl + S). Close the text editor. li c e
f. Leave the terminal window open for the next task. a ble
fe r
4. Stop the administration server and restart it. Observe the server’s use of the boot identity a ns
file. n- t r
a no
a. In the Terminal window, navigate to the bin directory under the domain directory, and
a s
run the script to stop the administration server:
a ) h i d eฺ
$ cd /u01/domains/part1/wlsadmin/bin
b c ฺc t Gu
$ ./stopWebLogic.sh
@ ci den
Note
k i c S tu
k o ฺrausestthe
− Notice that the script
h isWebLogic Scripting Tool (WLST).
− You can also
d r se by pressing Ctrl + C in the window in which it is running.
av stop auserver
b. When (the
i c to finishes, find the Terminal window in which the administration
z stop script
a k
server was running. You can see that it has been shut down. Close this window.
o R Return to the other Terminal window, navigate to the domain directory, and once again
c.
r a vk run the script to start the administration server:
Z d $ cd /u01/domains/part1/wlsadmin
$ ./startWebLogic.sh
...
Note: This time you are not prompted for the username and password.
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>
Note
− If you look through the messages in the window, you can see the message about
storing the boot identity: <Storing boot identity in the file: ...>. It
was at this point that the server found the boot.properties file, used the
credentials in it, and because those credentials were valid, encrypted the credentials
and copied over the plain text in the file.
− You may have noticed that the stop script you used earlier did not prompt you for
the username and password. That script normally does, but it too can use the

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

Practices for Lesson 5: Starting Servers


Chapter 5 - Page 4
boot.properties file. It, however, does not encrypt the username and password,
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,
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

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 weblogic. When prompted for the password,
enter Welcome1:
nse
... li c e
Enter username to boot WebLogic server: weblogic
a ble
fe r
Enter password to boot WebLogic server: Welcome1
a ns
Note: The password does not display.
n- t r
a no
c. Messages will appear in the window. When the server successfully completes its
startup process, it writes the following message to the window:
a s
<The server started in RUNNING mode>
a ) h i d eฺ
Note
b c ฺc t Gu
ci den
− To remember that this is the window in which server1 is running, you might want to
@
i c tu
change the title of the Terminal window. In the window’s menu, select Terminal,
k S
k o ฺra this
and then Set Title. Enter the title of server1 and click OK.
− If you close
d r ayou u sein which a server is running, you kill the server. Minimize the
vthe window
(z
window, if to
want.
−kiIfcyou want to skip being prompted for the username and password when starting
o Ra this server too, create a boot.properties file for it as you did for the
r a vk administration server. (Create the security directory under the server1 directory
Z d and create a new boot.properties file there.)
d. Leave the managed server running.
e. Minimize the host01 desktop window to use it later.
6. Start a managed server on the other host, host02.
a. Connect to host02.
b. Open a Terminal window, navigate to the bin directory under the domain directory,
and run the script to start the managed server called server2:
$ cd /u01/domains/part1/wlsadmin/bin
$ ./startManagedWebLogic.sh server2 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.
c. When prompted for the username, enter weblogic. When prompted for the password,
enter Welcome1:
...
Enter username to boot WebLogic server: weblogic
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Starting Servers


Chapter 5 - Page 5
Enter password to boot WebLogic server: Welcome1
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>
Note
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

− 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.
7. Add a new JAR file to the CLASSPATH of all servers.
nse
a. Return to the host01 desktop.
li c e
Note: If you closed the window, then you must open it again.
a ble
b. Open a new Terminal window and copy the JAR file from the current practice directory
fe r
to the /home/oracle directory.
a ns
$ cd
n- t r
$ cp /practices/part1/practice05-01/sample.jar .
a no
a s the setUserOverrides.sh
c. Navigate to the bin directory of the domain and create
file. a ) h i d eฺ
c ฺcis invokedG u the setDomainEnv.sh script if
Note: The setUserOverrides.sh b file t
ctoi set environmental
en
by

i @
the file exists. It is a best practice
t u d
cdirectly toSWebLogic changes in the override file
instead of making changes k Server startup scripts. This avoids
a hiswhen new domain templates or Oracle product
ฺroverwritten
your changes getting
v k o e t
installations a
are
dr to u s
introduced that affect your domains.
z
$ cd (/u01/domains/part1/wlsadmin/bin
c setUserOverrides.sh
$kigedit
R a
a v ko d. Add the following line to the file:

Zdr
$ export PRE_CLASSPATH=/home/oracle/sample.jar
e. Save the file and exit the editor.

8. Use SFTP to copy the updated script and the JAR file to the other host.
a. In the same Terminal window, start SFTP and copy the updated script to other host
(replacing the script that is there). Also, put the JAR file onto the other host (in the
same relative location).
$ sftp oracle@host02.example.com
Connecting to host02.example.com...
sftp> cd /u01/domains/part1/wlsadmin/bin
sftp> pwd
Remote working directory: /u01/domains/part1/wlsadmin/bin
sftp> put setDomainEnv.sh
Uploading setDomainEnv.sh to ...
setDomainEnv.sh 100% ...
sftp> cd /home/oracle
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Starting Servers


Chapter 5 - Page 6
sftp> pwd
Remote working directory: /home/oracle
sftp> put /home/oracle/sample.jar
Uploading /home/oracle/sample.jar to /home/oracle/sample.jar
/home/oracle/sample.jar 100% ...
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

sftp> bye
$
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 weblogic and Welcome1, respectively.
$ cd /u01/domains/part1/wlsadmin/bin
nse
$ ./stopManagedWebLogic.sh server1 host01.example.com:7001 li c e
... a ble
fe r
Note: Notice that this script takes two parameters: the name of the managed server and the
a ns
URL for the domain’s administration server.
n- t r
a no
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
a s
a ) h i d eฺ
prompted for the username and password, enter weblogic and Welcome1,
respectively.
b c ฺc t Gu
ci den
$ cd /u01/domains/part1/wlsadmin/bin
@
i c tu
$ ./startManagedWeblogic.sh server1 host01.example.com:7001
k S
...
k o ฺra this
d r av use
<The server started in RUNNING mode>
(z to
c. Leave the window open in which the server is running.
c
aki
10. Notice the CLASSPATH update.
R
o a. Scroll up in the window in which the server is running until you find the print out of the
avk
Zdr
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.
Note: Only one server was stopped and restarted, so only that server picked up the
addition to the CLASSPATH. The others will pick it up the next time they are stopped and
started again. Because the JAR file code is not used by anything, it does not matter that the
other servers do not yet have access to it.

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

Practices for Lesson 5: Starting Servers


Chapter 5 - Page 7
Practice Solution: 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© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

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

Practices for Lesson 5: Starting Servers


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

nse
li c e
a ble
fe r
a ns
n- t r
Practices for o
nLesson 6: Using
s a
c a Guid ) ha eฺ
the Administration Console

c ibcChapter
e n6t

k i c@ Stud
k o ฺra this
d r av use
c ( z to
R aki
o
avk
Zdr

Copyright © 2014, 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
Practices Overview
In this practice, you access the WebLogic Server administration console. You then use the
console to create and configure some domain resources.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c ( z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, 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 nse
1. Connect to host01. li c e
2. Access the WebLogic Server administration console from the host01 machine. a ble
fe r
a. On the host01 machine, click the Mozilla Firefox web browser icon in the launch bar
a ns
near the top of the screen.
n- t r
Note: You can make Firefox the default browser if you want to.
a no
s
b. In the web browser, enter the URL to the administration console:
a
http://host01.example.com:7001/console
a ) h i d eฺ
c ฺcUsernameG uas weblogic and Password as
c. On the console welcome page, enter
Welcome1. Then click the Login c
i bthe
button. den
t
@
ic the u
tpassword
ฺ r k
Note: You can have Firefoxaremember
i s S if you want to.
d. Look at the layout
v e th
koof thesadministration console.
− At the dtopa
r left isotheuChange Center.
(
− iBelow
z
c that is thet Domain Structure (the hierarchy of domain resources).
k
a− The large area to the right displays information about the element selected in the
o R
av k Domain Structure.
Z dr − 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.
e. Notice the message at the top: “Settings updated successfully.”
4. Update the configuration of an existing domain resource.

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

Practices for Lesson 6: Using the Administration Console


Chapter 6 - Page 3
a. Lock the configuration. In the Change Center, click the Lock & Edit button.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

b. In the Domain Structure, expand Environment (click the “+” sign) and then select
Servers.

nse
li c e
a ble
fe r
c. On the right, in the Servers table, select AdminServer(admin) in the Name column. a ns
n- t r
d.
no
When “Settings for AdminServer” is displayed, click the Logging tab. Ensure that the
General subtab is selected. a
a s
e.
a ) h i d eฺ
Scroll down to find the “Rotation file size” field. Enter 7500.
f. Click the Save button.
b c ฺc t Gu
Note: Notice the message at the top: c i
“Settings en successfully.” Also notice in the
Change Center that the buttonsic have u dupdated
@ beentmodified.

g. In the Change Center, r a k is SChanges.
click Activate
a v ko se th
( z dr to u
a kic
k oR
dr av
Z

Note
− 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.
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.

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

Practices for Lesson 6: Using the Administration Console


Chapter 6 - Page 4
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
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

a. Create a New Enter or select these values for the following fields:
Server: Server • Server Name: server3
Properties
• Server Listen Address: host02.example.com
• Server Listen Port: 7013
• Should this server belong to a cluster? Select
Yes, make this server a member of an
nse
existing cluster.
li c e
• Select a cluster: cluster1
a ble
Click Next. fe r
a ns
b. Create a New Review the choices made.
n- t r
Server: Review
Choices
Click Finish.
a no
a s have
Note: Although the new server has been saved, thehchanges
a ) i d eฺ not yet been activated.
c ฺcwith thisthas
That means they are pending, and the configuration
G u actually been updated. You
not
c i b
have decided not to update the configuration
e n new server at this time.
e. In the Change Center, clickc
i @ All Changes.
Undo tu d
k
ฺra this S
k o
d r av use
i c (z to
k
o Ra
r a vk
Z d
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.
a. Return to the Logging > General page of the admin server. Scroll down to find the
“Rotation type” field. It is currently set to: By Size. Notice to the right of this (and
every) field there is a short description of the field. At the end of the description of the
“Rotation type” field is a link: More info… To learn more about how log files can be
rotated, click that link.
b. The More info… link takes you to the administration console help on the appropriate
field. The help opens in a new browser window (or tab).
c. Read a little about log file rotation. Then close the window (or tab).

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

Practices for Lesson 6: Using the Administration Console


Chapter 6 - Page 5
d. Back on the administration console, ensure that you are still on the Logging > General
tabs of the admin server. Click the Help link (at the top). Notice the help is context
sensitive, and you are taken to help about server logging.
e. On the left of the help text, find the Contents tab. Ensure that it is selected and look
around the help contents. Select some other help topic of interest.
f. Notice the other tab: Search. Click the Search tab. Enter gridlink in the Search field
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

and click the Go button. Notice all the topics that display below the field. Select one
and you are taken to that help content.
g. Close the help window (or tab).

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

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

Practices for Lesson 6: Using the Administration Console


Chapter 6 - Page 6
Practice Solution: 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© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c ( z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c ( z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
Practices for o
nLesson 7:
s a
c a Guid ) ha
Configuring ฺ
eJDBC

c ibcChapter
e n7t

k i c@ Stud
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, 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 nse
1. Connect to host01. li c e
2. Open the WebLogic Server administration console. a ble
fe r
3. Create a generic JDBC data source.
a ns
a. Lock the configuration. In the Change Center, click the Lock & Edit button.
n- t r
no
b. In the Domain Structure, expand Services (click the “+” sign) and then select Data
a
Sources.
a s
) h i d eฺ
c. On the right, above the Data Sources table, click the New button and select Generic
a
Data Source.
b c ฺc t Gu
ci den
d. The “create a data source” wizard starts. Use the guidelines in the following table to
@
i c
create a new generic data source:
k S tu
Step k o ฺra this
Window/Page Choices or Values
a v s e
( z dr to u
Description

a ka.ic Create a New JDBC Enter or select these values for the following fields:
Data Source: JDBC
R • Name: datasource1

a v ko Data Source
Properties (page 1) • JNDI Name: datasource1
Zdr • 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: • Database Name: orcl
Connection
Copyright © 2014, 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 Note: That is a lowercase “L” on the end.
• Host Name: host02.example.com
• Port: 1521
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

• Database User Name: oracle


• Password: Welcome1
• Confirm Password: Welcome1
• oracle.jdbc.DRCPConnectionClass: (leave blank)
Click Next.
e. Create a New JDBC Click the Test Configuration button.
Data Source: Test nse
Database
When the message “Connection test succeeded.”
displays, click Next. li c e
Connection
Note: If the test fails, click the Back button and check a ble
fe r
your entries. Correct any mistakes and come back to
a ns
this page and try the test again.
n- t r
f. Create a New JDBC
Data Source: Select a no
Under Clusters, select cluster1.
s
Ensure that All servers in the cluster is selected.
a
Targets
) h
Click Finish.
a i d eฺ
b c ฺc t Gu
e. In the Change Center, click Activate
@ c“Alli changes
Changes.
d enhave been activated. No restarts are
Note: Notice the message at thectop:
k i S u
tand targeted without having to restart the
necessary.” This data source
r a was created
oฺ e thi s
affected servers.
v k
ra name
f. Verify thedJNDI uiss
set on the servers in the cluster. Expand Environments, click
(
Servers,z t o
click server1, and click View JNDI Tree. You should see datasource1 as an
a kic in the list. Repeat for server2.
entry
R the new generic data source.
4.o Tune
k
av Note: The scenario for the database is this:
Zdr − 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.
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:
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Configuring JDBC


Chapter 7 - Page 4
Step Field and Value Reason
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
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

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.
c. Minimum Capacity: 1 The same as the initial capacity
Note: This number is used in pool shrinking
calculations.
nse
d. Statement Cache Type: LRU This algorithm keeps statements used frequently
li c e
in the cache.
a b le
e. Statement Cache Size: 15 The cache size value from the DBA fe r
n s
e. Click Save.
n - tra
f. Click Advanced. Use the guidelines in the following tablentooset the rest of the
connection pool attributes:
s a
Step Field and Value ) a
h ideฺ Reason
a
ฺc t TestG u
a. i
Test Connections On Reserve:b c connections before they are
n distributed
c d e
Selected
k i c@ Stu
b. ฺra240 this
Test Frequency:
k o Test unused connections every four
minutes
r a v use
c. ( z d totoTrust an Idle Pool
Seconds Trust idle connections for one minute
k i c Connection: 60
Ra d.
a v ko Shrink Frequency: 300 Allow the database to shrink every
five minutes
Zdr 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 © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Configuring JDBC


Chapter 7 - Page 5
Practice Solution: 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© 2015, 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
nse
Machine,” and then start the servers in the domain, you can still run this solution.
li c e
Solution Tasks a ble
fe r
1. Connect to host01.
a ns
2. Run the solution script.
n- t r
no
a. Open a Terminal window and navigate to the practice directory.
a
$ cd /practices/part1/practice07-01
a s
b. Run the solution script. a ) h i d eฺ
$ ./solution.sh
b c ฺc t Gu
i
cScripting en (WLST) passing it the WLST script
@
Note: This script starts the WebLogic
ic creates u dTool
t the new generic data source for you. The
create_data_source.py,k which S
r a s
WLST script prints out o
v k ฺ
messages.
e thBei patient and do not close the Terminal window until
ra o us
you see these messages:
... (zd
k i c sourcet created successfully!
R a >>>Data

vk o
r a Exiting WebLogic Scripting Tool.
Zd 3. Close the Terminal window.

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

Practices for Lesson 7: Configuring JDBC


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

nse
li c e
a ble
fe r
a ns
n- t r
Practices for o
nLesson 8:
s a
c a Guid ) ha aeDomain
Monitoring ฺ

c ibcChapter
e n8t

k i c@ Stud
k o ฺra this
d r av use
c ( z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c ( z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, 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.
nse
2. Open the WebLogic Server administration console.
li c e
3. In the admin console, locate the server log file for server1.
a ble
a. In the Domain Structure, expand Diagnostics (click the “+” sign), and then select Log
fe r
Files.
a ns
b. In the Log Files table, select the ServerLog option for server1. Then click the View
n- t r
button.
a no
s
Note: If you do not see this log on the first page of the table, click the Next link.
a
c. The Server Log Entries table displays. a ) h i d eฺ
b c ฺc t Gu
Note: There may be no rows in the table. The table settings determine what to display.
@ ci den
d. Click the Customize this table link.
k i c S tu
k o ฺra this
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
r av use
change the Number of rows displayed per page to 25 (or a number of your choice).
d
f. c (z to
Click the Apply button.
g.
R aki
Select the option button next to a message and click the View button to see the details
o
avk
of one of the messages.

Zdr h. Use the breadcrumbs at the top of the page to go back to the log by clicking Server
Log.

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.

4. In a Terminal window, navigate to the location of the log file and edit it. Use the editor to
search the log file.
a. Open a Terminal window and navigate to the logs directory under the server1
directory. List the directory contents.
$ cd /u01/domains/part1/wlsadmin/servers/server1/logs
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Monitoring a Domain


Chapter 8 - Page 3
$ ls
access.log diagnostic_images server1.log
Note: There may be more files and directories in your logs directory than listed here.
b. Open the server1.log file in an editor.
$ gedit server1.log
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

c. Use the search capabilities of the gedit editor to find messages placed in the log by the
JDBC subsystem. Press Ctrl + F to use the editor’s search capabilities. Enter <jdbc>
in the search field and click the Find button.
d. Read the first found message. Continue to click the Find button and look at other from
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.
nse
5. Use the admin console to create a log filter. li c e
Note: Here is the scenario: Let us say that you are having issues with server2 and
a ble
clustering. You want to temporarily have server2 only publish messages from the Cluster fe r
subsystem into its log, so it is easier to look through the log and find the problem. You a ns
create and apply a log filter that accomplishes this. n- t r
a. In the Change Center, click Lock & Edit. a no
b. In the Domain Structure, select the domain, wlsadmin.
h a s ฺ
a ) i d e
c. Click the Configuration tab and then the
c ฺcLog Filters
G usubtab.
d. Above the Log Filters table, click c i
the bNew t
en Click OK.
button.
ic @
e. For the name of the filter, enter t u d
clusterfilter.
r a k s S
v k oฺ click
f. In the Log Filters table,
e t hiname of the new filter, clusterfilter.
the
ra o utab
g. On the Configuration
d s of the filter, click the Add Expressions button.
h. Enter (
c z t values for the following fields, and then click OK:
or select these
k i
o Ra− Message Attribute: SUBSYSTEM
r a vk − Operator: LIKE

Z d − 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.
Note
− 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.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Monitoring a Domain


Chapter 8 - Page 4
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.
Note
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

− 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
restarted.
j. Click the Save button.
k. In the Change Center, click Activate Changes.
7. Check that the filter is working. First, stop and restart server2, then go look at the server2
log file.
nse
a. In the admin console, in the Domain Structure, expand Environment, then select li c e
Servers. Click the Control tab.
a ble
b. Select the check box next to server2. Then click the Shutdown button and select fe r
Force Shutdown Now. a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c. When (asked
i c to the shutdown, click Yes.
z to confirm
k
d. aConnect to host02.
R
a v ko 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
Zdr command you used to previously start it, and pressing Enter.

Note
− 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.
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.*
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Monitoring a Domain


Chapter 8 - Page 5
server2.log server2.log00001
Note: You may have more than one older server2 log file. The newest server log file has no
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
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

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.
...
####<Feb 22, 2013 11:57:06 AM UTC> <Info> <WebLogicServer>...
####<Feb 22, 2013 11:57:27 AM UTC> <Notice> <Cluster>...
####<Feb 22, 2013 11:57:36 AM UTC> <Info> <Cluster>...
nse
...
li c e
####<Feb 22, 2013 11:57:37 AM UTC> <Info> <Cluster>...
r a ble
Note: The timestamps in your log file will be different. The severity levels mayfe be different.
n s
j. Exit the editor.
n - tra
k. Close the Terminal window.
a no
8. Remove the filter from server2.
h a s ฺ
a )
Note: A filter like this would only be used temporarily. After i d
youeremedied whatever the
cluster issue was, you would remove the filter. c
cฺproblems
WithoutG u
the usual messages going to the
c
server log, it would be difficult to debug i b
new e n t as they arise.
a. Return to the web browseriwith @
c the S u d
t console.
admin
r a k s
b. In the Change Center,
v k oฺ clicke thi Environment
Lock & Edit.
c. In the Domain
d r a Structure,
u sexpand and then select Servers.
z table,
d. In the (servers
i c toselect server2.
k the Logging tab. Ensure that the General subtab is selected.
e. aClick
R
o f. Click Advanced.
a v k
Zdr
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 © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Monitoring a Domain


Chapter 8 - Page 6
Practice Solution: 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© 2015, 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
nse
b. Run the solution script. li c e
$ ./solution.sh
r a ble
Note: This script starts the WebLogic Scripting Tool (WLST) passing it the WLST
n s fe script
create_logfilter.py, which creates the log filter. It does not apply
- t r a
the filter, because

n o n
this filter is removed at the end of the practice. Also note that the WLST script does not
change any server2 log settings that would require a serverarestart, nor are those settings
necessary. a s
3. Close the Terminal window. a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
i c (z to
R ak
o
avk
Zdr

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

Practices for Lesson 8: Monitoring a Domain


Chapter 8 - Page 7
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© 2015, 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.
nse
2. Access the WebLogic Server administration console.
li c e
3. Use the admin console to monitor server health.
a ble
a. In the Domain Structure, expand Environment (click the “+” sign), and then select
fe r
Servers.
a ns
b. Before doing anything else, notice the Servers table. By default it displays each
n- t r
using the Customize this table link. a no
server’s state and health. Other columns of information can be added to the table by

a s
c. In the Servers table, select server2.
a ) h i d eฺ
c ฺc t Gu
d. Click the Monitoring tab. Ensure that the General subtab is selected. Notice the
b
ci den
information available, such as when the server started, the version of WebLogic
@
i c tu
Server, which JVM and version WebLogic Server is running under, the operating
k S
k o ฺra this
system and version, and so on.

d r av use
e. Click the Health subtab under the Monitoring tab. Some of the WebLogic Server
subsystems are listed along with their health.
c ( z to
aki
f. Stay on the Monitoring tab of the server for the next task.
4.
o R
Modify the information displayed by a monitoring table. You will use this table later.
avk a. Click the JDBC subtab under the server’s Monitoring tab.
Zdr 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.
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
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Monitoring a Domain


Chapter 8 - Page 8
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
environment variables and run the script that sets up the database.
Note: The ORACLE_HOME variable needs to point to where the database is installed.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

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
$ ./setup.sh
...
1 row created
nse
li c e
Commit complete.
a ble
fe r
...
a ns
$
n- t r
a no
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
a s
a ) h
sequence exist. Ignore those messages if you see them.
i d eฺ
b c ฺc t Gu
b. Now, run the script that calls the Java client. When you run the script, you pass it the

@ ci den
number of times you want it to access the database. The first time it accesses the
database, it prints out some data it retrieves. It then loops, accessing the database, in
k i c S tu
o ฺra this
total, the number of times you entered. The client then pauses. You let the client wait,
still running, and go see what is happening with the data source.
k
r av use
Important: The number you enter when you run the script should be TWO TIMES the
d
( z to
Maximum Capacity you made note of earlier. Why double it? Because the data source is
c
R aki
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
o
avk connection pool Maximum Capacity.
Zdr 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...
...
This client is still running...
When you are ready to stop it, press Enter.

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

Practices for Lesson 8: Monitoring a Domain


Chapter 8 - Page 9
Note: Do NOT press Enter yet!
c. Go back to the admin console on host01.
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
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

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.
7. View the kinds of messages that the JDBC subsystem places in a server log.
a. Open a Terminal window and navigate to the logs directory under the server2
directory. Edit the server log. nse
li c e
$ cd /u01/domains/part1/wlsadmin/servers/server2/logs
a ble
$ gedit server2.log
fe r
b. In the editor, scroll all the way to the bottom of the log file. Then use the search
a ns
capabilities of the gedit editor to find messages placed in the log by the JDBC
n- t r
a no
subsystem. Press Ctrl + F to use the editor’s search capabilities. Because you are at
the end of the file, select Search backwards. Enter <jdbc> in the search field and
a s
click the Find button.
a ) h i d eฺ
b c ฺc t Gu
c. You should see some messages that connections have been closed. This happened
ci den
when the client stopped running earlier.
@
i c tu
####...<JDBC>...<Connection for pool "datasource1" has been
k S
closed.>
k o ฺra this
d r av use
d. Close the Find window. Close the editor.
8.
c (z to
Use the admin console to enable JDBC debugging. This increases the number of

aki
messages about JDBC sent to the server log.

o R
a. Go back to the admin console on host01.

avk b. In the Change Center, click Lock & Edit.


Zdr 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.
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
...
>>>Obtained initial context
>>>Data source named datasource1 retrieved

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

Practices for Lesson 8: Monitoring a Domain


Chapter 8 - Page 10
>>>Querying data source...
Contacts from database:
1 Homer Simpson 742...
...
This client is still running...
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

When you are ready to stop it, press Enter.

$
10. View the server2 log to see the debug messages.
a. In a Terminal window, navigate to the logs directory under the server2 directory and
edit the server log.
$ cd /u01/domains/part1/wlsadmin/servers/server2/logs
nse
b.
$ gedit server2.log
In the editor, scroll all the way to the bottom of the log file. Then use the search li c e
capabilities of the gedit editor to find debug messages placed in the log by the JDBC a ble
subsystem. Press Ctrl + F to use the editor’s search capabilities. Because you are at fe r
the end of the file, select Search backwards. Type <debug> in the search field and a ns
click the Find button. n- t r
Note a no
a s
a ) h i d eฺ
− Notice that there are many messages of the “debug” severity level. They are from
various JDBC-related subsystems.
b c ฺc t Gu
ci den
− The “info” level messages you found before from the JDBC subsystem, about
@
k i S tu
connections closing, are still there. In addition, there are quite a few debug
c
k o ฺra this
messages around each one of those.
− As you are editing this file, the editor may interrupt you with a message that the file
d r av use
has “changed on disk” and ask if you want to reload the file. You can reload it if you
(z to
want to. Because many debug messages are being sent to the log, it is possible that
c
R akithe file changes as you are viewing it.
o c. See whether you can find debug messages that show connection testing. Scroll to the
avk
Zdr
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.
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.
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.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Monitoring a Domain


Chapter 8 - Page 11
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
opens in a new window (or tab).
c. In the Monitoring Dashboard View List, expand server2. Select the view JDBC Data
Sources on server2.
d. Above the view list, press the Start button ( ).
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

e. In a Terminal window on host02, navigate to the practice directory and run the script to
call the Java database client. When the client is waiting, do not press Enter, let it
continue to run.
$ cd /practices/part1/practice08-02
$ ./runclient.sh 10
...
This client is still running...
nse
When you are ready to stop it, press Enter. li c e
f. Return to the Monitoring Dashboard. You should notice changes in the “datasource1
a ble
Capacity” chart (top left). Your chart may not look exactly like this one, but the “Number fe r
Available” should go to 0. a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
i c ( z to
k
g. aIn the “datasource1 Connections” chart, you should also notice that the “Active
k o R Connections Current Count” goes up.
dr av h. Above the View List, click the Stop button ( ).
Z i. Close the Monitoring Dashboard window (or tab). When asked whether you are sure,
click the Leave Page button.
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.

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

Practices for Lesson 8: Monitoring a Domain


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

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c ( z to
R aki
o
avk
Zdr

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

Practices for Lesson 8: Monitoring a Domain


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

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c ( z to
R aki
o
avk
Zdr

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

Practices for Lesson 8: Monitoring a Domain


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

nse
li c e
a ble
fe r
a ns
n- t r
Practices for o
nLesson 9: Node
s a
c a Guid ) ha
Manager eฺ

c ibcChapter
e n9t

k i c@ Stud
k o ฺra this
d r av use
c ( z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c ( z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, 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.
nse
2. Access the WebLogic Server administration console on host01.
li c e
3. Stop the managed servers that are running.
a ble
a. In the Domain Structure, expand Environment and then select Servers.
fe r
b. On the right, click the Control tab.
a ns
c. Select the check box next to any managed servers that are running. Click the n- t r
no
Shutdown button and select Force Shutdown Now. When asked to confirm, click
a
Yes.
a s
) h i d eฺ
d. Wait a moment and refresh the screen. Ensure that the State column in the table
a
c ฺc t Gu
confirms that all managed servers are shut down.
b
4. ci den
Update the configuration of the machines.
@
k i c S tu
a. In the Change Center, click Lock & Edit.
o ฺra this
b. In the Domain Structure, under Environment, select Machines.
k
r
c. Select machine1.
d av use
c (z to
d. Click the Configuration tab and the Node Manager subtab.
R aki
e. Use the drop-down list to change the Type to Plain.
k o
av f. Ensure that Listen Address is host01.example.com and the Listen Port is 5556.
Zdr 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.
k. Click Save again.
l. Click the Configuration > Servers tab. Ensure that server2 is assigned to machine2.
m. In Change Center, click Activate Changes.
Note: You will note that one restart is required. Because the admin server is assigned to
machine1, it must be restarted for the machine’s configuration changes to take effect.
5. Stop and restart the administration server running on host01.
a. Find the Terminal window in which server1 was running and close it.

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

Practices for Lesson 9: Node Manager


Chapter 9 - Page 3
Note: Even if you do not have the Terminal window titles set, you can tell in which window
server1 was running, because you stopped server1. You can see “shut down” messages,
and the window shows the prompt again. Close the server1 window.
b. Find the Terminal window in which the admin server is running.
c. Press Ctrl + C in the admin server window.
Note: This is not as bad as it seems. It has the same effect as Force Shutdown Now.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

d. Use the up arrow to bring back the command issued to start the admin server, and
start it again.
$ ./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
nse
$ ls
li c e
nodemanager.domains nodemanager.properties
r a ble
b. List the contents of the nodemanager.domains file. Notice that the onlyfe
n s entry is the
name of your domain and its location. This Node Manager is for theawlsadmin
domain. n - tr
$ cat nodemanager.domains
a no
a s
...
a ) h i d eฺ
wlsadmin=/u01/domains/part1/wlsadmin
c ฺcnot shownG u
b
ci den
Note: The comments at the top of the file are t here.
i c
c. Edit the nodemanager.properties @ u
tfile.
k
ฺra this
$ gedit nodemanager.properties
S
k o e
d r avfollowing
d. Look at the file
u sproperties and their values:
(z to
− ListenAddress=host01.example.com
i c
k
o Ra− ListenPort=5556
r a vk − StartScriptEnabled=true

Z d − StartScriptName=startWebLogic.sh
Note
− 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
there as a convenience. It calls startWebLogic.sh, which does the real work of
starting a server.
e. Find the property SecureListener and change its value to false.
SecureListener=false
f. Save the file and close the editor.
g. Leave the Terminal window open.
7. Start the Node Manager on host01.
a. Run the Node Manager start script in the bin directory of the domain:
$ cd /u01/domains/part1/wlsadmin/bin
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Node Manager


Chapter 9 - Page 4
$ ./startNodeManager.sh
...
... <INFO> Plain socket listener started on port 5556, host
host01.example.com>
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
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

Manager.
8. 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
nse
Manager on host02.
li c e
a. Connect to host02.
a ble
b. Find the Terminal window in which server2 was running and close it.
fe r
c. Open a new Terminal window. Navigate to the domain’s Node Manager directory. Edit
a ns
the nodemanager.properties file.
n- t r
$ cd /u01/domains/part1/wlsadmin/nodemanager
a no
a s
$ gedit nodemanager.properties
d. Find the property SecureListener and change a ) h its u i d
value
etoฺ false.
b c ฺc t G
SecureListener=false
@ ci den
k i c
e. Save the file and close the editor.
S tu
f. Run the Node Manager
k o ฺrastart tscript
h is in the bin directory of the domain:
a v use
$ cd /u01/domains/part1/wlsadmin/bin
r
(z d to
$ ./startNodeManager.sh
k i c
Ra...<INFO> <Plain socket listener started on port 5556,
...
o host
avk host02.example.com>
Zdr 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.
b. In the Domain Structure, expand Environment, then select Servers. Click the Control
tab. Select the check box next to server2 and click the Start button. When asked
whether you are sure, click Yes.
c. Wait a moment, and refresh the browser. Wait until server2’s State is RUNNING.
d. Log out of the admin console and close the web browser.

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

Practices for Lesson 9: Node Manager


Chapter 9 - Page 5
Practice Solution: 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© 2015, 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
nse
b. Run the host01 solution script. li c e
$ ./solution-host01.sh
r a ble
Note: This script copies the correct nodemanager.properties file to thesdomain’s
n fe
nodemanager directory. It then starts the WebLogic Scripting Tool (WLST)
- t r a passing it the
WLST script update_machines.py, which updates the two machines
n on for you.
c. Close the Terminal window.
s a
3. Stop the admin server and the managed server on ) a
h ideฺ
host01.
Note: You want to stop the admin server so a
c Node
ฺthat G u is running when it comes
Manager
b c t
up again. You want to stop the managed
@ citheserver
d n from this point forward you will
ebecause
start it through Node Manager by
k i c using
S t u
admin console.

k o ฺra in twhich
a. Find the Terminal window
h is the admin server is running. Press Ctrl + C.
d r a se You will use it later.
v uwindow.
b. Minimize this Terminal
c. Find the o in which server1 is running. Press Ctrl + C.
(zTerminaltwindow
i c
k this Terminal window.
d. Close
R a
4.o Start the Node Manager on host01.
a v k
Zdr
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 © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Node Manager


Chapter 9 - Page 6
c. If you do not have a boot identity file, when you are prompted, enter the username and
password (weblogic and Welcome1). 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© 2015, 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
nse
b. Run the host02 solution script. li c e
$ ./solution-host02.sh
r a ble
fe
Note: This script copies the correct nodemanager.properties file to thesdomain’s
n
nodemanager directory.
n - tra
c. Close the Terminal window.
a no
9. Start the Node Manager on host02.
a s
a. Open a new Terminal window and navigate to
a ) h d eฺ of the domain. Run the
the binidirectory
Node Manager start script:
b c ฺc t Gu
$ cd /u01/domains/part1/wlsadmin/bin
@ ci den
$ ./startNodeManager.sh k i c S tu
...
k o ฺra this
... <INFO>
d r se listener started on port 5556, host
avPlainusocket
(z
host02.example.com>
i c to
k not close this window. This is where the Node Manager is running. If you want to,
b. aDo
o R set the title of the window to “Node Manager” by using the window’s Terminal > Set
av k Title option.
Zdr 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 © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Node Manager


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

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c ( z to
R aki
o
avk
Zdr

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

Practices for Lesson 9: Node Manager


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

nse
li c e
a ble
fe r
a ns
n- t r
Practices for o
nLesson 10:
s a
c a Guid ) ha Applications
Deploying eฺ

c ibcChapter
e n t
10

i c@ Stu d
k
ฺra this
k o
d r av use
c ( z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c ( z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, 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.
nse
a. Connect to host01.
li c e
b. Open a new Terminal window and navigate to the domain directory. Create a new
subdirectory called apps from which you will deploy applications. a ble
fe r
$ cd /u01/domains/part1/wlsadmin
a ns
$ mkdir apps
n- t r
c. no
Copy the application from the current practice directory to this directory.
a
a s
eฺ
$ cd apps
a ) h i d
ฺc t Gu
$ cp /practices/part1/practice10-01/benefits.war .
d. Leave the Terminal window open. ibc
@
2. Open the WebLogic Server administration
c console.
u d en
3. Deploy the application. rak
ic S t
s
thi & Edit.
oฺ clicke Lock
a. In the Change v k
Center,
sselect Deployments.
z d
b. In the Domainra Structure,
o u
i t
c (the Deployments
a k
c. Above table, click the Install button.
o R Use the links next to and below Current Location to navigate to:
d.
av k
Zdr
host01.example.com/u01/domains/part1/wlsadmin/apps

Note: This fills in the Path field as you click links.


e. When the path is correct, select the option button next to benefits.war.

f. Click the Next button.


g. Select Install this deployment as an application and click Next.
h. 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 Settings at their default values. Click Next.
j. Select No, I will review the configuration later. Click Finish.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Deploying Applications


Chapter 10 - Page 3
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.
a. In the Deployments table, select the check box next to the benefits application.
b. Click the Start button and select Servicing all requests.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

c. When asked to confirm, click Yes.


Note: Notice that the State of the benefits application is now “Active.”
5. Test the application.
a. In the Deployments table, click the link that is the name of the newly deployed
application, benefits.
b. Click the Testing tab.
c. Click any of the test links. nse
d. The benefits application opens in a new window or tab. li c e
e. Try the application by selecting things and clicking buttons or links. a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
f. When you are
d r se the application, close the Benefits window or tab.
avfinishedutrying
6. Obtain an (
i c z version
updated to of the application.
k a Terminal window on host01 and navigate to the current practice directory. List
a. aOpen
o R the contents of the directory. Then list the contents of the update subdirectory.
av k
Zdr
$ cd /practices/part1/practice10-01
$ ls
... benefits.war ... update
$ ls update
benefits.war
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
$ 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.

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

Practices for Lesson 10: Deploying Applications


Chapter 10 - Page 4
c. In the Domain Structure, select Deployments.
d. Select the check box next to the benefits application.
e. Click the Update button.
f. Leave the “Source path” as it is. There is no deployment plan, so the empty
“Deployment plan path” is correct. Click Next.
g. On the next page, click Finish.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

h. 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 State of the benefits application is “Active,” even though you
did not explicitly start it.
i. Follow the earlier steps to test the application again. When you are finished, close the
Benefits window or tab.
8. Stop the application, so you can undeploy it.
nse
a. Return to the administration console.
li c e
b. In the Domain Structure, select Deployments.
a ble
c. Select the check box next to the benefits application. fe r
d. Click the Stop button and select Force Stop Now. a ns
n- t r
e. When asked to confirm, click Yes.
a no
Note: Notice the State of the benefits application is no longer “Active.”
a s
9. Undeploy the application.
a ) h i d eฺ
a. In the Change Center, click Lock & Edit.
b c ฺc t Gu
ci den
Note: If it is already locked, skip this step.
@
k i c S tu
b. In the Domain Structure, select Deployments.
o ฺra this
c. Select the check box next to the benefits application.
k
r av use
d. Click the Delete button.
d
(z to
e. When asked to confirm, click Yes.
c
aki
f. In the Change Center, click Activate Changes.
R
o
avk
Note: Notice the message that the changes have been activated and no restarts are

Zdr
necessary. Also notice that the benefits application is no longer in the Deployments table.

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

Practices for Lesson 10: Deploying Applications


Chapter 10 - Page 5
Practice Solution: 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© 2015, 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.
nse
a. Open a Terminal window and navigate to the practice directory.
li c e
$ cd /practices/part1/practice10-01
a ble
b. Run the solution script.
fe r
$ ./solution.sh
a ns
Note n- t r
a no
− This script creates the apps directory under the domain directory. It copies the
a s
a ) h i d eฺ
original benefits.war file there, calling it benefits.old. It then copies the

b c ฺc t Gu
updated benefits.war into the apps directory from the practice’s update

@ ci den
subdirectory. The script then starts the WebLogic Scripting Tool (WLST) passing it
the WLST script deploy_app.py, which deploys the benefits application, targets it
k i c
to cluster1, and starts it. S tu
k o ฺraabouttclosing
− If you get a warning h is in a different thread, ignore it
r av use was called in a different thread...). It is a
(WLContext.close()
d
iknown
c toWLST deployment and does no harm.
(z issue with
k
c. aDo
o d.R not close the Terminal window.
r a vk If you want to access the newly deployed application, enter the following URL in the
web browser:
Z d 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 © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Deploying Applications


Chapter 10 - Page 6
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© 2015, 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
nse
created.
li c e
a. Open a Terminal window and navigate to the practice directory. Then, run the
deploy.sh script. a ble
fe r
$ cd /practices/part1/practice10-02
a ns
$ ./deploy.sh
n- t r
...
a no
a s
>>>Deploying application contacts. Please wait.
a ) h i d eฺ
...
b c ฺc t Gu
ci den
>>>Application contacts deployed.
@
...
k i c S tu
$
k o ฺra this
2.
d r av use
Connect to host02. Run the database setup script. It initializes (or reinitializes) the database
to create a table and put some data in it that the application requires.
c ( z to
aki
Note: Notice that this is host02, not host01.

o R
a. Open a Terminal window and navigate to the practice directory. Set some environment

avk variables. Then run the setup.sh script.

Zdr Note: 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 © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Deploying Applications


Chapter 10 - Page 7
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.
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© 2015, 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 nse
console as “Page 1”). li c e
b. On the home page, click the browse all contacts link.
a ble
Note: This is the second request in the script (which will display in The Grinder console as fe r
“Page 2”). a ns
n- t r
c. Click the [edit] link in the first row.
a no
Note: This is the third request in the script (which will display in The Grinder console as
a s
“Page 3”).
a ) h i d eฺ
d. View the data on the edit screen.
b c ฺc t Gu
ci den
Note: This is the fourth request in the script (which will display in The Grinder console as
@
“Page 4”).
k i c S tu
4. ฺra this
Install The Grinder on host02.
k o
d r av use
a. Open a Terminal window on host02 and navigate to /install/grinder. Then, list
z to
the contents of the directory.
c (
aki
$ cd /install/grinder

o R $ ls
avk grinder-3.11-binary.zip
Zdr 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 © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Deploying Applications


Chapter 10 - Page 8
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© 2015, 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
nse
Note: What this means is that the agent starts two worker processes with 200 threads li c e
each. It runs the script called grinder.py. It continues running until the console tells it to
a ble
stop. fe r
d. Exit the editor without making any changes. a ns
n- t r
e. View the setgrinderenv.sh script.
a no
$ cat setgrinderenv.sh
a s
GRINDERPATH=/home/oracle/grinder-3.11
a ) h i d eฺ
c ฺc t Gu
GRINDERPROPS=/practices/part1/practice10-02/grinder.properties
b
ci den
CLASSPATH=$GRINDERPATH/lib/grinder.jar:$CLASSPATH
@
JAVA_HOME=/u01/app/jdk k i c S tu
o ฺra this
PATH=$JAVA_HOME/bin:$PATH
k
r av use
export CLASSPATH PATH GRINDERPROPS
d
(z to
Note: Notice this script sets various environment variables that The Grinder needs: where
c
R aki
The Grinder is, the location of its properties file, the CLASSPATH, and the PATH.
k o f. View the startconsole.sh script.
av
Zdr
$ 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 © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Deploying Applications


Chapter 10 - Page 9
... 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© 2015, 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).

nse
li c e
r a ble
n s fe OK.
c. When the dialog box warns that you have not selected a properties file, click
d. Click the Graphs tab. Watch the graphs go by for a while.
n - tra
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
i c (z to
k
o Ra
r a vk
Z d

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

Practices for Lesson 10: Deploying Applications


Chapter 10 - Page 10
e. Click the Results tab. Watch the numbers update for a while.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

nse
f. Click the “Stop collecting statistics” button. li c e
a ble
fe r
a ns
n- t r
a no
g. Look at the numbers in the console on the Results h a stab. Theฺ “Mean Time” is the
number of milliseconds a request takes. Although
c a ) theuscript
i de has “think time” in it for
each web page accessed (like a realbuser
i cฺ wouldn G that is not included in the Mean
t have),
Time, which is just the time the HTTP c e
@ tudYou probably will see much lower than sub-
request takes.
Note: Remember, this time iskinicmilliseconds.
second response time o
a his S
forฺrall the “pages.”
v k theseworker t
h. Next, click the
d a
r the console,
“Reset u processes” button. When asked whether you also
(
want to z
reset t o click No. (You did not reset the console in case you want to
k i c
R acontinue to look at the numbers.)

k o
dr av
Z

i. When you have finished investigating the numbers, close The Grinder console.
Note: If you are interested, the raw data has been saved in files in a newly created log
directory in the practices directory.
j. Close the host02 Terminal window.

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

Practices for Lesson 10: Deploying Applications


Chapter 10 - Page 11
9. Return to host01 and view the agent window.
a. The Terminal window in which the agent was running has various messages in it. You
should notice that the agent is no longer running. It stopped when it could no longer
communicate with the console, which you closed.
...
... INFO agent: finished
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

$
b. Close the Terminal window.

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c ( z to
R aki
o
avk
Zdr

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

Practices for Lesson 10: Deploying Applications


Chapter 10 - Page 12
Practice Solution: 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© 2015, 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.
nse
Note: Notice that this is host02, not host01.
li c e
a. Open a Terminal window and navigate to the practice directory. Set up some
a ble
environment variables, and then run the script.
fe r
$ export ORACLE_HOME=/u01/app/db11g/product/11.2.0/dbhome_1
a ns
$ export ORACLE_SID=orcl
n- t r
$ cd /practices/part1/practice10-02
a no
a s
$ ./setup.sh
a ) h i d eฺso you can run it multiple
Note: The SQL script drops the table (and sequence)
isc
it
ฺc it produces
G u messages that no such table or
creates,
times. Therefore, the first time the scriptib run, t
enthem.
c if youdsee
sequence exist. Ignore those messages
ic @ t u
b. Close the Terminal window.
r a k s S
2. Connect to host01 and
v k thito deploy the application from which The Grinder script
orunฺ theescript
was created. ra
d u s
z o
t window, navigate to the practice directory, and run the deploy
a. Open
k i c (a new Terminal
R ascript.

v k o $ cd /practices/part1/practice10-02
a
Zdr
$ ./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 © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Deploying Applications


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

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c ( z to
R aki
o
avk
Zdr

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

Practices for Lesson 10: Deploying Applications


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

nse
li c e
a ble
fe r
a ns
n- t r
Practices for o
nLesson 11:
s a
Network
a ) ha Channels
i d eฺ and Virtual
ฺc t Gu
cHosts
c ib en
k i tud 11
c@ SChapter
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, 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. nse
li c e
Tasks
a ble
1. Open the WebLogic Server administration console. fe r
a ns
2. Deploy the benefits application again.
n- t r
a no
Note: The application was undeployed in a previous practice. You can either deploy it again
by using the admin console, or run the solution to the practice titled “Deploying an
a s
a ) h i d eฺ
Application.” To deploy the application by using the admin console, perform the following
tasks:
b c ฺc t Gu
ci den
a. In the Change Center, click Lock & Edit.
@
k i c S tu
b. In the Domain Structure, select Deployments.

k o ฺra this
c. Above the Deployments table, click the Install button.

d r av use
d. Use the links next to and below Current Location to navigate to:
(z to
host01.example.com/u01/domains/part1/wlsadmin/apps
c
e.
R
f.
aki
When the path is correct, select the option button next to benefits.war.
Click the Next button.
o
avk g. Select Install this deployment as an application and click Next.
Zdr h. 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 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 © 2014, 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© 2015, 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
nse
g. Enter or select the following values for these fields, then click Next.
li c e
Field Value
a ble
Listen Address fe r
host01.example.com
a ns
Listen Port 4000
n- t r
External Listen Address (blank)
a no
a s
External Listen Port (blank)
a ) h i d eฺ
ฺc so
Note: You are not working with external addresses
c G u should be blank.
those
h. When the next page is displayed,cleave
b t
i theedefaults
n (Enabled and HTTP Enabled for
This Protocol are selected). @
ic Click Next.
t u d
r a k s S
i. When the next page
v k
Client Certificate
oEnforcede hi leave
ฺis displayed,
tboth are
the defaults (Two Way SSL Enabled and
deselected). Click Finish.
d r a u s
j. Activate
i c to and verify that the channel is created.
(zyour changes
R ak
vk o
r a
Zd 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 © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 11: Network Channels and Virtual Hosts


Chapter 11 - Page 4
Practice Solution: 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© 2015, 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
nse
b. Run the solution script. li c e
$ ./solution.sh
a ble
Note fe r
a ns
− This script calls two WLST scripts. The first creates a network channel on server1
n- t r
to which these servers belong. a no
and another on server2. The second deploys the benefits application to the cluster

a s
c. Close the Terminal window.
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, 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.
nse
li c e
Tasks
a ble
1. Connect to host01.
fe r
2. Run the setup script.
a ns
a. Open a Terminal window and navigate to the practice directory. n- t r
$ cd /practices/part1/practice11-02 a no
a s
b. Run the setup script.
a ) h i d eฺ
$ ./setup.sh
b c ฺc t Gu
Note: This script creates a new domain c i called
e n
wlsadmin2. It has an admin server named
c@ Stu
AdminServer (port 8001 on host01.example.com)
i d and a managed server called
ฺ k
a his
server1a (port 8011 on rhost01.example.com) and server2a (port 8011 on
host02.example.com). o
vk uThese t
e managed servers are in a cluster called cluster1a.
3. Start the admin r a s
d servertofo the new domain.
( z
a. In iacterminal window, navigate to the new domain directory and run the script to start
k admin server of the domain.
athe
R
o $ cd /u01/domains/part1/wlsadmin2
avk
Zdr $ ./startWebLogic.sh
Note: When prompted for the username and password, enter weblogic and Welcome1,
respectively.
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 © 2014, 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© 2015, 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.
nse
a. Open a new web browser, enter the URL to access the administration console via the
li c e
admin port:
a ble
https://host01.example.com:9002/console
fe r
Note: Notice the use of https and the admin port of 9002. a ns
n- t r
Understand the Risks. a no
b. When you get the warning about the “connection is untrusted,” click the link: I

a s
a ) h i d eฺ
Note: Because you are using the demo certificates, the host name inside of them do not
match the host on which they are used.
b c ฺc t Gu
c. Click the Add Exception button.
@ ci den
k i c S tu
d. In the “Add Security Exception” pop-up window, click Get Certificate.

Exception. k o ฺra this


e. Ensure Permanently store this exception is selected and click Confirm Security

d r av use
f. On the console welcome page, enter the username as weblogic and the password as
i c( z to
Welcome1. Then click the Login button.
k
a the admin port number of the managed server on the same machine as the admin
R
7. Override
o
avk server.
Zdr a.
b.
In the Change Center, click Lock & Edit.
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 © 2014, 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
Note
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

− When prompted for the username and password, enter weblogic and Welcome1,
respectively.
− 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.
nse
− Change the title of the Terminal window. In the window’s menu, select Terminal,
li c e
r a ble
and then Set Title. Enter the title of server1a and click OK. Minimize the window.
− Because this domain is only used temporarily, rather than set up Nodefe Manager,
you start servers by running start scripts. n s
9. Deploy an application to the managed servers in the new domain.n-
tra
o the deployment is
nand
Note: Although there are two managed servers in the domain a
s servers),
) h a
targeted to the cluster (and therefore both of the managed
e ฺ you will never start the
server on host02. That is because you would first
c a have to
u d
i the new domain over to
move
that host.
b ฺ
c nt G
c i efor applications in the new domain, and
a. In a new Terminal window create
i c @ t u d
a directory
copy an application there.
ฺ r a k is S
a v ko se th
$ cd /u01/domains/part1/wlsadmin2

z dr to u
$ mkdir apps
$ cd (apps
a ic
$k cp /practices/part1/practice10-01/benefits.war .
o R
av k b. Close this Terminal window.

Zdr c. Access the WebLogic Server administration console of the new domain by entering the
following URL:
https://host01.example.com:9002/console
Note: Log in with the username as weblogic and the password as Welcome1.
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.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 11: Network Channels and Virtual Hosts


Chapter 11 - Page 8
m. Select No, I will review the configuration later. Click Finish.
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.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

c. When asked to confirm, click Yes.


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: nse
https://host01.example.com:9003/benefits li c e
Note: Notice the use of https and the admin port override port number of 9003. a ble
fe r
(Remember, this server runs on the same machine as the admin server, so it had to
a ns
use a different port number for its admin port.)
n- t r
certificate. a no
g. Perform the same procedure as before to create a security exception for this demo

a s
a ) h i d eฺ
Note: Because the URL is different, the browser needs another exception.

b c ฺc t Gu
h. When asked to log in, use weblogic and Welcome1 as the username and password,
respectively.
@ ci den
i c tu
Note: Why does this application require us to log in? It is only accessible to administrators
k S
k o ฺra this
through the admin port. To prove you are an administrator, you must log in.

d r av use
i. You can now use the application while no regular clients have access. Try it. This is
sometimes done as a final check before an application is opened up to general users.
c (z to
R aki
j. Close the application browser window or tab.
11. As an administrator, you have seen that the application works through the admin port, so
o
avk open it up for everyone to use.
Zdr a. Return to the admin console.
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.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 11: Network Channels and Virtual Hosts


Chapter 11 - Page 9
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.
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.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

$ cd /u01/domains/part1
$ ls
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. nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

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

Practices for Lesson 11: Network Channels and Virtual Hosts


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

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c ( z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, 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.
nse
b. In the Domain Structure, expand Environment and select Virtual Hosts.
li c e
c. Click the New button.
a ble
d. Enter the Name of benefits.com. Click OK. fe r
a ns
e. Select the name of the new virtual host, benefits.com.
n- t r
f. Under Virtual Hosts Names enter:
a no
benefits.com
a s
g. Click Save.
a ) h i d eฺ
h. Click the Targets tab.
b c ฺc t Gu
i. Select cluster1. Select Part of the
@ cicluster.
d n server1.
eSelect
j. Click Save. k ic S t u
r a s
k
k. In the Change Center,
v thi Changes.
oฺ clicke Activate
3. Undeploy the d ra application.
benefits u s
z t o
k c (Domain Structure,
a. In ithe select Deployments.
b. a
R Select the check box in front of the benefits application. Click the Stop button and
o
avk
select Force Stop Now. When asked to confirm, click Yes.

Zdr c. In the Change Center, click Lock & Edit.


d. Select the check box in front of the benefits application.
e. Click the Delete button. When asked to confirm, click Yes.
f. Activate the changes.
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.
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.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 11: Network Channels and Virtual Hosts


Chapter 11 - Page 12
k. Select the check box in front of the benefits application.
l. Click Start. Select Servicing all requests. When asked to confirm, click Yes.
5. Add benefits.com to the hosts file on the host01 machine.
a. Open a new Terminal window on host01.
b. Navigate to the /etc directory.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

$ cd /etc
c. List the hosts file.
$ ls hosts –l
-rw-r—r-- 1 root root ... hosts
Note: Notice that the file belongs to the root user.
d. Edit the hosts file.
$ sudo vi hosts
nse
Note: The root user is not properly configured to use the gedit text editor because the
li c e
desktop GUI is rendered as the oracle user.
a ble
e. Find the line with host01.example.com. Move the cursor to the end of that line with
fe r
the arrow keys. Click the a key for “append” mode. Add some spaces and then
a ns
benefits.com to the end of that line. Press Esc. When you are finished, it will look
n- t r
like this:
a no
198.168.100.1 host01.example.com
a s
host01 benefits.com
...
a ) h i d eฺ
c G u :wq and then press Enter.
ฺc the characters
f. Save the file and exit the editor by entering
b
ci dewant t
n it to be:
ic @
g. View the file to ensure that line is what you
t u
r a k s S
oฺ e thi
$ cat hosts
...
v k s
z d ra o uhost01.example.com
198.168.100.1 host01 benefits.com
( t
a kic
...
R $

a v ko h. Close the Terminal window.


Z dr 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.
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 check box in front of the benefits application. Click the Stop button and
select Force Stop Now. When asked to confirm, click Yes.
e. Select the check box in front of the benefits application. Click the Delete button. When
asked to confirm, click Yes.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 11: Network Channels and Virtual Hosts


Chapter 11 - Page 13
f. Activate the changes.
g. Lock the configuration again.
h. Click the Install button.
i. Select the benefits.war application (under
host01.example.com/u01/domains/part1/wlsadmin/apps). Click Next.
j. Click Next again.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

k. Select cluster1. Ensure that All servers in the cluster is selected. Click Next.
l. Click Finish.
m. Activate the changes.
n. Select the check box in front of the benefits application. Click Start and select
Servicing all requests. When asked to confirm, click Yes.

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

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

Practices for Lesson 11: Network Channels and Virtual Hosts


Chapter 11 - Page 14
Practice Solution: 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© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c ( z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c ( z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
Practices for o
nLesson 12:
s a
c a Guid ) ha
Clusters eฺ

c ibcChapter
e n t
12

i c@ Stu d
k
ฺra this
k o
d r av use
c (z to
R aki
o
avk
Zdr

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

Practices for Lesson 12: Clusters


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© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

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

Practices for Lesson 12: Clusters


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© 2015, 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.
nse
b. In the Domain Structure, expand Environment and select Clusters.
li c e
c. Above the Clusters table, click the New button and select Cluster.
a ble
d. Enter or select the following values for these fields and then click OK. fe r
a ns
− Name: cluster3 (You are saving the name cluster2 for the dynamic cluster.)
n- t r
− Messaging Mode: Unicast.
a no
e. Click OK.
a s
f. ) h
Select the new cluster in the Clusters table.
a i d eฺ
g. c ฺc t Gu
Select the Configuration > Servers tabs.
b
h. @ ci den
Scroll down to the Servers table and click the Add button.
k i c S tu
i.
j. k o ฺra this
Select Create a new server and add it to this cluster. Click Next.
Enter or select the following values for these fields, then click Finish.
d r av use
− Server Name: server3
c (z to
R aki
− Server Listen Address: host01.example.com
− Server Listen Port: 7013
k o
av k.
Zdr
Click the Add button again.
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 © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Clusters


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© 2015, 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.
nse
g. Click the Save button. li c e
h. Use the breadcrumbs and select Summary of Servers. Click server4. Ensure that the
a ble
Configuration > General tabs are selected. Use the Machine drop-down list to select fe r
machine2. Click the Save button. a n s
i. Use the breadcrumbs and select Summary of Servers. Clickn
r
-t Ensure that the
server5.
Configuration > General tabs are selected. Use the Machine
o
n drop-down list to select
s a
machine1. Click the Save button.
) a
hServers. eฺ server6. Ensure that the
j. Use the breadcrumbs and select Summaryaof u i dClick
b
Configuration > General tabs are selected.c ฺc Uset G
the Machine drop-down list to select
machine2. Click the Save button.
@ ci den
k. In the Change Center, a k
click tu
icActivateSChanges.
4. Start the new serverskinothe t is
ฺr new cluster.
h
r avStructure,
u e Environment and select Servers.
sexpand
d
a. In the Domain
z Controltotab.
(the
i
b. Select
k c
o RaSelect the check boxes next to server3, server4, server5, and server6. Then
c.

r a vk click Start. When asked to confirm, click Yes.

Z d d. Wait for a little while and refresh the web browser. Ensure that the state of the new
managed servers is “RUNNING.”

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

Practices for Lesson 12: Clusters


Chapter 12 - Page 4
Practice Solution: 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© 2015, 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 nse
Note li c e
− This script calls a WLST script that creates the new servers, the new cluster, and a ble
fe r
adds the servers to the cluster. It then calls another WLST script to start all the
a ns
servers in the new cluster.
n- t r
b. Close the Terminal window. a no
− The WLST script that starts the servers can take a while to run, so be patient.

a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

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

Practices for Lesson 12: Clusters


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© 2015, 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. nse
Note: Notice that this is host02, not host01. li c e
a. Open a Terminal window and navigate to the practice directory. Set a couple of a ble
fe r
environment variables and run the script that sets up the database.
a ns
Note: The ORACLE_HOME variable points to where the database is installed. ORACLE_SID
n- t r
no
(Oracle System ID) is the unique name of this particular database.
a
$ cd /practices/part1/practice12-02
a s
) h i d eฺ
$ export ORACLE_HOME=/u01/app/db11g/product/11.2.0/dbhome_1
a
$ export ORACLE_SID=orcl
b c ฺc t Gu
$ ./setup.sh
@ ci den
k i c S tu
ฺra this
...
1 row created
k o
d r av use
c (z to
aki
1 row created

o R
avk
Commit complete.

Zdr ...
$
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 © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Clusters


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© 2015, 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.
nse
− Number of Dynamic Servers: 4
li c e
− Server Name Prefix: cluster2server-
a ble
Note: That is a “dash” on the end of the prefix name.
fe r
f. Select Use any machine configured in this domain. Click Next. a ns
g. Enter or select the following values for these fields, then click Next: n- t r
a
− Assign each dynamic server unique listen ports: Selected
no
a s
− Listen Port for First Server: 7099
a ) h i d eฺ
− SSL Listen Port for First Server: c
b ฺc t Gu
8099
h. Notice the details of this new dynamic
@ ci cluster,
d enincluding the name of the new server
k
template that will be created. S u
ic Click Finish.
t
r a s
i. In the Change Center,
v k thi Changes.
oฺ clicke Activate
ra generated
5. View the new servers
d u s for the dynamic cluster. Start those servers.
z t o
a. In the (Domain Structure, expand Environment and select Servers. Ensure that the
k i c
R aConfiguration tab is selected.

v k o Notice the four new servers. Their names all start with “cluster2server-” and end
b.
a
Zdr
in 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 © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Clusters


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© 2015, 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.
nse
d. Use the links next to and below Current Location to navigate to:
li c e
host01.example.com/u01/domains/part1/wlsadmin/apps
a ble
Note: This fills in the Path field as you click links.
fe r
e. When the path is correct, select the option button next to supplies.war. Click Next. a ns
f. Select Install this deployment as an application and click Next. n- t r
a no
g. Select the check box next to cluster2. Ensure that the All servers in the cluster
a s
option button is selected. Click Next.
a ) h i d eฺ
b c ฺc t Gu
h. Leave all the Optional Setting at their default values. Click Next.
ci den
i. Select No, I will review the configuration later. Click Finish.
@
i c tu
j. In the Change Center, click Activate Changes.
k S
k o ฺra this
Note: Notice the message that the changes have been activated and no restarts are
necessary.
d r av use
8. z
Start the application.
c ( to
R aki
a. In the Deployments table, select the check box next to the supplies application.
b. Click the Start button and select Servicing all requests.
o
avk c. When asked to confirm, click Yes.
Zdr Note: Notice that the State of the supplies application is now “Active.”

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

Practices for Lesson 12: Clusters


Chapter 12 - Page 8
Practice Solution: 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© 2015, 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.)
nse
The administration server is currently running. li c e
a ble
Solution Tasks
fe r
1. Connect to host02 and run the database setup script. a ns
Note: Notice that this is host02, not host01. n- t r
a no
a. Open a Terminal window and navigate to the practice directory. Set a couple of
a s
a ) i d eฺ
environment variables and run the script that sets up the database.
h
$ cd /practices/part1/practice12-02
b c ฺc t Gu
ci den
$ export ORACLE_HOME=/u01/app/db11g/product/11.2.0/dbhome_1
@
i c
$ export ORACLE_SID=orcl
k S tu
$ ./setup.sh
k o ฺra this
d r a u se
v window.
b. Close the Terminal
z andtorun the solution script.
2. Connect to(host01
c
i
a$k cd a/practices/part1/practice12-02
a. Open Terminal window, navigate to the practice directory, and run the solution script.
o R
avk
Zdr
$ ./solution.sh
Note
− 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 © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Clusters


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

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

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

Practices for Lesson 12: Clusters


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

nse
li c e
a ble
fe r
a ns
n- t r
Practices for o
nLesson 13:
s a
c a Guid ) ha
Clusters eฺ

c ibcChapter
e n t
13

i c@ Stu d
k
ฺra this
k o
d r av use
c (z to
R aki
o
avk
Zdr

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

Practices for Lesson 13: Clusters


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© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

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

Practices for Lesson 13: Clusters


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© 2015, 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 nse
1. Connect to host01. li c e
2. Rename the OHS installation directory and create a new, empty directory. a ble
fe r
a. Open a Terminal window, and navigate to /u01/app. Then rename the OHS
a ns
installation directory (that also contains the OHS instance).
n- t r
$ cd /u01/app
a no
$ mv ohs ohs-orig
a s
$ mkdir ohs
a ) h i d eฺ
3. Install the OHS part of Web Tier.
b c ฺc t Gu
a. Navigate to the directory that holds
@ cithe Webd n installer and execute it.
eTier
k ic S t u
$ cd /install/webtier
r a
oฺ e thi s
k
$ ./fmw_12.1.3.0.0_ohs_linux64.bin
v
d ra o us
0%..............................
z
Note c (
i t
k
a− If the installer file name is different (a different version of OHS), use that file name
o R
avk
instead.

Zdr b.
− Wait for all the files to extract before the installer starts. It can take a while.
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. Installation Location Oracle Middleware Home: /u01/app/ohs
Click Next.
c. 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.
d. Prerequisite Checks Wait for the progress bar to reach 100% and all
checks to pass.

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

Practices for Lesson 13: Clusters


Chapter 13 - Page 3
Step Window/Page Description Directions
Click Next.
e. Security Updates Deselect I wish to receive security updates
via My Oracle Support.
Click Next.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

f. Pop-up window Click Yes.


g. Installation Summary Click Install.
h. Installation Progress Wait for the progress bar to reach 100%.
Click Next.
Note: This can take a few minutes.
i. Installation Complete Click Finish.
nse
4. Configure an OHS instance. li c e
a. Rename the current OHS domain directory.
a ble
fe r
$ cd /u01/domains
a ns
$ mv ohs ohs-orig
n- t r
b. Navigate to the common Configuration Wizard for OHS.
a no
$ cd /u01/app/ohs/oracle_common/common/bin
a s
c. Run the Domain Configuration Wizard to create
a ) han
i eฺ
OHSddomain.
$ ./config.sh
b c ฺc t Gu
Note: The OHS 12c release providesc
i
a WebLogic endomain template for FMW system
ic @ t u d
components.
r a k i s S
d. Use the guidelinesoinฺ the following
v k se th table to configure the OHS domain by using the
ConfigurationaWizard:
Step (z
dr to uDescription
Window/Page Directions
k i c
R a a. Create Domain Select Create a new domain.
k o
dr av Enter /u01/domains/ohs as the domain
location.
Z Click Next.
b. Templates Select Oracle HTTP Server (Standalone) –
12.1.3.0 [ohs].
Click Next.
Note: The Basic Standalone System...
template is selected by default.
c. JDK Selection Select Oracle HotSpot 1.7.0_xx
/u01/app/ohs/oracle_common/jdk.
Click Next.
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

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

Practices for Lesson 13: Clusters


Chapter 13 - Page 4
Step Window/Page Description Directions
Admin Port: 9999
Listen Address: host01.example.com
Listen Port: 7777
SSL Listen Port: 7778
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

Server Name: http://host01.example.com:7777


Click Next.
f. Node Manager Node Manager Type: Per Domain Default
Location
Node Manager Credentials: Username:
weblogic, Password: Welcome1
Click Next.
nse
g. Configuration Summary Review and click Create.
li c e
h. Configuration Progress Wait for the progress bar to reach 100%. a ble
fe r
Click Next.
a ns
Note: This can take a few minutes.
n- t r
i. Success
a noClick Finish.
a s
e. Verify that the domain files are in place.
a ) h i d eฺ
$ ls –l /u01/domains/ohs
b c ฺc t Gu
drwxr-x--- 2 oracle oinstall c i 4096
e nSep 23 09:52 bin
drwxr-x--- 4 oracle ioinstall d
c@ Stu4096 Sep 23 09:52 config
k
ฺra oinstallis 4096 Sep 23 09:52
drwxr-x--- 2 oracle
k o t h init-info
drwxr-x---
d r av2 oracle
u seoinstall 4096 Sep 23 09:52 nodemanager
(z 2 toracle
drwxr-x--- o oinstall 4096 Sep 23 09:52 security
k i c
Ra
...

a v ko 5. Install patch file for OHS.

Zdr
$ /install/webtier/patch/patch.sh
If no errors are shown, then the patch file successfully
installed.

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

Practices for Lesson 13: Clusters


Chapter 13 - Page 5
Practice Solution: 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© 2015, Oracle and/or its affiliatesฺ

directory back to its previous name.

Solution Tasks
Important: Only do these tasks if you started the practice but did not complete it.
1. Connect to host01.
2. Check that the preinstalled directory is there. Delete the new installation directory that you
created. Rename the preinstalled directory back to its original name.
a. Open a Terminal window, and navigate to /u01/app. Then list the directories to
nse
ensure the ohs-orig directory is present. Check that this preinstalled directory has
li c e
valid contents.
a ble
$ cd /u01/app
fe r
a ns
$ ls
n- t r
no
ohs ... ohs-orig ...
$ ls ohs-orig
s a
bin domain-registry.xml inventory lib
) h a eฺ nls
a i d
oracle_common oui
ฺc t Gu
precomp sqlplus wlserver
b c
... oraInst.loc
ci den
plsql slax
@
webgate

k i c S tu
b. Ensure you are in the proper directory. Remove the new installation directory that you
created.
k o ฺra this
$ pwd
d r av use
/u01/app
c (z to
aki
$ rm –rf ohs

o R Warning: This command permanently deletes the directory, all its subdirectories, and
avk files. Use with caution.
Zdr c. Rename the preinstalled directory back to its original name.
$ mv ohs-orig ohs
3. Restore the original OHS domain folder.
a. In a Terminal window on host01, navigate to the /u01/domains folder. Then list the
directories to ensure the ohs-orig directory is present. Check that this preinstalled
directory has valid contents.
$ cd /u01/domains
$ ls
ohs ... ohs-orig ...
$ ls ohs-orig
auditlogs bin config init-info nodemanager security
servers system_components
b. Ensure you are in the proper directory. Remove the new installation directory that you
created.
$ pwd

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

Practices for Lesson 13: Clusters


Chapter 13 - Page 6
/u01/domains
$ rm –rf ohs
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.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

$ mv ohs-orig ohs

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

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

Practices for Lesson 13: Clusters


Chapter 13 - Page 7
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© 2015, Oracle and/or its affiliatesฺ

Assumptions
You completed “Practice 12-2: Configuring a Dynamic Cluster.”
“Practice 13-1: Installing OHS” was completed successfully, or not done at all (OHS is already
installed and ready on host01).
The administration server and all managed servers in the new dynamic cluster are currently
running.
nse
Tasks li c e
1. Connect to host01. a ble
fe r
2. Edit the WebLogic plug-in configuration file for OHS.
a ns
a. Open a Terminal window and navigate to the configuration directory of the OHS
n- t r
instance. Edit both httpd.conf and mod_wl_ohs.conf.
a no
s
$ cd /u01/domains/ohs/config/fmwconfig/components/OHS/instances/
a
ohs1
a ) h i d eฺ
$ gedit httpd.conf mod_wl_ohs.conf
b c ฺc t Gu
b. Check that httpd.conf includescthe i plug-inenconfiguration file. Make sure the
httpd.conf tab in the editoric @ d Ctrl + F and in the pop-up window enter
tuPress
is selected.
mod_wl_ohs.confฺand
k S
ra clickththeisFind button. Notice the include directive that
k o
v usefile.
includes this configuration
r a
dFind pop-up
c. Close the
( z t o window. Close the httpd.conf file (click the “X” in the tab)
a kic making any changes to it.
without

o R Edit the plug-in configuration file, mod_wl_ohs.conf. Notice that most lines are
d.

r a vk commented out (they start with a “#”). Also notice the LoadModule line, which loads
Z d 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>
Note
− 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 © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Clusters


Chapter 13 - Page 8
− 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© 2015, 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
nse
host01.example.com:7100,host02.example.com:7101
li c e
</Location>
a ble
fe r
</IfModule>
a ns
n- t r
#<Location /weblogic>
a no
# SetHandler weblogic-handler
a s
# PathTrim /weblogic
a ) h i d eฺ
c
# ErrorPage http:/WEBLOGIC_HOME:WEBLOGIC_PORT/
b ฺc t Gu
#</Location>
@ ci den
Note: The file is shown with some k i tu lines removed. You can keep them, if
c of theScomment
you prefer. Also, due toospace
k ฺra limitations,
t h is the LoadModule line is shown here on two lines,
but in the file it is
d r u se
aonvone line.
g. When (you
i c to that the file is correct, save it and exit the editor.
z are satisfied
k
o You have to modify two configuration settings to make Node Manager use a non-SSL
3.
Ra OHS Node Manager to use a non-SSL connection.
Configure

a v k
Zdr
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>
...
c. Open the nodemanager.properties file for editing.
$ gedit /u01/domains/ohs/nodemanager.properties

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

Practices for Lesson 13: Clusters


Chapter 13 - Page 9
d. Set the SecureListener property to false, and then save and close the file.
SecureListener=false
4. Start OHS.
a. Open a new Terminal window, name the window OHS NM, and navigate to the OHS
domain’s bin folder.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

$ 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
$ ./startNodeManager.sh
nse
...
li c e
ohs -> /u01/domains/ohs
a ble
fe r
<Sep 24, 2014 4:40:35 AM PDT> <INFO> <Node manager v12.1.3
a ns
#1604337>
n- t r
no
<Sep 24, 2014 4:40:36 AM PDT> <INFO> <Secure socket listener
a
started on port 5556, host localhost/127.0.0.1>
a s
Note: Wait for the command to finish.
a ) h i d eฺ
c. c ฺc t Gu
Open a new Terminal window, name the window OHS, and navigate to the OHS
b
domain’s bin folder.
@ ci den
k
$ cd /u01/domains/ohs/bini c S tu
o
d. Execute the following
a hitos start OHS.
ฺrcommand
v k e t ohs1
a
drsystem s
o uComponent ohs1 ...
$ ./startComponent.sh
( z
Starting t
a kic
...
R
a v ko Reading domain from /u01/domains/ohs

Zdr
Please enter Node Manager password:
e. Enter Welcome1 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.
...
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.

RUNNING

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

Practices for Lesson 13: Clusters


Chapter 13 - Page 10
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:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

http://host01.example.com:7777/supplies
b. When the application home page displays, click the browse the catalog link.
c. Click the [add] link next to a few items.
d. Scroll down and view the items in your shopping cart.
Note: Remember what items are in your shopping cart.
e. Do not close the web browser window. For the admin console, use a different browser
window. You will come back to this web browser window later.
6. Open the WebLogic Server administration console in a new tab or window. nse
7. Use the administration console to see which cluster server is servicing your requests. Stop li c e
that server. a ble
fe r
a. Under Domain Structure, expand Environment and select Clusters.
a ns
b. In the Clusters table, click cluster2.
n- t r
c. Click the Monitoring tab.
a no
s
d. Use the Primary column to determine which of the clustered servers is hosting your
a
a ) h i d eฺ
current shopping cart session (the value should be greater than 0). Remember which
server it is.
b c ฺc t Gu
ci den
Note: You can also see which server holds the backup copy of the session. Look at the
@
i c tu
Secondary Distribution Names column. For example, if cluster2server-1 is the
k S
k o ฺra this
primary, another server will have a value in this column of: cluster2server-1:1. What

d r av use
this means is that this server has 1 secondary session for cluster2server-1.
z to
Tip: If you cannot tell which server is the primary, write down the Primary session count
c (
aki
number for all the servers. Close all browsers. Open a new browser and access and use

o R
the application again. In the admin console, come back to this table and see which Primary

avk
number has increased. That is the server that currently holds your session and is servicing

Zdr
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 © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Clusters


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

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

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


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.
nse
$ cd /practices/part1/practice13-02 li c e
$ ./solution.sh
a ble
Note: fe r
a ns
This script performs the following tasks:
n- t r
no
− Copies a completed WebLogic plug-in configuration file for OHS to the right location
a
s
− Configures the OHS Node Manager to use a non-SSL connection
a
− Starts the OHS Node Manager a ) h i d eฺ
− Starts OHS b c ฺc t Gu
@
− Checks the status of the OHS server
ci den
− You should see thera k tu
icout in theSTerminal
o ฺ print
t h is window that ohs1 is RUNNING.
b. Close the Terminal
r a vk window.
u se deployed to the cluster (in a previous practice) through
3.
(z
If you want to d
access to
the application
the OHS
k i cproxy, use the web browser.

o RaEnter this URL:


a.

r a vk http://host01.example.com:7777/supplies
Z d

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

Practices for Lesson 13: Clusters


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

nse
li c e
a ble
fe r
a ns
n- t r
Assumptions a no
You completed “Practice 12-1: Configuring a Cluster.”) h
as eฺ
ฺ c a Guid
ibc ent
The administration server is running.
c
Tasks
k i c@ Stud
1. Connect to host01.
k o ฺra this
2. Open the WebLogic
d r se
avServeruadministration console.
(z groupstand
3. Set replication o preferred secondary groups.
i c
R akThis
Note:
groups so
is not a realistic example because you would not want to set up replication
that a server’s secondary server was on its same machine. It does give you
k o
av practice in configuring replication groups, however. And, if you do the optional task at the
Zdr 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 © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Clusters


Chapter 13 - Page 13
− 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© 2015, 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 nse
i. Use the breadcrumbs to select Summary of Servers. In the Servers table, select li c e
server6 (you may have to click the Next link to be able to select this server). Click the
a ble
Configuration > Cluster tabs. Enter the following values for these fields and then click fe r
Save. a ns
− Replication Group: group4 n- t r
− Preferred Secondary Group: group3 a no
a s
j. In the Change Center, click Activate Changes.
a ) h i d eฺ
4. Start the servers in this cluster.
b c ฺc t Gu
ci derunning
a. To cut down on the number of concurrently
@
n servers, stop all other managed
servers that are running. Inic
k the Domain
S u
t Structure, expand Environment and select
r
Servers. Click the Control
oare a
ฺ RUNNING.
tab.
h i s
Select the check boxes next to all managed servers
not in cluster3 v k
that t
e Yes. Click Shutdown and select Force Shutdown Now.
When asked d r a
to u
confirm, s
click
c
b. In ithe ( z
Domain
to
Structure, expand Environment and select Clusters.
R
c. aInk the Clusters table, select cluster3.
o
avk d. Click the Control tab.
Zdr 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. (Optional if you have time and are interested) Check to see whether the replication group
configuration overrides the “chose a different machine” preference. To do this, you need to
target a data source to this cluster, deploy an application that uses in-memory session
replication to this cluster, run the application, and then see which server is chosen as the
secondary server to the primary server servicing your requests.
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 on the name of datasource1.
d. Click the Targets tab.
e. Select the check box for cluster3. Ensure that All servers in the cluster is selected.
f. Click Save.
g. In the Domain Structure, select Deployments.
h. In the Deployments table, click the contacts application.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Clusters


Chapter 13 - Page 14
i. Click the Targets tab.
j. Select the check box next to cluster3. Ensure that the All servers in the cluster
option button is selected.
k. Click Save.
l. In the Change Center, click Activate Changes.
m. In the Domain Structure, select Deployments. Ensure the contacts application is
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

Active. If not, start servicing all requests.


n. Do not close the admin console.
o. In the web browser, open a new window or tab.
p. Enter the URL for the application running on server3:
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.
nse
q. Click the link browse all contacts. li c e
r. Return to the admin console. In the domain structure, expand Environment and select
a ble
Clusters. In the Clusters table, select cluster3. fe r
s. Click the Monitoring tab. a ns
n- t r
a no
t. In the server3 row, you should see a 1 in the Primary column. Look in the Secondary
Distribution Names column in all of the rows. If the replication group configuration
a s
a ) i d eฺ
works as suspected, you should see in the server5 row this value:
h
server3:1
b c ฺc t Gu
ci den
Note: Remember, server3 has “group1” as its replication group and “group2” as its
@
k i S tu
preferred secondary group. And server5 has “group2” as its replication group. So, even
c
o ฺra this
though server5 is on the same machine as server3, it is still chosen as the secondary
server because of the replication group configuration.
k
d r av use
c (z to
R aki
o
avk
Zdr

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

Practices for Lesson 13: Clusters


Chapter 13 - Page 15
Practice Solution: 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© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

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

Practices for Lesson 13: Clusters


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

nse
li c e
a ble
fe r
a ns
n- t r
Practices for o
nLesson 14:
s a
c a Guid ) ha
Clusters eฺ

c ibcChapter
e n t
14

i c@ Stu d
k
ฺra this
k o
d r av use
c (z to
R aki
o
avk
Zdr

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

Practices for Lesson 14: Clusters


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© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

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

Practices for Lesson 14: Clusters


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© 2015, 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.
nse
2. Open the WebLogic Server administration console.
li c e
3. So unnecessary servers are not running, shut down all managed servers.
a ble
Note: You are also shutting down servers you want to be running, because the changes
fe r
being made only take effect after a server restart, so you are shutting down these servers
a ns
ahead of time.
n- t r
no
a. In the Domain Structure, expand Environment and select Servers.
a
b. Click the Control tab. a s
a ) h i d eฺ
c. Select the check box in front of all RUNNING managed servers.
b c ฺc t Gu
@ ci den
d. Click Shutdown > Force Shutdown Now. Click Yes when asked to confirm. Wait for
the State of the servers to be SHUTDOWN.
k i c S tu
o ฺra this
Note: You may need to click the Next link to access all the servers. Select any running
managed servers on the next page and shut them down, too.
k
4. r av use
Configure a replication channel for each server in cluster1.
d
c (z to
a. In the Change Center, click Lock & Edit.
aki
b. In the Domain Structure, expand Environment and select Servers.
R
o
avk c. Select server1 in the Servers table.

Zdr 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 © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Clusters


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© 2015, 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 nse
li c e
Listen Port 6000
a ble
External Listen Address (blank) fe r
a ns
External Listen Port (blank)
n- t r
Enabled
a no Selected
a s
Tunneling Enabled Not selected
a ) h i d eฺ
HTTP Enabled for This Protocol
c c t Gu
ฺSelected
Outbound Enabled
b
ci Selected
en
ic @ u d
t Not selected
Two Way SSL Enabled
r a k s S
v
Client Certificatek ฺ
oEnforcede thi Not selected
r a
d Center, u s
z
k. In the (Change
i c to click Activate Changes.
5. k the cluster to use the new replication channel.
Configure
Ra
a v ko b. a. In the Change Center, click Lock & Edit.

Zdr
In the Domain Structure, expand Environment and select Clusters.
c. 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 © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Clusters


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© 2015, 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,
nse
deploy an application that uses in-memory session replication to this cluster, and run the
li c e
application.
a ble
Note: If the data source and application are already targeted to cluster1 you can skip those fe r
steps when you get to them.
a ns
a. Return to the admin console. n- t r
b. In the Change Center, click Lock & Edit. a no
a s
a ) h i d eฺ
c. In the Domain Structure, expand Services and select Data Sources.

b c ฺc t Gu
d. In the Data Sources table, click the name of datasource1.
e. Click the Targets tab.
@ ci den
i c tu
f. If the data source is already targeted to cluster1, move on to the next step. If not, select
k S
k o ฺra this
the check box for cluster1. Ensure All servers in the cluster is selected. Click Save.

d r av use
g. In the Domain Structure, select Deployments.
z to
h. In the Deployments table, click the contacts application.
c (
R aki
i. Click the Targets tab.
j. If the application is already targeted to cluster1, move on to the next step. If not, select
o
avk the check box next to cluster1. Ensure that the All servers in the cluster option
Zdr 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 © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Clusters


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© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

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

Practices for Lesson 14: Clusters


Chapter 14 - Page 6
Practice Solution: 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© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

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

Practices for Lesson 14: Clusters


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

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

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

Practices for Lesson 14: Clusters


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

nse
li c e
a ble
fe r
a ns
n- t r
Practices for o
nLesson 15:
s a
c a Guid ) ha
Transactions eฺ

c ibcChapter
e n t
15

i c@ Stu d
k
ฺra this
k o
d r av use
c ( z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c ( z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, 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.
nse
Tasks li c e
1. Connect to host01. a ble
fe r
2. Open the WebLogic Server administration console.
a ns
3. Create a new generic JDBC data source for the transaction log.
n- t r
no
a. Lock the configuration. In the Change Center, click the Lock & Edit button.
a
a s
b. In the Domain Structure, expand Services and then select Data Sources.
a ) h i d eฺ
c. Above the Data Sources table, click the New button and select Generic Data Source.
b c ฺc t Gu
@ ci den
d. The “create a data source” wizard starts. Use the guidelines in the following table to
create a new generic data source:
k i c S t u
Step
k o ฺra this
Window/Page
Description
Choices or Values

d r u se Enter or select these values for the following fields:


ava New JDBC
a.
i c z Source:
Create
(Data to JDBC
k Data Source • Name: tlogdatasource1
Ra
a v ko Properties (page 1) • JNDI Name: tlogds1

Zdr
• 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: • Database Name: orcl
Copyright © 2014, 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 • Host Name: host02.example.com
Properties
• Port: 1521
• Database User Name: oracle
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

• Password: Welcome1
• Confirm Password: Welcome1
• oracle.jdbc.DRCPConnectionClass: (leave blank)
Click Next.
e. Create a New JDBC Click the Test Configuration button.
Data Source: Test When the message “Connection test succeeded.”
Database displays, click Next. nse
Connection
Note: If the test fails, click the Back button and check li c e
your entries. Correct and mistakes and come back to
a ble
this page and try the test again fe r
a ns
f. Create a New JDBC Under Clusters, select cluster2. Ensure that the All
n- t r
Data Source: Select
Targets a
Click Finish.
no
servers in the cluster option button is selected.

a s
e. In the Change Center, click Activate Changes. a ) h i d eฺ
c ฺc have G u
Note: Notice the message at the top: “Allbchanges
necessary.” ci den t been activated. No restarts are

4. Set the Transaction Log Storekfori @ tu in the dynamic cluster to be a JDBC store.
c each server
ฺraclick Lock S
is& Edit.
k o
a. In the Change Center, t h
e Environment, expand Clusters, and select Server
r
b. In the Domain
d avStructure,
u sexpand
(z
Templates.
i c to
akBecause you want to set the transaction log store for the servers that are in the
Note:
R
v k o dynamic cluster, you change the template upon which they are based.
a
Zdr
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. The Prefix Name will be filled in for you automatically. Leave that field as it is.
h. Click Save.
i. In the Change Center, click Activate Changes.
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
tab. Select the check box in front of each of the servers in cluster2 that is RUNNING.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 15: Transactions


Chapter 15 - Page 4
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
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

Yes. Wait a little while and refresh the browser. Ensure the state of each of these
servers is RUNNING.
l. Minimize the web browser to use later.
5. Verify the TLog tables have been created.
a. Connect to host02.
Note: Notice that this is host02, not host01.
b. Open a Terminal window. Set a couple of environment variables and access SQL*Plus
as the oracle user. nse
li c e
$ export ORACLE_HOME=/u01/app/db11g/product/11.2.0/dbhome_1
a ble
$ export ORACLE_SID=orcl
fe r
$ $ORACLE_HOME/bin/sqlplus oracle/Welcome1
a ns
SQL*Plus: Release 11...
n- t r
...
a no
a s
etheฺ tables that end with
SQL>
) h
c. Within SQL*Plus, list all the oracle user’satables. i
Notice d
c ฺcin cluster2.
G uEach instance of WebLogic
“WLSTORE.” There is one for each server
b t
ciserverdtemplate
Server in that cluster, based on the en you modified, created a table for its
ic @ t u
TLog.
r a k s S
i user_tables;
v k oฺ e thfrom
SQL> select table_name

z d ra o us
c (
TABLE_NAME
i t
k
o Ra----------------------------
r a vk ...

Z d TLOG_CLUSTER2SERVER_4_WLSTORE
TLOG_CLUSTER2SERVER_1_WLSTORE
TLOG_CLUSTER2SERVER_2_WLSTORE
TLOG_CLUSTER2SERVER_3_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...
$
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.

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

Practices for Lesson 15: Transactions


Chapter 15 - Page 5
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
directory.
$ cd /practices/part1/practice15-01
$ cp contacts.war /u01/domains/part1/wlsadmin/apps
b. Return to the web browser running the administration console.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

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.
f. Click Next.
g. Click Finish.
h. In the Change Center, click Activate Changes.
nse
i. Lock the configuration again. li c e
j. In the Domain Structure, select Deployments.
a ble
fe r
k. Click on the name of the contacts application.
a ns
l. Click the Targets tab.
n- t r
Activate changes. a no
m. Select cluster2. Ensure that All servers in the cluster is selected. Click Save.

a s
a ) h i d eฺ
Note: If this application is already targeted to cluster2, you can skip this step.
c ฺc t Gu
n. Keep the administration console around, as you will need it shortly.
b
7. ci den
Use the application and edit some contacts.
@
k i c S tu
Note: The application has been modified so that when you edit a contact, half of the time
k o ฺra this
the transaction is committed, the other half of the time the application throws an exception

d r av use
and the transaction is rolled back. Using the modified version of the application will provide
z to
you with committed and rolled backed transactions to monitor.
c (
R aki
a. In the web browser, use the File menu and select either New Window or New Tab.

k o
av b. In the new web browser window or tab, enter the URL for the cluster proxy and the
Zdr 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.
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.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 15: Transactions


Chapter 15 - Page 6
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.)
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.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

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.
g. Notice under the Summary subtab, the number of transactions. Also notice the
number of committed transactions (Transactions Committed Total Count). The other
transactions were rolled back (Transactions Rollled Back for Application Errors Total
Count). nse
li c e
9. (Optional) If you are interested and have time, you can see what happened by viewing your
primary server’s “out” file. a ble
fe r
a. Access the host where your primary server runs. (You figured out your primary server
a ns
in the previous task.) You can use the Servers table in the admin console to see on
n- t r
a no
which machine your primary server runs. If it runs on machine1, use host01. If it runs
on machine2, use host02. In either case the password is oracle.
a s
b. Once on the proper host, open a Terminal window
a ) h i d eฺ to the servers
and navigate
directory under the domain:
b c ฺc t Gu
ci den
$ cd /u01/domains/part1/wlsadmin/servers
@
k i c S tu
ฺra fortyour
c. Then cd into the directory
k o h is primary server (for example, cluster2server-1):
r av use
$ cd cluster2server-1
d
d. Then cd
i c to directory:
(zinto the logs
k
o e.Ra$ cd logs
r a vk Edit the “out” file for this server (for example, cluster2server-1.out):

Z d $ 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 © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 15: Transactions


Chapter 15 - Page 7
Practice Solution: 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© 2015, 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.
nse
a. Open the WebLogic Server administration console. li c e
b. In the Domain Structure, expand Environment, and select Servers. Click the Control
a ble
tab. Select the check box in front of each of the servers in cluster2 that is RUNNING. fe r
Click the Shutdown button and select Force Shutdown Now. When asked whether a ns
you are sure, click Yes. n- t r
no
c. Wait a little while and refresh the browser. Ensure the state of each of the servers in
a
cluster2 is SHUTDOWN. a s
3. Run the solution script. a ) h i d eฺ
b c ฺc t Gu
a. In a Terminal window, run the solution script.
@ ci den
k i c
$ cd /practices/part1/practice15-01
S tu
$ ./solution.sh
k o ฺra this
Note v use
racalls
− Thisz
( d
script
t oa WLST script that creates a data source to be used for TLogs. It
c
kidynamic
then calls another WLST script that modifies the server template (on which the
R a servers are based) to use that data source for its TLogs. Finally, it calls a
vk o WLST script that redeploys the contacts application with a new version. The new
dr a version of the contacts application sometimes rolls back transactions, so there is
Z 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 © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 15: Transactions


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

nse
li c e
a ble
fe r
a ns
n- t r
Practices for o
nLesson 16:
s a
c a Guid ) ha Server
WebLogic eฺ Security

c ibcChapter
e n t
16

i c@ Stu d
k
ฺra this
k o
d r av use
c (z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, 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. nse
li c e
Tasks a ble
fe r
1. Create some LDAP users in the external LDAP system.
a ns
a. Connect to host02.
n- t r
Note: Notice that this is host02, not host01.
a no
s
b. Open a Terminal window. Navigate to the bin directory under the installed OpenDS
a
) h
LDAP system, and launch the OpenDS control panel:
a i d eฺ
$ cd /u01/app/ldap/bin
b c ฺc t Gu
$ ./control-panel
@ ci den
k i
c. A dialog box appears warningc that the
S u Server is not running. Click OK to close it.
tLocal
k o ฺra this
d. Click the Start button.
d r av use
i c (z to
k
o Ra
r a vk
Z d e. When prompted, enter the password, Welcome1, 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.

h. Click the base node in the list on the left, dc=example,dc=com. Then right-click and
select New User.

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

Practices for Lesson 16: WebLogic Server Security


Chapter 16 - Page 3
i. Enter or select the following values and then click OK.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

Field Value
First Name Larry
Last Name Fine
Common Name Larry Fine
User ID larryf
Password Welcome1
nse
Password (Confirm) Welcome1 li c e
E-mail a ble
larry.fine@example.com
fe r
Naming Attribute uid
a ns
Note: Leave blank any fields not listed. n- t r
a no
j. After the user has been successfully created, close the “Entry created” dialog box.
a s
Note: It may be behind other windows.
a ) h i d eฺ
b c ฺc t Gu
k. Click the base node again, dc=example,dc=com. Right-click and select New User.
ci den
Then enter or select the following values and click OK.
@
Field k i c S tu Value
First Name k o ฺra thMoe is
Last Name d r av use Howard
i c (z to
a k
Common Name Moe Howard
R
a v ko User ID moeh

Zdr Password Welcome1


Password (Confirm) Welcome1
E-mail moe.howard@example.com
Naming Attribute uid
Note: Leave blank any fields 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 © 2014, 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© 2015, 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.
nse
Tip: Click the “X” at the top right, or select File > Exit.
li c e
j. Close the Terminal window.
a ble
3. Open the WebLogic Server administration console.
fe r
4. Add the external LDAP system as an authentication provider to the domain’s security realm. a ns
a. In the Change Center, click the Lock & Edit button. n- t r
a
b. In the Domain Structure, select Security Realms. no
a s
c. In the Realms table, click myrealm.
a ) h i d eฺ
b c ฺc t Gu
d. Click the Providers > Authentication tabs.
e. Click the New button.
@ ci den
i c tu
f. Enter or select the following, then click OK.
k S
Field oฺ
ra this Value
a v k s e
Name dr
( z t ou CompanyLDAP

a kic
Type LDAPAuthenticator
R
a v ko h. g. In the Authentication Providers table, click the name of the new provider.

Zdr
Click the Configuration > Provider Specific tabs.
i. 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 © 2014, 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© 2015, 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.
nse
e. In the Authentication Providers table, click the CompanyLDAP provider.
li c e
f. Ensure that the Configuration > Common tabs are selected.
a ble
g. Set the Control Flag to Sufficient. fe r
a ns
h. Click Save.
n- t r
Save that change. a no
i. Similarly, edit DefaultAuthenticator and set its Control Flag to Sufficient as well.

a s
j. In the Change Center, click Activate Changes.
a ) h i d eฺ
b c ฺc t Gu
Note: Notice the message that some items must be restarted. You need to stop and start
ci den
all servers that are running. (The admin server and the managed servers need to access
@
the new external LDAP.)
k i c S tu
6. ฺra this
Navigate to the practice folder and execute the following script to disable the user cache.
k o
d r av use
$ cd /practices/part1/practice16-01
z to
$ ./disable_cache.sh
c (
7.
aki
Stop all the managed servers.
R
a. In the Domain Structure, expand Environment and then select Servers.
o
avk b. On the right, click the Control tab.
Zdr 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.

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

Practices for Lesson 16: WebLogic Server Security


Chapter 16 - Page 6
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.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

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.
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. nse
d. Select the check box next to all the managed servers in cluster2. Click the Start button. li c e
When asked to confirm, click Yes. a ble
fe r
e. Wait a moment and refresh the screen. Ensure that the “State” column in the table
a ns
confirms that all these managed servers are RUNNING.
n- t r
deployment descriptors to: a no
11. Deploy and start an application that uses role-based security. This application uses its

a s
− Define a role called manager.
a ) h i d eฺ
c
− Protect certain resources, which only c int the
ฺusers G umanager role are allowed to
access.
b
ci den
− Map the manager rolekto i @ tucalled boss.
ca principal
a group
ฺrboss S
isshould be allowed to access the protected
k
Therefore, any user in o
the t h
resources.
d r av use
a. Open
i c to window on host01 and navigate to the current practice directory.
(aznew Terminal
k the new application to the domain's application directory.
aCopy
R
o $ cd /practices/part1/practice16-01
av k
Z dr $ cp timeoff.war /u01/domains/part1/wlsadmin/apps
b. Return to the web browser running the admin console.
c. In the Change Center, click Lock & Edit.
d. In the Domain Structure, select Deployments.
e. Above the Deployments table, click Install.
f. Using the links, navigate to:
host01.example.com/u01/domains/part1/wlsadmin/apps
g. Select the option button in front of timeoff.war and click Next.
h. Ensure that Install this deployment as an application is selected. Click Next.
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.

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

Practices for Lesson 16: WebLogic Server Security


Chapter 16 - Page 7
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.
12. Use the new application. Log in as a user that does not have the correct role to access the
protected resources.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

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.
d. Click the Request Time Off link.

nse
li c e
a ble
e. Fill out the form and click the Submit Report button. fe r
f. Click the Back to Home Page link. a ns
Note: This part of the application is not protected, so it is open to anyone. n- t r
g. Now try the Close an Office link. a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
i c( z to
h.
k
aWhen the “Log In” page displays, enter the username and password of the non-
R
o manager and then click Log In.
av k
Z dr − User Name: larryf
− Password: Welcome1

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

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

Practices for Lesson 16: WebLogic Server Security


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

j. Close the web browser.


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:
nse
http://host01.example.com:7777/timeoff
li c e
c. The timeoff application opens.
a ble
d. Click the Close an Office link.
fe r
e. When the “Log In” page displays, enter the username and password of the manager
a ns
and then click Log In.
n- t r
− User Name: moeh
a no
− Password: Welcome1 a s
f. This time, because Moe is a manager, youa )
are
h
takenutoid
eฺ
the “Close an Office Form.”
b c ฺc t G
@ ci den
k i c S tu
k o ฺra this
d r av use
i c (z to
k
o Ra
r a vk
Z d Note: The user Moe (uid: moeh) was placed in the boss group. The boss principal was
mapped to the role manager by the application’s deployment descriptor. The protected
resources (particular pages in the web application) allow the role manager to have access.
g. Enter a Date and a Reason and click the Submit Form button.
h. On the next page, click the Back to Home Page link.
i. Close the web browser.

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

Practices for Lesson 16: WebLogic Server Security


Chapter 16 - Page 9
Practice Solution: 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© 2015, 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. nse
$ cd /practices/part1/practice16-01 li c e
$ ./solution.sh
r a ble
Note: This script runs an executable under the bin directory of the LDAP server
n s fe that
a LDAP server.
imports users and a group. It then calls another executable that startstrthe
-
n
o in cluster2,
Next, it calls a WLST script that creates the external LDAP authentication
n provider within
s a
the domain. Finally, it calls two more scripts: one stops all the servers the next
starts them up again. (Servers must be rebooted forhthe
) a e ฺ
authentication provider changes to
take effect.) Stopping and starting the servers can
c d
i so be patient.
a takeGauwhile,
c ฺ
b. Close the Terminal window.
d e nt
cib application
3. Connect to host01. Run a script to@ deploy anu to the dynamic cluster. Then stop
k i c S t
and restart the administration
ฺ r a server. is
k
a. In a Terminal window, o run theth
deployment script.
d r av use
c (z
$ i./deploy.sh
to
$ cd /practices/part1/practice16-01

k
o b.Ra If you get the WLContext.close() warning, ignore it.
Note:

r a vk Close the Terminal window.


Z d 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 username and
password (weblogic and Welcome1).
e. Wait for the server to indicate it is in RUNNING mode.

Copyright © 2014, 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© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
Practices for o
nLesson 17:
s a
Backing
a ) ha UpidaeฺDomain and
ฺc t Gu WebLogic Server
cUpgrading
c ib en
k i tud 17
c@ SChapter
k o ฺra this
d r av use
c ( z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c ( z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, 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 nse
li c e
1. Lock the domain configuration by using the WebLogic administration console.
a ble
a. In the Change Center, click Lock & Edit.
fe r
Note: Although in the classroom, no other administrator will be making configuration
a ns
changes to your domain, in the real world this step is recommended to keep other
n- t r
created. a no
administrators from making changes to the domain configuration while the backup is being

a s
2. Create a backup of the domain on host01.
a ) h i d eฺ
c ฺc t Gu
Note: You are just backing up the domain. This is just one of the tasks you would perform
b
in an online backup.
@ ci den
i c tu
a. Open a Terminal window on host01. Navigate to the directory that holds the domain:
k S
o ฺra this
/u01/domains/part1.
k
r av use
$ cd /u01/domains/part1
d
b. Create(z
i c tothe domain.
a backup of
$k tar –zcpvf /home/oracle/wlsadminbackup.tarz
Ra
wlsadmin

a v ko Note: The options are:

Zdr
− 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.
4. Make sure the cluster2 servers on host02 (machine2) are running.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Backing Up a Domain and Upgrading WebLogic Server
Chapter 17 - Page 3
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.
5. Stop all servers in the domain that are running on host01 (machine1).
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

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
nse
Shutdown Now. Then click Yes.
li c e
Note: Notice the message that you no longer have an administration console, because the
a ble
admin server is shutting down.
fe r
6. Find the Node Manager running on host01 and stop it.
a ns
Note: You want to stop Node Manager before removing its directory. n- t r
no
a. Find the Terminal window on host01 that is running Node Manager. Stop it by pressing
a
a s
Ctrl + C in the window. Do not close this Terminal window, you will use it later.
7. a ) h i d eฺ
Simulate a “media failure” by renaming the domain directory. (You could delete it, but we
c ฺc t Gu
will rename it, just in case the backup does not work.)
b
ci den
a. Open a new Terminal window on host01. Rename the domain directory.
@
k i c S tu
k o ฺra this
Note: The command is shown on two lines due to space limitations. Enter it on one line.
$ mv /u01/domains/part1/wlsadmin
d r av use /u01/domains/part1/wlsadminorig
c (z to
aki
8. Before restoring the domain on host01 and starting the admin server and some managed
servers, notice that the servers on host02 (machine2) continue to run.
o R
avk
a. Return to the web browser. Use it to access an application running on the two

Zdr
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
Note: The options are:
− z: Unzip the archive
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Backing Up a Domain and Upgrading WebLogic Server
Chapter 17 - Page 4
− x: Extract the archive
− p: Preserve file and directory permissions
− v: Verbose output
− f: File name
10. Restart the Node Manager on host01.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

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
retrieve the last command entered. Start the admin server by entering that command:
nse
$ ./startWebLogic.sh
li c e
Note: If the window has been closed, open a new Terminal window, navigate to the domain
directory and start the admin server. a ble
fe r
$ cd /u01/domains/part1/wlsadmin
a ns
$ ./startWebLogic.sh
n- t r
Note: Wait for the server to show it is in RUNNING mode.
a no
12. Open the WebLogic administration console. a s
a ) h i d eฺ
13. Start the two managed servers in cluster2 that run on machine1 (and that use the domain
directories just restored).
b c ฺc t Gu
ci den
a. In the Domain Structure, expand Environment, and select Servers.
@
b. Click the Control tab. k i c S tu
k o ฺra this
c. Select the check box in front of the two managed servers in cluster2 that are on
r av use
machine1 (which is host01).
d
c ( z to
Note: The servers are cluster2server-1 and cluster2server-3.
R aki
d. Click Start. Then click Yes.
o
avk e. Wait for a little while and refresh the web browser. Ensure the State of the servers is
Zdr RUNNING.
Note: You have restored the “missing” domain files from a backup and restarted the
servers running on that machine.

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

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

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c ( z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, Oracle and/or its affiliatesฺ

nse
li c e
a ble
fe r
a ns
n- t r
Appendix A: o
nConnecting to
s a
c a Guid ) ha eฺ
the Environment

c ibcChapter
e n t
18

i c@ Stu d
k
ฺra this
k o
d r av use
c (z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, Oracle and/or its affiliatesฺ

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

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

Copyright © 2014, 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© 2015, 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.
nse
From your gateway machine, double-click the VNC Viewer - host01 icon on the desktop.
li c e
You connect to host01 as the oracle user. (The Username field is not displayed.) Enter
a ble
oracle in the Password field (it displays as ******) and press the Enter key.
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
2. Accessing host02.
k o ฺra this
r
From your gateway avmachine,
u e
sdouble-click the VNC Viewer - host02 icon on the desktop.
(
You connect z d
to host02t o
as the oracle user. (The Username field is not displayed.) Enter
i c
k in the Password field (it displays as ******) and press the Enter key.
Ra
oracle

vk o
dr a
Z

Copyright © 2014, 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© 2015, 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.

nse
li c e
a ble
fe r
a ns
n- t r
a no
a s
a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c (z to
R aki
o
avk
Zdr

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

Appendix A: Connecting to the Environment


Chapter 18 - Page 4
Course Practice Environment: Security Credentials

For OS usernames and passwords, see the following:


• If you are attending a classroom-based or live virtual class, ask your instructor or LVC
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2015, Oracle and/or its affiliatesฺ

producer for OS credential information.


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

For product-specific credentials used in this course, see the following table:

Product-Specific Credentials
nse
Product/Application Username Password li c e
Oracle WebLogic Server weblogic Welcome1 a ble
fe r
Oracle Database system Welcome1
a n s
Oracle Database oracle -t r
nWelcome1
a no Welcome1
Oracle HTTP Server
a s weblogic

a ) h i d eฺ
b c ฺc t Gu
@ ci den
k i c S tu
k o ฺra this
d r av use
c ( z to
R aki
o
avk
Zdr

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

Practices for Lesson Intro: Course Practice Environment


Page 1 of 1

Vous aimerez peut-être aussi