You are on page 1of 438

Oracle SOA Suite 12c: System

Architecture and Administration


Activity Guide
D87561GC10
Edition 1.0 | July 2015 | D91684

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


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

Disclaimer

This document contains proprietary information and is protected by copyright and other intellectual property laws. You may copy and
print this document solely for your own use in an Oracle training course. The document may not be modified or altered in any way.
Except where your use constitutes "fair use" under copyright law, you may not use, share, download, upload, copy, print, display,
perform, reproduce, publish, license, post, transmit, or distribute this document in whole or in part without the express authorization
of Oracle.

The information contained in this document is subject to change without notice. If you find any problems in the document, please
report them in writing to: Oracle University, 500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not
warranted to be error-free.

Restricted Rights Notice

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

U.S. GOVERNMENT RIGHTS


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

Trademark Notice

Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective
owners.

Authors
Glenn Stokol, Ron Pinkerton, Armando Hernandez

Technical Contributors and Reviewers


Veerabhadra Rao Putrevu, Alessandro Leite, S. Matt Taylor Jr, Mark Lindros, TJ Palazzolo,
David Mills, Jonathan Ortiz Luna, Jay Kasi, Fermin Castro Alonso, Deepak Arora, Derek Kam,
David Read, Vishal Parashar, Colin Pearce, Maria Salzberger, Donna Keesling, Scott Haaland,
Joe Greenwald, Taj-Ul Islam, Antonella Giovannetti, Rajesh Raheja, Anuj Dwivedi

This book was published using: Oracle Tutor


Table of Contents
Course Practice Environment: Security Credentials ............................................................................... I-1
Practices for Lesson 1: Introduction ........................................................................................................ 1-1
Practices for Lesson 1 ............................................................................................................................. 1-2
Practices for Lesson 2: Planning an Oracle SOA Suite 12c Deployment Architecture ........................... 2-1
Overview of Practices for Lesson 2 .......................................................................................................... 2-2
Practice 2-1: Planning an Enterprise Deployment of Oracle SOA Suite 12c ............................................... 2-3
Practice 2-2: Performing Pre-Installation Checks and Setup ..................................................................... 2-15
Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c .................................... 3-1
Overview of Practices for Lesson 3 .......................................................................................................... 3-2
Practice 3-1: Installing the Oracle Fusion Middleware Infrastructure.......................................................... 3-3
Practice 3-2: Creating a Clustered SOA Domain for the Infrastructure ....................................................... 3-8
Practice 3-3: Integrating an LDAP Provider .............................................................................................. 3-39
Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c ............................................ 4-1
Practices for Lesson 4 ............................................................................................................................. 4-2
Practice 4-1: Installing Oracle SOA Suite 12c........................................................................................... 4-3
Practice 4-2: Extending the SOA Domain with Oracle SOA Suite 12c ....................................................... 4-6
Practice 4-3: Starting and Verifying the SOA Domain ............................................................................... 4-22
Practices for Lesson 5: Configuring a Load Balancer for Enterprise Deployment.................................. 5-1
Practices for Lesson 5 ............................................................................................................................. 5-2
Practice 5-1: Creating and Configuring the Load Balancer ........................................................................ 5-3
Practices for Lesson 6: High Availability ................................................................................................. 6-1
Practices for Lesson 6 ............................................................................................................................. 6-2
Practice 6-1: Testing Manual Failover of the Administration Server ........................................................... 6-3
Practice 6-2: Configuring the File Adapter for High Availability .................................................................. 6-7
Practice 6-3: Configuring the DBAdapter and Resources .......................................................................... 6-12
Practice 6-4: Configuring the JMS Adapter and Resources ....................................................................... 6-26
Practice Summary................................................................................................................................... 6-40
Practices for Lesson 7: Fundamentals of Oracle SOA Suite ................................................................... 7-1
Practices for Lesson 7 ............................................................................................................................. 7-2
Practices for Lesson 8: Deploying and Testing SOA Composite ............................................................ 8-1
Practices for Lesson 8 ............................................................................................................................. 8-2
Practice 8-1: Deploying and Testing the HelloWorld Composite Application .............................................. 8-3
Practice 8-2: Testing the Application ........................................................................................................ 8-5
Practice 8-3: Undeploying an Application with an Ant Script...................................................................... 8-10
Practice 8-4: Exploring the Composite Application Files ........................................................................... 8-11
Practices for Lesson 9: Managing the Composite Application ................................................................ 9-1
Overview of Practices for Lesson 9 .......................................................................................................... 9-2
Practice 9-1: Creating a Partition ............................................................................................................. 9-3
Practice 9-2: Examining the Contents of the SAR Files............................................................................. 9-6
Practices for Lesson 10: Administering the SOA Run Time .................................................................... 10-1
Practices for Lesson 10 ........................................................................................................................... 10-2
Practice 10-1: Deploying the Composite Applications ............................................................................... 10-3
Practice 10-2: Exploring the Features of the Error Hospital ....................................................................... 10-11
Practices for Lesson 11: Business Events............................................................................................... 11-1
Practices for Lesson 11 ........................................................................................................................... 11-2
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Oracle SOA Suite 12c: System Architecture and Administration Table of Contents
iii
Practice 11-1: Deploying the Stock Update Composite ............................................................................. 11-3
Practice 11-2: Testing the Subscriber of the StockUpdated Event ............................................................. 11-5
Practice 11-3: Deploying, Testing, and Monitoring the Event Publishing Composite................................... 11-13
Practices for Lesson 12: The User Messaging Service ............................................................................ 12-1
Practices for Lesson 12 ........................................................................................................................... 12-2
Practice 12-1: Configuring the Email Driver .............................................................................................. 12-3
Practice 12-2: Deploying the Composite Application ................................................................................. 12-8
Practice 12-3: Instantiating the Composite That Generates Email ............................................................. 12-10
Practices for Lesson 13: Performance Tuning and Troubleshooting ...................................................... 13-1
Practices for Lesson 13 ........................................................................................................................... 13-2
Part 1: Performance Tuning..................................................................................................................... 13-3
Practice 13-1: Deploying an EAR Application ........................................................................................... 13-4
Practice 13-2: Examining Server Information in the Routing Topology....................................................... 13-8
Practice 13-3: Observing the Performance of the WebLogic Server JVM Instance ..................................... 13-14
Practice 13-4: Exploring Metrics for Oracle SOA Suite Components ......................................................... 13-21
Part 2: Troubleshooting ........................................................................................................................... 13-33
Practice 13-5: Deploying a Troublesome Composite Application ............................................................... 13-34
Practice 13-6: Testing the TroubleSomeComposite Interfaces .................................................................. 13-45
Practices for Lesson 14: Backup and Recovery of Oracle SOA Suite ..................................................... 14-1
Practices for Lesson 14 ........................................................................................................................... 14-2
Practice 14-1: Backing Up and Breaking the Enterprise Deployment Domain ............................................ 14-3
Practice 14-2: Restoring the Enterprise Deployment Domain .................................................................... 14-5
Practices for Lesson 15: Securing SOA Composite Applications ........................................................... 15-1
Practices for Lesson 15 ........................................................................................................................... 15-3
Practice 15-1: Creating a Simple Username Token Security Policy ........................................................... 15-4
Practice 15-2: Applying the Security Policy to a Service Endpoint ............................................................. 15-13
Practice 15-3: Testing the Invocation of the Secured Service Endpoint ..................................................... 15-17
Practices for Lesson 16: Using Enterprise Scheduler ............................................................................. 16-1
Practices for Lesson 16 ........................................................................................................................... 16-2
Practice 16-1: Extending the Domain with Oracle Enterprise Scheduler .................................................... 16-3
Practice 16-2: Activating and Deactivating Adapters by Using ESS ........................................................... 16-17
Appendix A ............................................................................................................................................... 17-1
Appendix A ............................................................................................................................................. 17-2
Appendix A-1: Examining the Load Balancer HttpClusterServlets ............................................................. 17-3
Practice Script Source Code…………………………………………………………………………………………. 18-1

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

Oracle SOA Suite 12c: System Architecture and Administration Table of Contents
iv
Course Practice
Environment: Security
Credentials
Chapter I

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

Course Practice Environment: Security Credentials


Chapter I - Page 1
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
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 the product-specific credentials that are used in this course, see the following table:

Product-Specific Credentials
Product/Application Username Password
Oracle Database SYS oracle
Oracle Database All database schema names Welcome1
beginning with EDG_
Oracle Database SOADEMO soademo
Oracle WebLogic Server Administration weblogic Welcome1
Console
Oracle WebLogic Server Administration weblogic_soa Welcome1
Console
Oracle Enterprise Manager Fusion weblogic Welcome1
Middleware Control
Oracle Enterprise Manager Fusion weblogic_soa Welcome1
Middleware Control
Node Manager instances weblogic Welcome1
Oracle Unified Directory (LDAP Server) cn=”Directory Manager” Welcome1
Oracle Unified Directory All LDAP users Welcome1
Java Mail Server (JES) user accounts and All usernames Welcome1
Thunderbird email accounts
Email demoadmin@example.com Welcome1
Email jcooper@example.com Welcome1
Email sking@example.com Welcome1
Linux “service” commands Run as the oracle user oracle
TigerVNC for host01 - oracle
TigerVNC for host02 - oracle
Linux user account oracle oracle
Linux access to Desktop for LVC oracle oracle

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

Course Practice Environment: Security Credentials


Chapter I - Page 2
Note: All passwords are case-sensitive, except that of the database users SYS and
SOADEMO. Most Oracle WebLogic Server, LDAP server administration, and LDAP user
accounts are created during class. Therefore, students can choose their own passwords.
However, the passwords that are listed in the preceding table, which are related to Oracle
WebLogic Server, some LDAP users, and Oracle SOA Suite 12c applications, are suggested
values for consistency during class practices.

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

Course Practice Environment: Security Credentials


Chapter I - Page 3
Practices for Lesson 1:
Introduction
Chapter 1

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

Practices for Lesson 1: Introduction


Chapter 1 - Page 1
Overview of Practices for Lesson 1

There are no practices for this lesson.

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

Practices for Lesson 1: Introduction


Chapter 1 - Page 2
Practices for Lesson 2:
Planning an Oracle SOA
Suite 12c Deployment
Architecture
Chapter 2

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

Practices for Lesson 2: Planning an Oracle SOA Suite 12c Deployment Architecture
Chapter 2 - Page 1
Overview of Practices for Lesson 2

Practices Overview
In the practices for this lesson, you plan the installation of a clustered Oracle SOA Suite 12c
implementation based on the technical environment that is made available in class. The
planning includes performing the necessary pre-installation checks to verify that the required
software and operating system settings are installed.
Note: About Linux Commands
The Linux command-line instructions that are used in the practice are prefixed with a single
dollar character ($), which represents the command-line prompt. The actual command-line
prompt that is displayed in the Terminal applications sessions that you start may differ from the
prompt that is used in this document.
Saving Time with Practice Documents
Some text and graphics in the practice documents are highlighted with a gray background to
indicate that the information is not part of the practice instructions. For example:
This is additional text that is not part of the instructions!
Therefore, to save time while performing the practice tasks, you can skim through or skip the
text sections with the gray background as shown in the preceding line.

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

Practices for Lesson 2: Planning an Oracle SOA Suite 12c Deployment Architecture
Chapter 2 - Page 2
Practice 2-1: Planning an Enterprise Deployment of Oracle SOA Suite
12c

Overview
In this practice, you edit an Excel spreadsheet called the “Oracle SOA Suite Enterprise
Deployment Workbook for Oracle SOA Suite” to work through the design plan for your
installation and configuration of an Oracle SOA Suite 12c cluster in your classroom
environment.

Assumptions
• You have access to the /nfshome/practices/practice02 folder in which
soa_edg_workbook.xlsx exists, which was downloaded from the Oracle SOA Suite
12c documentation web page
(http://docs.oracle.com/middleware/1213/cross/installtasks.htm).
Note: OpenOffice is installed on your computer to view and edit Excel spreadsheets.

Tasks: Planning Your SOA Installation


Your course environment provides the following resources for implementation of a SOA cluster:
• The virtual machine named host01, which is running Oracle Linux 6 update 3
• The virtual machine named host02, which is running Oracle Linux 6 update 3 and has
an Oracle Database 11g instance that is preinstalled that should be running
Hint: Use the following diagram as guide to the machines in the environment:

The deployment environment provides two virtual machine (VM) hosts for creating a SOA
cluster. To access each virtual host, you first connect to the OVM Server 3.2 environment and
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Planning an Oracle SOA Suite 12c Deployment Architecture
Chapter 2 - Page 3
use VNC (deskop icons) to create VNC sessions with each VM host. You can work with each
VM through a VNC session or by using secure shell (ssh) and the command line (where
appropriate).
Note: Both virtual machines have access to the following shared folders that are exported
from and mounted on NFS disks:
− The practice files are located in the /practices folder tree.
− The Oracle Fusion Middleware and Oracle SOA Suite installers are located in the
/install folder tree.
− The /u02 folder tree contains some pre-installed software for Oracle JDeveloper
and Oracle Unified Directory (an LDAP server). This folder tree must be used for the
WebLogic Administration Server’s configuration files when you create the WebLogic
domain for the SOA installation.
Tip: You can access the shared folders from the Dom-0 (host operating system)
machine by using the /nfshome prefix before /practices and /install,
respectively. However, except for this practice, all installers and practice files should be
accessed from within the environment of the Linux guest operating system within each
virtual machine. The /u02 folder is mounted on an NFS path, /nfsvol02, which is a
separate virtual disk to be used for the SOA installation configuration files.
To plan your configuration, edit the details for each of the following worksheet (tab) pages in the
Oracle SOA Suite Enterprise Deployment Workbook:
• Hardware - Host Computers
• Network - Virtual Hosts & Ports
• Storage - Directory Variables
• Database - Connection Details
The following image shows the Start Excel sheet tab page that you see when you open the
soa_edg_workbook.xlsx file that is to be edited (as described in subsequent steps).

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

Practices for Lesson 2: Planning an Oracle SOA Suite 12c Deployment Architecture
Chapter 2 - Page 4
Architecture Plans
Your task is to edit the Oracle SOA Suite Enterprise Deployment Workbook Excel spreadsheet
sections to plan the configuration of a clustered SOA topology. The document plans are used to
install and configure the SOA architecture that is represented in the following diagram:

The following image depicts the physical topology on the actual VM hosts:

Note: In the diagram, the following information is provided to help you document the required
information for planning your configuration:
a. The architectural design relies on the use of virtual host names, each of which is
assigned an associated virtual IP address. The use of virtual host names (and virtual IP
addresses), as recommended by the Oracle SOA Suite Enterprise Deployment Guide,
is essential for supporting failover capabilities.
b. The Oracle Database is installed on the host02 instance with the database SID ORCL
and service name orcl.example.com by using port 1521.

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

Practices for Lesson 2: Planning an Oracle SOA Suite 12c Deployment Architecture
Chapter 2 - Page 5
c. Plan the installation folder paths for the Oracle SOA Suite and dependent software
components on each host.
d. Plan your Oracle WebLogic Domain cluster structure based on the diagram, where:
1) The machine called host01 has:
a) A WebLogic Server (WLS) node manager instance listening on port 5556
b) The WLS Administration server listening on port 7001. The virtual host name
adminvh.example.com is used for the administration server instance.
c) A clustered WLS Managed Server to run the Oracle Fusion Middleware
(FMW) Infrastructure, Oracle Web Services Manager (OWSM), and Oracle
SOA Suite, listening on port 8001. The virtual host name
soavh01.example.com is used for the Managed Server instance.
d) A stand-alone WLS Managed Server running the HTTPClusterServlet listening
on port 8080 and 4443 (SSL) for use as a load balancer front end to the
clustered instances. This same WLS Managed Server is configured to
separate requests for the Administration Server from the SOA Servers by
using the WebLogic Channel functionality.
2) The machine called host02 has:
a) A WebLogic Server (WLS) node manager instance listening on port 5556
b) A clustered WLS Managed Server to run the Oracle Fusion Middleware
(FMW) Infrastructure, Oracle Web Services Manager (OWSM), and Oracle
SOA Suite, listening on port 8001. The virtual host name
soavh02.example.com is used for the Managed Server instance.
Note: In addition to running the Oracle Database instance that holds the database
schemas that are needed for the Oracle SOA Suite components, host02 can run
the LDAP server instance that is to be used for authentication.

Opening the Oracle SOA Suite Enterprise Deployment Workbook


In this section, you download the soa_edg_workbook.xlsx file from the Oracle SOA Suite
12c documentation web page or copy the file from the /nfshome/practices/practice02
folder in the context of the main desktop environment that is available to you. After downloading
or copying the file, you open the file in OpenOffice and edit the contents for each of the
sections.
1. To obtain a copy of the SOA Suite Enterprise Deployment Workbook Excel spreadsheet,
perform the following steps:
a. Open the web browser. To configure the settings to ask you where to download files,
perform the following actions:
1) In the web browser window, select Edit > Preferences.
2) In the General section of the Preferences window, in the Downloads section,
select the “Always ask me where to save files” option, and click Close.
b. Access the Oracle Fusion Middleware Documentation Release 12.1.3 Install, Patch,
and Upgrade web page by using the URL
http://docs.oracle.com/middleware/1213/cross/installtasks.htm.
The Oracle SOA Suite 12c Installation Documentation web page opens with the Install
tab selected.
c. In the section titled “Install a Production Environment,” click the “Enterprise
Deployment Workbook for Oracle SOA Suite [XLS]” link.
d. When prompted, save the file in your /home/oracle folder.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Planning an Oracle SOA Suite 12c Deployment Architecture
Chapter 2 - Page 6
Note: The layout of the web page may differ from the example shown in the preceding
step, and depends on the size of the browser window that you are using.
e. If you are unable to access the Oracle SOA Suite 12c Installation Documentation web
page, copy the soa_edg_workbook.xlsx file from the
/nfshome/practices/practice02 folder into your home folder (/home/oracle).
2. To open the soa_edg_workbook.xlsx file in the OpenOffice spreadsheet editor, perform
the following steps:
a. Double-click the “oracle’s Home” desktop icon.
A window titled “oracle” opens, displaying the files and folders contained in the
/home/oracle folder.
b. In the oracle window, double-click the soa_edg_workbook.xlsx file to open it in
OpenOffice.
Note: Alternatively, right-click the soa_edg_workbook.xlsx file and select “Open
with “Oracle Open Office 3.3 Calc””.
c. Verify that the Start worksheet tab page is visible after the file is opened in the
OpenOffice 3.3 Calc application, as shown in the following image:

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

Practices for Lesson 2: Planning an Oracle SOA Suite 12c Deployment Architecture
Chapter 2 - Page 7
Note: You can click the links in the Start worksheet or click the worksheet tab label
names to navigate to the worksheet section that is to be modified in subsequent steps.

Planning the Hardware - Host Computers


In this section, you modify the entries in the Hardware – Host Computer sheet (tab page) of the
workbook with information that is needed to describe the hardware components of your Oracle
SOA Suite topology.
3. To plan the hardware components for the classroom topology, perform the following steps:
a. On the Start worksheet tab, click the “Hardware – Host Computers” link (in Row 7 of
the Start worksheet) to open the related worksheet.

b. On the “Hardware – Host Computers” worksheet tab page, complete the field values
for the Real Host Name, IP Address, OS, and # of CPUs, and the RAM columns for
each of the Abstract Host Name entries listed.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Planning an Oracle SOA Suite 12c Deployment Architecture
Chapter 2 - Page 8
Hint: Use the following image of the course topology based on the actual virtual host
names to assist you:

You can change to super user to find information about your virtual machines by
executing the following commands in a terminal window that is opened from your
desktop:
$ sudo /usr/sbin/xm list
For example, the sample output for the xm list command should be similar to the
following results:
Name ID Mem VCPUs State Time(s)
Domain-0 0 1024 2 r----- 17160.9
host01 11 6500 2 -b---- 340.8
host02 12 6500 2 -b---- 18605.8
Notes:
− The xm list command shows Mem as megabyte quantities.
− View the contents of the /etc/hosts file to obtain the IP addresses for each
VM host.
− You need to populate only the WEBHOST1 row in the worksheet, and leave the
WEBHOST2 row empty, because the course uses one of the VM instances to
host the HTTPClusterServlet for the software-based load balancer on
WEBHOST1.
− Fill in the row for DBHOST1, because there is one database instance, and
therefore, you can leave the DBHOST2 row entry.
c. Close the Terminal application window that you started to execute the sudo command.
4. Verify that your plan resembles information in the following table of hardware components:
Real Host Name Abstract Host Name IP Address OS RAM
host01.example.com WEBHOST1 192.0.2.11 Linux 6.5Gb

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

Practices for Lesson 2: Planning an Oracle SOA Suite 12c Deployment Architecture
Chapter 2 - Page 9
WEBHOST2
host01.example.com SOAHOST1 192.0.2.11 Linux 6.5Gb
host02.example.com SOAHOST2 192.0.2.12 Linux 6.5Gb
host02.example.com DBHOST1 192.0.2.12 Linux 6.5Gb
DBHOST2
Note: The preceding table does not show the CPU column found in the worksheet.
However, each VM has been configured with the equivalent of two CPUs, as seen from the
output results of the xm list command. Use the following image of the “Hardware – Host
Computers” worksheet page as a guide:

In summary, the plan is to create a cluster of two WebLogic Managed Server instances, each
allocated to one of the VM hosts. The database is already installed on host02, and the plan is to
create a stand-alone WebLogic Managed Server for the WEBHOST1 load balancer.

Planning the Network - Virtual Hosts and Ports


In this section, you modify the entries in the Virtual Hosts and Ports sheet (tab page) of the
workbook with information that describes the virtual or physical hosts and ports to be used for
the various components in your Oracle SOA Suite topology. The worksheet for planning virtual
hosts uses the following abstract names for each virtual host:
• ADMINVHN for the WebLogic Administration Server
• SOAHOST1VHN for a WebLogic Managed Server running Oracle SOA Suite
• SOAHOST2VHN for another (clustered) WebLogic Managed Server running Oracle
SOA Suite
Note: Because the target environment that you are working with is based on using virtual
machines (VMs) for each host in your cluster, there is no requirement for virtual host names and
no need for virtual IP addresses. However, as discussed in the presentation part of the lesson,
virtual host and IP addresses may be necessary depending on the strategy that you wish to
implement for high availability, and backup and recovery purposes. For example, if you do not
use a VM implementation model, it is necessary to define a virtual IP address for your hosts so
that the configuration enables you to easily migrate WebLogic Server instances to another
physical machine to minimize the manual configuration tasks that may be needed to make
available an environment on a new physical host when an original host failed and could not be
restarted in a timely manner. Virtual IP addresses are then needed to support migration of the
WebLogic Administration Server to another physical machine.
5. To plan the host and port details for the classroom topology, perform the following steps:
a. In the Excel spreadsheet application window, either click the Start worksheet tab
followed by clicking the “Network - Virtual Hosts & Ports” link (in Row 8 of the Start

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

Practices for Lesson 2: Planning an Oracle SOA Suite 12c Deployment Architecture
Chapter 2 - Page 10
worksheet) to open the related worksheet, or click the “Network - Virtual Hosts & Ports”
worksheet tab name to make that worksheet active.
b. On the “Network - Virtual Hosts & Ports” worksheet tab page, fill in the details in the
Network – Virtual Hosts table, where:
− The WebLogic Administration host (ADMINVHN) is planned to reside on the same
virtual host as the first SOA virtual host (SOAHOST1VHN)
− Each SOA Managed Server is targeted to its own virtual host, which means that you
have two SOA virtual hosts (SOAHOST1VHN and SOAHOST2VHN)
Note: In the class environment, the VM host names represent your virtual host names.
c. On the “Network - Virtual Hosts & Ports” worksheet tab page, fill in the Network – Port
Number section by using the following guidelines:
− The HTTP_PORT number should be set as 8080 and is used for the Oracle
WebLogic Managed Server that is created to run the HTTPClusterServlet as the
load balancer.
− The SOA and WSM ports should both be set to 8001 because the plan is to have
these two components share the same Managed Server instance.
− The Node Manager port should be set to the default value of 5556.
− The OSB port is not used in this course.
− The OSN is not used in this course.
− The LDAP port should be set to 1389 and the LDAP SSL port set to 1636.
− The Database listener port is 1521.
6. Verify that your network virtual host and port planning documentation matches the relevant
host and port information shown in the following table:
Virtual Hosts:
Abstract Virtual Host Actual Virtual Host IP Address
ADMINVHN adminvh.example.com 192.0.2.20
SOAHOST1VHN soavh01.example.com 192.0.2.21
SOAHOST2VHN soavh02.example.com 192.0.2.22
Note: The SOAHOST1VHN1 and SOAHOST1VHN2 entries do not appear in this table
because they are not used in this course.
Port Numbers:
Port Variable Name Description Actual Port
Number
HTTP_PORT HTTP Server port (for admin access) 8080
LDAP_DIR_PORT OUD/OID Directory Services Port 1389
LDAP_DIR_SSL_PORT OUD/OID Directory Services SSL Port 1636
DB_LSNR_PORT Database Listener Port 1521
NMGR_PORT WLS Node Manager Listen Port 5556
SOA_PORT SOA Port 8001
WSM_PORT Oracle Web Services Manager Port 8001

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

Practices for Lesson 2: Planning an Oracle SOA Suite 12c Deployment Architecture
Chapter 2 - Page 11
Note: The ONS_PORT and OSB_PORT entries are not listed in the table because these
components are not used in this course. Use the following image of the “Network - Virtual
Hosts & Ports” worksheet page as a guide:

Planning the Storage - Directory Variables


In this section, you modify the entries in the “Storage – Directory Variables” sheet (tab page) of
the workbook with information that defines the folder structure that is created when you install
the Oracle WebLogic Server and Oracle SOA Suite 12c software, and the folders to be created
for the Oracle WebLogic Server domain for the Oracle SOA Suite cluster.
7. To plan the directory folder structure for the software binaries and the WebLogic domain of
the classroom topology, perform the following steps:
a. In the Excel spreadsheet application window, either click the Start worksheet tab
followed by clicking the “Storage - Directory Variables” link (in Row 9 of the Start
worksheet) to open the related worksheet, or click the “Storage - Directory Variables”
worksheet tab name to make that worksheet active.
b. On the “Storage - Directory Variables” worksheet tab page, you need to populate only
the Actual Value column in the section titled “Directory Location Variables - Application
Tier,” because you are not planning to create a full Web Tier installation for this course
environment (due to memory constraints on the classroom machines). For this course,
use the following folder names for the components listed in the table:
Directory Variable Actual Value
ORACLE_HOME /u01/oracle/product/fmw
ORACLE_COMMON_HOME /u01/oracle/product/fmw/oracle common/
WL_HOME /u01/oracle/product/fmw/wlserver
PROD_DIR /u01/oracle/product/fmw/soa/
EM_DIR /u01/oracle/product/fmw/em/
JAVA_HOME /usr/java/latest/
ASERVER_HOME /u02/oracle/config/domains/edg domain/
MSERVER_HOME /u01/oracle/config/domains/edg domain/
APPLICATION_HOME /u02/oracle/config/applications/edg domain/
DEPLOY_PLAN_HOME /u02/oracle/config/dp/
OHS_ADMIN_CONF_DIR n/a
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Planning an Oracle SOA Suite 12c Deployment Architecture
Chapter 2 - Page 12
Note: The letters “EDG_” in the domain name are used as an indicator that this domain
is based on the “Enterprise Deployment Guide.” Although “Storage - Directory
Variables” provides a Share and Mount Point Dependency column, there is no need to
populate it for the course because the plan is to create local folders for each installation
of Oracle SOA Suite 12c on the respective VM instances. You do use the /install
shared mount point to access the product installation media, and the /practices
folder tree to access files that may be needed when performing the practices for this
course. Therefore, there is no need to document these two folders (/install and
/practices) as share and mount points, because they are used for the practices in
this course. However, if you plan a cluster configuration to eliminate duplicate
installation of the binaries, you should document the share and mount points that are
used for the components in the Application Tier for the configuration of your
deployment topology.
8. Verify that your plan includes the file system folders represented in the preceding table, as
shown in the following image:

Note: Be aware that the ASERVER_HOME and DEPLOY_PLAN_HOME folders are located on
a different mount point than MSERVER_HOME. The administration server folders are located
on a shared disk to support high availability and failover of the administration server. For
completeness, if you wish, you can document the Share and Mount Point Dependency
columns to show that the ASERVER_HOME and DEPLOY_PLAN_HOME folders are located on
a specific shared disk mount point, as shown in the Share and Mount Point Dependency
columns in the preceding diagram.

Planning the Database - Connection Details


In this section, you modify the entries in the Database – Connection Details sheet (tab page) of
the workbook to define where the Oracle SOA Suite and component schemas are created and
how they are accessed by the WebLogic Server instances that are created for your Oracle SOA
Suite topology.
Note: Because the Oracle Database 11g server software and instance have been pre-
installed on your host02.example.com VM instance, you document the connection details in
the worksheet. It is important to plan the database configuration requirements because the
Oracle Fusion Middleware Infrastructure and Oracle SOA Suite 12c software requires
database schemas to be created for applications that are created when you configure the
Oracle WebLogic domain for the Oracle Fusion Middleware Infrastructure and Oracle SOA
Suite 12c components.
9. To document the database connection information, perform the following actions:
a. In the Excel spreadsheet application window, either click the Start worksheet tab
followed by clicking the “Database – Connection Details” link (in Row 10 of the Start
worksheet) to open the related worksheet, or click the “Database – Connection Details”
worksheet tab name to make that worksheet active.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Planning an Oracle SOA Suite 12c Deployment Architecture
Chapter 2 - Page 13
b. On the “Database – Connection Details” worksheet tab page, add the following details
in the Actual Values column of worksheet for the corresponding rows listed in the
following table:
Database Connection Detail Actual Value
Database Hosts (SOADBHOST1) Single-node
Database Service Name orcl.example.com
Database SID orcl
System Account Name and Password Account Name: sys
Password: Use the password provided.
RCU Schema Prefix EDG
Database Listener Port 1521
The SOADBHOST1 abstract name in the “Variable or Value Used in Procedures”
column refers to the DBHOST1 entry in the “Hardware – Host Computers” worksheet,
which you should have documented as host02.example.com.
Because the course environment does not use a RAC-enabled database configuration,
there is no need to document those values in this practice. The Database Connection
Detail rows that do not need to be documented for the planned installation for this
course are related to using a RAC database cluster for the Data Tier.
c. Verify that your database connection information is specified with information similar to
the details of the following image:

Note: The System Account password is provided as a generic value for this
documentation. Ask your instructor for the password of the database system
administration account SYS when required.
10. Save the spreadsheet with all the documented configuration plans that you have made to
your home folder, by performing the following steps:
a. In the “Oracle Open Office – Calc” window, select File > Save.
b. In the “Save As” (or Save) dialog box, accept the default settings and click Save.
Note: The file is saved with the default extension of .ods, which is the default file
name extension that is used by Oracle OpenOffice for spreadsheet files. In this case,
you are saving a copy of the original .xlsx file in a new format that is compatible with
the Oracle OpenOffice Calc application. If required, you can refer back to the saved file
details during the practice when you perform the software installation and domain
configuration tasks.
c. Close the “Oracle Open Office – Calc” application by selecting File > Exit.

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

Practices for Lesson 2: Planning an Oracle SOA Suite 12c Deployment Architecture
Chapter 2 - Page 14
Practice 2-2: Performing Pre-Installation Checks and Setup

Overview
In this practice, you connect with the host01 and host02 VM instances, perform basic pre-
installation checks, and install the required software on each instance as indicated by the
supplied checklist. In addition, you prepare the environment variables for the command line and
scripts to be executed to perform installation tasks.

Assumptions
• You can sign in to your assigned computer and access the host01 and host02 VM
instances to examine and prepare the environment.
Note: The host01 and host02 instances can be accessed via a Terminal window and
through VNC clients. It is recommended that you use Terminal windows within the VNC
client windows.

Tasks
Normally your host environments may not have all the required software installed before you
begin to install Oracle SOA Suite 12c software components. However, to save time, instead of
you installing some of the required software, it has been pre-installed and your tasks in this
section are to verify that:
• The correct version of the Java Development Kit (JDK) has been installed, and that you
can create JAVA_HOME and modify the PATH environment variables to include the JDK
that is needed to run the Oracle WebLogic and Oracle SOA Suite installers
• The Oracle Database and the Database listener have been started and that you can
successfully connect to the Oracle Database by using the connection details specified
in the “Planning the Database - Connection Details” section of practice 2-1

Checking the Java Development Kit and Setting the Environment


In this section, you verify that JDK 1.7 update 55 or later is installed on your VM instance and
modify the bash shell configuration files to define the path for the JAVA_HOME environment
variable and the PATH to include the JAVA_HOME/bin path. This is necessary because the
Oracle Fusion Middleware Infrastructure and Oracle SOA Suite 12c installers require an
appropriate version of the Java Development Kit (JDK) in the execution path.
1. To start a VNC session on the host01 VM instance, perform the following steps:
a. On the main computer desktop, double-click the “VNC Viewer – host01” icon to start
the VNC client session.

b. In the “VNC authentication” dialog box, enter the VNC session Password (as supplied
by your instructor), and click OK.

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

Practices for Lesson 2: Planning an Oracle SOA Suite 12c Deployment Architecture
Chapter 2 - Page 15
Note: After you successfully start the VNC session with host01, the
“host01.example.com:1 (oracle) – TigerVNC” window appears. The host01 VNC
session window displays with a light blue desktop background color, as shown in the
following screenshot:

Notes about the VNC session window:


• The Linux toolbar at the top of the page contains a Terminal icon, a Firefox web
browser icon, and a Preferred Mail Reader icon, the latter of which is not used.
• You can use the Terminal icon or click Applications > System Tools > Terminal to
start a Terminal application.
• The host02 VNC session displays a green background color to visually distinguish
the host02 VNC session from the host01 VNC session.
2. To check that JDK 1.7 update 55 is installed on the host01 VM instance, and include the
JDK in the environment variables, perform the following steps:
a. In the “host01.example.com:1 (oracle) - TigerVNC” window, click the Terminal icon on
the toolbar to start a Terminal application session.

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

Practices for Lesson 2: Planning an Oracle SOA Suite 12c Deployment Architecture
Chapter 2 - Page 16
b. In the Terminal application window, execute the following commands:
1) To check the current version of the Java that is being used:
$ java –version

2) To locate and verify that the latest version of Java is JDK 1.7.0_55:
$ ls /usr/java
$ /usr/java/latest/bin/java –version
Note: The version reported here should be:
java version "1.7.0_55"
3. While on host01, to ensure that the correct version of JDK is available to the Terminal
sessions and command-line scripts, perform the following steps:
a. In the Terminal window, enter the following commands to modify and display the
.bashrc file (located in the /home/oracle folder):
$ /practices/scripts/setbashrc.sh
$ cat .bashrc
Note: Using the setbashrc.sh script reduces the typing that is required to modify the
.bashrc file and eliminates typing errors. The following image provides the sample
contents of the .bashrc file after executing the script:

b. Because the changes made to the .bashrc file are not activated in the current
Terminal session, you must close the current Terminal application window and start a
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Planning an Oracle SOA Suite 12c Deployment Architecture
Chapter 2 - Page 17
new Terminal session. To terminate the current Terminal session, enter the exit
command, or click the close (x) icon on the window title bar.
c. Start a new Terminal application session, and enter the following command to verify
that the JDK 1.7.0_55 version is now active:
$ java -version

d. Optionally, close the new Terminal window. However, you can retain the Terminal
session to enter commands in the next practice.
4. On the host02 VM instance, repeat the steps documented for host01 to ensure that the JDK
is installed and available in the bash shell environment.
a. After starting the VNC session with host02, open a Terminal application window and
enter the following commands:
$ java –version
$ /practices/scripts/setbashrc.sh
$ cat .bashrc
Hint: The following image provides a sample of the results that you can expect for the
all the commands, except the exit command, in the Terminal application session:

b. Close the current Terminal session window.


c. Start a new Terminal application session, and enter the following command to verify
that the JDK 1.7.0_55 version is now active:
$ java -version
Note: Use the following image as a guide to the result expected:

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

Practices for Lesson 2: Planning an Oracle SOA Suite 12c Deployment Architecture
Chapter 2 - Page 18
Summary of Changes
On both host01 and host02, you started a Terminal application session to modify the
/home/oracle/.bashrc file, for the oracle user, to prepare the initial environment variables
and alias needed for the installation tasks to be performed in practice 3 of this course. To make
the changes, you executed the /practices/scripts/setbashrc.sh script that edits the
.bashrc file with the following changes:
• Sets the TZ environment to set the session time zone
• Adds the export commands to set JAVA_HOME and update the PATH environment
variables
• Determines if the rlwrap and sqlplus applications are accessible and sets Bash
shell command shortcuts, respectively, called aliases, by adding appropriate alias
commands to the environment
Note: The rlwap command-line tool, if installed, provides command-line editing
functionality for applications that do not natively support command-line editing, such as
Oracle SQL*Plus.

Verifying That the Database is Running and Accessible


In this section, on the host02 VM instance, you use the Oracle sqlplus command to connect
as the sys user to the Oracle Database instance as part of a simple process to verify that the
Oracle Database instance is running.
5. To verify that the Oracle Database instance is running and that you can connect to the
database, perform the following steps:
a. If required, on the host02 VM instance (do not use the host01 VM instance), open a
new Terminal window (or choose an existing Terminal window).
b. In the Terminal window on host02, execute the following command:
$ sqlplus sys as sysdba@orcl
c. When the Oracle SQL*Plus application starts, you are prompted for the password. At
the Enter Password prompt, enter the password for the sys user. For example:
Enter Password: <enter-sys-password-here>
Note: Ask your instructor for the sys database user password.
d. If you have logged in successfully, Oracle SQL*Plus displays a message indicating that
you are connected to the database and it displays the SQL> prompt.
Note: If you did not get the “Connected to an idle instance.” message, you can assume
that the database is running and can be connected to by client applications.
e. At the SQL*Plus SQL> prompt, enter the exit command to terminate the application.
Starting the Database Instance If It Is Idle
You need to perform the commands in this section only if you received the “Connected to
an idle instance.” message after you signed in to the SQL*Plus application.
To start the database, while at the SQL*Plus command prompt (SQL>), enter the following
commands:

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

Practices for Lesson 2: Planning an Oracle SOA Suite 12c Deployment Architecture
Chapter 2 - Page 19
SQL> startup
SQL> exit
Hint: The following image shows a sample session when the database instance is idle, and
how to start the database instance:

6. To verify that the database listener is running, execute the following command:
$ lsnrctl status
Hint: The following image displays the results that are returned when the database listener
is running.

Note: If the results returned from the listener status command report the following error,
you must start the database listener:
TNS-12541: TNS:no listener
Hint: To start the database listener, execute the following command:
$ lsnrctl start

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

Practices for Lesson 2: Planning an Oracle SOA Suite 12c Deployment Architecture
Chapter 2 - Page 20
Practices for Lesson 3:
Installing Oracle Fusion
Middleware Infrastructure 12c
Chapter 3

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 1
Overview of Practices for Lesson 3

Practices Overview
In the practices for this lesson, you install the Oracle Fusion Middleware Infrastructure binaries,
and create a WebLogic Server domain for the Infrastructure components based on a variation of
the recommendations in the Oracle Enterprise Deployment Guide.
Notes about Command-Line Instructions
• Shell commands: Some bash shell commands are long and therefore are formatted
across multiple lines for readability. However, when you enter the commands, they
should be entered on one line. If you enter any shell command over more than one line,
you must use the backslash (\) character as a command-line continuation indicator. The
long shell commands in this guide, however, do not show the command-line continuation
character.
• WebLogic Scripting Tool (WLST) commands: WLST commands do not require a
command-line continuation character, and therefore can be entered on one line or over
multiple lines as written in the guide.
• Entered commands: The commands that you enter in this practice cause a domain to be
created. This task may take some time.

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 2
Practice 3-1: Installing the Oracle Fusion Middleware Infrastructure

Overview
In this practice, you install the Oracle Fusion Middleware infrastructure on host01 and capture
the installation response file, which you use with a supplied script to perform a silent installation
of the same software on host02.
Note: Although the installation folders have the same structure on each host, the installation
steps are repeated on host02 because the destination installation folders for the products are
local to each host. The script format reduces the repetitive effort that is normally involved.

Assumptions
• The Oracle Database 11g instance is running and available on host02.
• The Oracle Java Development Kit (JDK 1.7.0_55) is installed on host01 and host02 as
verified in the practices for the lesson titled “Planning an Oracle SOA Suite 12c
Deployment Architecture.”
• You have access to the /install folder, which contains the Oracle Fusion
Middleware Infrastructure installer, on the host01 and host02 VM instances.
• The JAVA_HOME and PATH environment variables should have been set correctly by
the modifications performed in Practice 2 for the lesson titled “Planning an Oracle SOA
Suite 12c Deployment Architecture” that modified the .bashrc file.

Tasks
Your key tasks in this practice are:
• Installing the Oracle Fusion Middleware Infrastructure binaries on host01 and capturing
the installation response file, which you copy to host02
• Installing the Oracle Fusion Middleware Infrastructure binaries on host02 by using a
supplied script with the response file that is captured from the installation on host01

Installing the Oracle Fusion Middleware Infrastructure on Host01


The installation media files are already downloaded and supplied for you in the /install
folder tree that is accessible to each VM instance.
Tip: A VNC session with host01 should have already been started and open. If a VNC session
with host01 is not active, double-click the “VNC Viewer – host01” desktop icon and enter the
password for the VNC session (ask your instruction for the password, if you have forgotten).
1. To start the installation of the Oracle Fusion Middleware Infrastructure software on host01,
run the following commands in a Terminal window (if required, open a new Terminal
window):
$ cd /install/soa
$ java –d64 –jar fmw_12.1.3.0.0_infrastructure.jar
Note: The java command starts the Oracle Fusion Middleware Infrastructure Installer
wizard.
2. On the Oracle Fusion Middleware Infrastructure Installer wizard pages, perform the
following actions:
a. On the Welcome page, click Next.
b. On the Installation Location page, enter /u01/oracle/product/fmw as the Oracle
Home value, and click Next.

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 3
Note: Replace the Oracle Home value with the new value derived from the planning
information that you saved in the soa_edg_workbook.ods (or
soa_edg_workbook.xlsx) spreadsheet. Refer to the ORACLE_HOME value specified
on the “Storage – Directory Variables” worksheet page of the spreadsheet.
c. On the Installation Type page, accept the default selection of “Fusion Middleware
Infrastructure” and click Next.
d. On the Prerequisite Checks page, wait for the prerequisite checks (operating system
certification and Java version) to complete, and click Next.
e. On the Security Updates page, because you are in a classroom context, deselect the “I
wish to receive security updates via My Oracle Support” check box, and click Next.
Note: When the “My Oracle Support Username/Email Address” dialog box is displayed
with the message “You have not provided an email address. Do you wish to remain
uniformed of critical security issues in your configuration?” click Yes.
Tip: However, in a production environment, you may wish to enter details to be notified
by Oracle Support of critical security updates.
f. On the Installation Summary page, click Save Response File.
Tip: You save the response file because you repeat the installation on host02 by using
a silent installation script that requires the data saved in the response file.
1) In the Save dialog box, enter the File Name install_fmw_infra.rsp, and click
Save.
2) After you have saved the response file, click Install.
g. On the Installation Progress page, wait for and monitor the installation progress that is
displayed on this page. On completion, verify that all the steps that are listed have a
green check icon indicating success, and click Next.
h. On the Installation Complete page, observe the location of the installation log file, and
click Finish.
Tip: The installation log file is useful to look at in the event that something failed during
installation. After the Fusion Middleware Infrastructure Installer terminates, you can view
the installation command-line messages that are displayed in the Terminal window. In the
Terminal window, verify that there are no installation errors and observe the information
about where to find the installation log files.

Note: In the event of an error during installation, you can use the information displayed in
the Terminal window to locate the log file and open the log file to find details of the errors
reported before taking corrective action. In this course, it is expected that the installation
completes without any errors.

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 4
3. Because the installation response file that you created in the previous task step was saved
in the user home folder (/home/oracle) on host01, it is not accessible on host02. To
make the installation response file accessible to host02, copy the response file to a shared
folder location by performing the following actions:
a. In the Terminal window, verify that the response file was created in the user home
folder by executing the following commands:
$ cd $HOME
$ ls *.rsp
Note: The results of running these commands display a single file called
install_fmw_infra.rsp, as shown in the following image:

b. In the same Terminal window, execute the following commands to copy the response
file to the /practices/practice03 folder, and verify that the file exists in the
destination folder:
$ cp install_fmw_infra.rsp /practices/practice03
$ ls /practices/practice03
Note: The result of running the preceding commands is shown in the following image:

c. After installation has completed, verify that the installation files and folders are created
in the /u01/oracle/product/fmw folder by entering the command to list the
contents of the folder:
$ ls /u01/oracle/product/fmw
Note: Displaying the contents of the /u01/oracle/product/fmw folder results in
the list of files and folders shown in the following image:

Note: Do not close the Terminal application window, because you continue to use the
Terminal application session for the additional installation tasks that are performed on
host01.

Installing the Oracle Fusion Middleware Infrastructure on Host02


In this section, you must first start a VNC session with host02, if it is not already started. If a
VNC session with host02 already exists, make that window active.
Note: To start a VNC session on host02, double-click the “VNC Viewer – host02” desktop icon,
and when prompted, enter the password for accessing host02. Ask your instructor for the VNC
password for each VM host.
4. In the VNC session on host02, to install the Oracle Fusion Middleware Infrastructure
software on host02, perform the following steps:
a. In the host02 VNC session, open the Terminal application (if required).
b. In the Terminal application window, execute the install_infra.sh script that is
located in the /practice/scripts folder by entering the following command:

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 5
$ /practices/scripts/install_infra.sh
Note: The install_infra.sh script file executes a parameterized version of the
following silent installation command, which depends on the presence of the
installation response file that was created in the previous task step:
$ java –jar fmw_12.1.3.0.0_infrastructure.jar -silent
-responseFile /practices/practice03/install_fmw_infra.rsp
Note: The following image shows a sample of the results that you can expect to see
when running the silent installation script:

c. After the installation script has completed, verify that the installation files and folders
have been created.
1) In the /u01/oracle/product/fmw folder on host02, run the ls command.
2) Confirm that the files and folders are the same as that appearing in the same
Oracle Home folder on host01.

Note: It is recommended and a best practice to keep your installation folder trees identical
across VM hosts to support whole server migration and scalability for high availability
implementations.
Summary of Practice Tasks
In summary of the tasks performed in the practice, you have:
• Installed the Oracle Fusion Middleware Infrastructure binaries on host01
• Captured the installation response file to the home folder on host01
• Copied the installation response file to a shared folder that is accessible to host02

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 6
• Installed the Oracle Fusion Middleware Infrastructure binaries on host02 by using a
supplied script that depends on the installation response file being present in the
shared folder
Notes About the install_infra.sh Script
The install_infra.sh script:
− Sets the environment variables that are needed to perform the silent installation
− Depends on the install_fmw_infra.rsp response file being copied to the
/practices/practice03 folder
− Accepts the full path name of the response file as a command-line argument (if
you copied the response file to a different location)
− Specifies the –silent option in the installation command line to run the
installation process in silent mode
− Uses the –responseFile option to locate the installation response file that
defines the installation parameters to complete the installation without user input

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 7
Practice 3-2: Creating a Clustered SOA Domain for the Infrastructure

Overview
In this practice, you perform tasks to create a WebLogic Server domain with one AdminServer
and a cluster with two Managed Server instances, each of which is assigned to its own host.
Before you can create the domain, you must create the required database schemas in the
Oracle Database on host02 by running the Repository Creation Utility (RCU) that is installed
with the Oracle Fusion Middleware Infrastructure software.
After you have configured the domain, to ensure that the entire clustered domain can be started,
you must run the Oracle WebLogic pack.sh script to package the domain configuration into an
archive format that can be unpacked, with the unpack.sh script, on the second host to create
the domain configuration folders for the clustered instance on the second machine.

Assumptions
• The Oracle Database 11g instance is running and available on host02.
• You have verified and set the path of the Oracle Java Development Kit on host01 and
host02 as described in the practices for the lesson titled “Planning an Oracle SOA
Suite 12c Deployment Architecture.”
• You have successfully installed the Oracle Fusion Middleware Infrastructure software,
on the host01 and host02 VM instances, as described in “Practice 3-1: Installing the
Oracle Fusion Middleware Infrastructure.”
• You have access to the /install folder, which contains the Oracle SOA Suite 12c
installers, on the host01 and host02 VM instances.

Tasks
Your key tasks in the practice are:
• Creating the database schemas with RCU
• Creating the domain configuration
• Packing and unpacking the domain configuration files
• Starting the server instances in the cluster

Creating the Database Schemas with RCU


When you install the Oracle Fusion Middleware Infrastructure software, a directory tree
(/u01/oracle/product/fmw) that is referred to as the Oracle Home is created for the
software. The RCU software is located in the oracle_common/bin subfolder in the Oracle
Home of the Fusion Middleware Infrastructure installation. Because the database is on host02,
you execute the RCU application on host02.
Note: It does not matter on which host you run the RCU application to create schemas, as long
as you can access the database host by using the correct connection details.
1. To start the RCU application, perform the following steps:
a. Ensure that the “VNC Viewer – host02” session window is active.
Note: If the “VNC Viewer – host02” session window is not active, double-click the
“VNC Viewer – host02” icon on the desktop to create a new session and sign in with
the VNC session password provided by your instructor.
b. In a Terminal window, enter the following commands:
$ cd /u01/oracle/product/fmw/oracle_common/bin

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 8
$ ./rcu
Note: The ./rcu command starts the RCU utility wizard.
2. To create the database schemas, perform the following actions on each page displayed by
the Repository Creation Utility:
a. On the Welcome page, click Next.
b. On the Create Repository page, accept the default setting with the Create Repository
and “System Load and Product Load” options being selected. Click Next.
c. On the Database Connection Details page, modify (as required) the following field
values. Click Next:
Field Value
Database Type Oracle Database
Host Name host02.example.com
Port 1521
Service Name orcl
Username sys
Password Enter the DBA password.
Note: Ask your instructor for the DBA password string.
Role SYSDBA
d. In the Checking Prerequisites dialog box, click OK.
e. On the Select Components page, in the Create New Prefix field, replace the default
value DEV with EDG and select the “Oracle AS Repository Components” check box in
the components section. Click Next.
Note: After you select the “Oracle AS Repository Components” check box, the entries
are expanded, showing all the components that are selected.
f. In the Checking Prerequisites dialog box, click OK.
g. On the Schema Passwords page, accept the default option “Use same passwords for
all schemas,” and enter the same value in the Password and Confirm Password fields.
Click Next.
Tip: Ensure that you remember the password value that you entered because it is
needed when creating the Oracle WebLogic domain.
h. On the Map Tablespaces page, click Next.
Note: A Confirmation dialog box is displayed.
i. In the Confirmation dialog box, click OK.
j. In the Creating Tablespaces dialog box, click OK.
k. On the Summary page, click Create.
Note: A System Load progress window is displayed. Wait for the System Load
progress window to be closed.
l. On the Completion Summary page, click Close.
Note: Before you close the Repository Creation Utility wizard, you can view the log
files generated during the creation process. Viewing log files may be necessary to
identify and resolve errors, if any are produced during the creation process.

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 9
In summary, now that you have created the database schemas, the next section guides you
through the process of creating the Oracle WebLogic domain with an AdminServer and two
Managed Server instances in a cluster.

Creating the Infrastructure Domain Configuration


This section guides you through the process of starting the Domain Configuration Wizard to
create the Oracle WebLogic domain, which is done on host01, through the host01 VNC session.
Note: Allow 5 to 10 minutes for the domain creation wizard to complete the task after entering
all the configuration information.
3. Either return to the existing “VNC Viewer – host01” session or double-click the “VNC Viewer
– host01” desktop icon to start a new session by using the VNC password provided by your
instructor.
4. In the “VNC Viewer – host01” session window, to create the WebLogic domain, start the
Domain Configuration wizard by entering the following commands in the Terminal window:
$ cd /u01/oracle/product/fmw/oracle_common/common/bin
$ ./config.sh
Note: The config.sh script starts the Fusion Middleware Configuration Wizard,
which displays the pages where you specify the values to configure and create the
WebLogic domain.
5. To create the domain by using Fusion Middleware Configuration Wizard, take the actions
described in the following steps:
Note: To assist you with creating the domain configuration, use the documentation that you
saved in the Application Tier section of the “Storage – Directory Variables” worksheet in the
soa_edg_workbook.xls (or.ods) spreadsheet file that was modified in practice 2 titled
“Planning an Oracle SOA Suite 12c Deployment Architecture.” For quick reference, the
planned folder configuration for your domain is as follows:

Tip: The initial configuration of the cluster and administration server files should be created
in the shared folder tree; in this course, the folder tree in the /u02 mount point.
a. On the Create Domain page:
1) Accept the default “Create a new domain” option setting
2) Replace Domain Location with /u02/oracle/config/domains/edg_domain
3) Click Next
b. On the Templates page, select the following two templates and click Next.

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 10
Templates
Oracle Enterprise Manager - 12.1.3.0 [em]
Oracle WSM Policy Manager - 12.1.3.0 [oracle_common]
Note: Selecting the “Oracle Enterprise Manager - 12.1.3.0 [em]” template causes the
following two dependencies to be included:
− Oracle JRF - 12.1.3.0 [oracle_common]
− WebLogic Coherence Cluster Extension - 12.1.3.0 [wlserver]
c. On the Application Location page, replace the “Application location” path with the value
/u02/oracle/config/applications/edg_domain, and click Next.
d. On the Administrator Account page, accept the default administration Name
weblogic, enter the course password for the WebLogic administrator user (or enter a
password of your own choice) in the Password and Confirm Password fields, and click
Next.
e. On the Domain Mode and JDK page, for Domain Mode, accept the default
Development Mode option and click Next.
Note: Production Mode should be always be used for production systems. However, in
this course, Development Mode is used to simplify and reduce the time to complete
administration tasks during the practices.
f. On the Database Configuration Type page, accept the default RCU Data selection for
the Specify AutoConfiguration Options Using option. Accept or change the remaining
fields to match the rows in the following table. Click Get RCU Configuration.
Field Value
Vendor Oracle
Driver *Oracle’s Driver (Thin) for Service Connections
DBMS/Service orcl
Host Name host02.example.com
Port 1521
Schema Owner EDG_STB
Schema Password Enter the password that you supplied when creating the
schemas by using the RCU utility.
Note: After clicking Get RCU Configuration, verify that the Connection Result Log
displays messages indicating that the connection was successful, similar to the
following image, and click Next.

g. On the Component Datasources page, click Next.

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 11
Note: The page displays all the data sources installed by RCU for the infrastructure
components. On the next page, tests are performed to ensure that the data sources
are accessible for configuration.
h. On the JDBC Component Schema Test (or JDBC Test) page, after verifying that the
connection tests for all component schemas are successful (where a green check mark
appears in their respective rows in the Status column), click Next.
Tip: Use the following image as a guide:

Note: The component schemas listed on the previous page are automatically tested by
the configuration wizard by connecting to the schema with the password supplied
during RCU configuration.
i. On the Advanced Configuration page, to complete domain configuration for the
topology, select the following check boxes before clicking Next.
Select Advanced Configuration Options
Administration Server
Node Manager
Managed Servers, Clusters and Coherence
JMS File Store
Note: These check boxes are selected to ensure that you properly configure the listen
address for the Administration Server, Node Manager, and Managed Servers. In
addition, you can create the cluster, configure which servers belong to the cluster, and
configure Coherence. The JMS File Store option is required to configure appropriate
shared storage for the JMS persistent stores.
Tip: Do not select the Domain Frontend Host Capture advanced configuration option.
In practice 4-2 titled “Extending the SOA Domain with Oracle SOA Suite 12c,” when
you extend the Infrastructure domain with Oracle SOA Suite 12c, you configure the
frontend host property for the cluster, rather than for the domain.
j. On the Administration Server page, change (where applicable) the values of the fields
listed in the following table, and click Next:

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 12
Field Value
Server Name AdminServer
Listen Address adminvh.example.com
Listen Port 7001
Note: SSL configuration is not done, because the Enterprise Deployment Guide
recommends using SSL at the load balancer port of entry. Although the Administration
Server settings are not documented in the planning soa_edg_workbook spreadsheet,
you can refer to the “Network – Virtual Hosts & Ports” section of the
soa_edg_workbook.xls (or .ods) spreadsheet as a reference for the Node
Manager and Managed Server listen address and port values.
k. On the Node Manager page, modify the following field values (where applicable), and
click Next.
Field Value
Node Manager Type Per Domain Default Location
Note: This option is selected by default.
Node Manager Credentials Username: weblogic
Password and Confirm Password: Enter the same
value you chose for the WebLogic administrator
password.
Note: Although you can normally enter a different
username and password for Node Manager, the
scripts designed for this course depend on them being
the same as the WebLogic administrator credentials.
Note: The Node Manager Listen Address field must be set to a specific host name or
interface and not localhost, to allow the Coherence cluster addresses to be dynamically
calculated.
l. On the Managed Servers page, for each entry in the following table, click Add to create
a row with the values listed as follows:
Server Name Listen Address Listen Server Groups
Port
soa_server1 soavh01.example.com 8001 Select the JRF-MAN-SVR,
WSM-CACHE-SVR, and
WSMPM-MAN-SVR check
boxes.
soa_server2 soavh02.example.com 8001 Select the JRF-MAN-SVR,
WSM-CACHE-SVR, and
WSMPM-MAN-SVR check
boxes.
Hint: You can use Clone to duplicate some of the settings from the first server entry.
Use the following image as a guide, showing how to select two check boxes for the
Server Groups column:

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 13
Note: The Server Groups selections of JRF-MAN-SVR and WSMPM-MAN-SVR ensure
that the Oracle JRF and Oracle Web Services Manager (OWSM) services are targeted
to the Managed Servers created. The WSM-CACHE-SVR Server Group, which
configures nonce caching for Oracle Web Services automatically by the WSM-CACHE-
SVR server group, is suitable for most applications. Nonce is a unique number that can
be used only once in a SOAP request, and is used to prevent replay attacks. Nonce
caching naturally scales with the number of added Managed Servers that are running
web service applications.
m. On the Clusters page, click Add to create a new row that replaces the Cluster Name
column with the value soa_cluster1, and click Next.
Note: Other cluster settings are configured later after creating and configuring a stand-
alone Managed Server as the front-end load balancer.
n. On the Assign Servers to Clusters page, perform the following steps:
1) In the Servers section, select soa_server1 and soa_server2 and click the arrow
icon between the Servers and Clusters sections to move the two Managed Servers
under the soa_cluster1 entry in the Clusters section.

2) With the two Managed Servers appearing under the soa_cluster1 cluster, click
Next.

o. On the Coherence Clusters page, accept 0 in the Unicast Listen Port column for the
Cluster Name defaultCoherenceCluster, and click Next.
Note: The Coherence Clusters page configures the Coherence cluster that is added to
the domain. If you enter a Unicast Listen Port, enter a value such as 9991 or keep the
default port 0. When the port value is zero, an offset algorithm from the Managed
Server port is used to determine the Unicast Listen Port. The configured port becomes
the default port that is used by all cluster members unless a cluster member explicitly
specifies a different port.

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 14
p. On the Machines page, click the Unix Machine tab page, click Add three times to
create the entries listed in the following table, and then click Next.
Note: Accept default values in columns that appear on the page that are not listed in
the table here.
Name Node Managed Listen Address Node Manager Listen Port
adm_machine adminvh.example.com 5556
soa_machine1 soavh01.example.com 5556
soa_machine2 soavh02.example.com 5556
Hint: The following image shows the Unix Machine entries that are created:

Note: The Node Manager servers are started for each of the virtual hosts listed, as
documented in the Enterprise Deployment Guide.
q. On the Assign Servers to Machines page, assign the servers in the Servers column to
their corresponding machine entries in the Machines column. Click Next after you have
made the following assignments:
Servers Assigned Machines
AdminServer adm_machine
soa_server1 soa_machine1
soa_server2 soa_machine2
Hint: To make the server assignments, perform the steps in the following sequence:
1) Select an entry (or entries) in the Servers column.
2) Select the entry in the Machines column to which the servers are to be assigned.
3) Click the right arrow icon to make the assignment.
Note: Use the following image as a guide to view the appropriate assignments before
you click Next.

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 15
r. On the JMS File Stores page, replace the Directory value with the value
/u02/oracle/config/domains/edg_domain/soa_cluster1, and click Next.

Note: The Enterprise Deployment Guide suggests that you format the JMS File Store
Directory path by using the pattern ASERVER/cluster_name, where ASERVER
represents the path for the AdminServer domain home
(/u02/oracle/config/domains/edg_domain in this example) and the
cluster_name is soa_cluster1 (which you named and created on the Clusters
page of the Fusion Middleware Configuration Wizard).
s. On the Configuration Summary page, click Create.
Note: You can verify your domain configuration settings on the Configuration Summary
page before clicking Create.
t. On the Configuration Progress page, wait for the configuration progress to complete.
When you see the 100% progress indicator and the message “Domain Created
Successfully” in the progress text, click Next.
u. On the End of Configuration page, verify that you see the “Oracle WebLogic Server
Configuration Succeeded, New domain edg_domain Creation Successful” message,
and a link to the domain folder and the administration server. Click Finish.

6. To verify that the domain folder is created, enter the following command in a Terminal
window:
$ ls /u02/oracle/config/domains
Note: The folder name edg_domain should be displayed as a result of the ls command.

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 16
7. The Java Virtual Machine (VM) version that is being used to start Oracle WebLogic Server
later in this practice requires the time zone environment variable TZ to be defined. Although
the TZ environment variable is defined in your terminal session, it needs to be defined in
the environment of scripts that are used to manage the Oracle WebLogic Server processes.
Environment variables are created in the setUserOverrides.sh script in the bin folder of
the Oracle WebLogic Server domain. To create the setUserOverrides.sh script that
defines the TZ environment variable, perform the following actions:
a. On host01 in a Terminal window, enter the following command:
$ /practices/scripts/setwlsenv.sh
b. Verify that the setUserOverrides.sh script exists in the
/u02/oracle/config/domains/edg_domain/bin folder, and that it contains the
export command to define the TZ environment variable, by entering the following
command:
$ D=/u02/oracle/config/domains/edg_domain
$ cat $D/bin/setUserOverrides.sh
$ unset D
Note: Defining the D environment variable is optional and is used in this example to
keep the command lines readable. The following lines are displayed as the content of
the setOverrides.sh file:
#!/bin/bash
export TZ=$(date +%Z%z)
Note: It is recommended to use the setUserOverrides.sh script to override the
default environment settings for managing Oracle WebLogic Server 12c processes.

Configuring Additional Convenient Environment Variables


In this section, to save yourself some typing and to minimize typographic errors, you add
additional commands to create environment variables and an alias in the .bashrc file.
8. To append export commands for the additional environment variables and alias commands
to the $HOME/.bashrc file on host01, perform the following steps:
a. In a Terminal window, enter the following command to execute the addenv.sh script:
$ /practices/scripts/addenv.sh
b. Close the Terminal session and start a new one for the additional environment
variables to become effective.
Tip: Alternatively, instead of closing existing Terminal windows, you can enter the
following command in existing Terminal window sessions:
$ source /practices/scripts/setenv.sh
Note: The addenv.sh script appends the following commands at the end of the
.bashrc file to create the environment variables and alias shown:
export ASERVER=/u02/oracle/config/domains/edg_domain
export APPHOME=/u02/oracle/config/applications/edg_domain
export MSERVER=/u01/oracle/config/domains/edg_domain
export MW_HOME=/u01/oracle/product/fmw

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 17
alias wlst=$MW_HOME/oracle_common/common/bin/wlst.sh
c. Note: To save time, run the following command-line script on each host.
9. In the host02 environment, repeat the preceding task step to modify the .bashrc file and
environment in your Terminal sessions. In summary, in a Terminal on host02, enter the
command:
$ /practices/scripts/addenv.sh
Note: Remember to close the Terminal sessions on host02 and open new Terminal
application windows when required, or execute the source
/practices/scripts/setenv.sh command line in existing Terminal sessions.

Starting the Node Manager and Administration Server


10. To start the Node Manager on host01, perform the following actions:
a. In a Terminal window, execute the following command-line script to start the Node
Manager:
$ /practices/scripts/nm.sh start
Notes:
• The /practices/scripts/nm.sh script automatically checks and updates the
ListenAddress property in the nodemanager.properties file to be consistent
with the host name that is used to start the Node Manager. Normally, you would have
to manually change the ListenAddress property before starting the Node Manager.
• Caution: If you do not use the supplied script to start the Node Manager, you must edit
the $ASERVER/nodemanager/nodemanager.properties file and change the
ListenAddress property to match the virtual or actual host name that you want the
Node Manager to use as the ListenAddress before you start the Node Manager with
the instructions shown below these notes.
• By default, the nm.sh script that is created for this course uses the
adminvh.example.com virtual host as the default value for ListenAddress. To
specify a different value for ListenAddress, you can provide the preferred host name
in the second parameter of the nm.sh script.
• Using the start command-line parameter as the first parameter causes the nm.sh
script to execute following two commands:
$cd $ASERVER/bin
$nohup ./startNodeManager.sh > /practices/log/nm_adminvh.log &
Tip: When entering the preceding commands manually, it is assumed that you have set the
correct ListenAddress property in the nodemanager.properties file (located in the
$ASERVER/nodemanager folder). In addition, the nm.sh script recognizes the stop or
restart values in the first parameter to mean stop and restart the Node Manager,
respectively.
b. Verify that the Node Manager has started by running the nm.sh script with the status
command-line parameter:
$ /practices/scripts/nm.sh status
Note: The status command parameter executes the Java jps command to determine if
the NodeManager process is running or not. Alternatively, you can run the jps command
yourself, provided that $JAVA_HOME/bin is in the execution PATH.

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 18
11. To start the AdminServer instance and validate that the AdminServer has started and is
accessible through the WebLogic Administration Console web page, take the following
actions:
a. In the Terminal, enter the following commands to use the adminserver.sh script to
start the Administration Server via the Node Manager:
$ /practices/scripts/adminserver.sh start
Hostname [adminvh.example.com]: adminvh.example.com
NM Username [weblogic]: weblogic
NM password: password
Note: The script may appear to hang. It will take 3-4 minutes to complete.
Note: Entering values for the first two prompts are optional because the supplied data
is the same as the default values, unless you specified a different username for the
Node Manager user when you created the domain. However, you must enter the
password that you specified with the Node Manager username when you created the
domain.
The adminserver.sh script saves the time spent in typing the following commands
to start the AdminServer via the Node Manager with WLST commands:
$ cd $MW_HOME/oracle_common/common/bin
$ ./wlst.sh
wls:offline> nmConnect("weblogic", "password",
"adminvh.example.com", 5556, "edg_domain",
"/u02/oracle/config/domains/edg_domain
", 'ssl')
wls:offline> nmStart("AdminServer")
wls:offline> nmDisconnect()
wls:offline> exit()
Hint: If you examine the adminserver.sh script, it uses the following WLST
command line, and the adminserver.py WLST script and start parameters to
execute the equivalent of the preceding WLST commands, where the password
parameter in the nmConnect() statement is replaced with the value entered at the NM
Password prompt.
$ wlst /practices/scripts/adminserver.py start
b. To validate, you can access the AdminServer instance, enter the URL
http://adminvh.example.com:7001/console in a web browser (from either the host01 or
host02 environment), and confirm that the following WebLogic Administration Server
Console login page is displayed:

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 19
c. On the WebLogic Administration Server Console login page, enter the username
weblogic (or the administration username) and the password that you used when you
created the domain, and ensure that you are able to successfully sign in as the
WebLogic administrator.

Note: If the web browser prompts for remembering the password, to make things
easier for the remaining practices during the course, click “Remember Password.”
Alternatively, you can make any choice you prefer.

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 20
d. Verify that you see the Oracle WebLogic Server Administration Console home page.

e. On the WebLogic Administration Server Console home page, click Logout, and
optionally close the web browser window or tab page.

Tip: Consider bookmarking the web addresses that you enter during the practice, such as
http://adminvh.example.com:7001/console, because you would use them frequently
throughout the course.
12. Optionally, to verify that you can access and sign in to the Oracle Enterprise Manager
Fusion Middleware Control application, perform the following steps:
a. In a web browser window or on a tab page, enter the URL
http://adminvh.example.com:7001/em to access the application.
b. On the Oracle Enterprise Manager Fusion Middleware Control login page, enter the
WebLogic administrator username and password that you specified when you created
the WebLogic domain.
c. On the Oracle Enterprise Manager Fusion Middleware Control home page, verify that
the AdminServer instance is running, and then sign out.
d. Close the web browser window or tab page.
In summary, at this point in the practice, you should have:
• Configured a WebLogic domain with the AdminServer and two Managed Server
instances in a cluster
• Started the Node Manager and AdminServer
• Validated that you can access the Oracle WebLogic Server Console (and optionally the
Enterprise Manager Fusion Middleware Control) applications deployed in the
AdminServer

Packing and Unpacking the Domain Configuration Files on Host01


Before you can start the Managed Server instances for the SOA infrastructure deployment, you
must propagate the appropriate configuration files for the Managed Servers to the host01 and
host02 environments.
In this section, you first configure the Managed Server for host01 by using the Oracle WebLogic
Server pack.sh and unpack.sh shell scripts.
Note: The pack utility packages configuration data into a template JAR file, which is used by the
unpack utility to propagate the configuration files.

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 21
13. Access host01 by using the VNC Viewer, or use an existing VNC Viewer window for host01
if it is already open.
14. To create a Managed Server template with the pack utility, perform the following steps:
a. In a Terminal window, enter the following commands:
$ cd /practices/practice03
$ /practices/scripts/cpdomain.sh pack edgdomain_template.jar
Note: The first (cd) command navigates to the folder in which the template JAR file is
created. Alternatively, you can enter the full path name of the template JAR file in the
second parameter of the cpdomain.sh script. The cpdomain.sh script executes the
following commands (which you could have entered manually):
$ cd $MW_HOME/oracle_common/common/bin
$ ./pack.sh -managed=true
–domain=$ASERVER
-template=/practices/practice03/edgdomain_template.jar
-template_name=edgdomain
Note: If you enter these commands manually, the cd command navigates to the
location of the pack.sh script. The template is created from the domain that exists on
the shared folder with the /u02 path mount point prefix, because the ASERVER
environment variable is set to /u02/oracle/config/domains/edg_domain. The
following image represents similar results produced by the pack.sh script:

b. Verify that the template edgdomain_template.jar file exists in the


/practices/practice03 folder, where it should be accessible to host02, by
entering the following command:
$ ls /practices/practice03
Note: The ls command should list the edgdomain_template.jar file.
15. To unpack the domain template to create the configuration file that is needed for the
soa_server1 Managed Server on host01, perform the following steps:
a. To verify that the domain does not already exist on this host, enter the following
command:
$ ls $MSERVER
Note: The ls command returns a result indicating that it cannot access the path
defined by the MSERVER environment variable.
b. In a Terminal window, enter the following commands:
$ cd /practices/practice03
$ /practices/scripts/cpdomain.sh unpack edgdomain_template.jar
Note: The cd command may not be required if your current working directory is
/practices/practice03 (which can be verified by entering the pwd command).

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 22
Using the cpdomain.sh script with the unpack parameter executes the following
commands, which could be entered manually:
$ APPHOME=/u02/oracle/config/applications/edg_domain
$ cd $MW_HOME/oracle_common/common/bin
$ ./unpack.sh –domain=$MSERVER
-overwrite_domain=true
-template=/practices/practice03/edgdomain_template.jar
-log_priority=DEBUG
-log=/practices/log/unpack_edgdomain_template.log
-app_dir=$APPHOME
Hint: The following image shows a sample of the results that you may get when
unpacking the domain template file:

c. The Managed Server configuration is created in the folder tree with the /u01 path
prefix on host01. To check out the domain directories on host01, in the Terminal
window, navigate to the domain directory and explore by using the cd and ls
commands.
$ ls $MSERVER

$ cd $MSERVER/bin
$ ls

Starting the SOA Managed Server on the First SOA Host


Having completed unpacking the domain configuration for the Managed Server (on host01) for
the soavh01 instance, you perform the following tasks to start and verify that the first Managed
Server instance is running:

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 23
• Start the Node Manager on soavh01.example.com, after modifying the
ListenAddress property in the nodemanager.properties file to be
soavh01.example.com for the Managed Server.
• Start the Managed Server by using the Oracle Enterprise Manager Fusion Middleware
Control application.
• Verify that you can access a URL exposed by the Managed Server.
16. To start the Node Manager for the Managed Server that runs on soavh01.example.com,
enter the following command in a Terminal window session on host01:
$ /practices/scripts/nm.sh start soavh01.example.com
Note: The nm.sh script accepts the listen address (host name) as the second
parameter, which is used to modify the ListenAddress property in the appropriate
nodemanager.properties file (if required). You can enter the following command to
check what value the ListenAddress property is set to:
$ grep ListenAdd $MSERVER/nodemanager/nodemanager.properties
17. To access Oracle Enterprise Manager Fusion Middleware Control and start the Managed
Server on soavh01.example.com, perform the following steps:
a. On a web browser page, enter the URL http://adminvh.example.com:7001/em
to access the Oracle Enterprise Manager Fusion Middleware Control login page.
b. On the Oracle Enterprise Manager Fusion Middleware Control login page, sign in with
the WebLogic administrator credentials (username: weblogic, and the password that
you provided when creating the domain).
c. On the Oracle Enterprise Manager Fusion Middleware Control home page, in the
Target Navigation pane, if required, expand the edg_domain > soa_cluster1 tree nodes
to display the Managed Servers in the domain.

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 24
d. In the Target Navigation pane, select the soa_server1 Managed Server entry and click
Start Up on the Oracle WebLogic Server toolbar.

e. After clicking Start Up, the Processing pop-up window that is similar to the following
image is displayed, which shows the progress of the startup operation:

Note: Wait for the startup operation to complete (when the Processing page title
changes to Confirmation).

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 25
f. After successfully starting the Managed Server, click Close.

g. In the Target Navigation pane, click the edg_domain entry to display the edg_domain
home page and verify that the soa_server1 Managed Server is up and running. Use
the following image as a guide to the expected result:

Note: On the edg_domain home page, to verify that the soa_server1 instance is
running, collapse the Summary section. In the Servers section, verify that the Status
column for the soa_server1 row contains a green up arrow icon, as shown in the
preceding image.

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 26
18. To verify that the Managed Server is running and accessible, perform the following steps:
a. Open a new web browser window or tab page, and enter the URL
http://soavh01.example.com:8001/wsm-pm/.
b. When the Authentication Required dialog box is displayed, enter the username as
weblogic and the password that you provided when creating the domain. Click OK.

Note: If the web browser prompts you for remembering the password for the
weblogic user, take any action you prefer for your environment.
c. Verify that the Validate Policy Manager page is displayed as shown in the following
image:

d. Close the Validate Policy Manager web browser window or tab page.
In summary, you have unpacked the configuration files for the soa_server1 Managed Server,
and started the Node Manager and the Managed Server.

Unpacking the Domain Configuration Files on Host02


In this section, you unpack the edg_domain_template.jar file on host02, optionally modify
the ListenAddress property in the $MSERVER/nodemanager/nodemanager.properties
file on host02, start the Node Manager on soavh02.example.com, and start the soa_server2
Managed Server on host02.
19. Access host02 by using the existing or a new VNC session.
20. To create the domain configuration folders on host02 by using the unpack utility, take the
following actions:
a. In a Terminal window (on host02), verify that the domain configuration folders do not
exist by entering the following command:
$ ls $MSERVER
Note: The ls command returns a result indicating that it cannot access the path
defined by the MSERVER environment variable.
b. In a Terminal window, to unpack the domain configuration files, enter the following
commands:
$ cd /practices/practice03
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 27
$ /practices/scripts/cpdomain.sh unpack edgdomain_template.jar

c. The Managed Server configuration is created in the folder tree with the
/u01/oracle/config/edg_domain path on host02. In a Terminal window,
navigate to the domain directory and explore by using the cd and ls commands
similar to the following:
$ ls $MSERVER
$ cd $MSERVER/bin
$ ls

Starting the SOA Managed Server on Host02


21. Starting the Node Manager on soavh02.example.com requires the following steps to be
performed:
a. In the Terminal window, view the current value of the ListenAddress property in the
nodemanager.properties file (on host02) by entering the following command:
$ grep ListenAdd $MSERVER/nodemanager/nodemanager.properties
Question: What is the value of the ListenAddress property?
Answer: soavh02.example.com. The unpack processing modifies various values in
different configuration files. If the ListenAddress value was not correct for this
context, you could manually modify the file. However, the nm.sh script that is provided
in this course to start the Node Manager modifies the ListenAddress property, if
required.
b. To start the Node Manager on soavh02.example.com, enter the following command in
your Terminal window session:
$ /practices/scripts/nm.sh start soavh02.example.com
22. To start the soa_server2 Managed Server on soavh02.example.com, take the following
actions:
a. On a web browser page, return to the page where you have Oracle Enterprise
Manager Fusion Middleware Control active, or enter the URL
http://adminvh.example.com:7001/em to revisit the page.
Note: If the Oracle Enterprise Manager Fusion Middleware Control page session has
expired (or was terminated), you may have to sign in with the administrator username
(weblogic) and the associated password.
b. On the Oracle Enterprise Manager Fusion Middleware Control home page, in the
Target Navigation pane, if required, expand the edg_domain > soa_cluster1 tree node,

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 28
select the soa_server2 entry, and click Start Up on the Oracle WebLogic Server
toolbar.

c. After you click Start Up, the Processing pop-up window is displayed that shows the
progress of the startup operation.
Note: Wait for the startup operation to complete (when the Processing page title
changes to Confirmation) and verify that the soa_server2 Managed Server started
successfully. Click Close.
d. In the Target Navigation pane, click the edg_domain entry to display the edg_domain
home page and verify that the soa_server2 Managed Server is up and running. Use
the following image as a guide to the expected result:

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 29
Note: On the edg_domain home page, the Server pie chart should now display 100%
status, indicating that the entire system is operational. You can also verify that the
soa_server2 instance is running in the Servers section where the Status column for the
soa_server2 row contains a green up arrow icon.
23. Optionally, to test that you can access the Validate Policy Manager page on the
soa_server2 Managed Server instance, perform the following steps:
a. Open a new web browser window or tab page, and enter the URL
http://soavh02.example.com:8001/wsm-pm/.
b. In the Authentication Required dialog box, enter the username as weblogic and the
password that you selected when creating the domain. Click OK.
Note: If the web browser prompts for remembering the password for the weblogic
user, take any action that you prefer for your environment.
c. Verify that the Validate Policy Manager page is displayed as shown in the following
image:

d. Close the Validate Policy Manager web browser window or tab page.
In summary, you have unpacked the configuration files for the soa_server2 Managed Server,
started the Node Manager, and started the Managed Server.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 30
Modifying the Upload and Stage Directories to an Absolute Path
After creating and unpacking the domain configuration to the Managed Server domain
directories, you should verify and update the upload and stage directories for each Managed
Server. Verifying and updating (if necessary) the upload and stage directories avoids potential
issues when performing remote deployments and deployments that require the stage mode.
24. To update the upload and stage directory paths for the soa_server1 Managed Server,
perform the following steps:
a. Log in to the Oracle WebLogic Server Administration Console by using the URL
http://adminvh.example.com:7001/console, as the WebLogic administrator user.
b. On the Oracle WebLogic Server Administration Console home page, in the left
navigation tree, expand edg_domain > Environment, and click Servers.

c. On the Summary of Servers > Configuration tab page, click the soa_server1 link in the
Name column of the Servers table.
d. On the Settings for soa_server1 > Configuration tab page, click the Deployment tab.
Note: Click the Deployment (singular form) tab, not the Deployments (plural) tab name.

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 31
e. On the Summary of Servers > Configuration > Deployment tab page, verify and update
as required the values for the fields in the following table and click Save.
Field Name Value
Staging Directory Name /u01/oracle/config/domains/edg_domain/
servers/soa_server1/stage
Upload Directory Name /u02/oracle/config/domains/edg_domain/
servers/AdminServer/upload
Note: Ensure that fully qualified path names are entered for each field. Use the
following image as guide:

Note: After clicking Save to update the Deployment tab page settings, the following
confirmation messages are displayed above the “Settings for soa_server1” heading on
the page.

Note: The item that needs to be restarted is the soa_server1 Managed Server
instance. However, in the next task step, you first modify the same Deployment
settings for the soa_server2 instance before restarting both the Managed Server
instances.

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 32
25. Verify and update (if required) the upload and stage directory paths for the soa_server2
Managed Server, by repeating the steps that you performed for soa_server1 as
documented in the preceding task step. Use the following configuration values:
Field Name Value
Staging Directory Name /u01/oracle/config/domains/edg_domain/
servers/soa_server2/stage
Upload Directory Name /u02/oracle/config/domains/edg_domain/
servers/AdminServer/upload
Note: After you save the changes to the Deployment settings for soa_server2, the
messages should indicate that two items need to be restarted, as shown in the following
image:

26. To restart the soa_server1 and soa_server2 Managed Servers, take the following action:
a. In the web browser window or on the tab page, return to the Oracle Enterprise
Manager Fusion Middleware Control page.
Note: If required, enter the URL http://adminvh.example.com:7001/em to
reload the page. If the Oracle Enterprise Manager Fusion Middleware Control page
session has expired (or was terminated), you may have to sign in with the administrator
username (weblogic) and the associated password.
b. On the Oracle Enterprise Manager Fusion Middleware Control page, in the Target
Navigation pane, expand edg_domain if required, click the soa_cluster1 entry, and click
Shut Down.

Note: Shutting down the cluster causes both Managed Server instances to be shut
down with one operation.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 33
After clicking Shut Down, when the following Confirmation dialog box is displayed, click
Shutdown.

c. After clicking Shutdown in the Confirmation dialog box, the Processing dialog box is
displayed where you can monitor the progress of the cluster shutdown operation.

d. Wait for the Processing dialog box title to change to Confirmation. Verify that the
message indicates that two Managed Servers (soa_server1 and soa_server2) have
been shut down successfully, and click Close.

On the Oracle Enterprise Manager Fusion Middleware Control page, the soa_cluster1
entry should still be selected, with the soa_cluster1 page also visible and showing that
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 34
the cluster is shutdown. The presence of the red down arrow icon that appears before
the soa_cluster1 name at the top of the page is a visual indicator that the cluster is in a
shutdown state. In addition, in the Servers section on the page, a red down arrow icon
appears in the Status column for each of the Managed Server entries (soa_server1
and soa_server2), indicating their shutdown state, as shown in the following image:

e. To start the two Managed Servers, on the soa_cluster1 page, click Start Up.
f. After clicking Start Up on the soa_cluster1 page, the Processing dialog box appears
where you can monitor the progress of starting the server instances in the cluster.

g. Wait for the Processing dialog box title to change to Confirmation. Verify that the
message indicates that two Managed Servers (soa_server1 and soa_server2) have
been successfully started, and click Close.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 35
h. On the Oracle Enterprise Manager Fusion Middleware Control page, you can view the
visual indicators that show that the soa_cluster1 has started, and that each of the
Managed Servers are started by the presence of the green up arrow icon that appears
next to each of these servers on the page.

Backing Up the Installation Files and Initial Configuration


It is a good idea to take a back up of the work that you have done to create your environment.
Having created a working WebLogic cluster with the Fusion Middleware Infrastructure
components, this is a logical point where a backup could be performed. To back up the
environment, you need to back up the following:
• Static artifacts: This includes the installed folder trees for the Oracle Database home,
the Oracle Fusion Middleware Home for Application, and the web tier–related files. To
save time in this course, the static files are not backed up.
• Runtime artifacts: This includes the AdminServer domain home, the Application home,
the database files, any scripts and customizations, and the deployment plan home.

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 36
Note: At this stage, there is no web tier and therefore, there are no static or runtime
artifacts to back up for the web tier.
In this section, you run a script to back up the runtime artifacts for the application tier and the
database.
27. Before you back up the domain configuration, it is best to shut down the Managed Servers
and the AdminServer instance. To shut down the servers by using the command line, enter
the following command:
$ /practices/scripts/domain.sh shutdown
Username [weblogic]:
Password: password
Note: Because the default username is weblogic, you can press Enter at the
Username prompt; otherwise, enter the username that you specified when creating the
domain. Remember to provide the administrator password that you specified when
creating the domain.
Tip: The domain.sh script calls the /practices/scripts/domain.py WLST
script to shut down the cluster and the administration server instances. The Node
Manager instances are not shut down by this script.
28. To back up the application tier runtime files, perform the following steps in a Terminal
window on host01:
a. Back up the AdminServer domain and the application folder trees by entering the
following commands:
$ /practices/scripts/backup.sh admin infra
$ /practices/scripts/backup.sh apps infra
Note: The second parameter (value infra) is a tag that is used to label the files and
database backup to give you a way to associate related backup files. The backup.sh
script uses the standard Linux tar command to create a backup (while preserving the
file permissions) of the domain and the application folders for the AdminServer,
respectively. If interested, you can edit the backup.sh script to view the commands.
A sample of the output that is displayed for the backup operation of the administration
server configuration is as follows:

b. Back up the Managed Server domain configuration folders by entering the following
command:
$ /practices/scripts/backup.sh managed infra
29. To back up the remaining application tier runtime files, perform the following steps in a
Terminal window on host02:
a. Back up the Managed Server domain configuration folders by entering the following
command:
$ /practices/scripts/backup.sh managed infra
Note: You may want to view the script contents to view the commands that are used to
backup the various application tier folder trees.
b. Back up the data (database) tier files by entering the following:
$ /practices/scripts/backup.sh db infra
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 37
Note: This command must be entered in a Terminal session on host02, where you
have access to the Oracle Database tools that are installed on that machine. The
backup.sh script makes use of simple commands through the Oracle Database
RMAN utility to backup the Oracle Database instance.
30. After backing up the domain configuration, you can start up the domain servers. To start up
the domain by using the command line, enter the following command:
$ /practices/scripts/domain.sh startup
Username [weblogic]:
Password: password
Tip: The domain.sh script calls the /practices/scripts/domain.py WLST script to
start up the cluster and administration server instances.
31. To compress the space that is consumed by the collection of backup archive (tar) files,
enter the following command in a Terminal window (either on host01 or host02):
$ cd /u02/backup
$ zip infra.zip *.tar
$ rm *.tar
Note: The rm command deletes the backup archive files to reclaim the disk space that is
needed for the remaining course practices. The zip command packages all related backup
archive files into a single compressed file. If a restore operation is required, make sure that
you extract the backup archive files from the zip file first, and that you have enough disk
space to do so.

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 38
Practice 3-3: Integrating an LDAP Provider

Overview
By default, after creating and configuring an Oracle WebLogic domain, the domain is configured
to use the WebLogic Authentication (Embedded LDAP) provider, which is identified as the
DefaultAuthenticator on the Oracle WebLogic Administration Console security provider
configuration pages. However, for your enterprise deployment, it is preferable to use a
dedicated, centralized LDAP-compliant authentication provider.
In this practice, you use the Oracle WebLogic Server Administration Console to create a new
LDAP authentication provider for your enterprise deployment domain.
Note: The LDAP server should already be installed and include some initial configuration in
preparation for the integration process. In this course, Oracle Unified Directory has already been
installed and configured with some initial LDAP data for your centralized LDAP directory service.

Assumptions
• Oracle Unified Directory is installed and the directory instance has been started and is
listening on port 1389.
• Your initial Oracle WebLogic enterprise deployment domain has been created.

Tasks
Your tasks include:
• Creating and configuring LDAP providers in the Oracle WebLogic Administration
Console
• Provisioning a new SOA administrator user and group in the LDAP server as new
enterprise deployment entities
• Granting SOA application roles to the new SOA administrator user by using Oracle
Enterprise Manager Fusion Middleware Control
• Verifying that you can sign in to the Oracle WebLogic Administration Console and
Oracle Enterprise Manager Fusion Middleware Control applications as the new SOA
administrator user
Before making configuration changes for the authentication providers, it is a good idea to
backup appropriate files. A script to backup the relevant files is provided to save time.
1. To back up the files that are related to authentication configuration, enter the following
command in a Terminal window (either on host01 or host02):
$ /practices/scripts/auth.sh backup
Note: The auth.sh script with the backup parameter copies the following files into the
auth_data.tar file that is located in /practice/practice03 folder, by default.
$ASERVER/config/config.xml
$ASERVER/config/fmwconfig/jps-config.xml
$ASERVER/config/fmwconfig/system-jazn-data.xml
$ASERVER/servers/AdminServer/security/boot.properties
Tip: If you need to restore these files, enter the following command in a Terminal window:
$ /practices/scripts/auth.sh restore

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 39
Creating and Configuring a New LDAP Provider
In this section, you use the Oracle WebLogic Server Administration Console to create and
configure a new authentication provider. An Oracle Unified Directory server has been installed
with some basic configuration data as an LDAP provider on port 1389 for this purpose.
2. To create a new authentication provider for your WebLogic domain, perform the following
steps:
a. In a web browser window or on a tab page, access (and sign in to, if required, as the
WebLogic administrator user) the Oracle WebLogic Server Administration Console by
using the URL http://adminvh.example.com:7001/console.
b. On the WebLogic Server Administration Console home page, in the Domain Structure
panel, click Security Realms.
c. On the “Summary of Security Realms” page, click the myrealm link in the Name
column of the Realms table.
Note: The “Settings for myrealm” page is opened with the Configuration > General tab
page visible.
d. On the “Settings for myrealm” page, click the Providers tab.
Note: When you click the Providers tab, the Authentication subtab is displayed,
showing the Authentication Providers table where you should see the
DefaultAuthenticator entry that is configured as the default provider for the realm.

e. On the “Settings for myrealm” > Providers > Authentication tab page, in the
Authentication Providers table, click New.
f. On the “Create a New Authentication Provider” page, enter or select the following field
values. Click OK when you have finished.
Field Name Value
Name OUDAuthenticator
Type IPlanetAuthenticator
Note: The Type value must be set to IPlanetAuthenticator when creating an
authentication provider for Oracle Unified Directory.

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 40
g. On the “Settings for myrealm” > Providers > Authentication tab page, observe the message
at the top of the page that indicates that the changes have been activated and that some
items need to be restarted. In addition, verify that the OUDAuthenticator entry appears in
the Authentication Providers table.

Note: The message indicates that the domain servers must be restarted for the activated
changes to become effective.
3. To edit the OUDAuthenticator configuration settings, perform the following steps:
a. On the “Settings for myrealm” > Providers > Authentication tab page, click the new
OUDAuthenticator link in the Name column of the Authentication Providers table.
b. On the “Settings for OUDAuthenticator” Configuration > Common tabbed page,
select SUFFICIENT from the Control Flag drop-down menu, and click Save.

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 41
Note: The SUFFCIENT setting indicates that if an authenticator successfully
authenticates a user, the authentication should be accepted and no additional
authenticators should be invoked. However, if authentication fails, the next
authenticator provider in the order of appearance is checked.
Tip: Ensure that all subsequent authenticators also have their control flag set to
SUFFICIENT, such as the DefaultAuthenticator. You change the DefaultAuthenticator
control flag to SUFFICIENT in a subsequent step.
c. To set provider-specific details, on the “Settings for OUDAuthenticator” page, click the
Provider Specific subtab.
d. To configure the Oracle Unified Directory LDAP server as an authentication provider
instance, on the “Settings for OUDAuthenticator” > Configuration > Provider Specific
page, enter the values specified in the tables for each section that is listed in the
following steps. Click Save when you have completed the entries for all sections.
1) In the Connection section, make the following changes and accept default settings
for other connection fields:
Field Value
Host ldap.example.com
Port 1389
Principal cn=Directory Manager
Credential, and Enter the LDAP administrator password.
Confirm Credential Note: Check with your instructor.
SSL Enabled Leave this check box deselected.
Note: Use the following image as a guide:

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 42
2) Scroll down to the Users section, and update the following fields. Accept default
values for other user fields:
Field Value
User Base DN cn=users,dc=example,dc=com
Use Retrieved User Name as Principal Ensure that this check box is
selected.
Note: Use the following image as your guide:

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 43
Verify: Check that the following User section fields are set as shown:
Field Value
User From Name Filter (&(uid=%u)(objectclass=person))
User Name Attribute uid
3) Scroll down to the Group section, and update the Group Base DN field to the value
shown as follows (accept default settings for other group fields):
Field Value
Group Base DN cn=groups,dc=example,dc=com

4) Scroll down to the end of the General section, and update the GUID Attribute
setting by replacing the existing value of nsuniqueid with the following value:
Field Value
GUID Attribute (General) entryuuid
Note: Use the following image as a reference:
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 44
5) Because most fields should be set by now, you can click Save after entering the
changes to the GUID Attribute value. After you click Save, messages indicating
that the settings are updated successfully appear at the top of the page.
e. To return to the “Settings for myrealm” > Providers > Authentication page, click the
Providers link in the breadcrumb trail above the messages.

Note: Restarting of servers can be performed after you make additional configuration
changes to provider sequence and control flags.
4. To reorder the sequence of authentication providers, perform the following actions:
a. On the “Settings for myrealm” > Providers > Authentication page, above the list of
providers in the Authentication Providers table, click Reorder.
b. On the Reorder Authentication Providers page, select the OUDAuthenticator check
box, click the topmost up arrow icon to move the entry to the top of the list (to be the
first entry), and click OK.

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 45
Note: After you click OK to accept the change of authenticator order, a response
message indicates that the changes have been activated, and the “Settings for
myrealm” > Providers > Authentication tab page becomes visible, showing the
Authentication Providers table.
c. Keep the “Settings for myrealm” > Providers > Authentication tab page open.
5. To ensure that the DefaultAuthenticator authentication provider control flag is set to
SUFFICIENT, perform the following steps:
a. On the “Settings for myrealm” > Providers > Authentication tab page, click the
DefaultAuthenticator link in the Name column of the Authentication Providers table.
b. On the “Settings for DefaultAuthenticator” Configuration > Common tab page,
select SUFFICIENT from the Control Flag drop-down menu, and click Save.

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 46
Note: The original Control Flag setting for the DefaultAuthenticator is REQUIRED. It
must be changed to SUFFICIENT to work with the addition of OUDAuthenticator.
c. After saving the changes to the DefaultAuthenticator, verify that the message at the top
of the page indicates that the changes are updated successfully. Sign out of the Oracle
WebLogic Server Administration Console because you need to restart all the servers in
the domain next.
6. To restart the domain, including the Administration Server and all the Managed Server
instances, enter the following commands in a Terminal window (either on host01 or host02):
$ /practices/scripts/domain.sh shutdown
Username [weblogic]:
Password: password
:
Note: Wait for the domain to be completely shut down before starting up the domain!
$ /practices/scripts/domain.sh startup
Username [weblogic]:
Password: password
7. After restarting the domain, to verify that your LDAP configuration is operational, by using a
Terminal window or editor, open the AdminServer.log file in the
$ASERVER/servers/AdminServer/logs folder and search for any LDAP errors.
Hint: Use any editor (gedit or vi) to search for the keyword LDAP. Verify that no LDAP
connection errors occurred. For example, look for errors such as the following:

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 47
The LDAP authentication provider named "OUDAuthenticator" failed
to make connection to ldap server at ...
Note: If there are any errors, such as the one shown in the preceding line, check your
connection settings in the OUDAuthenticator provider, or with your instructor to resolve the
configuration problems before continuing with the practice. If you have configured the LDAP
authentication provider correctly, there should not be any errors related to the LDAP
services.
8. When the connection with your LDAP provider server is successful, to verify that you can
view the users and groups that exist in the LDAP provider, perform the following steps:
a. Access the Oracle WebLogic Server Administration Console (URL
http://adminvh.example.com:7001/console) and sign in with the WebLogic
administrator credentials.
b. On the Oracle WebLogic Server Administration Console home page, navigate to the
Security Realms > myrealm > Users and Groups page.
c. On the Users and Groups > Users tab page, in the Users table, verify that you can see
the entry with the Name bcobham and the Provider OUDAuthenticator:

d. Click the Groups tab, and in the Groups table, verify that you can see the entry with the
Name “Team Managers” and the Provider OUDAuthenticator:

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 48
Note: If you can see the OUDAuthenticator user and group entries already seeded in the
LDAP server, you can continue to the next step of provisioning the SOA administrator user
and group to the LDAP server.

Provisioning a New SOA Administrator User and Group to the LDAP Server
To provision a new user and group for a SOA Administrator, you could manually create each
entry in the LDAP server by using any user interfaces that provide support for these tasks. In
this course, you use the Oracle Unified Directory ldapmodify command-line tool to create the
LDAP entries from the LDIF files that are provided for these tasks.
9. To create the SOA administrator user called weblogic_soa, enter the following
commands in a Terminal window:
$ cd /practices/practice03
$ /practices/scripts/ldapadd.sh $PWD/soa_adminuser.ldif
Password: ldap-password

Tip: The $PWD environment variable expands to the path of the current working directory.
The ldapadd.sh script executes the ldapmodify command-line tool with the appropriate
parameters. The following command is executed to load the LDIF file to create the user:
$ /u02/oracle/product/fmw/asinst_1/OUD/bin/ldapmodify –a
-h ldap.example.com -p 1389-D "cn=Directory Manager"
-w password -f soa_adminuser.ldif
Note: The preceding command should be entered on one line with the password for the
Directory Manager user. The content of the soa_adminuser.ldif file is shown as
follows:
dn: cn=weblogic_soa, cn=Users, dc=example, dc=com
orclsamaccountname: weblogic_soa
givenname: weblogic_soa

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 49
sn: weblogic_soa
userpassword: password
mail: weblogic_soa@example.com
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetorgperson
objectclass: orcluser
objectclass: orcluserV2
uid: weblogic_soa
cn: weblogic_soa
description: Admin User for the SOA Domain
10. To create the SOA administrator group called SOA Administrators, enter the following
command in a Terminal window:
$ cd /practices/practice03
$ /practices/scripts/ldapadd.sh $PWD/soa_group.ldif
Password: ldap-password

Tip: The following command is executed to load the group LDIF file:
$ /u02/oracle/product/fmw/asinst_1/OUD/bin/ldapmodify –a
-h ldap.example.com -p 1389-D "cn=Directory Manager"
-w password -f soa_group.ldif
Note: The preceding command should be entered on one line. The content of the
soa_adminuser.ldif file is shown as follows:
dn: cn=SOA Administrators, cn=Groups, dc=example, dc=com
displayname: SOA Administrators
objectclass: top
objectclass: groupOfUniqueNames
objectclass: orclGroup
uniquemember: cn=weblogic_soa,cn=users,dc=example,dc=com
cn: SOA Administrators
description: Administrators Group for the SOA Domain
11. To verify that the SOA Administrator user and group are successfully added to the LDAP
server and are visible to the Oracle WebLogic Server instance, perform the following steps:
a. Return to the web browser page with the Oracle WebLogic Server Administration
Console application open, or enter the URL
http://admivh.example.com:7001/console.
Note: If required, log in to the Oracle WebLogic Server Administration Console
application as the WebLogic Server administrator.
b. To navigate to the Users and Groups page, perform the following steps:

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 50
Note: If the web browser is already displaying the User and Groups tab page, skip the
following steps.
1) On the Oracle WebLogic Server Administration Console home page, in the
Domain Structure panel, click Security Realms.
2) On the “Summary of Security Realms” page, click the myrealm link (the default
security realm).
3) On the “Settings for myrealm” page, click the Users and Groups tab.
c. On the “Settings for myrealm” > Users and Groups > Users page, verify that you can
see the weblogic_soa user (for the OUDAuthenticator provider) in the Users table.

Note: If necessary, refresh the User tab page.


d. On the “Settings for myrealm” > Users and Groups page, click the Group subtab and
verify that the SOA Administrators group (from the OUDAuthenticator provider) is
visible in the Groups table.

Tip: On the host01 desktop, there is an application called JXplorer. You can use this
graphic user interface to connect to Oracle Unified Directory and verify the LDAP user and
groups that are created in the LDAP server. There is a saved connection called OUD that
can be used to load the correct connection setting. Then you can enter the password to
connect and explore the LDAP tree.

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 51
Granting WSM-PM Application Roles to the New SOA Administrator
To ensure that the weblogic_soa user in the SOA Administrators group can access the Web
Services Policy Manager application-specific administration tasks, you grant the policy.Updater
administration role for the Oracle Web Services Manager wsm-pm application stripe.
Note: Application role assignments are performed in the Oracle Enterprise Manager Fusion
Middleware Control application, initially, as the weblogic administrative user.
12. To add the policy.Updater application role to the SOA Administrators group, perform the
following steps:
a. On the Oracle Enterprise Manager Fusion Middleware Control home page, ensure that
the edg_domain entry (under the WebLogic Domain tree of the Target Navigation
panel) is selected. The edg_domain WebLogic Domain home page is displayed
consequently.
Note: If necessary, sign in to Oracle Enterprise Manager Fusion Middleware Control
with the weblogic user credentials.
b. On the edg_domain WebLogic Domain home page, click the WebLogic Domain menu,
and select Security > Application Roles.

c. On the Application Roles page, in the Search section, select wsm-pm from the
Application Stripe drop-down menu and click the Search icon.

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 52
d. On the Application Roles page, in the Search section, select the policy.Updater row and
click Edit.
e. On the “Edit Application Role: policy.Updater” page, click Add.
f. In the Add Principal dialog box, select Group from the Type drop-down menu, enter
SOA in the Principal Name search field, and click the Search icon. From the Searched
Principals section, select the SOA Administrators entry, and click OK.

Note: Clicking OK closes the Add Principal dialog box and adds the selected entry to
the Role member list.
g. On the “Edit Application Role: policy.Updater” page, verify that the SOA Administrators
group appears in the Members table with the Administrators group, and click OK.
Note: After clicking OK on the “Edit Application Role: policy.Updater” page, you are
returned to the Applications Role page with the Information message indicating that the
policy.Updater role has been updated.
13. Sign out of Oracle Enterprise Manager Fusion Middleware Control and sign out of the
Oracle WebLogic Server Administration Console.

Verifying the SOA Administrator Access Rights


14. To verify that the weblogic_soa user can access the Web Services Manager Policy
Manager web pages, perform the following steps:
a. In a new web browser session, enter the following URL
http://soavh01.example.com:8001/wsm-pm.
b. In the Authentication Required dialog box, enter the User Name weblogic_soa and
the associated password for the user, and click OK.
Note: If the web browser prompts for remembering the password for the
weblogic_soa user, take any action that you prefer for your environment. Check with
your instructor for the password (or check the password sheet that is provided for this
course, or view the contents in the
/practices/practice03/soa_adminuser.ldif file).
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 53
c. Verify that the Validate Policy Manager page is displayed as shown in the following
image:

d. Close the Validate Policy Manager web browser window or tab page.
15. To check that the new SOA Administrator (the weblogic_soa user) cannot sign in to use
the Oracle WebLogic Server Administration Console (and the Oracle Enterprise Manager
Fusion Middleware Control administration applications), perform the following steps:
a. Open a new web browser application window and enter the URL
http://adminvh.example.com:7001/console. Sign in with the username
weblogic_soa and the user password that was created when the LDIF file was
loaded into the LDAP server.

Note: If the web browser prompts for remembering the password for the new
username, make a selection as is appropriate for you.
The weblogic_soa user should not be able to access the Oracle WebLogic Server
Administration Console application; a Forbidden response web page is returned after
attempting to sign in.

b. To check that the weblogic_soa user cannot sign in to Oracle Enterprise Manager
Fusion Middleware Control, enter the URL
http://adminvh.example.com:7001/em, and sign in with the weblogic_soa
user credentials.
Note: If the web browser prompts for remembering the password for the new
username, make a selection as is appropriate for you.

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 54
The weblogic_soa user should not be able to access Oracle Enterprise Manager
Fusion Middleware Control. An Error dialog box should be displayed indicating that the
user is not authorized to log in to the WebLogic Domain.

Adding the New Administration User to the Administration Group


In this section, as the weblogic administrator user, you assign the global Admin role to the
SOA Administrators group within the WebLogic domain security realm. This enables the users
(currently only the weblogic_soa user) that belong to the group to be administrators for the
whole domain as well.
16. To assign the Admin global role to the SOA Administrator group, perform the following
steps:
a. On the WebLogic Administration Server Console home page, click Security Realms.
Note: If required, log in to the Oracle WebLogic Administration Server Console with the
weblogic administrator credentials that were used when creating the domain (do not
use the weblogic_soa credentials).
b. On the “Summary of Security Realms” page, click the myrealm link (the default security
realm).
c. On the “Settings for myrealm” page, click the Roles and Policies tab.

d. On the “Summary for myrealm” page, expand the Global Roles entry, and click the
Roles link.

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 55
e. On the Global Roles page, click the Admin role link.

f. On the Edit Global Role page, click Add Conditions.

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 56
g. On the Edit Global Role page, select Group from the Predicate List drop-down menu,
and click Next.

h. On the Edit Global Role page, enter SOA Administrators in the Group Argument
Name field, and click Add.

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 57
i. On the Edit Global Role page, verify that the SOA Administrators value appears in the
text area below the Group Argument Name field, and click Finish.

j. On the Edit Global Role page, verify that Role Conditions includes the “Group: SOA
Administrators” entry with the OR operator combining it with the “Group: Administrators”
entry. Click Save to finish associating the SOA Administrators Group with the Admin
role.

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 58
Note: When you click Save, the “Changes saved successfully” message appears at
the top of the page above the Edit Global Role heading on the page.
17. Log out of the Oracle WebLogic Server Administration Console.
Note: Ensure that the default WebLogic administrator user is not logged in to any
administration application in a web browser. In other words, close all web browser
application windows. This is needed to perform the next task of validating for which you can
log in to the administration application as the new weblogic_soa user.
Ensure that you are also signed out of the Oracle Enterprise Manager Fusion Middleware
Control web application.

Verifying Administrative Access for the New SOA Administrator User


18. To validate that you can now successfully access the Oracle WebLogic Server
Administration Console and Oracle Enterprise Manager Fusion Middleware Control
administration applications by using the new weblogic_soa user credentials, perform the
following steps:
a. Open a new web browser application window and enter the URL
http://adminvh.example.com:7001/console. Sign in with the username
weblogic_soa and the user password that was created when the LDIF file was
loaded into the LDAP server. Check with your instructor for the password (or view the
contents in the /practices/practice03/soa_adminuser.ldif file).

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 59
Note: If the web browser prompts for remembering the password for the new
username, make a selection as is appropriate for you.
b. Verify that you can access various pages in the Oracle WebLogic Server
Administration Console application.
Note: Do not sign out the Oracle WebLogic Server Administration Console application.
c. Verify that you can access the Oracle Enterprise Manager Fusion Middleware Control
home page, by opening a new browser window or tab page and entering the URL
http://adminvh.example.com:7001/em.
Note: If you started a completely new browser session, when prompted to sign in,
enter the weblogic_soa user credentials and ensure that you can access the
application pages.
Tip: If you opened a new web browser tab page with the same web browser
application that is still signed in to the Oracle WebLogic Server Administration Console
application, you are not prompted for login credentials. You are automatically signed in
as the weblogic_soa user (which can be verified if you look at the top right-hand
corner of the Oracle Enterprise Manager Fusion Middleware Control banner where the
current username is displayed, as shown in the following image):

Note: If you can log in to the Oracle WebLogic Server Administration Console and Fusion
Middleware Control with the credentials of the new administration user that you just
provisioned in the new Authentication Provider, you have configured the provider
successfully.
Tip: Although the weblogic_soa administrator user credentials can be used in the Oracle
WebLogic boot.properties file to AdminServer start up capabilities to the user, this
change would build a dependency on the LDAP server to be available all the time. If you
retain the default WebLogic Server administrator credentials in the boot.properties file,
the AdminServer can be started without the LDAP server being available.

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 60
Practice Summary and Checkpoint
After completing these practices, you should have installed the Enterprise Deployment style
architecture with Oracle Fusion Middleware Infrastructure as a foundation for any additional
products that you may add to the domain by extending the domain. The initial domain includes:
• An application tier consisting of the AdminServer and a cluster of two Managed Server
instances running the Web Services Manager Policy Management components
• A database tier that contains the Fusion Middleware Infrastructure schemas
In addition, you walked through the process of creating a new LDAP user and group that can be
authorized for a subset of functions through the administrative interfaces that are provided.
However, after you assigned the Admin role to the SOA Administrators group, all the users in
the SOA Administrators group effectively become full administrators of the entire WebLogic
domain.
Congratulations!
In the next practice, you extend the domain to include Oracle SOA Suite 12c components.

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

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 61
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Installing Oracle Fusion Middleware Infrastructure 12c


Chapter 3 - Page 62
Practices for Lesson 4:
Extending the Domain with
Oracle SOA Suite 12c
Chapter 4

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

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 1
Practices for Lesson 4

Practices Overview
In the practices for this lesson, you install the Oracle SOA Suite software binaries, and extend
the Fusion Middleware Infrastructure WebLogic Server domain with the Oracle SOA Suite
components based on a variation of the recommendations in the Oracle Enterprise Deployment
Guide.
Notes About Command-Line Instructions
• Shell commands: Some bash shell commands are long and therefore formatted across
more than one line for readability. However, when you enter the commands, they should
be entered on one line. If you enter any shell command over more than one line, you
must use the backslash (\) character as a command-line continuation indicator. The
long shell commands in this guide, however, do not show the command-line continuation
character.
• WebLogic Scripting Tool (WLST) commands: The WLST commands do not require a
command-line continuation character, and therefore, can be entered on one line or over
multiple lines as written in the guide.

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

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 2
Practice 4-1: Installing Oracle SOA Suite 12c

Overview
In this practice, you install Oracle SOA Suite 12c on host01 and capture the response file for
using with a script to perform a silent installation of the same software on host02.

Assumptions
• The Oracle Database 11g instance is running and available on host02.
• You have verified and set the path of the Oracle Java Development Kit on host01 and
host02 as described in the practices for the lesson titled “Planning an Oracle SOA
Suite 12c Deployment Architecture.”
• You have successfully installed the Oracle Fusion Middleware Infrastructure software
on the host01 and host02 VM instances, as described in “Practice 3-1: Installing the
Oracle Fusion Middleware Infrastructure,” and created the initial WebLogic clustered
domain as described in “Practice 3-2: Creating a Clustered SOA Domain for the
Infrastructure.”
• You have access to the /install folder, which contains the Oracle SOA Suite 12c
installers, on the host01 and host02 VM instances.

Tasks
Your task in this practice is to install the SOA binaries on host01 and host02.

Installing Oracle SOA Suite 12c on Host01


1. To start the installation program on host01, perform the following actions:
a. In the host01 VNC session, open the Terminal application (if required) and verify that
the $MW_HOME/soa folder does not exist.
Note: If you use the ls $MW_HOME/soa command, the following message should be
displayed:
ls: cannot access /u01/oracle/product/fmw/soa: No such file or
directory
b. In the host01 VNC session, open the Terminal application (if required) and execute the
following commands:
$ cd /install/soa
$ java -d64 -jar fmw_12.1.3.0.0_soa.jar
Note: After extracting the installation files, the Oracle Fusion Middleware 12c SOA
Suite and Business Process Management installer is started. To save typing, execute
the /practices/scripts/install_soa.sh command-line script without
arguments.
2. On the Oracle Fusion Middleware 12c SOA Suite and Business Process Management
Installation page, enter the information suggested in the next several steps:
a. On the Welcome page, click Next.
b. On the Installation Location page, enter the path /u01/oracle/product/fmw or
select the value from the Oracle Home drop-down list, and click Next.
c. On the Installation Type page, accept the default SOA Suite value as the selected
option, and click Next.

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

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 3
d. On the Prerequisite Checks page, wait for the installer to pass the checks performed
and click Next.
e. On the Installation Summary page, click Save Response File.
f. In the Save dialog box, navigate to the /practices/practice04 folder, enter
install_soa.rsp in File Name, and click Save.

g. After saving the response file, while still on the Installation Summary page, click Install.
Note: The Installation Progress page is displayed where you can monitor and wait for
the installation process to complete.
h. On the Installation Progress page, after verifying that the installation was successful,
click Next, or click Finish.
i. If you did not click Finish on the Installation Progress page, click Finish.
3. In the Terminal window, verify that the soa folder exists in the $MW_HOME folder by entering
the following command:
$ ls $MW_HOME/soa
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 4
Note: The following image shows the list of folders that you can expect to see in the soa
folder:

Hint: The folders that are contained in the soa directory are aiafp, bam, bin, bpm,
common, integration, jlib, plugins, and soa.

Installing Oracle SOA Suite 12c on Host02


4. To perform the SOA installation on host02, perform the following actions:
a. In the host02 VNC session, open the Terminal application (if required) and verify that
the $MW_HOME/soa folder does not exist.
b. Run the silent installation by using the install_soa.rsp file that you created when
installing the SOA software on host01. In a host02 Terminal window, enter the
following commands:
$ cd /install/soa
$ java -d64 -jar fmw_12.1.3.0.0_soa.jar –silent
–responseFile /practices/practice04/install_soa.rsp
Note: Each command should be entered on its own line. Alternatively, execute the
/practices/scripts/install_soa.sh silent command-line script with
silent as the parameter.
c. Confirm whether the installation is successful and if necessary, check the installation
log files for errors. Confirm also whether the soa folder tree is created in the
$MW_HOME folder on host02.
Hint: The last lines of the output from the java command should resemble the text
shown in the following image:
You can find the log of this install session at:
/tmp/OraInstall2015-02-02_09-37-04PM/install2015-02-02_09-37-04PM.log
-----------20%----------40%----------60%----------80%--------100%

The installation of Oracle Fusion Middleware 12c SOA Suite and


Business Process Management 12.1.3.0.0 completed successfully.
Logs successfully copied to /u01/app/oraInventory/logs.
d. In the Terminal window, verify that the soa folder exists in the $MW_HOME folder by
entering the following command:
$ ls $MW_HOME/soa
In summary, you have installed the binary files that are required for the Oracle SOA Suite
components to be added to your domain. The binary files are needed on both hosts for runtime
configuration.

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

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 5
Practice 4-2: Extending the SOA Domain with Oracle SOA Suite 12c

Overview
In this practice, you run the Oracle WebLogic configuration to extend the existing domain with
the Oracle SOA Suite components. However, you must first create the database schema that is
needed for Oracle SOA Suite. Creating the schema is done by using the Repository Creation
Utility (RCU) that is located in the oracle_common/bin folder of the Fusion Middleware home
tree.

Assumptions
• You have installed the Oracle SOA Suite 12c binaries on the host01 and host02 VM
instances.
• You have verified that the soavh01.example.com and soavh02.example.com virtual
host names and their Virtual IP addresses are available.
Note: You can verify that these host names are accessible by using the ping
command with the virtual host name and confirm that the ping was successful with
commands similar to the following:
$ ping –c 1 soavh01.example.com
$ ping –c 1 soavh02.example.com
• The system clocks on each VM host computer are synchronized because this is
recommended for clustered SOA instances.

Tasks
Your tasks in the section include:
• Creating the SOA schemas with the Repository Configuration Utility (RCU)
• Extending the existing edg_domain with the SOA components
• Propagating the domain configuration changes to the Managed Servers in the cluster

Creating the SOA Schemas


In this section, you run the Repository Creation Utility (RCU) to create the SOA schemas.
1. In a Terminal window (either on host01 or host02), to start the RCU application for creating
the SOA Suite schema, enter the following commands:
$ cd $MW_HOME/oracle_common/bin
$ ./rcu
2. On the Repository Creation Utility wizard pages, take the following actions:
a. On the Welcome page, click Next.
b. On the Create Repository page, accept the default (or make the) selection combination
of the Create Repository option and the System Load and Product Load option, and
click Next.
c. On the Database Connection Details page, enter the following field values, and click
Next.
Field Name Value
Host Name host02.example.com
Port 1521

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

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 6
Service Name orcl
Username sys
Password Enter the password for the database administrator. If
you are unsure of the value, ask your instructor.
Role SYSDBA should be selected.
Note: The Database Type field should already be set to Oracle Database.
d. After entering the database connection values, when the “Repository Creation Utility –
Checking Prerequisites” dialog box is displayed, indicating that the checks are
completed, click OK.
e. On the Select Components page, take the following actions:
1) Choose the “Select existing prefix” option, which is assigned the prefix value EDG,
because it is the only existing prefix that you specified when you created the
infrastructure domain.
2) In the Component column, select the SOA Suite check box, and then click Next.
Note: When you select the SOA Suite check box, the SOA Infrastructure sub-
element is selected, and shows the value EDG_SOAINFRA in the Schema Owner
column in the same row.

Note: In the Components column, the following list of AS Common Schemas is


automatically included due to dependencies:
− Metadata Services
− Audit Services
− Audit Services Append
− Audit Services Viewer
− Oracle Platform Security Services
− User Messaging Service
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 7
The WebLogic Services and Common Infrastructure Services were created when
preparing the schemas for the Fusion Middleware Infrastructure installation.
f. When another “Repository Creation Utility – Checking Prerequisites” dialog box is
displayed, showing that the schema check is completed, click OK.
g. On the Schema Passwords page, accept the “Use same passwords for all schemas”
selection (or select it), enter the same password value in the Password and Confirm
Password fields, and click Next.
Tip: For simplicity, enter the same schema password that you used when creating the
schemas for the Fusion Middleware Infrastructure.
h. On the Custom Variables page, accept or enter the listed values for the following SOA
Infrastructure custom variables, and click Next when you have finished.
Custom Variable Value
Database Profile MED
Healthcare Integration NO
Note: Use the following image as a guide:

i. On the Map Tablespaces page, review the information presented for the SOA schema
and tablespace, and click Next.
j. In the “Repository Creation Utility – Confirmation” dialog box, click OK.
k. In the “Repository Creation Utility – Creating Tablespaces” dialog box, wait for the
tablespace creation to complete, and click OK.
l. On the Summary page, click Create.
Note: After clicking Create, the “Repository Creation Utility – System Load” dialog box
is displayed. Wait for the repository system load task to complete, and it automatically
closes when the task is complete.
m. On the Completion Summary page, optionally review the log files, and click Close.
Note: In the event of an error, use the log files that are accessible through the
Completion Summary page to determine the cause and take action to correct the
issues before continuing with the practice.
3. Optionally, verify the existence of the SOAINFRA schema in the Oracle Database by
performing the following steps on host02:
a. In a Terminal window session on host02, start SQL*Plus by entering the following
command:
$ sqlplus
b. After SQL*Plus starts, enter the following values for the username and the password
prompts:
Enter user-name: EDG_SOAINFRA
Enter password: soainfra_password
Note: The soainfra_password should be the same password that you entered for the
schema that was created in with previous RCU task.

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

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 8
Tip: If you are able to successfully log in with SQL*Plus, the SQL> prompt is displayed,
and you can enter the exit command to terminate SQL*Plus, as follows:
SQL> exit
Note: The following image provides an example of how to verify that the
EDG_SOAINFRA schema has been created:

4. To finish preparation of the database configuration for the Oracle SOA Suite components,
perform the following steps to configure the SOA schemas for transactional recovery:
a. In the Terminal window on host02, using SQL*Plus, sign in as the sys user with
sysdba privileges:
$ sqlplus "/ as sysdba"
b. At the SQL> prompt, enter the following commands to configure transactional recovery
and exit SQL*Plus:
SQL> GRANT SELECT ON sys.dba_pending_transactions
TO EDG_SOAINFRA;
SQL> GRANT FORCE ANY TRANSACTION TO EDG_SOAINFRA;
SQL> exit
Note: To save typing, execute the /practices/scripts/granttxr2soa.sh
command-line script. The “Grant succeeded.” message should appear after each
GRANT statement. These SQL statements are not case-sensitive and statements can
be entered on one or more lines. Use the following image as a guide to the session:

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

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 9
Extending the Domain with SOA Components
With the SOA schema created, you now extend the existing edg_domain to include the SOA
components. However, to prevent any configuration locks, saves, or activations from occurring
while extending the configuration of the domain, you shut down the AdminServer and cluster
instances.
5. To shut down the AdminServer and the cluster of Managed Server instances, in a Terminal
window, enter the following command and provide suitable values for the prompts that are
displayed:
$ /practices/scripts/domain.sh shutdown
Username [weblogic]:
Password: password
Note: Wait for the domain shutdown to complete.
6. To start the Oracle WebLogic domain configuration wizard to extend the domain, enter the
following commands in a Terminal window:
$ cd $MW_HOME/oracle_common/common/bin
$ ./config.sh
7. When the Fusion Middleware Configuration Wizard starts, perform the following steps to
enter values on each page to extend the domain:
a. On the Create Domain page, select the “Update an existing domain” option, and enter
the path /u02/oracle/config/domains/edg_domain in Domain Location field,
and click Next.

Note: Domain Location must be the full path name to the shared folder that was
created for the Administration Server domain home that is used when creating the
Infrastructure domain.
b. On the Templates page, ensure that the Update Domain Using Product Templates
option is selected. Then in the Available Templates section, select the “Oracle SOA
Suite - 12.1.3.0 [soa]” check box, and click Next.

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

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 10
Note: Notice that the following additional templates are already selected:
− Oracle Enterprise Manager - 12.1.3.0 [em]
− Oracle WSM Policy Manager - 12.1.3.0 [oracle_common]
− Oracle JRF - 12.1.3.0 [oracle_common]
− WebLogic Coherence Cluster Extension - 12 1.3.0 [wlserver]
Tip: Depending on your configuration, other templates may also be selected.
c. On the Database Configuration Type page, the RCU Data option should already be
selected (if not, select RCU Data). All related fields should also be pre-populated,
because you already configured the domain to reference the Fusion Middleware
schemas for the Infrastructure domain. Click Get RCU Configuration after you verify
that the following fields, database connection, and credential information are correct:
Field Name Value
Vendor Oracle
Driver *Oracle’s Driver (Thin) for Service connections; …
DBMS/Service ORCL
Host Name host02.example.com
Port 1521
Schema Owner EDG_STB
Schema Password The password that you entered when you created the
schemas by using the RCU tool
Hint: Use the following image as a guide:

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

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 11
Note: Confirm that the output seen in the Connection Result Log indicates that the
operating succeeded.
d. In the Component Datasources step (or on the JDBC Component Schema page), click
Next.
e. In the JDBC Test step (or on the JDBC Component Schema Test page), select all the
SOA schemas in the table and ensure that the DBMS/Service, Host Name, Port, and
Schema Password have the same values that you used when you created the
schemas with the RCU tools. Click Next.
Caution: You may find that the User Messaging Service row does not contain correct
values. If the password field is empty for the User Messaging Service row, select the
check box for the row to enter the password that was specified when running the RCU
tool before you click Next.

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

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 12
Tip: If any Component Schema has incorrect configuration data, such as a prefix other
than EDG_ in the Schema Owner column, select the check box for that Component
Schema and make corrections manually before clicking Next.
f. In the JDBC Test step (or on the JDBC Component Schema Test page), to test the
data source connections that are configured, select the check box at the top of the
table to select all component schemas, and then click Test Selected Connections.
Verify that all connections are successfully established (tested) before you click Next.

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

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 13
g. On the Advanced Configuration page, to complete domain configuration for the
topology, select the following options, and click Next.
− Managed Server, Clusters and Coherence
− JMS File Store

h. On the Managed Servers page, confirm that the soa_server1 and soa_server2
Managed Server entries, which were created when you configured the Fusion
Middleware Infrastructure domain, appear in the list of servers.
Action: For each Managed Server, click the Server Groups column drop-down list and
ensure that the SOA-MGD-SVRS group is selected, in addition to others that are already
selected. After setting the Server Groups for both Managed Servers (as shown in the
following image), click Next.

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

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 14
i. On the Clusters page, ensure that the soa_cluster1 row is already present, enter the
following values in the specified columns, and click Next:
Column Name Value
Frontend Host soa.example.com
Frontend HTTP Port 8080
Frontend HTTPS 4443

Note: These values ensure that when necessary, WebLogic Server will redirect Web
services callbacks and other redirects to soa.example.com on the load balancer
rather than the address in the HOST header of each request. However, the load
balancer instance has not been installed and configured at this stage of the installation
process. Normally, the load balancer has already been configured.
j. On the Assign Servers to Clusters page, verify that the two Managed Servers
(soa_server1 and soa_server2) are assigned to soa_cluster1, and click Next.
k. On the Coherence Clusters page, accept the default settings, which were defined
during the initial Infrastructure domain creation, and click Next.
l. On the Machines page, click the Unix Machine tab to verify that the machines created
during the initial Infrastructure domain creation are still correct, and click Next.
Note: Use the following image as a guide for verification purposes:

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

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 15
m. On the Assign Servers to Machines page, verify that AdminServer is assigned to
adm_machine, soa_server1 is assigned soa_machine1, and soa_server2 is assigned
soa_machine2, and click Next.

n. On the JMS File Stores page, update entries as specified in the following table to
assign a Directory column value for each of the SOA Persistence stores, including the
UMS and BPM file stores. Click Next when you have finished.
Name Directory Column Path Value
mds-owsm /u02/oracle/config/domains/edg_domain/s
oa_cluster1/jms/mds-owsm
mds-soa /u02/oracle/config/domains/edg_domain/s
oa_cluster1/jms/mds-soa
UMSJMSFileStore_a /u02/oracle/config/domains/edg_domain/s
uto_1 oa_cluster1/jms/UMSJMSFileStore_auto_1
UMSJMSFileStore_a /u02/oracle/config/domains/edg_domain/s
uto_2 oa_cluster1/jms/UMSJMSFileStore_auto_2
BPMJMSFileStore_a /u02/oracle/config/domains/edg_domain/s
uto_1 oa_cluster1/jms/BPMJMSFileStore_auto_1
BPMJMSFileStore_a /u02/oracle/config/domains/edg_domain/s
uto_2 oa_cluster1/jms/BPMJMSFileStore_auto_2
SOAJMSFileStore_a /u02/oracle/config/domains/edg_domain/s
uto_1 oa_cluster1/jms/SOAJMSFileStore_auto_1
SOAJMSFileStore_a /u02/oracle/config/domains/edg_domain/s
uto_2 oa_cluster1/jms/SOAJMSFileStore_auto_2
Note: Update the mds-owsm and mds-soa entries as shown in the preceding table.
Copy the /u02/oracle/config/domains/edg_domain/soa_cluster1/jms/
path (including the trailing slash character) for the first entry that is updated and paste
the copied path as a prefix to all remaining entries in the Directory column, to save
typing time. Use the following image as a guide:

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

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 16
o. On the Configuration Summary page, review the details, verify that the domain creation
information is correct, and click Update.
Note: After you click Update, the Configuration Progress page is displayed. Wait until
the configuration progress is completed.
p. On the Configuration Progress page, when the progress bar reaches 100% indicating
completion, click Next.
q. On the Configuration Success page, click Finish.
Note: Clicking Finish closes the configuration wizard.
8. To start the Administration Server and verify that you can access the Oracle WebLogic
Administration Console web page, perform the following steps:
a. To start the AdminServer, in a Terminal session on host01 or host02, enter the
following command:
$ /practices/scripts/adminserver.sh start
b. To verify that you can access the Oracle WebLogic Administration Console web page,
enter the URL http://adminvh.example.com:7001/console in a web browser
window or on a tab page, and optionally sign in as the WebLogic administrator.
Configuring the Default Persistence Store for Transaction Recovery
Each Managed Server uses a transaction log that stores information about the committed
transactions that are coordinated by the server and those that may not have been completed.
Oracle WebLogic Server uses this transaction log for recovery from system crashes or network
failures. To leverage the migration capability of the Transaction Recovery Service for the
Managed Servers within a cluster, store the transaction log in a location that is accessible to the
Managed Server and its backup servers.
9. To access the Managed Server entries, perform the following steps:
a. If required, sign in to the Oracle WebLogic Server Administration Console as the
WebLogic administrator user.
b. On the Oracle WebLogic Server Administration Console home page, in the Domain
Structure pane, expand the Environment and click Servers.

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

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 17
10. To set the location for the default persistence stores for the transaction logs for soa_server1,
perform the following steps:
a. On the Summary of Servers > Configuration tab page, click the soa_server1 link in the
Name column of the Servers table.

b. On the Settings for soa_server1 > Configuration tab page, click the Services subtab.

c. On the Settings for soa_server1 > Configuration > Services tab page, under the Default
Store section heading, enter the path
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 18
/u02/oracle/config/domains/edg_domain/soa_cluster1/tlogs in the
Directory field, and click Save.

Note: The path that is entered specifies the folder where the default persistent stores
keep the transaction log data files. For the enterprise deployment, it is recommended
to create a new subdirectory tree in the Administration Server domain home, such as
soa_cluster1/tlogs, as the central shared location for the transaction logs.
11. To set the location for the default persistence stores for the transaction logs for soa_server2,
perform same steps as you did for soa_server1 (as documented without images here):
a. Return to the Summary of Server page, either by clicking the Summary of Servers
breadcrumb link on the current page or clicking the Servers entry under the
Environment node in the Domain Structure pane.
b. On the Summary of Servers > Configuration tab page, click the soa_server2 Name link.
c. On the Settings for soa_server2 > Configuration tab page, click the Services subtab.
d. On the Settings for soa_server2 > Configuration > Services tab page, under the Default
Store section heading, in the Directory field, enter the path
/u02/oracle/config/domains/edg_domain/soa_cluster1/tlogs, and click
Save.
Note: At this stage, the two Managed Servers should still be shutdown. If not, take action to
shut down the servers. You can verify that the Managed Servers are shutdown by viewing
their State column value on the Summary of Servers page (refer to the image in the
previous step part a. for an example).

Packing the Extended Domain Configuration


Before starting the Managed Server instances again, you propagate the extended domain
configuration to the Managed Server configuration trees on host01 and host02. This task is the
same as what you did to pack and unpack the Infrastructure domain configuration with a
template file.
12. To create a Managed Server extended SOA domain configuration template with the pack
utility on host01, perform the following steps:
a. In a Terminal window on host01, enter the following commands:
$ cd /practices/practice04
$ /practices/scripts/cpdomain.sh pack edgsoa_template.jar

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

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 19
Note: The name of the template file is changed to reflect that the packaged
configuration files represent the extended SOA domain configuration. Alternatively, you
can enter the following commands to perform the task manually:
$ cd $MW_HOME/oracle_common/common/bin
$ ./pack.sh -managed=true
–domain=$ASERVER
-template=/practices/practice04/edgsoa_template.jar
-template_name=edgsoa
Note: The following image represents similar results produced by the pack.sh script:

b. Verify that the template edgsoa_template.jar file exists in the


/practices/practice04 folder, where it should be accessible to host02 by entering
the following command:
$ ls /practices/practice04
Note: The ls command should list the edgsoa_template.jar file.

Unpacking the Extended Domain Configuration on Host01


13. To unpack the extended domain configuration for the soa_server1 Managed Server on
host01, enter the following commands in a Terminal window:
$ cd /practices/practice04
$ /practices/scripts/cpdomain.sh unpack edgsoa_template.jar
Note: To perform this task manually, enter the following commands:
$ cd $MW_HOME/oracle_common/common/bin
$ ./unpack.sh –domain=$MSERVER
-overwrite_domain=true
-template=/practices/practice04/edgsoa_template.jar
-log_priority=DEBUG
-log=/practices/log/unpack_edgsoa_template.log
-app_dir=$APPHOME
Hint: To save time, you can start on the unpack operation on host02 (shown in the next
section) while waiting for the unpack operation on host01 to complete.

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

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 20
Unpacking the Extended Domain Configuration on Host02
In the following section, you unpack the edgsoa_template.jar file on host02.
14. Access host02 by using the existing or new VNC session.
15. To unpack the extended domain configuration files for soa_server2, enter the following
commands in a Terminal window on host02:
$ cd /practices/practice04
$ /practices/scripts/cpdomain.sh unpack edgsoa_template.jar

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

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 21
Practice 4-3: Starting and Verifying the SOA Domain

Overview
In this practice, you start your updated WebLogic domain, which contains the Oracle SOA Suite
12c components installed. You also grant SOA-specific application roles to the weblogic_soa
user.

Assumptions
• The WebLogic AdminServer has already been started.
• The SOA extension to the edg_domain has been unpacked on host01 and host02.

Tasks

Starting the Clustered Managed Servers


1. To access Oracle Enterprise Manager Fusion Middleware Control and start the Managed
Server on soavh01.example.com, perform the following steps:
a. In a web browser, enter the URL http://adminvh.example.com:7001/em to
access the Oracle Enterprise Manager Fusion Middleware Control login page.
b. On the Oracle Enterprise Manager Fusion Middleware Control login page, sign in with
the WebLogic administrator credentials (username: weblogic, and the password that
you selected when creating the domain).

Note: Verify that the AdminServer is running and that the soa_server1 and
soa_server2 Managed Servers are not running.

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

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 22
c. On the Oracle Enterprise Manager Fusion Middleware Control home page, in the
Target Navigation pane (if required), expand the edg_domain node, right-click
soa_cluster1, and select Control > Start Up.

Note: It takes between five to ten minutes to start the two Managed Servers.
d. After clicking Start Up, the Processing pop-up window similar to the following image is
displayed, showing the progress of the startup operation:

Note: Wait for the startup operation to complete (when the Processing page title
changes to Confirmation). After successfully starting the Managed Servers, click Close.

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

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 23
e. In the Target Navigation pane, click the edg_domain entry to display the edg_domain
home page and verify that the soa_server1 and soa_server2 Managed Servers are up
and running.

Note: The Target Navigation pane now contains a SOA folder indicating that the
Oracle SOA Suite 12c components are available. Alternatively, you can return to the
WebLogic Administration Console web page and revisit (or refresh) the Servers page
to verify that all the server instances are in a RUNNING state, as shown in the
following image:

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

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 24
Granting the SOAAdmin Application Role to the SOA Administrators Group
Because the weblogic_soa user has the WebLogic Admin global role, the tasks in this section
are optional. However, it can be useful to grant access to the SOA Administrators group for
specific SOA administration tasks. Therefore, in this section, you grant the SOAAdmin
application roles (from the soa-infra application stripe) to the SOA Administrators group.
2. To add the SOAAdmin application role to the SOA Administrators group, perform the
following steps:
a. On the Oracle Enterprise Manager Fusion Middleware Control home page, ensure that
the edg_domain entry (under the WebLogic Domain tree of the Target Navigation
panel) is selected. This ensures that the edg_domain WebLogic Domain home page is
displayed.
Note: If necessary, sign in to Oracle Enterprise Manager Fusion Middleware Control
with the credentials of either the weblogic or weblogic_soa user.
b. On the edg_domain WebLogic Domain home page, click the WebLogic Domain menu,
and select Security > Application Roles.

c. On the Application Roles page, in the Search section, select soa-infra from the
Application Stripe drop-down menu. In the Role Name field, with the Starts With filter
selected, enter the text SOAA and click the Search icon.

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

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 25
Note: After entering the specified search filters and clicking the Search icon, the result
table is populated with matching role entries.
d. On the Application Roles page, in the Search section, from the results table, select the
SOAAdmin Role Name row and click Edit.

e. On the “Edit Application Role: SOAAdmin” page, in the Members table section,
observe that the Administrators group is already a member and click Add.

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

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 26
f. In the Add Principal dialog box, select Group from the Type drop-down menu, enter
SOA in the Principal Name field with the Starts With filter, and click the Search (right
arrow) icon . In the Searched Principals result table, select SOA Administrators and
click OK.

Note: Clicking OK closes the Add Principal dialog box and adds the selected entry to
the Role member list.
g. On the “Edit Application Role: SOAAdmin” page, verify that the SOA Administrators
group appears in the Members table, and click OK.

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

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 27
Note: After clicking OK on the “Edit Application Role: SOAAdmin” page, you are
returned to the Applications Role page with the Information message indicating that the
SOAAdmin role has been updated as shown in the following image:

h. Do not close the Application Roles page, because you use it in the next task to add the
SOA Administrators group to a role in the wsm-pm application stripe in a similar way to
adding the group to the SOAAdmin role.

Verifying That the SOA Managed Servers Are Running and Are Accessible
3. To verify that the soa_server1 Managed Server is running and is accessible, perform the
following steps:
a. Open a new web browser window or tab page, and enter the URL
http://soavh01.example.com:8001/soa-infra.
Caution: The web browser gets a redirect request with the URL replaced with
http://soa.example.com:8080/soa-infra, which fails to access the page, and the
following web response page appears:

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

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 28
Note: Because the front-end host and ports were configured when extending the
domain with the SOA components, this behavior is expected until the load balancer is
configured.
Tip: To work around this anomaly, in the browser URL, replace the host name soa
with soavh01, replace the port 8080 with 8001 to form the original URL
http://soavh01.example.com:8001/soa-infra/, and press Enter. You may have to
change the URL a few times to get the desired result.
b. When the Authentication Required dialog box is displayed, enter the User Name
weblogic and the password that you selected when creating the domain, and click
OK.

Note: If the web browser prompts for remembering the password for the weblogic
user, take any action that you prefer for your environment.
c. Verify that the Welcome to the Oracle SOA Platform on WebLogic page is displayed as
shown in the following image:

d. Close the web browser window or tab page.

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

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 29
4. To verify that the soa_server2 Managed Server is running and is accessible, perform the
following steps:
a. Open a new web browser window or tab page and enter the URL
http://soavh02.example.com:8001/soa-infra.
Caution: The web browser gets a redirect request with the URL replaced with
http://soa.example.com:8080/soa-infra, which fails to access the page, and the
following web response page appears:

Note: Because the front-end host and ports were configured when extending the
domain with the SOA components, this behavior is expected until the load balancer is
configured.
b. To work around this anomaly, in the browser URL, replace the host name soa with
soavh02, replace the port 8080 with 8001 to form the original URL
http://soavh02.example.com:8001/soa-infra/, and press Enter.
c. When the Authentication Required dialog box is displayed, enter the User Name
webLogic and the password that you selected when creating the domain, and click
OK.

Note: If the web browser prompts for remembering the password for the weblogic
user, take any action that you prefer for your environment.

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

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 30
d. Verify that the “Welcome to the Oracle SOA Platform on WebLogic” page is displayed
as shown in the following image:

e. Close the web browser window or tab page.

Validating the Transaction Log File Location


5. After starting the Managed Servers in the cluster, to validate the location and creation of the
transaction logs files and to ensure that they are created as expected, enter the following
command:
$ ls $ASERVER/soa_cluster1/tlogs
Note: The output for the ls command should display the following two .DAT files, one for
each SOA Managed Server instance:
_WLS_SOA_SERVER1000000.DAT _WLS_SOA_SERVER2000000.DAT
6. Sign out of the WebLogic Administration Console and the Oracle Enterprise Manager
Fusion Middleware Control web pages, and close their respective web browser pages.

Backing Up the SOA Domain and Database Schemas


If you have been successful setting up the SOA cluster, it is a good time to back up the
environment.
7. To back up the SOA cluster configuration, perform the following steps:
a. In a Terminal window on host01, enter the following commands:
$ /practices/scripts/domain.sh shutdown
Username [weblogic]:
Password: password
Note: To get a consistent backup, the domain is shut down first.
b. On host01, use the following backup.sh script commands with a second parameter
that identifies the backup files with the tag (or label) name soa.
Tip: You can execute the backup commands on host02 (documented in the next step)
at the same time as running the following backup commands on host01:
$ /practices/scripts/backup.sh admin soa
$ /practices/scripts/backup.sh apps soa
$ /practices/scripts/backup.sh managed soa
c. In a Terminal window on host02, enter the following commands:
$ /practices/scripts/backup.sh managed soa
$ /practices/scripts/backup.sh ldap soa
$ /practices/scripts/backup.sh db soa
d. Start up the domain by entering the following command in a Terminal window (on
host01 or host02).
Note: Do not start up the domain until all the backup operations are completed.
$ /practices/scripts/domain.sh startup

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

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 31
Username [weblogic]:
Password: password
8. To compress the space consumed by the collection of backup archive (tar) files, enter the
following command in a terminal window (either on host01 or host02):
$ cd /u02/backup
$ zip soa.zip *.tar
$ rm *.tar
Note: The rm command deletes the backup archive files to reclaim the disk space that is
needed for remaining course practices. The zip command packages all related backup
archive files into a single compressed file. If a restore operation is required, make sure that
you extract the backup archive files from the zip file first after ensuring that you have
enough disk space to do so.
In summary, you have unpacked the SOA configuration files for the two Managed Server
instances (soa_server1 and soa_server2) in the cluster. You started the Node Manager
instances for each server, and started the two Managed Servers configured with Oracle SOA
Suite components. You have verified that the transaction log files are successfully created in the
designated shared storage folder, and have taken a backup of the SOA domain configuration
and database schemas.

Practice Summary and Checkpoint


At this stage of the practices, you have extended the Enterprise Deployment architecture with
Oracle SOA Suite 12c, which includes:
• An application tier with the AdminServer and the cluster of two SOA Managed Servers
that are extended to include the Oracle SOA Suite 12c components, in addition to the
Web Services Manager components that are configured with the Fusion Middleware
Infrastructure domain
• A database tier that now contains the SOA schemas in addition the Fusion Middleware
Infrastructure schemas
Congratulations!
Your next practice is about configuring a Managed Server as a load balancer and web tier for
your SOA cluster instances.

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

Practices for Lesson 4: Extending the Domain with Oracle SOA Suite 12c
Chapter 4 - Page 32
Practices for Lesson 5:
Configuring a Load Balancer
for Enterprise Deployment
Chapter 5

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

Practices for Lesson 5: Configuring a Load Balancer for Enterprise Deployment


Chapter 5 - Page 1
Practices for Lesson 5

Practices Overview
In the practices for this lesson, you create a stand-alone Managed Server in the domain that is
to be used as a load balancer in a cut-down variation of the web tier implementation for your
Enterprise Deployment.
Notes About Command-Line Instructions
• Shell commands: Some bash shell commands are long and therefore formatted across
more than one line for readability. However, when you enter the commands, they should
be entered on one line. If you enter any shell command over more than one line, you
must use the backslash (\) character as a command-line continuation indicator. The
long shell commands in this guide, however, do not show the command-line continuation
character.
• WebLogic Scripting Tool (WLST) commands: The WLST commands do not require a
command-line continuation character and therefore, can be entered on one line or over
multiple lines as written in the guide.

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

Practices for Lesson 5: Configuring a Load Balancer for Enterprise Deployment


Chapter 5 - Page 2
Practice 5-1: Creating and Configuring the Load Balancer

Overview
An important component of any clustered WebLogic configuration is having the capability to
receive client requests at a front-end system that acts as a traffic director or load balancer to
support high availability and failover of services behind the load balancer.
Note: Because the choice of load balancer implementation varies for everyone, the load
balancer implementation is configured by using a stand-alone WebLogic Server instance with
the HttpClusterServlet that can be deployed to load balance requests to a collection of clustered
SOA instances.
In this practice, you run a command-line shell script that invokes the WebLogic Scripting Tool
(WLST) with a WLST script to fully automate the creation and configuration of the entire load
balancer implementation that is used in this course. You are provided with optional steps to
examine the configuration of the load balancer to understand how requests are received and
forwarded on to their destinations.
Scripts are provided to save time because load balancer configuration details are beyond the
scope of this course. The WebLogic Server instance configuration for load balancing depends
on sound experience with and knowledge of Oracle WebLogic Server administration tasks. It
includes:
• Creating a stand-alone Managed Server, which can run independently of the existing
cluster
• Configuring the main HTTP listener to accept requests for the SOA cluster instances
by using the front-end listen address soa.example.com that listens on port 8080 and
port 4443 (for HTTP/SSL) instead of the default port (80 for HTTP and 443 for HTTPS)
that is typically required for real-world implementations
• Creating a WebLogic Server network channel to accept HTTP requests with the listen
address, admin.example.com, on port 8080 (typically port 80), and to separate
requests for the Administration Server from requests that are directed to the SOA
clustered instances
• Creating a WebLogic Server network channel to accept HTTP requests with the listen
address, soainternal.example.com, on port 8080 (typically port 80) for internal requests
that are directed to the SOA clustered instances, such as for command-line application
deployment tasks
Note: Load balancing and request redirection are handled by the following three
HTTPClusterServlet application deployments:
− The soa.example.com listen address directs requests to any of the SOA instances
in the SOA cluster.
− The admin.example.com listen address directs requests to the AdminServer
instance only.
− The soainternal.example.com listen address directs requests to any of the SOA
instances in the SOA cluster.

Assumptions
• The WebLogic Server AdminServer instance is running and by implication the
database server and other dependent services, possibly including Oracle Unified
Directory.
• The load balancer scripts and the related HTTPClusterServlet WAR files exist in the
/practices/lbr folder that is already configured for deployment.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Configuring a Load Balancer for Enterprise Deployment


Chapter 5 - Page 3
Tasks
You key tasks in this practice are:
• Verifying that the main URL access points to the edg_domain are yet not accessible,
even though you can ping each host name that is used in the URLs.
• Running the create_lbr.sh shell script to create and configure the load balancer
instance
• Starting the load balancer and testing the operation of the load balancer as it handles
requests for the AdminServer and SOA cluster operations.

Verifying That Front End URLs Are Not Enabled


In this section, you use the web browser to make HTTP requests to see if you can access the
main web URLs that are intended for use in the production environment and ping their
respective host names.
For each URL and host name listed in the following table, perform the actions that are described
after the table:
URL (for Web Browser Access) Intended Use
http://admin.example.com:8080/console To access the administration server
applications
http://soa.example.com:8080/wsm-pm For external clients to access the SOA
https://soa.example.com:4443/wsm-pm applications

http://soainternal.example.com:8080/wsm-pm For internal clients to access the SOA


applications
Note: The following actions can be performed from applications on host01 or host02.
1. In a web browser window, enter each URL listed in the preceding table and confirm that you
receive an “Unable to connect” response page that is similar to the following image:

Note: Each time you change the URL, the “Unable to connect” response page displays the
URL host name and port that you entered in an attempt to access the server.

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

Practices for Lesson 5: Configuring a Load Balancer for Enterprise Deployment


Chapter 5 - Page 4
Hint: At this stage, the “Unable to connect” response page is expected for each URL that is
entered.
Tip: To test soa.example.com with port 4443 (SSL), ensure that you enter https:// as
the protocol specification prefix to the rest of the suggested URL. You must manually test
the SSL port combination. However, when the load balancer is operational, it is configured
to redirect non-SSL requests to the SSL port.
2. In a Terminal window, use the host name part of the URL in a ping command, as shown
as follows, to verify that the specified host name is accessible by using basic networking
connectivity:
$ ping –c 1 admin.example.com
Note: Repeat the ping command with the different host names in the table. The result for
each host used should appear similar to the following output:

Tip: If the ping command fails, you may see messages containing any of the following
text:
− Unknown host
− Request timed out
− Destination host unreachable
Note: If you see any problem reported by a ping command, discuss the resolution with
your instructor.
In summary, you should have verified that each host name is accessible at the network layer by
using the ping command, but their corresponding URL web applications are inaccessible from
a web browser. The reason for the lack of web access is that the load balancer has not been
created and configured to proxy the web requests to the appropriate servers in edg_domain.

Creating and Configuring the Load Balancer Managed Server


The load balancer creation and configuration are completely scripted to save time and minimize
errors during the setup process. However, you are guided through the steps to review the
configuration that is created and start the load balancer.
3. Before creating the load balancer Managed Server instance, perform the following steps to
display the servers in your environment:
a. In a web browser, enter the URL http://adminvh.example.com:7001/console
to access the Oracle WebLogic Server Administration Console page.
b. On the Oracle WebLogic Server Administration Console page, sign in as the
administrator user.
c. In the Domain Structure panel, expand Environment and click Servers.

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

Practices for Lesson 5: Configuring a Load Balancer for Enterprise Deployment


Chapter 5 - Page 5
d. On the Summary of Servers page, verify that you see the AdminServer, soa_server1,
and soa_server2 server entries.

Note: The server instances, particularly the AdminServer, should be running.


4. To create and fully configure the load balancer as a stand-alone Managed Server instance,
perform the following steps:
a. In a Terminal window (either on host01 or host02), enter the following commands:
$ cd /practices/lbr
$ ./create_lbr.sh
...
Username [weblogic]:
Password: password
Domain home [/u02/oracle/config/domains/edg_domain]:
Note: The create_lbr.sh script prompts for the Administration Server username,
password, and domain path, and starts the AdminServer instance if it is not already
running. All you need to enter is the password for the administrator user, because the
username and domain path default values suggested match your class environment
and you need to enter those values only if you specified a different username for the
WebLogic administration user and used a different domain home path.
Tip: The following image shows the prompts displayed by the create_lbr.sh script:

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

Practices for Lesson 5: Configuring a Load Balancer for Enterprise Deployment


Chapter 5 - Page 6
b. Wait for the create_lbr.sh script to complete its tasks and verify that there are no
errors. The script should not take more than one minute (or two) to run. A sample of
some of the initial output results that you can see while the script is running is as
follows:

Note: When the script has completed, the following warning message with the text can
be ignored and does not indicate that an error occurred while creating and configuring
the load balancer:
<Warning> <JNDI> <BEA-050001> <WLContext.close() was called in a
different thread than the one in which it was created.>
5. To verify that the load balancer is created and configured successfully, perform the
following actions in the Oracle WebLogic Administration Console:
Note: If required, sign in to the Oracle WebLogic Administration Console as the
administrator again.
a. In the Domain Structure panel, expand Environment, click Servers, and on the
“Summary of Servers” page, verify that the lbr_server server entry appears in the
Servers table.

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

Practices for Lesson 5: Configuring a Load Balancer for Enterprise Deployment


Chapter 5 - Page 7
Note: The lbr_server entry is being managed by the Node Manager on the
adm_machine, and the Listen Port is set to 8080.
b. On the “Summary of Servers” page, click the lbr_server Name link, and in the “Settings
for lbr_server” page, under the Configuration > General tab pages, verify that the Listen
Address is soa.example.com and that the Listen Port 8080 and SSL Listen Port 4443
are both enabled.

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

Practices for Lesson 5: Configuring a Load Balancer for Enterprise Deployment


Chapter 5 - Page 8
Note: The main listen address and ports shown here are used for access to the SOA
applications and SOA clustered Managed Server instances.
Load Balancer Configuration Note: At this stage, you have run a script to configure a
stand-alone Managed Server that accepts requests from clients, either through the main
server listen address and port combination or the listen address and port combinations
configured in the two virtual host entries and their associated channels.
The course load balancer that was implemented as a stand-alone Managed Server was
created to mimic a real load balancer. However, the course load balancer implementation is
not recommended for production. Therefore, it is treated as a black box configuration
process for this course.

Starting the Load Balancer Managed Server


6. To start the load balancer lbr_server Managed Server instance, perform the following steps:
a. Access Oracle Enterprise Manager Fusion Middleware Control at the URL
adminvh.example.com:7001/em.
Note: You may not need to sign in if you use the same web browser application
instance that you used to access the Oracle WebLogic Server Administration Console.

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

Practices for Lesson 5: Configuring a Load Balancer for Enterprise Deployment


Chapter 5 - Page 9
In addition, because the load balancer has not been started, you must still use the
adminvh.example.com host name in the URL at this time.
b. On the Oracle Enterprise Manager Fusion Middleware Control page, in the Target
Navigation pane, expand edg_domain (if needed) and click lbr_server.

c. On the lbr_server page, click Start Up.

d. Wait while the Processing dialog box displays the progress of the server till it
eventually changes to show a Confirmation title. Verify that the server started
successfully, and click Close.

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

Practices for Lesson 5: Configuring a Load Balancer for Enterprise Deployment


Chapter 5 - Page 10
Note: If you click the edg_domain entry, you can confirm that all the servers are
running.

Configuring the WebLogic Proxy Plug-In Settings


After configuring the load balancer (or the web tier of the HTTP servers) in front of the SOA
cluster, you must configure the WebLogic Proxy Plug-In setting for the cluster instance.
7. To set the WebLogic Plug-In Enabled parameter for the SOA cluster, perform the following
steps:
a. Return to the Oracle WebLogic Server Administration Console page, and if needed,
sign in as the WebLogic administrator.
Tip: If you are still viewing the lbr_server page, on the Oracle Enterprise Manager
Fusion Middleware Control page, click the WebLogic Server Administration Console
link under the Tools heading to go the Oracle WebLogic Server Administration Console
load balancer Configuration > General tab page. The main idea here is to return to the
Oracle WebLogic Server Administration Console.

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

Practices for Lesson 5: Configuring a Load Balancer for Enterprise Deployment


Chapter 5 - Page 11
b. In the Domain Structure pane, expand the Environment node, and click Clusters.

c. On the “Summary of Clusters” page, click the soa_cluster1 link in the Name column.
The Configuration > General tabbed page is displayed.

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

Practices for Lesson 5: Configuring a Load Balancer for Enterprise Deployment


Chapter 5 - Page 12
d. On the “Settings for soa_cluster1” page, scroll down the Configuration > General tab
page to locate and expand the Advanced section. In the Advanced section, select “yes”
in the WebLogic Plug-In Enabled drop-down box, and click Save.

8. A change to the WebLogic Plug-In Enabled setting normally requires the Managed Servers
to be restarted. To restart the clustered servers, perform the following steps:
a. From the previous tasks in the practice, the clustered Managed Servers should already
be shutdown. If not, on the Enterprise Manager Fusion Middleware Control web page,
right-click soa_cluster1 and select Control > Shut Down, and respond to additional
dialog boxes as appropriate.
Note: Skip this step if the Managed Servers are already shutdown.

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

Practices for Lesson 5: Configuring a Load Balancer for Enterprise Deployment


Chapter 5 - Page 13
b. To start the clustered servers, on the Fusion Middleware Control web page, right-click
soa_cluster1 and select Control > Start Up.
Note: Take appropriate action in the various dialog boxes that are presented. Starting
the two Managed Servers in the cluster may take up to 10 minutes.

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

Practices for Lesson 5: Configuring a Load Balancer for Enterprise Deployment


Chapter 5 - Page 14
Validating Routing of Requests Through the Load Balancer
9. To validate that you can access and sign in to the Oracle WebLogic Server Administration
Console through the load balancer, perform the following steps:
a. In a web browser, enter the URL http://admin.example.com:8080/console
and verify that you can the access the Oracle WebLogic Server Administration Console
login page.
Note: You are now using a different URL for accessing the WebLogic Administration
Console application. The load balancer host name, admin.example.com, is intended to
be exposed to external clients and customers, whereas, the adminvh.example.com
host name is intended to be kept private behind a corporate firewall and inaccessible to
external clients. The load balancer host names and IP addresses become the public
view of your SOA Suite network.
b. On the Oracle WebLogic Server Administration Console login page, sign in with the
WebLogic administrator credentials.
Note: This validates that the admin.example.com virtual host on the load balancer is able to
route requests to the Oracle WebLogic Server Administration Console.
10. Similarly, verify that you can access Oracle Enterprise Manager Fusion Middleware Control
by using the URL http://admin.example.com:8080/em.
11. To verify that you can access the Oracle Web Services Manager Policy Manager page
through the load balancer, enter the URL http://soa.example.com:8080/wsm-pm
and perform the following steps:
a. Because the load balancer is configured to redirect requests to the
soa.example.com:8080 URL to the secure port 4443, the web browser displays
messages that require you to accept the temporary SSL certificate. Ideally, you need to
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Configuring a Load Balancer for Enterprise Deployment


Chapter 5 - Page 15
enable the web entry point with valid SSL certificates. On the “This Connection is
Untrusted” response page, click “I Understand the Risks.”

Note: You should need to do this only once during the course. After clicking “I
Understand the Risks,” the page expands with an explanation and the Add Exception
button. Click Add Exception.

b. In the Add Security Exception dialog box, click Confirm Security Exception.

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

Practices for Lesson 5: Configuring a Load Balancer for Enterprise Deployment


Chapter 5 - Page 16
c. After accepting the security exception, in the Authentication Required dialog box
(presented before you can access the Validate Policy Manager page), enter the
WebLogic administrator credentials and click OK.

Hint: If the web browser asks for remembering the password, select either the default
option to Remember Password or “Never Remember Password for This Site” as you
prefer. Then the Validate Policy Manager page is displayed.

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

Practices for Lesson 5: Configuring a Load Balancer for Enterprise Deployment


Chapter 5 - Page 17
Note: The URL should reflect the redirection to the HTTPS protocol by using port
4443.
d. Do not close this web page for the Validate Policy Manager.
12. Finally, validate that you can also access the Oracle Web Services Manager by using the
URL http://soainternal.example.com:8080/wsm-pm.
Note: When the Authentication Required dialog box is displayed, enter the WebLogic
administrator credentials and click OK. In addition, decide if you want the web browser to
remember the password. After entering the credentials, the Validate Policy Manager page
is displayed.

13. By starting a new browser session (by closing all browser windows or starting a new
browser on a different host), validate that you can access the following additional SOA
application URLs:
• https://soa.example.com:4443/soa-infra
• https://soa.example.com:4443/soa/composer
• https://soa.example.com:4443/integration/worklistapp
• https://soa.example.com:4443/sdpmessaging/userprefs-ui
Tip: The last two URLs are easily accessible from the links provided on the page that is
returned when you access the /soa-infra URI path. The last URL must be manually
entered. Use the following steps as a guide:
a. On a web browser page (try this on the other VM host to the one that you were testing
other URLs on), enter the URL https://soa.example.com:4443/soa-infra.
Note: If prompted for credentials, use the weblogic_soa user’s credentials. If you
can access the page, the following “Welcome to the Oracle SOA Platform on
WebLogic” page is displayed.

Tip: Notice the Links section on the right-hand side of the page with the SOA
Composer and BPM Worklist links.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Configuring a Load Balancer for Enterprise Deployment


Chapter 5 - Page 18
Hint: If you observe a Server Error response while trying to access the BPM Worklist
link (either the https://soa.example.com:4443/integration/worklistapp or the
https://soa.example.com:4443/sdpmessaging/userprefs-ui URLs), close all browser
windows and ensure that you use the weblogic_soa user credentials to sign in. The
BPM Worklist application and user preferences, being applications deployed to SOA
servers, require credentials for a user that exists in the external LDAP server. The
weblogic user credentials are stored in the embedded LDAP server of the
AdminServer instance.
b. On the “Welcome to the Oracle SOA Platform on WebLogic” page, click the SOA
Composer link (with URL https://soa.example.com:4443/soa/composer).
Note: A new browser tab page is opened, and after a short time, the following SOA
Composer page is displayed:

c. On the “Welcome to the Oracle SOA Platform on WebLogic” page, click the BPM
Worklist link to access the URL https://soa.example.com:4443/integration/worklistapp.
Note: A new browser tab page is opened, and after a short time, the following BPM
Worklist page is displayed:

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

Practices for Lesson 5: Configuring a Load Balancer for Enterprise Deployment


Chapter 5 - Page 19
d. To view the User Communication Preferences page, open a new browser tab page (or
window) and enter the URL
https://soa.example.com:4443/sdpmessaging/userprefs-ui.
Note: The following User Communication Preferences page is displayed:

e. While keeping the Validate Policy Manager web page open, close the other web
browser windows or tab pages:
1) The “Welcome to the Oracle SOA Platform on WebLogic” page
2) The SOA Composer page
3) The BPM Worklist page
4) The User Communication Preferences page
Note: Keep the web page for the Oracle WebLogic Server Administration Console and
Enterprise Manager Fusion Middleware Control open.
14. To validate that the load balancer services a request for the Policy Manager if only one
SOA server is running, perform the following steps:

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

Practices for Lesson 5: Configuring a Load Balancer for Enterprise Deployment


Chapter 5 - Page 20
a. In the Oracle Enterprise Manager Fusion Middleware Control Target Navigation pane,
expand the edg_domain > soa_cluster1 entry (if needed) and click soa_server2.
b. On the soa_server2 page, click Shut Down.

c. On the Confirmation page, click Shutdown, wait for the confirmation that the server
instance has been stopped, and click Close.

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

Practices for Lesson 5: Configuring a Load Balancer for Enterprise Deployment


Chapter 5 - Page 21
d. On the Validate Policy Manager web browser page, click the Refresh icon and verify
that the page reloads successfully.

Note: The Validate Policy Manager page should be successfully refreshed because
the soa_server1 instance is still running.
15. To examine what happens on the Validate Policy Manager web browser page after shutting
down the last Managed Server in the cluster, perform the following steps:
a. In the Oracle Enterprise Manager Fusion Middleware Control Target Navigation pane,
expand the edg_domain > soa_cluster1 entry (if required), right-click soa_server1, and
select Control > Shut Down.
Note: On the Confirmation page, click Shutdown and wait for the server to shutdown.
Click Close when the Confirmation dialog box appears.
b. On the Validate Policy Manager web browser page, click the Refresh icon and verify
that the page displays the message “No backend servers available.”

Practice Summary and Checkpoint


You now created a form of web tier consisting of a Managed Server as the load balancer that
directs requests to the application tier in your Enterprise Deployment architecture that contains
Oracle SOA Suite 12c. Your Enterprise Deployment now consists of:
• A cut-down web tier that implements a load balancer as a front end for your Oracle
SOA Suite 12c cluster and application tier
• An application tier with the AdminServer and the cluster of two SOA Managed Servers
• A database tier that holds the data for the SOA schemas in addition to the Fusion
Middleware Infrastructure schemas
Congratulations!
Some additional post-configuration tasks for an enterprise deployment implementation that are
performed in the practice related to the lesson titled “Configuring High Availability” include:
• Configuring the Oracle File Adapter in the Administration Console, and editing the JCA
file within the composite application
• Configuring the Oracle FTP Adapter
• Enabling high availability the for Oracle JMS Adapters
• Enabling high availability for the Oracle Database Adapter

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

Practices for Lesson 5: Configuring a Load Balancer for Enterprise Deployment


Chapter 5 - Page 22
Practices for Lesson 6: High
Availability
Chapter 6

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 1
Practices for Lesson 6

Practices Overview
In these practices, you prepare the environment for high availability by configuring the following
adapters and resources to be used by applications that need to be deployed and run in a
clustered environment:
• The File Adapter and connection factory configuration
• The DBAdapter, data sources, and connection factory configuration
• The JMS Adapter and JMS resources used by applications
Before updating the JCA adapters and creating the resources that are required for applications
that use the resources to function in the highly available architecture that you have created, you
test the manual failover of the Administration Server.

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 2
Practice 6-1: Testing Manual Failover of the Administration Server

Overview
In this practice, on the host01 VM, you stop the IP address that is allocated to the virtual host
name for the AdminServer (adminvh.example.com) from receiving packets to emulate a network
failure condition. You perform steps to manually “fail over” the Administration Server to the
host02 VM. The failover should be transparent to the clients, because the Administration Server
uses the same WebLogic Server machine (which is a logical machine, not a physical machine)
to be restarted, and clients access the AdminServer through the load balancer virtual host
names.

Assumptions
• You have edg_domain running.
• The oracle user can execute the ifconfig and arping commands by using the
sudo command on host01 and host02.

Tasks
1. Verify that the adminvh.example.com virtual host name is accessible by executing the
following command in a Terminal window (on any host VM):
$ ping –c 1 adminvh.example.com
Note: The ping command should be successful. You can verify success by comparing the
output response for the ping command to the following results, showing 0% packet loss:
PING adminvh.example.com (192.0.2.20) 56(84) bytes of data.
64 bytes from adminvh.example.com (192.0.2.20): icmp_seq=1
ttl=64 time=0.017 ms

--- adminvh.example.com ping statistics ---


1 packets transmitted, 1 received, 0% packet loss, time 0ms

Emulating Node Failure of the Administration Server on host01


2. To shut down the Node Manager and the associated Administration Server on host01, as
part of emulating the node failure condition, perform the following steps:
a. To shut down the AdminServer, in a Terminal window on host01, enter the following
command:
$ /practices/scripts/adminserver.sh stop
Hostname [adminvh.example.com]: press Enter
NM Username [weblogic]: Press Enter
NM Password: password
Note: You can press Enter for the first two prompts to accept the default values
suggested, and then enter the weblogic user’s Node Manager password when
prompted.
b. To shut down the Node Manager, enter the following command in a Terminal window
on host01:
$ /practices/scripts/nm.sh stop

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 3
3. To disable the IP address that is assigned to the host name adminvh.example.com, perform
the following steps:
a. To determine the IP address that is assigned to the adminvh.example.com virtual host
name, in a Terminal window, enter the following command:
$ grep adminvh /etc/hosts
Note: The result returned should be the same as shown in the following results:
192.0.2.20 adminvh.example.com adminvh
b. To determine the network interface that is associated with the adminvh.example.com
IP address, you can use the ifconfig command. However, in this course, the IP
address is associated with the eth0:2 interface. To verify that eth0:2 is the interface
that is assigned the IP address 192.0.2.20, in a Terminal window on host01, enter the
following command:
$ ifconfig eth0:2
Note: The results displayed should show the IP address 192.0.2.20 as the inet addr
value (as shown in bold font here):
eth0:2 Link encap:Ethernet HWaddr 00:16:3E:01:01:00
inet addr:192.0.2.20 Bcast:192.0.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
c. In a Terminal window on host01, to turn off the eth0:2 interface to stop it from
communicating with the IP address for the virtual host adminvh.example.com, execute
the following commands:
$ sudo ifconfig eth0:2 down
Note: This command shuts down the eth0:2 network interface, causing the host to stop
listening for traffic on the virtual IP address (192.0.2.20) that is associated with the
eth0:2 network interface. The virtual IP address effectively becomes unreachable.
d. To verify that the adminvh.example.com is no longer reachable, enter the following
command in the Terminal window:
$ ping –c 1 adminvh.example.com
Note: The results you see should be similar to the following output that shows 100%
packet loss and the message “Destination Host Unreachable:”
PING adminvh.example.com (192.0.2.20) 56(84) bytes of data.
From host01.example.com (192.0.2.11) icmp_seq=1 Destination Host
Unreachable

--- adminvh.example.com ping statistics ---


1 packets transmitted, 0 received, +1 errors, 100% packet loss, time
3000ms
Tip: Optionally, you can attempt to access the URL
http://admin.example.com:8080/console (or http://adminvh.example.com:7001/console)
to verify the same thing.

Failing Over AdminServer Manually to Host02


4. To manually fail over (restart) the AdminServer on the host02 VM, effectively migrating the
IP to the second host, and start the Node Manager and AdminServer on the other machine,
perform the following steps:

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 4
a. To enable the adminvh.example.com virtual host name IP address on host02, execute
the following commands in a Terminal window on host02:
$ sudo ifconfig eth0:2 192.0.2.20 netmask 255.255.255.0
Note: This command creates a network interface, eth0:2, with the virtual IP address
192.0.2.20, and by using the appropriate network mask, you ensure that the IP address
is visible in the local network.
b. Verify that the adminvh.example.com host name is reachable by entering the following
command in a Terminal window (on host01 or host02):
$ ping –c 1 adminvh.example.com
Note: The result of the ping command should resemble the following output, revealing
0% packet loss, and the host name being reachable:
PING adminvh.example.com (192.0.2.20) 56(84) bytes of data.
64 bytes from adminvh.example.com (192.0.2.20): icmp_seq=1
ttl=64 time=0.017 ms

--- adminvh.example.com ping statistics ---


1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.017/0.017/0.017/0.000 ms
Tip: Although it is not needed in this course environment, if you are using Domain
Naming Service (DNS) for your virtual host name to IP address resolution (as would be
the case in production environments), you may need to update your host’s IP tables by
executing the following command:
$ sudo arping -q -U -c 3 -I eth0 192.0.2.20
c. To start the Node Manager on host02, in a Terminal window on host02, execute the
following command:
$ /practices/scripts/nm.sh start
d. To start the AdminServer on host02, in a Terminal window on host02, execute the
following command:
$ /practices/scripts/adminserver.sh start
Hostname [adminvh.example.com]: press Enter
NM Username [weblogic]: Press Enter
NM Password: password
Note: You can press Enter for the first two prompts to accept the default values
suggested, and then enter the weblogic user’s Node Manager password when
prompted.
5. To verify that the Oracle WebLogic Server Administration Console is accessible, in a web
browser (on any host), enter the URL http://admin.example.com:8080/console (or
http://adminvh.example.com:7001/console), and confirm that the login page is displayed.
Note: If you managed to open the Oracle WebLogic Server Administration Console login
page in the web browser, you have successfully migrated the Administration Server from
one host to another. This verifies that your configuration supports manual failover of the
Administration Server.

Restoring the AdminServer That Was Running on Host01


6. To return the Administration Server operation back to host01, perform the following steps:

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 5
a. To shut down the AdminServer, in a Terminal window on host02, enter the following
command:
$ /practices/scripts/adminserver.sh stop
Hostname [adminvh.example.com]: press Enter
NM Username [weblogic]: Press Enter
NM Password: password
Note: You can press Enter for the first two prompts to accept the default values
suggested, and then enter the weblogic user’s Node Manager password when
prompted. Alternatively, you can force a shutdown of the AdminServer through the
Oracle WebLogic Server Administration Console.
b. To shut down the Node Manager, enter the following command in a Terminal window
on host02:
$ /practices/scripts/nm.sh stop
c. In a Terminal window on host02, to turn off the eth0:2 interface and to stop it from
communicating with the IP address for the adminvh.example.com virtual host name,
execute the following command:
$ sudo ifconfig eth0:2 down
Note: This stops host02 from servicing network requests for the virtual IP address
assigned to the eth0:2 network interface.
d. To enable the adminvh.example.com virtual host name IP address on host01, execute
the following commands in a Terminal window on host01:
$ sudo ifconfig eth0:2 192.0.2.20 netmask 255.255.255.0
Note: This command enables host01 to service network requests for the virtual IP
address 192.0.2.20, and the virtual host name (adminvh.example.com) associated with
the virtual IP address.
e. Verify that the adminvh.example.com host name is reachable by entering the following
command in a Terminal window (on host01 or host02):
$ ping –c 1 adminvh.example.com
f. To start the Node Manager again on host01, in a Terminal window on host01, execute
the following command:
$ /practices/scripts/nm.sh start
g. To start the AdminServer on host01, in a Terminal window on host01, execute the
following command:
$ /practices/scripts/adminserver.sh start
Hostname [adminvh.example.com]: press Enter
NM Username [weblogic]: Press Enter
NM Password: password
Note: You can press Enter for the first two prompts to accept the default values
suggested, and then enter the weblogic user’s Node Manager password when
prompted.
h. Verify that the Oracle WebLogic Server Administration Console is accessible by
entering the URL http://admin.example.com:8080/console (or
http://adminvh.example.com:7001/console) in a web browser and confirm
that the login page is displayed.

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 6
Practice 6-2: Configuring the File Adapter for High Availability

Overview
In this practice, you use the Oracle WebLogic Administration Console to update the
FileAdapter’s eis/HAFileAdapter connection factory to support deployment of composite
applications that can service requests in the Enterprise Deployment environment that is
configured for high availability.

Assumptions
• You have completed the practices to install and configure edg_domain with the Oracle
SOA Suite 12c components.
• The Oracle WebLogic Administration Server is running in edg_domain.
• The load balancer Managed Server is configured and operational.
• The Oracle Database is running and listening for connections.

Tasks
1. In a Terminal window on either host01 or host02, execute the following command:
mkdir –p /u02/oracle/config/dp
2. If required, sign in to the Oracle WebLogic Server Administration Console as an
administrator by performing the following steps:
a. In a web browser, enter the URL http://admin.example.com:8080/console to
access the Oracle WebLogic Server Administration Console page.
b. On the Oracle WebLogic Server Administration Console page, sign in as the
administrator user.

Modifying the File Adapter HA Connection Factory


3. To configure the eis/HAFileAdapter properties, take the following actions:
a. On the Oracle WebLogic Server Administration Console home page, in Domain
Structure panel, click Deployments.
b. On the “Summary of Deployments” page, in the Deployments table, click the Next link
a few times until you locate the FileAdapter entry in the Name column.

c. On the “Summary of Deployments” page, in the Deployments table, click the


FileAdapter link.

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 7
d. On the “Settings for FileAdapter” page, click the Configuration tab.
e. On the “Settings for FileAdapter” Configuration tab page, click the Outbound
Connection Pools subtab.
f. On the “Settings for FileAdapter” Configuration > Outbound Connection Pools subtab
page, in the Outbound Connection Pool Configuration Table, expand the
javax.resource.cci.ConnectionFactory entry.

g. On the “Settings for FileAdapter” Configuration > Outbound Connection Pools subtab
page, in the “Groups and Instances” column of the Outbound Connection Pool
Configuration Table, click the eis/HAFileAdapter link.

h. On the “Settings for javax.resource.cci.ConnectionFactory” Properties tab page:


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

Practices for Lesson 6: High Availability


Chapter 6 - Page 8
1) Click inside the Property Value column for the Property Name with ControlDir
2) Replace the ControlDir default value /scratch/mycontroldir with the
following shared folder path and press Enter:
/u02/oracle/config/domains/edg_domain/soa_cluster1/fadapter
Important Note: You must press Enter after changing the value before you click
Save.
3) After verifying that the ControDir property value has been changed, click Save.

i. On the Save Deployment Plan Assistant page, ensure that you replace the Path field
value with the following shared folder path, (do not press Enter) and click OK:
/u02/oracle/config/dp/FileAdapterPlan.xml

j. On top of the “Settings for javax.resource.cci.ConnectionFactory” page, verify that the


Messages information indicates that the changes are activated, and that the
deployment plan is successfully created in
/u02/oracle/config/dp/FileAdapterPlan.xml.

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 9
Note: No restarts are required because the FileAdapter is targeted to the servers in
soa_ cluster1. Because the Managed Server instances in the cluster are currently
shutdown, the FileAdapter changes are not yet active. Therefore, the FileAdapter
remains in the New state. The State should be changed to Active when the Managed
Servers in the cluster are started, provided that there are no problems with the
FileAdapter configuration.

Verifying That the File Adapter Is Active


4. To verify that the FileAdapter deployment is active after the modifying the HA connection
factory instance, perform the following steps:
a. To start the Managed Servers in soa_cluster1 after configuring the FileAdapter, enter
the following command in a Terminal window (either on host01 or host02):
$ /practices/scripts/domain.sh startup
Username [weblogic]:
Password: password
Note: Wait until the cluster instances are started.
b. On the Oracle WebLogic Server Administration Console home page, in the Domain
Structure panel, click Deployments.
c. On the “Summary of Deployments” page, in the Deployments table, click the Next link
a few times until you locate the FileAdapter entry and verify that the State column
contains the value Active.

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 10
Note: Only if the State column does not show the Active value, select the check box
next to the FileAdapter row entry, and click Start > Servicing All Requests.

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 11
Practice 6-3: Configuring the DBAdapter and Resources

Overview
In this practice, you configure the runtime server resources that are required for the composite
applications that use a Database Adapter to store purchase order information in the ORDER and
ITEMS tables of the SOADEMO database schema. In this practice, your tasks are to:
• Verify that the SOADEMO database schema in the Oracle Database instance exists, and
to display some of the data
• Configure a JDBC data source resource that is required by the composite applications
• Configure the DbAdapter component with a connection factory that uses the new JDBC
data source as a resource, and create a new deployment plan
• Update the DbAdapter with the new deployment plan

Assumptions
• The SQL scripts needed to create the SOADEMO schema and the database tables, and
populate the tables are in the /practices/sql folder.

Tasks
In this section, you perform the three tasks described in the overview of this practice.

Verifying That the SOADEMO Database Schema Exists


Because the SOADEMO database schema is created as part of the course environment, you
check that the database schema is accessible before creating a JDBC Data Source for the
applications.
1. To verify that the SOADEMO database schema exists and is accessible, perform the
following steps:
a. In a Terminal window on host02, enter the following command:
$ sqlplus soademo
b. The sqlplus command requires a password for the SOADEMO user. At the “Enter
password:” prompt, enter the password for the database schema user.
SQL*Plus: Release 11.2.0.3.0 Production on Sun May 10 23:23:26
2015
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Enter Password: password
Note: The password for the SOADEMO schema is listed in the password reference sheet
or you can ask the instructor. After entering a correct password, information similar to
the following is displayed:
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 -
64bit Production
With the Partitioning, OLAP, Data Mining and Real Application
Testing options
SQL>
Note: Do not exit from the SQL*Plus command-line application.

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 12
c. If you have successfully logged on as the SOADEMO user, you have verified that the
account exists. At the SQL*Plus command-line prompt, enter the following SQL
statement to verify that data exists in the CUSTOMERS table:
SQL> SELECT count(*) FROM customers;
Note: The result of 4 is displayed.
COUNT(*)
----------
4
d. To exit SQL*Plus, enter the exit command:
SQL> exit
Note: Ask your instructor to help resolve any SQL errors.

Creating a New JDBC Data Source


In this section, you create a JDBC data source by using Oracle Enterprise Manager Fusion
Middleware Control.
2. If required, in a web browser window (or on a tab page), access Oracle Enterprise Manager
Fusion Middleware Control with the URL http://admin.example.com:8080/em. Sign in with
the weblogic administrator user account.
3. To create the JDBC data source, perform the following steps:
a. On the Oracle Enterprise Manager Fusion Middleware Control home page, (if required)
in the Target Navigation pane, expand the WebLogic Domain entry, and click
edg_domain.

b. On the edg_domain page, click WebLogic Domain > JDBC Data Sources.

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 13
c. On the JDBC Data Sources page, click Create > Generic Data Source.

Note: Because the course architecture is not using a Real Application Clusters (RAC)
database configuration, you create a Generic Data Source. Otherwise, for a RAC
database, you create a GridLink Data Source.
d. On the “Creating New JDBC Data Source : Data Source Properties” page, enter the
following field values, and click Next:
Field Name Value
Data Source Name soademoDS
JNDI Name jdbc/soademo

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 14
Note: Accept default values for all other settings.
e. On the “Creating New JDBC Data Source : Connection Properties” page, click
Generate URL and Properties.

f. In the Generate URL dialog box, enter the following field values and click OK:
Field Name Value
Database Host Name host02.example.com
Database Listener Port 1521
Database Name orcl
Database User Name soademo

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 15
Password Password for soaedemo
Confirm Password Password for soaedemo
Note: The password for the SOADEMO schema is listed in the password reference sheet
or you can ask the instructor.

g. On the “Creating New JDBC Data Source : Connection Properties” page, click Test
Database Connection.

h. Verify that the message “Connection test succeeded.” appears in the Confirmation
dialog box, and click OK.

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 16
i. On the “Creating New JDBC Data Source : Connection Properties” page, click Next.
j. On the “Creating New JDBC Data Source : Transaction Properties” page, click Next.

k. On the “Creating New JDBC Data Source : Select Targets” page, in the Name column,
select the soa_cluster1 check box for the target, and click Next.

l. On the “Creating New JDBC Data Source : Review” page, verify that the settings are
correct, and click Create.

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 17
4. On the edg_domain > JDBC Data Sources page, verify that you receive a confirmation
message at the top of the page that indicates that the soademoDS JDBC Data Source is
created successfully. Scroll down the table to verify that you can see the soademoDS entry.

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 18
Configuring the DbAdapter Connection Factory and Deployment Properties
In this section, you use the Oracle WebLogic Server Administration Console to create a
connection factory that references the JDBC Data Source JNDI name that you created in the
previous section titled “Creating a new JDBC Data Source.” After modifying the connection
factory, you create a new DBAdapter deployment plan.
5. If required, on a web browser page, access the Oracle WebLogic Server Administration
Console with the URL http://admin.example.com:8080/console, and sign in as the
weblogic administrator user.
6. To configure the DBAdapter connection factory, perform the following steps:
a. On the Oracle WebLogic Server Administration Console home page, in the Domain
Structure pane, click Deployments.
b. On the “Summary of Deployments” > Control tab page, click Next in the Deployments
table until you locate the DbAdapter entry. Click the DbAdapter link.

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 19
c. On the “Settings for DbAdapter” page, click the Configuration tab, and then click the
Outbound Connection Pools subtab.

d. On the “Settings for DbAdapter” Configuration > Outbound Connection Pools subtab
page, click New.

e. On the “Create a New Outbound Connection” Outbound Connection Group page,


select the javax.resources.cci.ConnectionFactory option, and click Next.

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 20
f. On the “Create a New Outbound Connection” “JNDI name for Outbound Connection
Instance” page, enter the JNDI Name: eis/DB/soademo, press Enter, and then click
Finish.

g. On the “Save Deployment Plan Assistant” Save Deployment Plan page, replace the
Path value with /u02/oracle/config/dp/DBAdapterPlan.xml (do not press
Enter here), and click OK.
Tip: To quickly replace the directory in the path, you can click an appropriate Recently
Used Paths entry below the Path field, navigate if necessary to the appropriate
directory, and then enter the XML file name at the end of the selected directory in the
Path field.

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 21
Note: The deployment plan must be placed on a shared folder for an Enterprise
Deployment topology.
h. Verify that you receive a message, at the top of the Settings for DbAdapter page,
indicating that the deployment configuration is successfully updated and that the
deployment plan path is /u02/oracle/config/dp/DBAdapterPlan.xml.

7. To update the eis/DB/soademo connection factory to use the jdbc/soademo connection


pool, perform the following steps:
a. On the “Settings for DbAdapter” page, navigate to the Configuration > Outbound
Connection Pools page, expand the javax.resource.cci.ConnectionFactory entry, and
click the eis/DB/soademo link.

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 22
b. On the “Settings for javax.resource.cci.ConnectionFactory” > Properties tab page, in
the Outbound Connection Properties table, enter the Property Value jdbc/soademo
for the Property Name called XADataSourceName. Press Enter, and click Save after
verifying that the XADataSourceName name is correctly set.

c. On the “Settings for javax.resource.cci.ConnectionFactory” > Properties tab page,


confirm that the Messages at the top of the page indicate that the changes have been
activated and are successfully updated.

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 23
Note: The DbAdapter deployment changes must be updated to become active.
8. To update the DbAdapter with the deployment plan changes, performing the following
steps:
a. In the Domain Structure panel, click the Deployments link.
b. On the “Summary of Deployments” page, click Next in the Deployments table to locate
and select the check box for the DbAdapter row, and click Update.

c. On the Update Application Assistant “Locate new deployment files” page, verify that
the “Redeploy this application using the following deployment files:” option is selected
and that the “Deployment plan path” is
/u02/oracle/config/dp/DBAdapterPlan.xml. Click Finish.

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 24
d. On the top of the “Summary of Deployments” page, in the Messages section, confirm
that the changes are activated and that the deployments are updated.

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 25
Practice 6-4: Configuring the JMS Adapter and Resources

Overview
In this practice, you configure the JMS Adapter resources that are required for two composite
applications to communicate messages by using the JMS technology.

Assumptions
• None

Tasks
1. In a web browser window, if required, log in as the weblogic administrator user to Oracle
WebLogic Server Administration Console by using the URL
http://admin.example.com:8080/console.

Creating a New JMS Queue Resource


In this section, you create the JMS queue and the resources that are used by composite
applications that are developed as JMS producers to write messages to the JMS queue.
Applications that consume the messages use the same JMS queue resource to receive the
messages.
2. To create the demoMsgQueue JMS queue, perform the following steps:
a. In the Domain Structure panel, expand Services > Messaging and click JMS Modules.

b. On the JMS Modules page, click the SOAJMSModule link.

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 26
c. On the “Settings for SOAJMSModules” > Configuration tab page, in the “Summary of
Resources” table, click New.

d. On the “Create a New JMS System Module Resource” page, select the Queue
(resource type) option, and click Next.

e. On the “Create a New JMS System Module Resource” page, in the JMS Destination
Properties section, enter the following case-sensitive values, and click Next.

Name demoMsgQueue
JNDI Name jms/demoMsgQueue

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 27
f. On the “Create a New JMS System Module Resource” page, take the following actions:
1) From the Subdeployments drop-down list, select the entry with text that begins
with SOAJMSServer.
2) In the Targets table, select the SOAJMSServer_auto_1 option.
3) Click Finish.

Note: By selecting a single SOAJMSServer entry, you are configuring the selected
entry as the preferred JMS server. However, because JMS servers are in a clustered
environment, if the preferred server is unavailable, other active servers can process
messages.

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 28
g. On the “Settings for SOAJMSModule” page, in the Messages section at the top of the
page, check that the messages confirm the successful creation of the new JMS Queue
resource. For example:

Configuring the JMS Connection Factory Resource


The connection factory resource is created for applications to form a connection with a
destination. After creating the connection factory, you create the connection pool that the factory
uses to create connections for application destinations.
Note: As the administrative perspective, create the connection factory and associate it with the
connection pool used by the application. The application determines the destination resource
(created previously) that is used in combination with the configured connection pool.
3. To configure the demoCF JMS connection factory, perform the following steps:
a. On the “Settings for SOAJMSModule” page, in the Summary of Resources table, click
New.

b. On the “Create a New JMS System Module Resource” page, for the resource type,
select the Connection Factory option, and click Next.

c. On the “Create a New JMS System Module Resource” > Connection Factory
Properties page, enter the following values and click Next when you have finished:
Field Value
Name demoCF
JNDI Name jms/demoCF
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: High Availability


Chapter 6 - Page 29
d. On the “Create a New JMS System Module Resource” page, verify that the
soa_cluster1 check box is selected as the target server, and click Finish.

e. On the “Create a New JMS System Module Resource” page, verify that the Messages
section displays that the connection factory has been successfully created, for
example:

Creating a JMS Adapter Connection Pool


4. To create a JMS connection pool and associate it with the connection factory, perform the
following steps:
a. On the Oracle WebLogic Server Console home page, in the Domain Structure pane,
click Deployments.

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 30
b. On the “Summary of Deployments” > Control tab page, click Next in the Deployments
table until you locate the JMSAdapter entry, and click the JmsAdapter link.

c. On the “Settings for JmsAdapter” page, navigate to the Configuration > Outbound
Connection Pools subtab page, and click New.

d. On the “Create a New Outbound Connection” page, select the


oracle.tip.adapter.jms.IjmsConnectionFactory option for the Outbound
Connection group, and click Next.

e. On the “Create a New Outbound Connection” page, for JNDI Name, enter
eis/demo/Queue, and click Finish.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: High Availability


Chapter 6 - Page 31
f. On the Save Deployment Plan Assistant page, enter the path
/u02/oracle/config/dp/JmsAdapterPlan.xml and click OK.
Note: Do not press Enter after entering the path name.

g. On the “Settings for JmsAdapter” page, in the Messages section at the top of the page,
verify that the changes have been activated.

Configuring Outbound Credential Mappings for the Resource Adapter


Because the connection pool for the eis/demo/Queue resource requires credentials, you first
configure credential mapping for the resource to ensure that the password is stored securely.
Note: The Settings for JmsAdapter page should still be open. If not, from the Domain Structure
pane, click Deployments. In the Deployments table, click Next until you locate the JMSAdapter
entry, and click the JmsAdapter link.
5. To configure credential mapping for the eis/demo/Queue resource, take the following
actions:

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 32
a. On the “Settings for JmsAdapter” page, click the Security tab, and if required, click the
Outbound Credential Mappings subtab.
b. On the “Settings for JmsAdapter” > Security > Outbound Credential Mappings tab
page, click New.

c. On the “Create a New Security Credential Mapping” page, select the check box next to
the eis/demo/Queue Outbound Connection Pool entry, and click Next.

d. On the “Create a New Security Credential Mapping” WebLogic Server User page,
select the Configured User Name option, enter weblogic in the WebLogic Server
User Name field, and click Next.

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 33
e. On the “Create a New Security Credential Mapping” EIS User Name and Password
page, enter field values as shown in the following table, and click Finish:
Field Name Field Value
EIS User Name weblogic
EIS Password Enter the password for the weblogic
user.
Confirm Password Enter the password for the weblogic
user.

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 34
f. On the Settings for JmsAdapter > Security > Outbound Credential Mappings tab page,
verify that weblogic user appears as an entry for the eis/demo/Queue resource.

Modifying the Connection Pool Properties


The connection pool is configured with properties that determine the servers to which the
connection factory creates a connection. The following connection pool properties for the
eis/demo/Queue resource must be configured:
• The ConnectionFactoryLocation property to associate the pool with the jms/demoCF
connection factory

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 35
• The FactoryProperties property to ensure that the queue functions correctly in a cluster
(high available) environment
Note: The Settings for JmsAdapter page should still be open. If not, in the Domain
Structure pane, click Deployments. In the Deployments table, click Next until you locate the
JMSAdapter entry, and click the JmsAdapter link.
6. To modify the connection pool properties and update the new JMS Adapter configuration
plan, perform the following steps:
a. On the “Settings for JmsAdapter” page, click the Configuration tab, and then click the
Outbound Connection Pools subtab.
b. On the “Settings for JmsAdapter” > Configuration > Outbound Connection Pools tab
page, expand the oracle.tip.adapter.jms.IJmsConnectionFactory entry, and locate and
click the eis/demo/Queue link.

c. On the “Settings for oracle.tip.adapter.jms.IJmsConnectionFactory” > Properties tab


page, in the Outbound Connection Properties table, click in the Property Value column
to change the values for the Property Names listed in the following table. Press Enter
after changing each value. After you have changed both property values, click Save:
Property Name Property Value
ConnectionFactoryLocation jms/demoCF
FactoryProperties java.naming.factory.initial=weblogic.jndi.
Note: The value for this WLInitialContextFactory;java.naming.provid
property is entered without er.url=t3://soavh01.example.com:8001,soavh
spaces on one line. Please 02.example.com:8001
read the Important Note
that follows this table too.
Username weblogic
Important Note: For the FactoryProperties value, you can copy and paste the text
from a file called /practices/practice06/FactoryProperties.txt.
Tip: Always press the Enter key after changing a Property Value column entry.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: High Availability


Chapter 6 - Page 36
Note: FactoryProperties are required to enable this connection factory to be used in a
clustered context, where each Managed Server host name is included in the property
value. Press Enter after changing the ConnectionFactoryLocation and
FactoryProperties values. Do not use the Tab key. The password is obtained from the
credential mapping configuration that you created before this task.
d. On the “Settings for oracle.tip.adapter.jms.IJmsConnectionFactory” page, verify that
the Messages section indicates that the deployment plan is successfully updated.
Note: However, that you are reminded to update the JmsAdapter deployment with the
changes made to the deployment plan.

Updating the JMS Adapter Deployment to Activate New Resources


7. To update the JMS adapter with the new resources that are configured, perform the
following steps:
a. On the Oracle WebLogic Server Administrator Console home page, in the Domain
Structure pane, click Deployments. On the “Summary of Deployments” page, click Next
until you locate the JmsAdapter entry.
b. On the “Summary of Deployments” page, select the check box next to the JmsAdapter
entry, and click Update.

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 37
c. On the Update Application Assistant page, select the “Redeploy this application using
the following deployment files:” option, verify that the “Deployment plan path” is
/u02/oracle/config/dp/JmsAdapterPlan.xml, and click Finish.

d. On the “Summary of Deployments” page, verify that the Messages section indicates
that the deployments are updated, for example:

e. Optionally, navigate through the Deployments table by clicking Next, and verify that the
JmsAdapter entry shows Active in the State column and OK in the Health column.

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 38
Note: If the JmsAdapter State is not showing Active as the value, select the check box
next to JmsAdapter, and click Start > Service All Requests.

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 39
Practice Summary

Summary of Tasks Performed


In this practice, in addition to validating that you can successfully manually fail over the
Administration Server instance from one host to another, you also configured several JCA
Adapters for the various composite applications that are deployed in the remaining practices of
this course.
The composite applications that are deployed in subsequent practices indirectly verify that the
configuration tasks performed in this lesson have been performed correctly. If not, you get to
perform some troubleshooting tasks.
For test and production environments, you may want to consider having some test composite
applications that are ready to validate the configuration changes made to adapters as part of a
post-configuration validation process. This would ensure that the actual composite applications
that use these resources can run successfully.
The type of configuration changes made to adapters in these practices may need to be done
often, as determined by each application’s requirements based on the resources needed to
perform a business function.

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

Practices for Lesson 6: High Availability


Chapter 6 - Page 40
Practices for Lesson 7:
Fundamentals of Oracle SOA
Suite
Chapter 7

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

Practices for Lesson 7: Fundamentals of Oracle SOA Suite


Chapter 7 - Page 1
Practices for Lesson 7

There are no practices for this lesson.

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

Practices for Lesson 7: Fundamentals of Oracle SOA Suite


Chapter 7 - Page 2
Practices for Lesson 8:
Deploying and Testing SOA
Composite
Chapter 8

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

Practices for Lesson 8: Deploying and Testing SOA Composite


Chapter 8 - Page 1
Practices for Lesson 8

Practices Overview
In this practice, you deploy the HelloWorld composite application project to the SOA server and
use the Enterprise Manager web application to test the service with a sample input. You then
write an Ant script to undeploy the application. Finally, you extract the composite application
files from the SAR file and examine them to learn the expected behavior of the application.

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

Practices for Lesson 8: Deploying and Testing SOA Composite


Chapter 8 - Page 2
Practice 8-1: Deploying and Testing the HelloWorld Composite
Application

Overview
In this practice, you use an Ant script to deploy the HelloWorld composite application project to
the SOA server and use the Enterprise Manager web application to test the service with a
sample input.

Assumptions
• You have successfully completed all previous practices.
• Oracle WebLogic Server is running.

Tasks

Deploying the HelloWorld Composite Application


1. Deploy the application.
a. Open a terminal window.
b. In the open terminal window, issue the following commands:
$ cd /practices/practice08/scripts
$ ./deployHelloWorld.sh
c. When prompted, supply the username weblogic and the password for the weblogic
user.
The script runs and reports successful deployment of the application.

2. Examine the deployHelloWorld.sh script to understand what just happened.


# deployHelloWorld.sh

# variables store ant and ant script locations


MW_HOME=/u01/oracle/product/fmw
ANT_HOME=$MW_HOME/oracle_common/modules/org.apache.ant_1.9.2/bin
ANT_CMD=$ANT_HOME/ant
ANT_SCRIPT=$MW_HOME/soa/bin/ant-sca-deploy.xml

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

Practices for Lesson 8: Deploying and Testing SOA Composite


Chapter 8 - Page 3
Note: The Ant command line utility uses the ant-sca-deploy.xml script to deploy
the application. Both the Ant command line utility and the ant-sca-deploy.xml
script are included in the Oracle SOA Suite installation.

# variables store ant script parameters


SERVER_URL=http://soainternal.example.com:8080
SAR_LOCATION=/practices/practice08/deploy/sca_HelloWorld_rev1.0.
jar
OVERWRITE=true

Note: The preceding lines provide the URL of the WebLogic Administration Server, the
location of the composite application jar file, and the instruction to overwrite any
composite of the same name and version number that is already deployed. (Version
numbers are discussed in the next lesson titled “Managing the Composite Application
Life Cycle.”)

# invoking the ant script


$ANT_CMD -f $ANT_SCRIPT -DserverURL=$SERVER_URL -
DsarLocation=$SAR_LOCATION -Doverwrite=$OVERWRITE

Note: Although this is not always a best practice, you could also set the username and
password values as variables and pass them as parameters when calling the Ant
command line utility. Because they have been omitted in the provided script, you are
prompted for these values at run time. If you were providing the username and
password as parameters, you would add USER and PASSWORD to the preceding script
parameter assignments, and you would append the parameters to the command line in
the script invocation.
# additional script parameter assignments
# USER=weblogic
# PASSWORD=<password>

# additional script parameters passed at invocation


# -Duser=$USER -Dpassword=$PASSWORD

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

Practices for Lesson 8: Deploying and Testing SOA Composite


Chapter 8 - Page 4
Practice 8-2: Testing the Application

Overview
In this section, you use a web browser to access Oracle Enterprise Manager Fusion Middleware
Control and initiate a test of the deployed HelloWorld application.

Assumptions
• You have successfully completed practice 8-1.
• Oracle WebLogic Server is running.

Tasks
1. Familiarize yourself with the composite application.
The following screenshot is of the composite.xml file that is part of the HelloWorld
application. This file describes the entire composite assembly of services, service
components, and references. There is one composite.xml file for each SOA project.
The left swimlane is for services (such as web services, REST adapters, or JCA adapters)
that provide an entry point to the SOA composite application. The right swimlane is for
references that send messages to external services in the outside world, such as web
services or JCA adapters. The center swimlane is for components such as BPEL
processes, business rules, human tasks, Oracle Mediators, and spring components.
In this example, a client connects to the application by invoking the execute operation of the
ReceiveData service. The data is passed to the RouteData mediator, which transforms the
data and routes it its next destination. In this case, the destination is a file adapter,
WriteData, which writes the data to a file.

The following screenshot shows the transformation in the mediator. In this simple example,
the format of the incoming and outgoing data is identical. Data from each incoming field is
mapped to its corresponding node in the destination message.

2. Log in to the Oracle Enterprise Manager Fusion Middleware Control application by


performing the following steps:

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

Practices for Lesson 8: Deploying and Testing SOA Composite


Chapter 8 - Page 5
a. Open a web browser and provide the URL http://admin.example.com:8080/em.
Tip: You may want to bookmark this URL, because you will use it again in this course.
b. Log in with the username weblogic and the weblogic user password.
3. In the Target Navigation pane, expand the SOA > soa-infra (soa_server1) > default nodes
in the tree and click the “HelloWorld [1.0]” link.

4. To initiate a test of the HelloWorld composite, perform the following steps:


a. On the “HelloWorld [1.0]” home page, click Test.

b. On the Test Web Service page, scroll down to the Request tab’s Input Arguments
section and click the Browse button.

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

Practices for Lesson 8: Deploying and Testing SOA Composite


Chapter 8 - Page 6
c. In the File Upload dialog box, navigate to the /practices/practice08/input
folder, select po-medium-player.xml, and click Open.

The initially supplied XML test data is replaced by the contents of the file.
5. On the Test Web Service page, scroll to the bottom of the page and click Test Web Service.

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

Practices for Lesson 8: Deploying and Testing SOA Composite


Chapter 8 - Page 7
Note: This action sends the XML data as an input message to the HelloWorld composite
application. It might take several seconds for the page to refresh with the response that is
displayed on the Response tab. Wait until the page is refreshed.
6. On the “HelloWorld [1.0]” Response tab page, click the Launch Flow Trace button to view
the results of the asynchronous composite application.

Note: If your web browser blocks the pop-up window, perform steps to correct allow pop-
ups.
7. On the Flow Trace page, verify that the ReceiveData, RouteData, and WriteData
components have a Completed state, indicating that the application executed successfully.

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

Practices for Lesson 8: Deploying and Testing SOA Composite


Chapter 8 - Page 8
8. Close the Flow Trace window.
9. Use your web browser to open the output file
/practices/practice08/files/output/hardcoded/order_1.xml.
10. Verify that the XML file contains data that matches the following screenshot:

11. Minimize or close your web browser.

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

Practices for Lesson 8: Deploying and Testing SOA Composite


Chapter 8 - Page 9
Practice 8-3: Undeploying an Application with an Ant Script

Overview
In this practice, you complete and run an Ant script to undeploy an application.

Assumptions
This practice assumes that you have completed Practice 8-1 successfully.

Tasks
1. Use gedit to open the file
/practices/practice08/scripts/undeployHelloWorld.sh.
2. Update the script to assign values to the five missing script parameters.
# script parameters
ACTION=undeploy
SERVER_URL=
COMPOSITE_NAME=
REVISION=
USER=
PASSWORD=
Hint: There are several ways to learn the revision number of the application. It can be
found as part of the name of the SAR file that you deployed earlier in this practice. You can
also get the number and learn more about the application in Enterprise Manager.
3. Save your changes and close gedit.
4. From a terminal window, execute the
/practices/practice08/scripts/undeployHelloWorld.sh script.
5. Optional: Use Enterprise Manager to verify that the application has been undeployed.

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

Practices for Lesson 8: Deploying and Testing SOA Composite


Chapter 8 - Page 10
Practice 8-4: Exploring the Composite Application Files
In this section, you extract the composite application configuration files from the SAR file. You
then examine these files to learn about the expected behavior of the application.

Tasks
1. Extract the application files from the SAR file.
a. Open a terminal window.
b. Enter the following commands:
$ cd /practices/practice08/deploy
$ unzip sca_HelloWorld_rev1.0.jar –d v1
$ cd v1
$ ls –lt
Note: The –d command-line option in the unzip command creates the v1 subfolder
and extracts the contents of the .zip file into that subfolder. A directory listing similar
to the one that follows is displayed:

2. Use your web browser to open the composite.xml file. Examine the contents of the file to
answer the following questions:
• What file would you examine to know the data format that is expected when the
composite is invoked?
• What file would you open to examine the transformation performed by the mediator?
• What file would you examine to learn about the data format that is written to file by the
composite?
• What file would you examine to learn about the directory where data is written by the
composite?
3. Locate the files that you have identified within the directory hierarchy. Open each of the files
you have named and confirm your answer.

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

Practices for Lesson 8: Deploying and Testing SOA Composite


Chapter 8 - Page 11
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Deploying and Testing SOA Composite


Chapter 8 - Page 12
Practices for Lesson 9:
Managing the Composite
Application
Chapter 9

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

Practices for Lesson 9: Managing the Composite Application


Chapter 9 - Page 1
Overview of Practices for Lesson 9

Practices Overview
In this practice, you perform the following tasks:
• Create a partition
• Deploy a SOA bundle
• Use the ant command to determine what applications are deployed
• Unzip the jar files to learn how each application is configured
• Manage the life cycle of the deployed composites
• Undeploy the applications and delete the partition

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

Practices for Lesson 9: Managing the Composite Application


Chapter 9 - Page 2
Practice 9-1: Creating a Partition

Overview
In this practice, you perform the following tasks:
• Create a partition
• Deploy a SOA bundle
• Use the ant command to determine what applications are deployed

The antPartitions.sh Script


Many of the tasks in this practice ask you to issue ant commands. To reduce the amount of
typing required, two scripts have been provided. One deploys a SOA bundle. The other provides
menu-based access to a variety of partition management actions. Both scripts show you the
ant command line and each of the parameter values to be passed before they execute it.

Assumptions
• You have successfully completed all previous practices.
• Oracle WebLogic Server is running.

Tasks

Creating a Partition
1. Create a partition.
a. Open Enterprise Manager at http://adminvh.example.com:7001/em.
b. Right-click soa-infra (soa_server1) and select Manage Partitions.

c. Click Create.
The Create New SOA Partition dialog box is displayed.
d. In the Name field, enter myPartition.
e. Accept the default work manager group.
Note: A work manager is an Oracle WebLogic Server entity that represents a logical
thread pool. It is similar to a queue in which work items line up for processing. You can
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Managing the Composite Application


Chapter 9 - Page 3
define priorities for the work to be processed by work managers. Work managers
manage thread pools internally and automatically, providing for optimal scheduling
thereby.
f. Click Create.

The new partition is displayed in both the navigator under soa-infra and the SOA Partition
column of the Manage Partitions page.

You can now deploy composites to this partition by selecting “Deploy to This Partition” from
the Deployment drop-down list or by right-clicking a specific partition in the navigator and
selecting Deploy to This Partition. When a composite is deployed to a partition, it is
displayed below the partition in the navigator. After it is deployed, a composite cannot be
transferred to a different partition.
Note: You can also create partitions with the Oracle WebLogic Scripting Tool (WLST) and
ant commands. Most of the remaining activities in this practice use ant commands.
2. Use the antPartitions script to list the partitions on this host.
a. In a Terminal window, enter the following commands:
$ cd /practices/practice09/scripts
$ ./antPartitions.sh

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

Practices for Lesson 9: Managing the Composite Application


Chapter 9 - Page 4
Note: The antPartitions script displays a menu of partition management options.
b. Select the List Partitions option.
c. Provide the weblogic user password when prompted.
The script lists the partitions on this host.

Deploying a SOA Bundle to a Partition


In this step, you deploy a composite bundle to the new partition. You invoke a command script,
which in turn invokes an Ant script that actually performs the deployment.
3. Use the antDeploy.sh script to deploy a bundle of composite applications to the new
partition.
a. In a Terminal window, enter the following commands:
$ cd /practices/practice09/scripts
$ ./antDeploy.sh
b. Provide the weblogic username and password when prompted.
The script deploys the bundle.

Listing the Applications in the Partition


4. Use the antPartitions script to determine which composite applications were just
deployed. Determine which version of the application is the default.
a. In a Terminal window, enter the following commands:
$ cd /practices/practice09/scripts
$ ./antPartitions.sh
Note: The antPartitions script displays a menu of partition management options.
b. Select the List Composites in Partition option.
c. Provide the weblogic password when prompted.
The script lists the composites that are deployed to the new partition, as well as some
information about their state.

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

Practices for Lesson 9: Managing the Composite Application


Chapter 9 - Page 5
Practice 9-2: Examining the Contents of the SAR Files
In this practice, you perform the following:
• Unzip jar files to learn how each application is configured
• Manage the life cycle of the deployed composites
• Undeploy the applications and delete the partition

Assumptions
• You have successfully completed practice 9-1.
• Oracle WebLogic Server is running.

Tasks

Unzipping the SOA Bundle


1. In a Terminal window, enter the following commands:
$ cd /practices/practice09
$ unzip deploy/mybundle.zip –d tmp
Note: The jar files for each of the deployed composites are extracted from the
mybundle.zip file into the tmp subfolder. The –d option of the unzip command creates
the subfolder to which the files are extracted.

Unzipping Each of the SAR Files


2. In the same Terminal window, enter the following commands:
$ cd tmp
$ unzip sca_Versioning_rev1.0.jar –d 1
$ unzip sca_Versioning_rev2.0.jar –d 2
$ unzip sca_Versioning_rev3.0.jar –d 3
Note: The contents of each of the jar files are extracted to the subfolders 1, 2, and 3,
respectively.

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

Practices for Lesson 9: Managing the Composite Application


Chapter 9 - Page 6
The file adapter in each of the applications writes the output to a different location. Each
composite has used a different method to configure this behavior. In the next task, you use the
following diagram as reference to explore the contents of each of the SAR files. The composite
applications that you deployed are represented by the model at the top of the diagram. The
bottom portion of the diagram lists the files that were created with each component. The red
dashed lines indicate references among the files, and from that, the underlying relationships
among the components.

The Files
• The BPELProcess1.wsdl file describes how to call the composite application. It
includes a reference to the versionsLab.xsd file, which describes the input and
output message formats of the composite.
• The BPELProcess1.bpel file includes the definition of the business process. It also
includes a reference to the versionsLab.xsd file, which describes the input and
output message formats of the business process.
• The fileAdapter_file.jca file contains the adapter implementation details. In the
case of a file adapter that is configured to write data, the details include an output
directory name and a file naming pattern, as well as other information.
• The fileAdapter.wsdl file includes the abstract WSDL information about the service
that the adapter provides. It also references the versionsLab.xsd file, which
describes the input and output message formats of the adapter.
• A composite.xml file is automatically created when you create a SOA project. This
file describes the entire composite assembly of services, service components,
references, and wires.

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

Practices for Lesson 9: Managing the Composite Application


Chapter 9 - Page 7
• When a file adapter is defined in a composite, an <import> statement is added to
the composite.xml file, which makes the fileAdapter.wsdl file contents
available.
• A <reference> element is also added to the composite.xml file. It aggregates
references to the adapter .jca and .wsdl files, as well as the binding information in
place of the concrete information in a WSDL.
• A configurationPlan.xml document (not shown) can be used at deployment time
to specify values that may vary among the development, test, and production
environments. In this example, the values might include the output directory of the file
adapter.
3. Use gedit and the preceding diagram to explore the contents of each of the SAR files that
you just extracted. Determine the following:
• Which composite writes its output to a hard-coded path name? What directory will it
write to?
• Which composite uses a logical name for the path that is resolved at the composite
level? What directory will it write to?
• Which composite uses a configuration plan to specify the path name? What directory
will it write to? How does the configuration plan leverage the logical name?

Verifying the Output Directory of Each Application


4. Log in to the Oracle Enterprise Manager Fusion Middleware Control 12c application and
test the applications:
a. Open a web browser and provide the URL http://admin.example.com:8080/em.
b. Log in with the username weblogic and the weblogic user password.
c. Navigate to the test console for the first of the deployed applications.
d. Provide any text that you wish as input.
e. Verify that the application writes to the output directory that you anticipated in the
previous task.

Forcing Version 2 of the Application To Be the Default


5. To force version 2 of the application to be the default version, perform the following steps:
a. Make a copy of the antDeploy.sh script.
$ cd /practices/practice09/scripts
$ cp antDeploy.sh myantDeploy.sh
b. Use gedit to modify the myantDeploy.sh script to redeploy version 2 and force it to
be the default version.
1) In the SET ANT PARAMETERS section of the script, modify the value of
SAR_LOCATION.
SAR_LOCATION=/practices/practice09/tmp/sca_Versioning_rev2.0.
jar
2) In the SET ANT PARAMETERS section of the script, uncomment the
FORCE_DEFAULT variable assignment.
FORCE_DEFAULT=true

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

Practices for Lesson 9: Managing the Composite Application


Chapter 9 - Page 8
3) In the INVOKE ANT section of the script, add the following text to the command
line:
-DforceDefault=true

c. Save your work and close gedit.


d. Invoke the script to redeploy the application.
$ ./myantDeploy.sh
e. Provide the weblogic username and password when prompted.
The script deploys the bundle.

f. Use the List Composites in Partition option of the antPartitions script to verify that
version 2 of the application is now the default.

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

Practices for Lesson 9: Managing the Composite Application


Chapter 9 - Page 9
Managing the Applications in the Partition
6. Use the antPartitions.sh script to perform the following:
a. Shut down all the composites in the partition myPartition
b. Retire all the composites in the partition myPartition
c. Activate all the composites in the partition myPartition
d. Undeploy all the applications and delete myPartition

7. Use the antPartitions.sh script to verify successful deletion of the partition.

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

Practices for Lesson 9: Managing the Composite Application


Chapter 9 - Page 10
Practices for Lesson 10:
Administering the SOA Run
Time
Chapter 10

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

Practices for Lesson 10: Administering the SOA Run Time


Chapter 10 - Page 1
Practices for Lesson 10

Practices Overview
In this practice, you use an Ant script to deploy a pair of composite applications to the SOA
server. A second script generates a series of data files that provide input to the applications.
You use the Enterprise Manager web application to monitor the sensors, events, analytics,
faults, and more.

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

Practices for Lesson 10: Administering the SOA Run Time


Chapter 10 - Page 2
Practice 10-1: Deploying the Composite Applications

Overview
In this practice, you use an Ant script to deploy a pair of composite applications to the SOA
server. You then use a shell script to generate input data for the deployed applications to
process.

Assumptions
• You have successfully completed all previous practices.
• Oracle WebLogic Server is running.

Tasks

Deploying the Composite Applications


1. Deploy the applications.
a. Open a Terminal window.
b. In the open Terminal window, issue the following commands:
$ cd /practices/practice10/scripts
$ ./deployApps.sh
c. When prompted, supply username weblogic and the password for the weblogic
user.
(You will be prompted once for each of the two applications.) The script runs and
reports successful deployment of the applications.

Creating the Data Script


2. Execute the following commands in a Terminal window:
$ cd /practices/practice10/scripts
$ nohup ./makeData.sh &
This script creates an input file for the deployed application every 10 seconds for the next
10 minutes, for a total of 60 inputs. By design, every 20th input generates a fault. In the
remainder of this practice, you monitor the various behaviors and statistics of the
applications and their respective BPEL and mediator components. You observe the faults,
sensors, analytics, and events generated by these applications and components.

Verifying That All Servers Are Running


3. Complete the following steps:
a. In a web browser window or on a tab page, sign in to Oracle Enterprise Manager
Fusion Middleware Control (URL http://admin.example.com:8080/em) with the
weblogic user credentials.
b. In the Target Navigation pane, navigate to WebLogic Domain > edg_domain.
c. On the edg_domain page, examine the Servers pane and verify that all the servers are
up.

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

Practices for Lesson 10: Administering the SOA Run Time


Chapter 10 - Page 3
Verifying That Deployed Applications Are Active
4. Complete the following steps:
a. In the Target Navigation pane, navigate to SOA > soa-infra (soa_server1).
b. On the soa-infra page, click the Deployed Composites tab.
c. Verify that all the composites listed in the Composite column are Active in the Partition
that is named default.

Examining the Definition of the BookingSystem Application


5. Complete the following steps:
a. Click the BookingSystem [1.0] composite.

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

Practices for Lesson 10: Administering the SOA Run Time


Chapter 10 - Page 4
b. On the BookingSystem page, click the Composite Definition tab.

The BookingSystem project consists of a BPEL process that provides a simple


mechanism to simulate a training enrollment booking system. It exposes a service,
which receives enrollment-related messages. In most cases, it responds with positive
confirmations, but when provided with certain data values, it returns a fault.

Examining the Definition of the Enroll Application


6. Repeat the previous steps to display the composite definition for the Enroll [1.0] composite.

The Enroll project uses a file adapter (fileInput) to read enrollment messages from a
specified directory. The messages are then passed via a mediator (Mediator2) to a BPEL
process (EnrollmentProcess). The process then invokes the BookingSystem application
(BookingService). When a response is received from the BookingSystem project, it is
passed to the mediator (Mediator2), which passes the message to an outbound file adapter
(fileOut) that writes the message to a file.

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

Practices for Lesson 10: Administering the SOA Run Time


Chapter 10 - Page 5
Note that the Enroll entry point, which is shown in the diagram, provides an operation that is
exposed through one of the web service interfaces for this composite. You do not use this
interface during this practice.

Examining the Configuration of the Enroll Application


7. Examine the application configuration by performing the following steps:
a. Display the Dashboard tab of the Enroll application home page.
b. Use the links in the application’s Services and References entries to determine the
input directory for the fileInput file adapter.
c. Determine the file naming convention for the fileOut file adapter. How many
messages will be written to each file?

Examining the Flow Trace of a Successful Instance


Several minutes should have passed since you initiated the script to pass instances to the Enroll
application (step 2). A number of instances should have succeeded, and a few should have
raised faults by now. In the next tasks, you examine both the successful and faulted instances
of the application.
8. Locate the composite application instance and view the Flow Trace page.
a. Click the Flow Instances tab of the Enroll application home page.
Note: Click Search to populate the Flow Instances tab, if empty, and click the Search
icon to close the Search Options panel. Alternatively, click the Recent Instances link
above the Search Results table.
b. Click an Instance ID with a Flow State of Completed.

Note: Click the Recent Instances link or the Search (magnifying glass) icon as needed
to display the most current instances.
The Trace pane for the selected instance is displayed.

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

Practices for Lesson 10: Administering the SOA Run Time


Chapter 10 - Page 6
c. In the Trace pane, click EnrollmentProcess.
d. From the application instance Flow Trace page, display the incoming payload.

• What is the incoming message type?


• What is the ID number of the message?

Click the Flow Tab to display the BPEL process instance details.
A portion of the instance graphic is displayed as follows. Individual process activities
are represented in the model.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Administering the SOA Run Time


Chapter 10 - Page 7
e. Return to the Flow Trace page.
f. Click the Composite Sensor Values tab.

• What is the value of the incomingMsg Sensor?


• Compare this to the message payload that you viewed earlier. Which field of the
message is the sensor tracking?
g. Click the Faults tab.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Administering the SOA Run Time


Chapter 10 - Page 8
• What is the name of the Event published by Mediator2?
(You discuss events in more detail in the lesson titled “Administering Business
Events.”)
h. Close the Flow Trace page.

Examining the Flow Trace of a Faulted Instance


9. Complete the following steps:
a. Return to the Enroll application home page.
b. Click the Flow Instances tab.
c. Click an Instance ID with a Flow State of Recovery.

• What is the error message number?


d. Abort the instance.

Viewing the Log Files for a Given Instance


10. Complete the following steps:
a. On the Enroll Dashboard page, click the Flow Instances tab.
b. For a selected instance, scroll the table all the way to the right to find the Logs icon.

c. Click the icon to display the logs search page.


d. Modify the search criteria (specifically the date range), and click Search.

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

Practices for Lesson 10: Administering the SOA Run Time


Chapter 10 - Page 9
e. Explore the resulting list of log messages.

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

Practices for Lesson 10: Administering the SOA Run Time


Chapter 10 - Page 10
Practice 10-2: Exploring the Features of the Error Hospital

Overview
In this practice, you explore additional features of the Error Hospital for management of error
conditions.

Assumptions
• You have successfully completed Practice 10-1.

Tasks

Generating Additional Faults


1. Shut down the BookingSystem project.
a. In the Enterprise Manager Target Navigation pane, expand soa-infra > default.
b. Select the BookingSystem project.
c. In the BookingSystem pane, click Shut Down.

d. In the Confirmation dialog box, click Yes.

The project is shut down.


2. Execute the following commands in a Terminal window:
$ cd /practices/practice10/scripts
$ nohup ./makeData.sh &
As before, this script creates an input file for the deployed application every 10 seconds for
the next 10 minutes, for a total of 60 inputs. This time, because the BookingSystem
application is unreachable, every message generates a remote fault. In subsequent steps,
you use the bulk recovery and bulk abort features to address these faults.

Accessing the Error Hospital


3. Complete the following steps:
a. In the Enterprise Manager Target Navigation Pane, expand SOA > soa-infra.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Administering the SOA Run Time


Chapter 10 - Page 11
b. Click soa-infra (soa_server1).
c. Click the Error Hospital tab.

Viewing Faults
4. Set and apply report filters:
a. Select the following options:
• Partition Name: default
• Composite Name: default/Enroll!1.0
b. Click Search.

5. Confirm that there is a single entry for the Fault Name:


{http://schemas.oracle.com/mediator/faults}mediatorFault.
Note: If required, select Fault Name from the Group By drop-down menu.

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

Practices for Lesson 10: Administering the SOA Run Time


Chapter 10 - Page 12
Invoking Bulk Recovery
6. Restart the BookingSystem project and recover the faults.
a. In the Enterprise Manager Target Navigation pane, expand soa-infra > default.
b. Select the BookingSystem project.
c. In the BookingSystem pane, click Start Up.

d. Click Yes to confirm the Start Up action.


e. Return to the Error Hospital page, and initiate a search for faults (if required).
f. Select Bulk Recovery.
Note: A majority of the faults are shown as recovered. (These are the remote faults
generated by shutting down the BookingSystem application.) The remaining faults,
which were originally thrown by the BookingSystem application, remain. The following
example shows that 57 faults were recovered and 6 remain.

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

Practices for Lesson 10: Administering the SOA Run Time


Chapter 10 - Page 13
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Administering the SOA Run Time


Chapter 10 - Page 14
Practices for Lesson 11:
Business Events
Chapter 11

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

Practices for Lesson 11: Business Events


Chapter 11 - Page 1
Practices for Lesson 11

Practices Overview
In the practices for this lesson, you perform the following key tasks:
• Deploy the SubscribeStockUpdComposite application
• Perform an event test operation in Oracle Fusion Middleware Control Console
• Deploy the PublishStockUpdComposite application
• Initiate the PublishStockUpdComposite application and monitor the events and
instances that are created as a result of processing the files that contain the stock
update information

General Notes
The SubscribeStockUpdComposite application uses the jdbc/soademo data source that was
configured in the practice associated with the lesson titled “Configuring High Availability,”
because it contains the DB Adapter that interacts with the database to query, insert, update, and
potentially delete rows from a database table called EXTERNAL_STORE. Therefore, in this
practice, you use the SQL*Plus command-line utility to query the information in the
EXTERNAL_STORE table.

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

Practices for Lesson 11: Business Events


Chapter 11 - Page 2
Practice 11-1: Deploying the Stock Update Composite

Overview
In this practice, you deploy the SubscribeStockUpdComposite application to perform database
operations on the EXTERNAL_STORE database table.
You deploy the SubscribeStockUpdComposite application, which subscribes to a StockUpdated
event, and use the Oracle Fusion Middleware Control Console to send a test event to verify that
the subscriber receives the event.

Assumptions
The Oracle Database is running and the SOADEMO schema has been created with the required
database tables and populated with the correct data. In addition, the DbAdapter configuration in
Oracle WebLogic Administration Server is configured with a data source that is identified by the
JBDC URL jdbc/soademo.
Note: All these requirements are addressed in the practices associated with the lesson titled
“Configuring High Availability.”

Tasks
1. To deploy the SubscribeStockUpdComposite application, perform the following steps:
a. In a Terminal window (open a new one if needed), use the SOA archive to deploy the
SubscribeStockUpdComposite application by executing the following commands:
$ cd /practices/practice11/deploy
$ /practices/scripts/deploy12c.sh
sca_SubscribeStockUpdComposite_rev1.0.jar
b. Verify that the deployment is successful.

Note: You are prompted for a username and password. Ask your instructor for the
weblogic credentials.
2. To log in to the Oracle Fusion Middleware Control Console and locate the deployed
applications, perform the following steps:

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

Practices for Lesson 11: Business Events


Chapter 11 - Page 3
a. In a web browser, (if required) enter the URL
http://admin.example.com:8080/em, and log in with the username weblogic
and the password provided by the instructor.
b. In the Target Navigation pane of the Oracle Fusion Middleware Control Console,
expand the SOA > soa-infra (soa_server1) > default tree and click the
SubscribeStockUpdComposite [1.0] entry.

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

Practices for Lesson 11: Business Events


Chapter 11 - Page 4
Practice 11-2: Testing the Subscriber of the StockUpdated Event

Overview
In this practice, you use the Business Event Web interface to examine the event definitions and
event subscribers, and initiate a test event for the StockUpdated event to verify that the
SubscriberStockUpdComposite application receives and processes the test event.
Note: The event test is performed as a check that the event subscriber is operational before the
event publisher application is deployed and tested. By performing the steps described in the
following section, you are learning about the tools that can assist you in troubleshooting
scenarios that involve applications that use events to communicate information and initiate
processing, while also being reminded of application dependencies in the form of service
references and runtime server configuration requirements.

Assumptions
• You have successfully deployed the SubscribeStockUpdComposite application.

Tasks
1. To examine the Business Event information in the Oracle Fusion Middleware Control
Console, perform the following steps:
a. On the Oracle Fusion Middleware Control Console page, in the Target Navigation
pane, click the soa-infra (soa_server1) entry in the SOA folder.

b. On the soa-infra page, click SOA Infrastructure > Business Events.

c. With the soa-infra > Business Events page visible, answer the following questions:
1) What events are shown on the Events tab page?
Answer: The following two events are listed on the Events tab page:

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

Practices for Lesson 11: Business Events


Chapter 11 - Page 5
− The EnrollmentResponse event, which was created when deploying the
BookingSystem and Enroll composite applications in the practice for the
lesson titled “Administering Composite Applications at Runtime”
− The StockUpdated event, which was created when you deployed the
SubscribeStockUpdComposite application

2) What is the event subscription count for the StockUpdated event?


Answer: The StockUpdated event subscription count is one. This can be verified
in the Subscriptions column in the “Namespaces and Events” table.
3) What is the XML namespace for the StockUpdated event definition and the event
payload? Explain how you determined the information.
Answer: The event definition namespace is
http://www.example.com/events/edl/StockEventDefinitions, which
is the same namespace that is used for the event content namespace.
The event definition XML namespace can be seen in the “Namespaces and
Events” table as the parent of the StockUpdated event. The event content
namespace (specified for the payload) is the same as the event definition in this
case (although it does not have to be this way). You can find the event content
namespace by selecting the StockUpdated event and clicking Show Event
Definition.

In the “XML Definition: StockUpdated” dialog box, you can locate the XML
namespace for the event structure in the schema-import element.

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

Practices for Lesson 11: Business Events


Chapter 11 - Page 6
Click OK to close the “XML Definition: StockUpdated” dialog box.
4) What are the XML elements needed to create a StockUpdated test event
message?
Answer: Using the Show Event Definition button and examining the XML definition
for the event, you can get only the main element name for the event structure. In
this case, it is called ns1:StockUpdInfo, where ns1 is an XML namespace
prefix that references the namespace
http://www.example.com/events/edl/StockEventDefinitions to fully
qualify its elements.
Note: You require access to the actual XML Schema file to determine the
complete structure of the StockUpdInfo element.
In this case, the StockUpdInfo element has the following two child elements:
− The productId element, which contains a product ID string value
− The quantity element, which contains an integer quantity value
The following image is a visual representation of the XML Schema that defines the
StockUpdated event payload that is obtained from the Oracle JDeveloper XML
Schema Editor:

Note: To create an event document for this XML Schema definition, you need to
qualify each element by its correct XML namespace. This is easily done by using
an XML namespace prefix that is defined by an xmlns attribute in the root
element.
<evt1:StockUpdInfo xmlns:evt1=
"http://www.example.com/events/edl/StockEventDefinitions">
<evt1:productId>GUI001</evt1:productId>
<evt1:quantity>10</evt1:quantity>
</evt1:StockUpdInfo>
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 11: Business Events


Chapter 11 - Page 7
Note: In this example, the XML namespace prefix used is evt1 that is mapped to
the required XML namespace string
http://www.example.com/events/edl/StockEventDefinitions.
You can determine the XML structure of payloads for a composite by first
examining the service WSDL, and then the XML schemas either inline or imported
into the WSDL. However, XSL schema documents for event messages are not
visible through the WSDL.
c. Where do you locate the subscriber for the StockUpdated event?
Answer: On the Business Events page, click the Subscriptions tab. In this case, you
find the SubscribeStockUpdComposite only in the Composite column.

Note: By using the Search section, you can filter the Subscriptions. The Search section
is collapsed in this image example.
2. Before you test the StockUpdated event from the Oracle Fusion Middleware Control
Console, query the EXTERNAL_STORE table data with SQL*Plus as the soademo user, by
performing the following steps:
a. In the Terminal window (on host02), enter the following sqlplus command and
supply the password for the soademo database user account when prompted:
$ cd /practices/practice11/sql
$ sqlplus soademo
:
Enter password: password
Tip: Either ask the instructor for the soademo database schema password, or refer to
the password page that is provided with your student guide.
b. At the SQL*Plus SQL> prompt, run the query_gui001.sql script by entering
following command:
SQL> @query_gui001.sql
Note: The SQL script runs the following SELECT statement:
SQL> SELECT * FROM external_store WHERE prod_id = 'GUI001';
The query should return the following result:
PROD_ID QUANTITY
-------------------- ----------
GUI001 5

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

Practices for Lesson 11: Business Events


Chapter 11 - Page 8
Use the following image as a guide for the SQL*Plus session:

c. Do not exit SQL*Plus yet, because you run the same SQL statement again to view the
changes to data after initiating a StockUpdated event test.
3. To initiate a test of the StockUpdated event and an instance of the
SubscribeStockUpdComposite application, perform the following steps:
a. On the soa-infra > Business Events page, click the Events tab.
b. On the Business Events > Events tab page, select the StockUpdated event entry and
click Test.

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

Practices for Lesson 11: Business Events


Chapter 11 - Page 9
c. In the “Test Event: StockUpdated” dialog box, paste the contents of the
/practices/xml/events/stockupdevent_1.xml file into the XML Payload field.
After pasting the XML data into the XML Payload field, ensure that the first line
containing the <StockUpInfo> element and the XML namespace attribute with the
xmlns=”http://www.example.com/event/edl/StockEventDefinitions”
value appears on one line, as shown in the following image, and then click Publish.

Note: This event request for the product with ID GUI001 has a quantity value of 10
specified.
d. In the Information dialog box, the message “The Event published successfully”
appears. Click OK.
4. To confirm that the SubscribeStockUpdComposite application received and processed the
test StockUpdated event, perform the following steps:
a. In the Oracle Fusion Middleware Control Console > Target Navigation pane, click the
SubscribeStockUpdComposite [1.0] entry under the SOA > soa-infra (soa_server1) >
default tree. Click the Flow Instances tab and then click Search in the Search panel (if
displayed). Answer the following questions and perform the associated steps:
1) Did the new instance that was created for the SubscribeStockUpdComposite
application complete successfully?
Answer: Yes. When you navigate to the SubscribeStockUpdComposite [1.0] >
Flow Instances tab page, under Recent Instances, the newly created instance has
a Completed state.

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

Practices for Lesson 11: Business Events


Chapter 11 - Page 10
2) Using the SubscribeStockUpdComposite application instance Flow Trace, identify
the composite application component that received the StockUpdated event and
explain the steps that you used to locate the component.
Answer: The component that received the StockUpdated event is the
SubscribeStockUpdMediator component. To locate the information in the Flow
Trace that identifies the component that received the event, perform the following
steps:
a) On the Flow Instances page, click the Flow ID link for the composite
application.
b) On the Flow Trace page, you can identify the
SubscribeStockUpdMediator component that received the event,
because it appears next to the StockUpdated event entry in the Trace tree.

In addition, if you wish, you can click the mediator component link to view the
onEvent information in the Audit Trail for the component.

3) Close the SubscribeStockUpdComposite application instance Flow Trace page.


Note: There is no need to revisit the Business Events page because it does not display
information for successfully published events.

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

Practices for Lesson 11: Business Events


Chapter 11 - Page 11
5. Return to the Terminal window (on host02) with the SQL*Plus application, and run the
query script to view the changes to database data:
a. At the SQL> prompt (on host02), enter the following command to execute the
query_gui001.sql script again.
SQL> @query_gui001.sql
Tip: The sqlplus command should have been started with a command-line recall
utility enabled. Therefore, you press the up arrow key to recall the preceding command
and press Enter to execute the script again.
Note: The query results should be similar to the following data:
PROD_ID QUANTITY
-------------------- ----------
GUI001 15
The StockUpdated event payload supplied a quantity of 10, which is added by the
application logic to the product with ID GUI001 in the database table data.

b. Do not exit SQL*Plus and do not exit the Terminal window in which it is running.

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

Practices for Lesson 11: Business Events


Chapter 11 - Page 12
Practice 11-3: Deploying, Testing, and Monitoring the Event
Publishing Composite

Overview
In this practice, you deploy and test the PublishStockUpdComposite application as the final task
of this practice.
The PublishStockUpdComposite application takes data from an input file (or a SOAP request),
copies the product ID and quantity into the StockUpdated event message, and publishes the
event. You view the results of the process instances that are created for the event to ensure that
the event published by PublishStockUpdComposite is received and processed by the
SubscribeStockUpdComposite application.

Assumptions
You have successfully completed Practice 11-1 and Practice 11-2.

Tasks
1. To deploy the PublishStockUpdComposite application, perform the following steps:
a. In a Terminal window (open a new one if needed), use the SOA archive to deploy the
PublishStockUpdComposite application by executing the following commands:
$ cd /practices/practice11/deploy
$ /practices/scripts/deploy12c.sh
sca_PublishStockUpdComposite_rev1.0.jar
b. Verify that the deployment is successful.

Note: You are prompted for a username and password. Ask your instructor for the
weblogic credentials.
2. To check the database data, maximize the SQL command-line window and execute the
following SQL statement to view the database data row for the GUI002 product ID:
SQL> SELECT * FROM external_store WHERE prod_id = 'GUI002';

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

Practices for Lesson 11: Business Events


Chapter 11 - Page 13
Tip: In SQL*Plus, you can enter the list command to display the last SQL statement
executed. This can help you to quickly copy the preceding SQL statement and modify the
value assigned to prod_id in the WHERE clause.
Note: The output result for the query for prod_id = 'GUI002' should be similar to the
following data:
PROD_ID QUANTITY
-------------------- ----------
GUI002 5
The data before the StockUpdated event occurs shows a quantity of 5 for the product with
ID GUI002.

3. To initiate an instance of the PublishStockUpdComposite application, perform the following


steps:
a. In a file browser window, copy the
/practices/xml/events/stockupd_file_01.xml file to the
/practices/practice11 folder.
b. Wait until the stockupd_file_01.xml file is removed from the
/practices/practice11 folder.
Note: If you open this file by using the gedit command, the stock update requests an
addition of a quantity of 28 for the product with ID GUI002.

Note: The XML namespace and XML elements for the PublishStockUpdComposite
application input file have a different structure when compared to the XML structure
required for the StockUpdated XML event. They do not need to match. The application
performs a transformation to convert the data from one structure to another.
c. On the Oracle Fusion Middleware Control Console page, in the Target Navigation
pane, expand SOA > soa-infra (soa_server1) > default, and click
PublishStockUpdComposite [1.0].
d. On the “PublishStockUpdComposite [1.0]” page, click the Flow Instances tab and
perform either of the following:
1) Click Search in the Search panel to display the recent instances (and click the
Search panel icon to collapse the panel).

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

Practices for Lesson 11: Business Events


Chapter 11 - Page 14
2) Click the Recent Instances link in the Search Results section, as shown in the
following image:

Note: The Search Results page should display that one new instance is created.
4. To view the results of the PublishStockUpdComposite application instance, perform the
following steps:
a. In the PublishStockUpdComposite [1.0] > Flow Instances > Recent Instances results
section, click the Flow ID link for the new instance to open the Flow Trace page.
b. Observe the information on the Flow Trace page and answer the following questions:
1) What is the name of the component that published the event?
Answer: In this case, the PublishStockUpdEventMediator is the publisher of the
StockUpdated event, because the StockUpdated event entry appears below the
PublishStockUpdEventMediator component entry in the Trace tree.

Note: The Business Events page does not provide any information about the
publishers.
2) Do you need to go to the event subscriber application page to see the results of
the completed application flow sequence? Why or why not?
Answer: You do not need to visit the SubscribeStockUpdComposite application
page. The Flow Trace displays the components that are involved in the entire
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 11: Business Events


Chapter 11 - Page 15
process flow for both the event publisher and the event subscriber (composite
application instances). Both applications are running in the same SOA Suite
runtime environment.
c. Close the Flow Trace page for the PublishStockUpdComposite [1.0] instance.
5. Return to the Terminal window (on host02) where SQL*Plus is still active and execute the
following SQL statement to view the changes to database data for PROD_ID value GUI002.
Tip: In the SQL*Plus window, press the up arrow to recall the last SQL statement that was
executed and press Enter. Otherwise, enter the following SQL statement again and press
Enter.
SQL> SELECT * FROM external_store WHERE prod_id = 'GUI002';

Note: The query results shows that the product with ID GUI002 has a quantity of 33, as
shown in the query output data:

6. Exit SQL*Plus by entering the exit command and optionally, close the Terminal window
on host02.

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

Practices for Lesson 11: Business Events


Chapter 11 - Page 16
Practices for Lesson 12: The
User Messaging Service
Chapter 12

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

Practices for Lesson 12: The User Messaging Service


Chapter 12 - Page 1
Practices for Lesson 12

Practices Overview
In this practice, you perform the following tasks:
• Configure the email driver to enable the user messaging service
• Deploy a pair of applications. The first is a composite application, which includes a
BPEL process that invokes both a human task activity and an email activity. Each of
these activities uses the user messaging service to send emails. The second
application is an ADF task form that allows the human task participant to examine an
incoming order, and to either approve or reject the order.
• Instantiate the composite application, complete the human task, and access the emails
generated by the application

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

Practices for Lesson 12: The User Messaging Service


Chapter 12 - Page 2
Practice 12-1: Configuring the Email Driver

Overview
In this practice, you enable email notifications to work in the SOA Server for Human Tasks and
BPEL Email notification.
Note: The Email Driver sends and receives messages. It supports all relevant email protocols,
SMTP for sending emails, and IMAP and POP3 for receiving emails, to be able to communicate
with every standard mail server. Support is implemented for enabling the security protocols, TLS
or SSL, to protect email contents on the wire. The Email Driver uses JavaMail v1.4, which is the
standard Java component that implements the required protocols and clients, to create, access,
send, and receive emails. The Email Driver uses a multi-threaded design to be able to poll
multiple mail boxes (over IMAP or POP3 protocol). One limitation is that if there is only one mail
box to poll, this leads to only one thread working on that box.

Assumptions
• None

Tasks
1. Seed the LDAP server.
a. Open a Terminal window and execute the following commands:
$ cd /practices/practice12/ldap
$ /practices/scripts/ldapadd.sh new_groups.ldif
Password: ldap-admin-password (Refer to the course password document.)
$ /practices/scripts/ldapadd.sh new_users.ldif
Password: ldap-admin-password (Refer to the course password document.)
2. Update the workflow notification email addresses.
a. Access Enterprise Manager.
b. In the Target Navigation pane, expand the SOA folder. Right-click soa-infra and select
SOA Administration > Workflow Properties.
c. On the Workflow Notification Properties page, set the following values:
Notification Mode ALL
Email: From Address demoadmin@example.com
Email: Actionable Address demoadmin@example.com
Email: Reply To Address no.reply@yourdomain.com (default)
d. Verify your work and click Apply.

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

Practices for Lesson 12: The User Messaging Service


Chapter 12 - Page 3
e. In the Confirmation window, click Yes.
f. On the SOA Infrastructure > Workflow Notification Properties page, verify that you get
a confirmation that the changes have been applied.

3. Configure the email driver.


a. Click the “Go to the Messaging Driver page” link.

b. On the usermessagingserver page, under Associated Drivers in the Local tabbed


page, click the Configure Driver icon in the row for User Messaging Email Driver.

c. In the Email Driver Properties pane, click Create.


d. In the Common Configuration section, name the configuration soaEmail.
e. In the Driver-Specific Configuration section, set the following field values:
E-Mail Receiving Protocol POP3
Outgoing Mail Server mail.example.com

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

Practices for Lesson 12: The User Messaging Service


Chapter 12 - Page 4
Outgoing Mail Server Port 25 [This is the default.]
Default From Address demoadmin@example.com
Incoming Mail Server mail.example.com
Incoming Mail Server Port 110
Incoming Mail IDs demoadmin@example.com
Incoming User IDs demoadmin
f. For the Incoming Passwords field, set the following:
• Type of Password: Indirect Password, Create New User [default]
• Indirect Username/Key: demoadmin
• Password: <see the course password document for the password for the
demoadmin user>
g. Click OK.
h. Verify that you receive a confirmation that the operation succeeded.

Testing Your Changes


4. Stop and restart soa_cluster1 to cause your changes to take effect.
5. Test the email driver.
a. In the Enterprise Manager Target Navigation pane, right-click soa-infra and select
Service Engines > Human Workflow.
b. On the Human Workflow Engine page, click the Notification Management tab.
c. Click Send Test Notification.
d. In the Send Test Notification dialog box, supply the following values:
• Send To: jcooper@example.com
• Subject: Test Message
• Content: Can you see me?
• Channel: Email
e. Verify your settings and click Send.

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

Practices for Lesson 12: The User Messaging Service


Chapter 12 - Page 5
f. The response SENT is displayed in the lower-left section of the Send Test Notification
pane.
6. Review the sent message status.
a. Refresh the Notification Management page.

b. In the Outgoing Notifications section, click the Sent link of the top-most message.

The Status Description dialog box is displayed.

s
7. View the email message that was sent to jcooper.
a. Right-click the Thunderbird desktop icon on your desktop and select Open.
b. In the Thunderbird window, in the All Folders pane, click the jcooper@example.com
account name.
c. Click Get Mail on the Thunderbird toolbar.
An email appears in the inbox.
d. In the Inbox, click the email to see the message body.

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

Practices for Lesson 12: The User Messaging Service


Chapter 12 - Page 6
e. Close or minimize Thunderbird.

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

Practices for Lesson 12: The User Messaging Service


Chapter 12 - Page 7
Practice 12-2: Deploying the Composite Application
1. Deploy the Approval application from a script.
a. In a Terminal window, enter the following commands:
$ cd /practices/practice12/scripts
$ ./antDeploy.sh
b. Provide the weblogic username and password when prompted.
The script deploys the application.

2. Deploy the ApprovalTaskForm application from Enterprise Manager.


a. Access Oracle Enterprise Manager.
b. In the Target Navigation pane, expand the WebLogic Domain > edg_domain.
c. Right-click soa_cluster1 and select Deployments.
d. In the Deployments pane, click Deploy.

e. On the Select Archive screen, in the Archive or Exploded Directory section, below the
“Archive is on the machine where this Web browser is running” option, click Browse.

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

Practices for Lesson 12: The User Messaging Service


Chapter 12 - Page 8
f. Navigate to /practices/practice12/deploy/ApprovalTaskForm.ear.
g. Click Open.

h. Click Next.
i. On the Select Target screen, select the check box next to soa_cluster1.
j. Click Next.
k. On the Application Attributes screen, verify the selected values and click Deploy.

Note: Verify that deployment has been successful.

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

Practices for Lesson 12: The User Messaging Service


Chapter 12 - Page 9
Practice 12-3: Instantiating the Composite That Generates Email
1. Initiate the composite application.
a. Access Oracle Enterprise Manager.
b. In the Target Navigation pane, expand the SOA > soa-infra > default nodes in the tree.
Click the “Approval [2.0]” link.
c. On the “Approval [2.0]” home page, click Test.
d. In the Request section, use the Browse button to replace the sample XML data with the
contents of the /practices/practice12/input/approval_input.xml file.
e. Click Test Web Service.
The Response tab is displayed.
f. On the Response tab, click the Launch Flow Trace button.
2. On the Flow Trace page, examine the Trace tree that is shown in the following image and
answer the questions that follow the image:

Note: If the process Flow Trace tree does not resemble the preceding image, wait a few
seconds and refresh the page before you continue. You may need to refresh the page a
few times.
Using the Flow Trace tree, answer the following questions:
a. Has the entire process completed? Explain your answer.
b. In this case, what does the last row in the Trace tree that contains the
ManualApproval Human Workflow component indicate?
Q Answers to Step 3
a. No, the process is still running. If you look in the Trace tree, you can see that
the rows containing Approval and ManualApproval indicate their state as
Running.
b. The ManualApproval row indicates that the process is executing the Human
Workflow component, which is not yet complete because it is still in the
Running state.
3. To examine the ManualApproval component state, perform the following steps:
a. In the web browser window with the Trace Flow page, click the ManualApproval
Human Task component link.
b. On the “Instance of ManualApproval” page, view the information and answer the
following questions:
1) What is the state of the human workflow task?
2) Who is the task assignee?

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

Practices for Lesson 12: The User Messaging Service


Chapter 12 - Page 10
Q Answers to Step 4b
a. The task is in the ASSIGNED state. The following image shows the Instance of
ManualApproval.
b. The assignee is jcooper (refer to the following image).

c. On the “Instance of ManualApproval” page, click the Flow Trace locator link at the top
of the page.

4. To determine why the application is still running, click the Approval BPEL Component link in
the web browser window with the Trace Flow page.
5. On the “Instance of Approval” page, view the process details and answer the following
questions:
a. What is the name of the last activity that was executed?
b. Explain what the execution state of the last activity represents at this time.
Note: Do not close the “Instance of Approval” page yet.
Q Answers.
a. The name of the last activity that was executed is
receiveCompletedTask_ManualApproval2.
b. receiveCompletedTask_ManualApproval2 is in a pending state. The activity
is waiting for an asynchronous callback message from the human workflow task
that indicates that it has been completed. The implications are that the human
workflow process is not complete.

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

Practices for Lesson 12: The User Messaging Service


Chapter 12 - Page 11
Viewing the Email Messages and the Worklist Application
6. View the email message that is sent to the task assignee jcooper.
a. Right-click the Thunderbird desktop icon on the desktop of host02 and select Open.
b. In the Thunderbird window, in the All Folders pane, click the jcooper@example.com
account name.
c. Click Get Mail on the Thunderbird toolbar.
An email appears in the Inbox.
d. In the Inbox, click the Worklist Application link.

A browser window opens the URL


http://soa.example.com:4443/integration/worklistapp.
Tip: If for any reason you need to access the worklist application manually, supply the
fully qualified host name as shown in the preceding URL. Use only the Firefox browser.
e. On the Oracle BPM Worklist application page, enter jcooper as the Username.
Supply the password and click Login.
f. On the Worklist home page, the Inbox is selected and the task with the title “Manual
Approval” should be present in the top-right pane on the page. Click the “Manual
Approval” task entry to display the order details.

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

Practices for Lesson 12: The User Messaging Service


Chapter 12 - Page 12
7. Click Approve (on either the task form as shown in the preceding screenshot or the toolbar
shown as follows) to approve the order and allow the process to complete.

8. Return to the Flow Trace and click Approval. Examine the steps of the business process
and verify that they completed successfully.

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

Practices for Lesson 12: The User Messaging Service


Chapter 12 - Page 13
9. Return to the email program. Select the sking user and click the “Get Mail” toolbar button.
Note: It may take a few moments for the email to arrive in the Inbox.
10. Verify that the customer email was sent correctly.

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

Practices for Lesson 12: The User Messaging Service


Chapter 12 - Page 14
Practices for Lesson 13:
Performance Tuning and
Troubleshooting
Chapter 13

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 1
Practices for Lesson 13

Practices Overview
In the first part of the practices for this lesson, which focuses on performance tuning tools, the
key tasks are to explore and view the following:
• The Topology Viewer that is available in the Oracle Fusion Middleware Control
Console
• The performance information pages that are available for WebLogic Server instances,
SOA server instance, SOA applications, and SOA application components
The second part and the remaining practices of this lesson involve deploying and executing a
composite application that fails due to various problems. Your task is to diagnose the causes of
the problems and fix them. For example, your tasks include:
• Deploying a troublesome composite application
• Diagnosing the cause of faults in the troublesome composite application
• Determining the cause of faults in a Human Workflow scenario

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 2
Part 1: Performance Tuning

General Notes
The practice environment has not provided the tools to generate a large system load for honing
performance tuning skills. In addition, performance tuning is a multi-layered discipline that
requires an iterative monitoring and tweaking process that can take a long time to get the
desired results. Therefore, the purpose of this practice is to familiarize yourself with the various
pages in the Oracle Fusion Middleware Control Console that enable you to monitor the
performance of the Oracle SOA Suite components and applications.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 3
Practice 13-1: Deploying an EAR Application

Overview
The goal of this practice is to deploy an EAR application that is examined by using the Routing
Topology in the next practice.

Assumptions
• Oracle SOA Suite has been installed and is running.

Tasks
To deploy an EAR application, perform the following tasks:
1. Log in to Enterprise Manager.
2. In the Target Navigation pane, click WebLogic Domain > edg_domain.
3. On the edg_domain home page, select WebLogicDomain > Deployments.

4. On the Deployments page, at the top of the applications table, click Deploy.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 4
5. On the Select Archive page, for the “Archive is on the machine where this Web browser is
running.” selected option, click Browse to search for the application file.

6. In the File upload window:


a. Navigate to /practices/practice13/deploy
b. Select the ApprovePO_UI.ear file
c. Click Open

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 5
d. On the Select Archive page, click Next.

7. On the Select Target page, select the soa_cluster1 check box and click Next.

8. On the Application Attributes page, accept the default settings and click Next.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 6
9. On the Deployment Settings page, verify the application settings and click Deploy to start
the deployment of the application.

10. On the Deployment Result page, verify that the deployment succeeded and click close.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 7
Practice 13-2: Examining Server Information in the Routing Topology

Overview
The goal of this practice is to become familiar with the Routing Topology that is available in the
Oracle Fusion Middleware Control Console.

Assumptions
• Oracle SOA Suite has been installed and is running.
• Any composite application is available to examine its metrics.

Tasks
To explore the information provided by the Routing Topology, perform the following tasks:
1. If required, in a web browser window, log in to Oracle Enterprise Manager Fusion
Middleware Control with the URL http://admin.example.com:8080/em.
Note: Sign in as the weblogic user with the appropriate password.
2. On the Oracle Fusion Middleware Control Console home page, to access the Routing
Topology, expand WebLogic Domain, click edg_domain, click WebLogicDomain, and click
Routing Topology.

Viewing Metrics for the SOA Server


3. In the Routing Topology window, explore the information that is available by performing the
following steps:
a. Expand the soa_cluster1 item from the diagram so that you can see the soa_server1
component in the viewer. Click the Expand icon for the soa_server1 component.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 8
b. After expanding the soa_server1 component, on the Routing Topology toolbar, click
Options, select Annotations, and click Metric Values.

Note: The metric values are loaded, and then refreshed; you will notice the icon on the
top-right corner. If the metrics do not appear, try repeating steps a and b.
c. In the expanded soa_server1 component, you can verify the metric information for the
deployed applications. If you move your mouse over the icon next to the soa_server1
component name or let the mouse hover over the bottom of the expanded icon view,
the soa_server1 pop-up callout box is displayed.

d. In the soa_server1 dialog box, you can see the metrics details. Click the “more” link to
view the properties for soa_server1.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 9
e. In the “Properties for soa_server1” dialog box, you can see the version and location of
soa_server1.

Viewing the Metrics for the SOA Infrastructure


4. To examine the metrics for the SOA Infrastructure, move the cursor over the Routing
Topology diagram to the soa-infra visual element.
a. When you have located the soa-infra icon, move the mouse over the icon to display the
popup callout box.
Note: You can use the Zoom In and Zoom Out options near the top-left side of the
viewer window to obtain more or less detail on the page.

b. In the dialog box, you can see the metric information. Feel free to examine the
information in the “more” section, and click Close.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 10
Note: The metric information counts displayed in this example may differ from what
you observe on your system.

Viewing the Metrics for Composite Applications


5. In this section, you view the metrics for a composite application that is active (up).
a. In the Routing Topology window, move the viewer with the mouse or Navigator frame
and locate a deployed composite application that is in the active state (or UP), for
example, the SusbcribeStockUpdComposite [1.0] application. Move the mouse over
the SusbcribeStockUpdComposite [1.0] icon, and click the
SusbcribeStockUpdComposite link.

b. In the dialog box, click the “more” link to view the location details. When you have
finished examining the information, click the Close icon.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 11
c. On the Routing Topology toolbar, click the Down link to display a list of components
that have been shutdown (or are down for other reasons).

d. In this case, the results window is displayed, showing the applications with the down
status. You can filter the results by name, status, and type.

e. When you click the link for any of the applications from the results list, the Routing
Topology window is repositioned to show the icon for the selected application. This is
another way in which you can navigate the Routing Topology window.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 12
6. Optionally, take five minutes more to explore and examine the other components that are
displayed in the Routing Topology window.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 13
Practice 13-3: Observing the Performance of the WebLogic Server
JVM Instance

Overview
In this practice, you navigate the Oracle Fusion Middleware Control Console to locate
performance information about the WebLogic Server instances, such as the AdminServer and
soa_server1 instances, and their Java Virtual Machine (JVM) performance metrics.

Assumptions
• The Oracle WebLogic Server Admin Server and SOA Server instances are running.

Tasks
1. If required, in a web browser window, log in to Oracle Enterprise Manager Fusion
Middleware Control with the URL http://admin.example.com:8080/em.
Note: Sign in as the weblogic user with the appropriate password.

Viewing Performance Information for the AdminServer


2. To view performance information for the AdminServer instance, perform the following steps:
a. On the Oracle Fusion Middleware Control Console page, expand the WebLogic
Domain > edg_domain tree, and click the AdminServer entry to view Summary
information about the server in the right frame of the page.

b. On the AdminServer home page, click WebLogic Server > Monitoring > Performance
Summary.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 14
c. On the Performance Summary page, wait a minute while the graphs are updated in
real time.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 15
d. On the Performance Summary page, use the right-hand scroll bar to view information
that may not be visible. For example, scrolling down brings the General, Servlets and
JSPs, EJBs, and Deployments sections into view.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 16
e. To view the JVM Performance metrics for the AdminServer instance, on the
AdminServer page, click WebLogic Server > Monitoring > JVM Performance.

f. On the JVM Performance page, wait a few minutes while the Memory Heap Usage and
Non Heap Usage graphs are updated with useful information.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 17
g. On the JVM Performance page, scroll down the page to examine information about the
threads that are executing in the JVM. This information can be useful for monitoring
Thread metrics to help you to decide on the settings for threading properties.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 18
Viewing the Performance Information for the SOA Server Instance
3. To view the performance information for the SOA server instance, perform the following
steps:
a. On the Oracle Fusion Middleware Control Console page, expand WebLogic Domain >
edg_domain (if needed) > soa_cluster1, and click the soa_server1 entry to view its
Summary information page.

b. On the soa_server1 > Summary page, scroll down to view information about
application deployments.

c. Like the AdminServer, you can view Performance Summary information for the
soa_server1 instance by clicking WebLogic Server > Monitoring > Performance
Summary on the soa_server1 page.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 19
d. On the Performance Summary page, you can scroll down and view information about
the server and its deployments.

e. Optionally, you can also click WebLogic Server > Monitoring > JVM Performance to
view the JVM performance metrics for the soa_server1 instance.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 20
Practice 13-4: Exploring Metrics for Oracle SOA Suite Components

Overview
In this practice, you navigate the Oracle Fusion Middleware Control Console pages to locate
performance metric information for the different layers and the components running in an Oracle
SOA Suite instance (for example, the components running within the JVM instance for the
soa_server1 instance), such as the SOA Domain, SOA Infrastructure, composite applications,
and service engines.

Assumptions
• The Oracle WebLogic Server AdminServer and SOA Server instances are running.
• Any composite application is available to examine its performance summary.

Tasks
1. If required, in a web browser window, log in to Oracle Enterprise Manager Fusion
Middleware Control with the URL http://admin.example.com:8080/em.
Note: Sign in as the weblogic user with the appropriate password.

Monitoring the SOA Domain


2. In the Oracle Fusion Middleware Control Console Target Navigation pane, expand the
WebLogic Domain tree (if needed) and click the edg_domain entry.

Note: When you click the edg_domain entry, you can see information on the Summary
page. There is not much information that can be obtained about the domain, which is a
named structural component for configuration purposes.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 21
Monitoring the SOA Infrastructure
3. To monitor the SOA Infrastructure performance information, perform the following steps:
a. In the Target Navigation pane, expand the SOA folder and click soa-infra
(soa_server1). On the soa-infra home page, click SOA Infrastructure > Monitoring >
Performance Summary.

b. On the soa-infra > Monitoring > Performance Summary page, wait a minute for the
graphs to update with real-time information.

Note: You can also access the Performance Summary page by right-clicking the soa-
infra (soa_server1) node in the Target Navigation tree, and selecting Monitoring >
Performance Summary.
c. On the soa-infra page, click SOA Infrastructure > Monitoring > Request Processing.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 22
d. On the Request Processing page, you can view information about request statistics
and processing times for various SOA Service Engines, Service Infrastructure, and
Binding Components.

Monitoring Composite Application Performance Information


4. To monitor the performance of a composite application, for example, the
SubscribeStockUpdComposite [1.0] application, perform the following steps:
a. In the Target Navigation pane, expand the SOA > soa-infra (soa_server1) > default
tree, and click the SubscribeStockUpdComposite [1.0] entry.
Note: You can select any other composite application to monitor its performance
summary.
b. On the SubscribeStockUpdComposite [1.0] home page, click SOA Composite >
Monitoring > Performance Summary.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 23
c. On the Performance Summary page, observe the graphic display information. Because
the application is not actively processing requests, there is not much to see.

Note: If you wish, you can click Overlay to add additional layers of metric information
from a large list of items that can be monitored. The choice you make depends on the
nature of the application and what you are trying to monitor.

Monitoring Java EE Application Performance


5. To monitor the performance of a Java EE application, such as the ApprovePO_UI web
application (or the Human Task Form application), perform the following steps:
a. In the Target Navigation pane, expand the Application Deployments section and locate
and click the application of interest, for example, ApprovePO_UI. Expand and select
the application deployed in the cluster to display its home page with a Summary page
of information.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 24
Note: You can select any other Java EE application to monitor its performance
summary.
b. To view the application performance metrics, on the application home page, click
Clustered Application Deployment > Monitoring > Performance Summary.

c. On the ApprovePO_UI > Performance Summary page, you can wait for the graphs to
be updated with information and scroll the page to view other details.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 25
Note: You do not see much activity for the ApprovePO_UI application because of
process inactivity at this time. Consider looking at performance information for the
Enterprise Manager application [the em(AdminServer) entry located in the
Application Deployments > Internal Applications tree > em].

Monitoring User Messaging Service Component Performance


6. To monitor the performance of the email driver in the SOA Server instance, perform the
following steps:
a. In the Target Navigation pane, expand the User Messaging Service folder and click the
usermessagingdriver-email(soa_server1) entry to display the usermessagingdriver-
email home page.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 26
Note: If you have installed other user messaging drivers, you can monitor them in a
similar way.
b. On the usermessagingdriver-email home page, click User Messaging Email Driver >
Performance Summary.

c. On the Performance Summary page, in the graphs, you can view and add the overlay
metric information that you wish to monitor.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 27
d. To view performance information for usermessagingserver, click the
usermessagingserver entry in the User Messaging Service folder in the Target
Navigation pane, and on the usermessagingserver home page, click User Messaging
Service > Performance Summary.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 28
e. On the Performance Summary page, you can view email throughput and other
messaging service throughput if those drivers have been installed and are active. For
example, the following page displays information about email performance:

Monitoring Service Engine Performance


7. To monitor the performance of a SOA Service Engine, for example, the BPEL Service
Engine, in the Target Navigation pane, expand the SOA folder (if needed), right-click the
soa-infra (soa_server1) entry, and select Service Engines > BPEL.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 29
Note: The same steps can be performed for any of the Service Engines options that are
available in the Service Engine menu. The performance information for each Service
Engine, such as the preceding BPEL Engine (Service Engine) page example, is visible on
the Statistics tab page for the Service Engine.

Monitoring Port Usage


In this section, you view port usage.
8. To monitor port usage in the SOA Server instance, perform the following steps:
a. On the Oracle Fusion Middleware Control Console home page, to access Port Usage,
expand WebLogic Domain and click edg_domain.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 30
b. On the edg_domain page, click WebLogic Domain > Monitoring > Port Usage.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 31
c. On the Port Usage page, you can observe the different ports in use by the different
components.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 32
Part 2: Troubleshooting

General Notes
Although the practice instructions for the troubleshooting tasks and their corrective actions are
documented in a sequential manner, consider trying to diagnose and take corrective action by
yourself before reading the possible solutions and corrective actions that are documented.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 33
Practice 13-5: Deploying a Troublesome Composite Application

Overview
In this practice, you deploy the TroubleSomeComposite application by using its supplied SOA
archive file. You log in to the Oracle Fusion Middleware Control Console and examine the
components that are part of the deployed application.
The application accepts a new product name and quantity in the input (request) data and inserts
the new product into the EXTERNAL_STORE database table. The input data can be sent through
the SOAP binding or the JCA binding that is provided by a File Adapter. The application uses
the DbAdapter to insert the new product into the database table.

Assumptions
• The runtime server configuration for the DbAdapter connection factory,
eis/DB/soademo, is configured to use the JDBC jdbc/soademo data source, which
is also configured. If not, perform the steps for configuring the database adapter as
described in the practice for the lesson titled “Configuring High Availability.”

Tasks

Deploying the TroubleSomeComposite Application


1. To deploy the TroubleSomeComposite application, perform the following steps:
a. If required, in a web browser window, access Oracle Enterprise Manager Fusion
Middleware Control with the URL http://admin.example.com:8080/em, and sign in with
the weblogic administrator credentials.
b. In the Target Navigation pane, expand the edg_domain node, right-click it, and select
SOA Deployment > Deploy.

c. On the “Deploy SOA Composite: Select Archive” page, accept the default selected
option called “Archive is on the machine where this web browser is running.”, and click
Browse.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 34
d. In the File Upload dialog box, navigate to the /practices/practice13/deploy
folder, select the sca_TroubleSomeComposite_rev1.0.jar file, and click Open.

e. On the “Deploy SOA Composite : Select Archive” page, verify that the
sca_TroubleSomeComposite_rev1.0.jar file name appears in the “Archive or Exploded
Directory” section, accept the default settings for the remaining items, and click Next.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 35
f. On the “Deploy SOA Composite : Select Target” page, accept the default settings and
click Next.
g. On the “Deploy SOA Composite : Confirmation” page, click Deploy.
Note: The “Deployment in progress” dialog box is displayed, where you can track
deployment processing.
h. When processing completes, you should see a Deployment Failed message appear
with details of the error shown in the Progress Messages area. Take note of the error
message and the component name (InsProdDBAdapter) listed in the error message,
and click Close.

i. Briefly explore, with your instructor or other students, what the possible cause of this
error may be.
Hint: The error is related to the type of component and the configuration details
associated with the error.
2. Because the error message references the diagnostic log file for a specific SOA server (in
this case, soa_server2), you could navigate through the file system on host02 to find the
$MSERVER/servers/soa_server2/logs folder and view the contents of the

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 36
soa_server2-diagnostic.log file. However, you can view the same log information by
performing the following steps:
a. On the Oracle Enterprise Manager Fusion Middleware Control Console page, with the
edg_domain node selected in the Target Navigation pane, on the edg_domain home
page, click WebLogic Domain > Logs > View Log Messages.

b. On the Log Messages page, the default search settings capture the latest messages of
interest, and therefore, the topmost message should represent the error related to the
application deployment failure.
Note: If you hover the mouse over the Message column for the Error message for the
selected Message ID, the message that is written to the log file can be seen in the
Deployment Failed dialog box.

Tip: If you can view all the columns for the message log page, you can find a column
that identifies the file in which the message you are viewing is saved. In this case, the
message with ID SOA-21357 is written to the soa_server2-diagnostic.log file.
Note: In this case, if you understand Database Adapter properties and configuration,
you can ascertain that there is probably an issue with the connection factory
associated with the DbAdapter.
3. Because the diagnostic error message references the InsProdDBAdapter_db.jca file,
which holds the application configuration data related to the Database Adapter, you can
examine the InsProdDBAdapter_db.jca file by opening it from the deployment archive,
by using the following steps:

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 37
a. On the Linux desktop, on host01 or host02, right-click the “oracle’s Home” desktop icon
and select Browse Folder.

Note: This action opens the File Browser application.


b. In the File Browser window, click the first Edit icon below the menu and toolbar.

Note: Clicking the Edit icon creates a Location field using which you can navigate to
any folder by entering the destination path name and pressing Enter.
c. In the File Browser window, in the Location field, enter the
/practices/practice13/deploy path and press Enter. Right-click the
sca_TroubleSomeComposite_rev1.0.jar file and select “Open with Other
Application.”

d. In the “Open with” dialog box, select Archive Mounter, and click Open.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 38
Note: After clicking Open, the sca_TroubleSomeComposite_rev1.0.jar file is
added as an entry in the Places pane as a mounted archive. This mechanism allows
easy navigation through the archive and viewing of file contents as if it were a normal
file system.

e. In the Places pane, select the sca_TroubleSomeComposite_rev1.0.jar mounted


archive entry, and in the right-hand pane, scroll down to locate and right-click the
InsProdDBAdapter_db.jca file, and select “Open with Other Application.”

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 39
f. In the Open With dialog box, select the gedit entry and click Open.

g. In the gedit window, the InsProdDBAdapter_db.jca file content is displayed on a


tab page with the same name. Locate and view the location attribute value in the
<connection-factory> element.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 40
h. What is the value of the location attribute value in the <connection-factory>
element?
Answer: eis/DB/demo
Comment: This is the source of error because you have not yet created a connection
factory with the JNDI name eis/DB/demo. However, you have previously created a
connection factory with the JNDI name eis/DB/soademo. In this case, you can
presume (although this should be checked with the application developer) that the
JNDI name eis/DB/soademo should have been used.
Note: This error can be fixed by using a deployment configuration plan to replace the
offending value. Alternatively, the developer can fix the application source and provide
you with an updated archive for deployment.
i. Close the gedit application without making changes to the
InsProdDBAdapter_db.jca file.
j. In the File Browser window, eject the mounted archive by clicking the Eject icon to the
right of the mounted archive name.

k. Do not close the File Browser application window.


4. Because a deployment configuration plan is created for you, you can view the deployment
configuration plan file by performing the following steps:
a. In the File Browser application window, enter the /practices/practice13/deploy
path in the Location field, or navigate to this location. Locate and right-click the
TroubleSomeComposite_cfgplan.xml file, and select “Open with gedit.”

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 41
b. In the gedit editor window, click Search > Find (or press Ctrl+F) and search for the
word demo.
Note: After finding the first occurrence of the word demo, you should see the
<searchReplace> element that provides the instruction to the deployment
processing to replace the incorrect eis/DB/demo value with the correct
eis/DB/soademo value.

Tip: Either the developer can create this configuration plan file for you with the
appropriate configuration data, or you can create it yourself. It is easier to create the
deployment plans by using Oracle JDeveloper with the source of the composite
application available.
c. Close the gedit editor window.
d. Close the File Browser application window.

Redeploying the TroubleSomeComposite Application with a Deployment Configuration


Plan
5. Return to the Oracle Fusion Middleware Control Console.
Note: If required, access the page by using the URL http://admin.example.com:8080/em,
and sign in as the weblogic administration user.
6. To deploy the TroubleSomeComposite application with the configuration plan, performing
the following steps:
a. In the Target Navigation pane, with the edg_domain node expanded and selected,
right-click the edg_domain node and select SOA Deployment > Deploy.
b. On the “Deploy SOA Composite: Select Archive” page, accept the default selected
option called “Archive is on the machine where this web browser is running.” and click
Browse. In the File Upload dialog box, navigate to the
/practices/practice13/deploy folder, select the
sca_TroubleSomeComposite_rev1.0.jar file, and click Open.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 42
c. On the “Deploy SOA Composite: Select Archive” page, in the Configuration Plan
section, select “Configuration Plan is on the machine where this web browser is
running.” and click Browse. In the File Upload dialog box, navigate to the
/practices/practice13/deploy folder, select the
TroubleSomeComposite_cfgplan.xml file, and click Open.

d. On the “Deploy SOA Composite : Select Archive” page, with the composite archive and
its configuration plan files selected, click Next.
e. On the “Deploy SOA Composite : Select Target” page, accept the default settings and
click Next.
f. On the “Deploy SOA Composite : Confirmation” page, click Deploy.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 43
g. Wait for the deployment to complete. This time you should see a Deployment
Succeeded dialog box displayed. Click Close.

Note: Having successfully diagnosed the deployment error and deployed the
application, you might want to test the various interfaces provided by the application.
Although this type of testing should be done during the development and testing
phases, some runtime error can still occur that may not have been caught during those
phases.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 44
Practice 13-6: Testing the TroubleSomeComposite Interfaces

Overview
In this practice, you initiate tests of the TroubleSomeComposite application by using different
interfaces to see if any errors occur at run time. You start with testing the SOAP binding
interface. If you encounter problems, you are required to take corrective action to diagnose and
fix the problem.
You then initiate a test by using the File Adapter interface. Again, if problems arise, you are
required to take corrective action.

Assumptions
• You have deployed the TroubleSomeComposite application.

Tasks
In the tasks, you first test the SOAP interface, take corrective action for problems, then test the
File Adapter interface again, and take corrective action if there are any problems remaining. The
goal is to have a working application for all its input sources.

Testing the SOAP Application Interface


In this section, you test the SOAP interface of the TroubleSomeComposite application to verify
that the changes made to the database adapter connection factory property, by deploying with
the configuration plan, makes the application operate as expected. If successful, a data row is
added to the EXTERNAL_STORE table in the SOADEMO database schema.
1. Ensure that you have the Dashboard tab page of the TroubleSomeComposite application
displayed in the Oracle Enterprise Manager Fusion Middleware Control interface.
Note: If the TroubleSomeComposite Dashboard page is not visible, in the Target
Navigation panel, expand SOA > soa-infra (soa_server1) > default, and click the
TroubleSomeComposite [1.0] node.

2. To invoke a test of the TroubleSomeComposite application SOAP interface, perform the


following steps:
a. On the TroubleSomeComposite [1.0] page, above the subtabs such as the Flow
Instances tab, click Test.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 45
b. On the TroubleSomeComposite [1.0] > Test Web Services page, scroll down to the
Input Arguments section on the Request subtab, expand the body element in the Input
Arguments area, and after entering the following field values, click Test Web Service
(at the top or bottom right side of the page).

Id TBLT03
qty 5

Note: If you look for the Operation field, it shows that the Read operation is being
invoked. The Read operation is the only function that is exposed by the service. In
addition, you have to scroll down the page to locate the fields in the expanded Input
Arguments section. After you click Test Web Service, the Response tab becomes
active on the page with the response information.
c. On the TroubleSomeComposite [1.0] > Test Web Services Response tab page, you
can see an indicator that the request was received successfully. However, receiving a
message successfully does not necessarily indicate that the service completed
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 46
successfully. To view if the service’s Read operation completed successfully, click
Launch Flow Trace.

d. On the Flow Trace page, the Faults tab page is active by default. You can now see that
the invocation and execution of the service operation was successful because there
are no error messages on the Faults tab page. In addition, in the Trace section, you
can see that all the components that were executed by the flow completed without
error. With the focus on the database adapter, you can see that the InsProdDBAdapter
service reference completed successfully, indicating that a row was inserted into the
database table.

Note: Although you may not know the target database table, in this course, you can
verify that the data has been added to the EXTERNAL_STORE table in the SOADEMO
database schema.
e. Close the Flow Trace browser window or tab page.
3. To verify that the row has been inserted into the EXTERNAL_STORE table in the SOADEMO
database schema, enter the following sqlplus command in a Terminal window on host02,
and then enter the subsequent SQL statements:
$ sqlplus
Note: When SQL*Plus prompts for the username, enter soademo, and enter the
password for the database schema (check with your password list or ask the
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 47
instructor). At the SQL*Plus SQL> prompt, enter the SELECT SQL statement shown,
and then the exit SQL*Plus command:
SQL> SELECT * FROM external_store WHERE prod_id like 'TBLT%';
Note: Whereas the SQL query is not case-sensitive, the text data (TBLT%) within the
quotation marks is case-sensitive. The following query result should be returned:
SQL> SELECT * FROM external_store WHERE prod_id like 'TBLT%';
PROD_ID QUANTITY
-------------------- ----------
TBLT03 5
SQL> exit

Summary: You have verified that the deployed application functions correctly for
invocations through its SOA interface for the Read operation, and that the Database
Adapter configuration is now valid.

Testing the File Adapter Interface


In this section, you test the File Adapter interface by copying a supplied XML file to a specified
folder, from which the File Adapter consumes the supplied file.
Note: There are two problems that you get to experience and solve with this File Adapter
scenario.
4. To test the File Adapter interface, as input for new product data, perform the following
steps:
a. In a Terminal window, copy the file prod_tblt01.xml from the
/practices/xml/troubleshoot folder to the /practices/practice13 folder,
by entering the following commands:
$ cd /practices/practice13
$ cp /practices/xml/troubleshoot/prod_tblt01.xml .
Note: There is a space followed by a dot character at the end of the last command.
b. Wait a maximum of one minute for the file to be processed.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 48
Note: The File Adapter reference in the application is configured to delete a file that it
reads as input data. If the file is not processed, it will not be removed.
c. Does the prod_tblt01.xml file get removed from the /practices/practice13
folder?
Hint: Enter the following command in the Terminal window to check if the XML file is
still present in the /practices/practice13 folder:
$ ls prod*.xml
Answer: No the prod_tblt01.xml file does not get removed from the
/practices/practice13 folder.
d. Your task is to diagnose the cause of the problem. Where do you start looking first? Is
an instance created for the application? Is any fault reported?
Answer: In this case, no application instance is created and therefore no fault
information is available either in the Oracle Fusion Middleware Control Console or in
the log files. Therefore, the problem could be related to the application component
configuration.
Tip: Although a developer can take care of these configuration settings, changes may
be required when an application is moved from the test to production contexts, and the
component configuration data may need to be modified. Some of the component
configuration for the services and references in composite applications can be
accessed and modified through the Oracle Enterprise Manager Fusion Middleware
Control interface.
5. To troubleshoot the lack of file processing observed with the File Adapter interface, perform
the following steps:
a. On the Oracle Fusion Middleware Control Console web page, in the Target Navigation
pane, click the TroubleSomeComposite [1.0] application node.
Note: You may need to expand the SOA > soa-infra (soa_server1) > default tree first.
b. On the TroubleSomeComposite [1.0] application Dashboard tab page, scroll down to
the “Services and References” section and click the NewProdFileService JCA Adapter
Service link.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 49
c. On the TroubleSomeComposite [1.0] > NewProdFileService (File Adapter) page, click
the Properties tab.

d. On the TroubleSomeComposite [1.0] > NewProdFileService (File Adapter) > Properties


tab page, the prd_dir property specifies the folder for the input files. This value has
not been configured yet.

e. On the TroubleSomeComposite [1.0] > NewProdFileService (File Adapter) > Properties


tab page, enter the path /practices/practice13 in the Value cell of the prd_dir
property row to specify where the File Adapter looks for input files, and click Apply.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 50
f. In the Confirmation dialog box, with the “Save Properties” prompt, click Yes.

g. In the Information dialog box, with the message “Properties have been saved
successfully,” click OK.

6. To verify that your corrective action is successful, perform the following steps:
a. In the Terminal window, verify that the prod_tblt01.xml file no longer exists, that is,
it has been consumed (removed from the folder) by the application for processing, by
entering the command:
$ ls prod*.xml
Note: No files should be listed as a result of entering the ls command. The following
message is displayed:
ls: cannot access prod*.xml: No such file or directory
b. Return to the web browser window with the TroubleSomeComposite [1.0] >
NewProdFileService (File Adapter) > Properties tab page, and click SOA Composite >
Home > Flow Instances.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 51
c. On the TroubleSomeComposite [1.0] > Flow Instances tab page, click the Search icon
on the right side of the page to expand the Search Options pane.

d. In the expanded Search Options pane, accept the default settings and click Search.

Note: To collapse the Search Options pane, click the Search icon in the pane.

e. On the TroubleSomeComposite [1.0] > Flow Instances tab page, verify that a new
(topmost) instance ID has been created and has the value Completed in the Flow State
column. Click the Flow ID for the top row in the Search Results table, to open the Flow
Trace for that instance.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 52
f. On the Flow Trace page, you can verify that the service executed successfully to
completion, and you can expect to find another row inserted into the
EXTERNAL_STORE table of the SOADEMO database schema.

g. Optionally, in the Terminal window, start SQL*Plus again, and press the up arrow key
to recall the SELECT * FROM external_store WHERE prod_id LIKE 'TBLT%'
SQL statement. Press Enter.
Note: A row with the TBLT01 value in the PROD_ID column, and the value 10 in the
QUANTITY column should be displayed in the query results.
h. Exit SQL*Plus.

Working with the Audit Level and Payload Validation Settings


In this section, you initiate the TroubleSomeComposite application with another input XML file.
However, this time the data can generate a fault. Before you perform the test, you are required
to make some changes to the Audit Level for the composite to facilitate the troubleshooting
process. You also enable the payload validation feature.
7. To change the Audit Level for the TroubleSomeComposite [1.0] application, perform the
following steps:

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 53
a. In the web browser window with the Oracle Fusion Middleware Control Console, click
TroubleSomeComposite [1.0] in the Target Navigation pane to display the Dashboard
tab page of the composite application.
b. On the TroubleSomeComposite [1.0] home page, select Settings > Composite Audit
Level: Inherit > Development.

Note: The default Audit Level setting is Inherit, which is derived from the soa-infra
container settings.
c. In the Confirmation dialog box, click Yes.

Note: After clicking Yes in the Confirmation dialog box, the following confirmation
message response is displayed at the top of the page.

8. Using a Terminal window, to initiate the composite application again, perform the following
steps:
a. Copy the prod_tblt02.xml file from the /practices/xml/troubleshoot folder
to the /practices/practice13 folder, by entering the following commands:
$ cd /practices/practice13
$ cp /practices/xml/troubleshoot/prod_tblt02.xml .
Note: There is a space followed by a dot character at the end of the last command.
Wait for approximately one or two minutes for the XML file to be processed and
removed from the /practices/practice13 folder.
b. Does the prod_tblt02.xml file get removed from the /practices/practice13
folder?

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 54
Answer: Yes! The prod_tblt02.xml file is removed from the
/practices/practice13 folder.
c. Return to the web browser window with the TroubleSomeComposite [1.0] page, and
click SOA Composite > Home > Flow Instances.

d. Perform a Search request to refresh the information displayed in the flow trace Search
Results table.
e. On the TroubleSomeComposite [1.0] > Flow Trace tab page, what is the Flow State of
the latest (topmost entry) instance?
Answer: The latest instance has a Recovery State.

f. What do you think is the cause of the fault condition this time? The File Adapter or
something else?
Answer: This time the File Adapter is not the cause of the fault. The problem lies
somewhere else. You need to examine the application Flow Trace to examine and
determine the source of the problem.
9. To explore the application fault condition, perform the following steps:
a. On the TroubleSomeComposite [1.0] > Flow Instance tab page, click the name of the
composite in the top row of the Search Results table to select the row, and view the
Error Message on the Faults subtab below the Search Results table.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 55
Note: If you hover the mouse over the Error message beginning with the text
ORAMED-03302, you can see the message detail appear in a pop-up display area.

Hint: The preceding image highlights the failure condition, which indicates that an
attempt was made to insert a NULL value in to the PROD_ID column of the

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 56
EXTERNAL_STORE database table. This error points to the source of the problem being
in the data received from the XML file that is provided as input.
b. Move the mouse away from the Error Message to return to the
TroubleSomeComposite [1.0] > Flow Instance tab page, and click the instance ID link
in Flow ID column in the top row of the Search Results table.

Note: When you click the instance ID link for the faulted instance, the Flow Trace page
is opened.
c. On the Flow Trace page, click the InsProdMediator link in the Trace table. Notice that
the Error Message appears on the Faults tab page, with a link for recovery provided.
However, you first examine the Audit Trail for the mediator component to drill deeper
into the situation.

Note: In this flow sequence, the fault occurred when the InsProdDBAdapter reference
was invoked to perform the INSERT operation on the database. The fault was
propagated to the InsProdMediator component, which received the message from
NewProdFileService and forwarded it to the Database Adapter. Because the mediator
component invokes the database adapter service, it received the failed state as well.
d. On the Audit Trail page, you can see the error in detail again, located at the specific
point where it was detected within the application execution sequence, in this case,
when the ProdDBAdapter was invoked with the insert operation. Without the Audit Trail
setting set to Development, you will not be able to click the View Payload link to see

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 57
the data that is actually processed at this point in the application. Because the Audit
Level is set to Development mode, click the View Payload link.

e. On the Payload for Mediator page, the data to be processed (sent to the Database
Adapter) for inserting into the database reveals that there are no data values in the
<prodid> and the <quantity> elements. Click Close.

Note: The <payload> contents reveal that the DbAdapter did indeed get empty data
values. Empty XML elements are interpreted as a database NULL value by the
DbAdapter. Taking a closer look at the processing task that owns the payload, you can
see that the information appears just after the Transformation step. Therefore,
something happened during the transformation to cause the input data to be converted
to empty XML elements.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 58
f. On the Flow Trace > Instance of InsProdMediator page, click the Flow Trace
breadcrumb link on the top-left corner of the page to return to the main Flow Trace
page.

g. On the Flow Trace page, click Recovery Required.

h. On the System Fault page, you can view the error message again and the information
that indicates that the problem is considered “not retriable.” Therefore, you terminate
the instance by clicking Abort.

Note: Clicking Abort displays the following Confirmation dialog box that asks if you
want to Abort the Selected Fault, which aborts the entire flow. In the Confirmation
dialog box, click Yes.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 59
i. On the Flow Trace page, there is a message to indicate that the abort request could
take a little time to be reflected in the system. Close the Flow Trace page.

j. On the TroubleSomeComposite [1.0] > Flow Instance tab page, click the Refresh icon
on the top-right corner of the page.

Note: Clicking the Refresh icon updates the data in the Search Results table, where
you can confirm that the latest instance shows the Flow State of Aborted.

10. Because you now suspect that the data coming into the composite application could be
problematic, an option of enabling Payload Validation for the composite application is
available. However, there is a data storage overhead cost for enabling Payload Validation,
similar to using Audit Level set to Development. Therefore, use of these features should be
minimized on a production system. To enable payload validation for the application, perform
the following actions:
a. On the TroubleSomeComposite [1.0] page, above the Flow Instances tab, click
Settings > Payload Validation: Inherit > Enable.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 60
Note: This action enables the payload validation functionality, which was previously set
to a disabled value as inherited from the SOA infrastructure default setting.
b. In the Confirmation dialog box, click Yes.

c. On the TroubleSomeComposite [1.0] page, another confirmation message is displayed


to indicate that payload validation is now enabled for the composite application.

11. To examine the changes in the application execution sequence with payload validation
enabled, perform the following steps:
a. Repeat the commands to copy the prod_tblt02.xml file from the
/practices/xml/troubleshoot folder to the /practices/practice13 folder,
by entering the following commands:
$ cd /practices/practice13
$ cp /practices/xml/troubleshoot/prod_tblt02.xml .
Note: Remember that there is a space and dot character at the end of the command.
b. Wait for approximately one or two minutes for the XML file to be processed and
removed from the /practices/practice13 folder.
c. Return to your web browser where the TroubleSomeComposite [1.0] page is displayed
and click the Refresh icon on the right side of the page.
Note: If required, use the Target Navigation pane to navigate to the
TroubleSomeComposite [1.0] > Flow Instances tab page.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 61
d. On the TroubleSomeComposite [1.0] > Flow Instances tab page, a new failed instance
appears as the top (first) row in the Search Results table, with a Flow State value of
Recovery. Click the Flow ID link for the new row to open the Flow Trace.

e. On the Flow Trace page, observe the new error message information.
Note: In this flow sequence, the InsProdDBAdapter reference was not even invoked by
the InsProdMediator component. This time the InsProdMediator component gets the
fault condition, and the NewProdFileService component has the Recovery Required
state.

f. On the Flow Trace > Faults tab page, click the Recovery Required link in the Error
Message row.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 62
g. On the System Fault page, you see that the error message is different and indicates a
possible XML schema problem with invalid text in the <quantity> element. Again,
you terminate the instance by clicking Abort.

Note: Whereas this might be a recoverable message, there is no way to modify the
input data unless you go to the source where it is created to examine what is produced
and to fix the data where it is created.
h. In the Confirmation dialog box, which asks if want to confirm aborting the flow, click
Yes.

i. On the TroubleSomeComposite [1.0] page, click the Refresh icon on the right, to verify
that the instance is in the Aborted Flow state.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 63
j. After clicking the Refresh icon, verify that the Flow State for the latest instance is
Aborted.

Optional Tasks of Correcting the XML Input Data


This section is optional, because as an administrator, you may not be able to access the input
data, which could be transferred via the network via other protocols instead of using a File
Adapter to consume the data. However, in this case, the XML file has an incorrect namespace
in the source file.
12. To find the correct XML namespace that should be used (or the XML element structure if it
were the problem), you must find the XML Schema that is associated with the composite
entry point and definition. In this case, InsProdMediator_ep (SOAP entry point) shares the
same XML Schema as the File Adapter interface. To determine the XML namespace that is
required to be used for input data, perform the following steps:
a. On the TroubleSomeComposite [1.0] page, click the “Show WSDL and endpoint URI”
icon (next to the Settings button).

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 64
b. In the “Service Endpoint and WSDL” dialog box, click the WSDL URL link.

Note: Clicking the WSDL URL causes a new web browser window or tab page to open
with the XML structure of the endpoint WSDL document.
c. In the web browser window or on the page that displays the WSDL information, you
can scroll down to locate the first <schema> element and compare the namespace
attribute value (http://www.example.org/ns/product) in the <import>
element to the value observed in the “Native payload of rejected message” dialog box.

Note: This final piece of the puzzle clearly identifies the XML namespace in the input
file (prod_tblt02.xml) that contains the source of the error.
d. Close the extra web browser window or tab page that contains the WSDL information.
e. To close the “Service Endpoint and WSDL” dialog box, click OK.

13. To correct the source of the problem (the XML namespace in the input data), perform the
following steps:
a. In a Terminal window, make a copy of the prod_tblt02.xml file in the
/practices/xml/troubleshoot folder by entering the following commands:
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 65
$ cd /practices/xml/troubleshoot
$ cp prod_tblt02.xml prod_tblt02_copy.xml
Note: The new file is called prod_tblt02_copy.xml.
b. In the Terminal window, open the new file prod_tblt02_copy.xml in an editor, with
the gedit editor command, as shown in the following example:
$ gedit prod_tblt02_copy.xml
c. In the gedit editor window, locate the xmlns attribute in the <prd:product> root
element and delete the trailing letter “s” from the end of the string
xmlns:prd="http://www.example.org/ns/products" in the first line of the
file.

d. After you delete the trailing letter s from the XML namespace, click File > Save. Then
verify that the changed xmlns:prd attribute value is
http://www.example.org/ns/product (without a trailing s character).

e. To close the editor, click File > Quit.


14. To test if your corrective action produces the correct result, that is, the new composite
application processes the data file and stores the information in the EXTERNAL_STORE
table, perform the following steps:
a. In a Terminal window, enter the following commands to copy the updated
prod_tblt02_copy.xml file from the /practices/xml/troubleshoot folder to
the /practices/practice13 folder, by entering the following commands:
$ cd /practices/practice13
$ cp /practices/xml/troubleshoot/prod_tblt02_copy.xml .
Note: Remember that there is a space and dot character at the end of the command.
b. Wait for approximately one or two minutes for the XML file to be processed and
removed from the /practices/practice13 folder.
c. Return to your web browser where the TroubleSomeComposite [1.0] > Flow Instances
tab page is displayed and click the Refresh icon on the right of the page.
Note: If required, use the Target Navigation pane to navigate to the
TroubleSomeComposite [1.0] > Flow Instances tab page.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 66
d. On the TroubleSomeComposite [1.0] > Flow Instances tab page, verify that a new,
most recent (topmost) instance is created and that its State value is Completed.

Note: The Flow ID values may be different on your system.


e. As the final check for completeness, in a Terminal window on host02, enter the
SQL*Plus command (sqlplus), log in as the SOADEMO user, and enter the following
SQL statement to view the TBLT products in the table:
SQL> SELECT * FROM external_store WHERE prod_id LIKE 'TBLT%';
Note: The query result should include the row with the PROD_ID value TBLT02 and
the QUANTITY column with the value 10.

f. Exit SQL*Plus, by entering the exit command, and optionally close the Terminal
window.

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

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 67
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Performance Tuning and Troubleshooting


Chapter 13 - Page 68
Practices for Lesson 14:
Backup and Recovery of
Oracle SOA Suite
Chapter 14

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

Practices for Lesson 14: Backup and Recovery of Oracle SOA Suite
Chapter 14 - Page 1
Practices for Lesson 14

Practices Overview
In these practices, you run the backup scripts to back up your entire Enterprise Deployment
topology. You then run a script that removes part of the configuration files so that you can
recover the environment from the backup files that are created for the domain.

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

Practices for Lesson 14: Backup and Recovery of Oracle SOA Suite
Chapter 14 - Page 2
Practice 14-1: Backing Up and Breaking the Enterprise Deployment
Domain

Overview
In this practice, you run the backup scripts to back up the entire Enterprise Deployment domain
and the environment that you created.

Assumptions
• None

Tasks
1. To back up the Oracle SOA Suite domain configuration, perform the following steps:
a. In a Terminal window on host01, enter the following commands:
$ /practices/scripts/domain.sh shutdown
Username [weblogic]:
Password: password
Note: To get a consistent backup, the domain is shut down first.
b. On host01, use the following backup.sh script commands with a second parameter
that identifies the backup files with the tag (or label) name soasuite.
$ /practices/scripts/backup.sh admin soasuite
$ /practices/scripts/backup.sh apps soasuite
$ /practices/scripts/backup.sh dplan soasuite
$ /practices/scripts/backup.sh managed soasuite
Tip: This time you entered the command to back up the folder that contains the
deployment plans. You can execute the preceding backup commands on host01 at the
same time as running the backup commands for host02, which is listed in the next
step.
c. In a Terminal window on host02, enter the following commands:
$ /practices/scripts/backup.sh managed soasuite
$ /practices/scripts/backup.sh db soasuite
$ /practices/scripts/backup.sh ldap soasuite
2. Stop the Node Manager for the administration server instance on host01 by entering the
following command:
$ /practices/scripts/nm.sh stop
Note: The Node Manager for the administration server must be stopped before the next
step where you delete the folders that contain the files used by the Node Manager and the
administration server.
3. To destroy a part of your environment (the AdminServer configuration files), delete the
/u02/oracle/config folder tree by entering the following command in a Terminal
window:
$ rm –rf /u02/oracle/config
Note: This command deletes the entire config shared folder tree that contains the
administration server domain configuration files, applications, and deployment plans.
4. What happens when you attempt to start up the domain by entering the following command
in a Terminal window (either on host01 or host02)?
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Backup and Recovery of Oracle SOA Suite
Chapter 14 - Page 3
$ /practices/scripts/domain.sh startup
Username [weblogic]:
Password: password
Comment: After removing the /u02/oracle/config folder, the domain cannot be
started. In fact, the Node Manager cannot be contacted without the boot.properties
file, which would be found within the /u02/oracle/config tree. The output that you can
expect to see from the attempt to start the domain should be similar to the following text:
Error:
/u02/oracle/config/domains/edg_domain/servers/AdminServer/securi
ty/boot.properties does not exist yet. Please create the file.
Note: You could not even start the Node Manager for the administration server because the
configuration files that it depends on are no longer available and would need to be restored
as part of a recovery action.

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

Practices for Lesson 14: Backup and Recovery of Oracle SOA Suite
Chapter 14 - Page 4
Practice 14-2: Restoring the Enterprise Deployment Domain

Overview
In this practice, you restore the Enterprise Deployment domain after deleting some configuration
files and folders.

Assumptions
• You have performed the backup tasks described in Practice 14-1.

Tasks
1. To recover the AdminServer configuration files, in a Terminal window on host01, use the
following restore.sh script commands by providing the second parameter value of
soasuite (to restore the backup files with the soasuite tag or label name):
$ /practices/scripts/restore.sh admin soasuite
$ /practices/scripts/restore.sh apps soasuite
$ /practices/scripts/restore.sh dplan soasuite
Note: You should normally restore the database to restore the SOA Suite and the related
database schemas as well. However, in this case, it is clear that no additional configuration
and runtime changes have been made since the backup was performed and since this
restore operation.
2. To start up the domain, take the following actions:
a. In a Terminal window on host01, start the Node Manager for the administration server
by entering the following command:
$ /practices/scripts/nm.sh start
b. In a Terminal window (on host01 or host02), start the domain by entering the following
command:
$ /practices/scripts/domain.sh startup
Username [weblogic]:
Password: password
c. Verify that the servers in the domain have started.
Note: For example, use a web browser to see if you can access and log in to the
Oracle WebLogic Administration Console or Oracle Enterprise Manager Fusion
Middleware Control applications to view the state of your domain at run time.
3. To compress the space consumed by the collection of backup archive (tar) files, enter the
following command in a Terminal window (either on host01 or host02):
$ cd /u02/backup
$ zip soasuite.zip *.tar
$ rm *.tar
Note: The rm command deletes the backup archive files to reclaim the disk space that is
needed for the remaining course practices. The zip command packages all related backup
archive files into a single compressed file. If a restore operation is required, make sure that
you extract the backup archive files from the zip file first after ensuring that you have
enough disk space to do so.

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

Practices for Lesson 14: Backup and Recovery of Oracle SOA Suite
Chapter 14 - Page 5
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Backup and Recovery of Oracle SOA Suite
Chapter 14 - Page 6
Practices for Lesson 15:
Securing SOA Composite
Applications
Chapter 15

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

Practices for Lesson 15: Securing SOA Composite Applications


Chapter 15 - Page 1
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 15: Securing SOA Composite Applications


Chapter 15 - Page 2
Practices for Lesson 15

Practices Overview
In the practices for this lesson, the key tasks that you perform are:
• Creating a simple username token service security policy
• Applying the security policy to a service endpoint
• Testing the application without and with the credentials supplied in the client request

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

Practices for Lesson 15: Securing SOA Composite Applications


Chapter 15 - Page 3
Practice 15-1: Creating a Simple Username Token Security Policy

Overview
In this practice, you log in to the Oracle Fusion Middleware Control Console and use the Oracle
Web Services Manager policy management interface to create a simple security policy that can
be applied to a service endpoint. In this case, you use a WS-Security UsernameToken security
policy template and a logging template to create the policy.

Assumptions
• None

Tasks
To create a new security policy, perform the following tasks:
1. In a web browser window, if needed, log in to the Oracle Fusion Middleware Control
Console by performing the following steps:
a. Enter the URL http://admin.example.com:8080/em to access the Oracle Fusion
Middleware Control Console web application.
b. On the Login page, enter the username weblogic and the specified password, and
click Login.
2. To access the Web Services Policy management Web page, perform the following steps:
a. In Oracle Fusion Middleware Control Console, in the Target Navigation pane, expand
the WebLogic Domain folder and click edg_domain.

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

Practices for Lesson 15: Securing SOA Composite Applications


Chapter 15 - Page 4
b. On the Fusion Middleware Control page, click WebLogic Domain > Web Services >
WSM Policies.

3. On the WSM Policies page, perform the following steps to create a new policy:
a. Click Create.

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

Practices for Lesson 15: Securing SOA Composite Applications


Chapter 15 - Page 5
b. On the Policy Create page > General tab, enter or select the following field values:
Field Name Field Value
Name soa12c/admin_username_token_service_policy
Category Security
Description This policy requires WS-Security credentials
to be supplied with SOAP requests.
Applies To Service Bindings
Note: The description is optional. To save time, you do not enter the description, and
accept the default settings for all other fields. All policies are identified by the directory
in which the policy is located.

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

Practices for Lesson 15: Securing SOA Composite Applications


Chapter 15 - Page 6
Note: By default, the policy is disabled. If you want to enable the policy, select the
Enabled box. A policy that is not enabled is not enforced at run time. When selecting
the value of Service Bindings from the “Applies To” drop-down list, you can choose to
specify whether the policy can be attached to “Service Endpoint,” “Client,” or “Both.” In
this case, we accept the default of “Service Endpoint.”
4. To add the first policy assertion to the new policy, perform the following steps:
a. On the Policy Create page, click the Assertions tab, click Add, and select Assertion.

Note: The Create button is available only for the Security and Management categories.
You cannot edit the name of a policy after the policy is created. To change the policy
name, you need to copy the policy and assign it a different name.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 15: Securing SOA Composite Applications


Chapter 15 - Page 7
b. In the Add Assertion dialog box, enter the Name oracle/wss_username_token,
and click Search.

c. In the Template table, select oracle/wss_username_token_service_template,


and click Add Selected.

d. In the Selected Assertion Templates table, verify the security assertion that is added,
and click Add Assertion.

e. In the Assertions section, examine the default settings and details for the new
assertion, without changing any of the settings.

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

Practices for Lesson 15: Securing SOA Composite Applications


Chapter 15 - Page 8
5. To add the second assertion to the new policy, perform the following steps:
a. On the Assertion tab, click Add, and select Assertion.

b. In the Add Assertion dialog box, enter the Name oracle/security_log, and click
Search.

c. In the Template table, select oracle/security_log_template, and click Add


Selected.

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

Practices for Lesson 15: Securing SOA Composite Applications


Chapter 15 - Page 9
d. In the Selected Assertion Templates table, verify the log assertion that is added, and
click Add Assertion.

e. On the Assertions tab, examine the default settings for the Log Message assertion
(without changing any of the settings), select the Log Message entry, and click Move
Up.

Note: The assertions are invoked in the order in which they appear in the list.

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

Practices for Lesson 15: Securing SOA Composite Applications


Chapter 15 - Page 10
6. To save the policy definition, perform the following steps:
a. On the Web Services Policies > Policy Create page, click the General tab and select
Enabled.

Note: If an Information dialog box is displayed with the “Validation successful!”


message, click OK.
b. On the WSM Policies > Policy Create page, click Save.

Note: Clicking Save closes the Create Policy page.

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

Practices for Lesson 15: Securing SOA Composite Applications


Chapter 15 - Page 11
c. On the WSM Policies page, scroll down the list and verify that
soa12c/admin_username_token_service_policy is available and that it has a
check mark in its Enabled column.

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

Practices for Lesson 15: Securing SOA Composite Applications


Chapter 15 - Page 12
Practice 15-2: Applying the Security Policy to a Service Endpoint

Overview
In this practice, you deploy a ValidateCreditComposite application that performs credit card
validation. Before testing the application functionality, you attach the new security policy that
was created in Practice 15-1 to the ValidateCreditCard_ep service entry point of the
CreditCardValidation composite application. You test the service with and without supplying
security credentials.

Assumptions
You have created the WS-Security UsernameToken security policy by completing practice 15-1.
In addition, because the ValidateCreditComposite application uses a Database Adapter, which
is configured with the JDBC URL jdbc/soademo, the JDBC data source should already be
configured in the runtime environment along with its associated DbAdapter connection factory.
Note: The ValidateCreditComposite application uses the DbAdapter to query the data from the
CREDITCARDS table of the SOADEMO database schema, which should also already exist. The
steps needed to configure the database adapter and the database tables are described in the
practice for the lesson titled “Configuring High Availability.”

Tasks
1. To deploy the ValidateCreditComposite application, perform the following steps:
a. In a Command Prompt window (open a new one if needed), use the SOA archive to
deploy the ValidateCreditComposite application by executing the following two
commands:
$ cd /practices/practice15/deploy
$ /practices/scripts/deploy12c.sh
sca_ValidateCreditComposite_rev1.0.jar
b. Verify that deployment is successful by ensuring that you see the “Deploying
composite success” message just before the BUILD SUCCESSFUL message.

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

Practices for Lesson 15: Securing SOA Composite Applications


Chapter 15 - Page 13
Note: You are prompted for a username and password. Use the weblogic user and
the password for this account. Make sure that the “Composite deployment produced 0
warning/severe messages” message appears near the end of the output.
2. In a web browser window, if needed, log in to Oracle Enterprise Manager by performing the
following steps:
a. Enter the URL http://admin.example.com:8080/em to access the Oracle
Enterprise Manager web application.
b. On the Login page, enter the username weblogic and use the password for this user.
Click Login.
3. To locate the policy page for the ValidateCreditComposite application and attach the policy
to the ValidateCreditCard_ep entry point, perform the following steps:
a. In the Target Navigation pane, expand the SOA folder > soa-infra > default, and click
the ValidateCreditComposite [1.0] composite link.

b. On the ValidateCreditComposite [1.0] page, click the Policies tab.

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

Practices for Lesson 15: Securing SOA Composite Applications


Chapter 15 - Page 14
c. On the ValidateCreditComposite [1.0] Policies page, click “Attach To/Detach From” and
select ValidateCreditCard_ep.

d. On the “Attach/Detach Policies(validateCC_pt) Constraint” page, under the Available


Policies section, select the row containing the Name
soa12c/admin_username_token_service_policy, and click Attach.

Note: You can use the Search feature to make it easier to locate the desired policy. In
the Available Policies section, you enter soa12c in the Search field, and press Enter to
produce the list, filtering by name. Otherwise, scroll down the Available Policies page
to locate the soa12c/admin_username_token_service_policy entry.

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

Practices for Lesson 15: Securing SOA Composite Applications


Chapter 15 - Page 15
e. On the “Attach/Detach Policies(validateCC_pt)” page, under the Attached Policies
section, select the attached policy entry, and click Validate.

f. In the Information dialog box that has the “Validation is successful” message, click OK.
g. On the “Attach/Detach Policies(validateCC_pt)” page, confirm that the attached
soa12c/admin_username_token_service_policy is enabled, and click OK.

h. On the ValidateCreditComposite [1.0] Policies page, you can view the policy and the
service endpoint to which the policy is attached in addition to the security violation
information counters (use the horizontal scroll bar embedded in the page).

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

Practices for Lesson 15: Securing SOA Composite Applications


Chapter 15 - Page 16
Practice 15-3: Testing the Invocation of the Secured Service Endpoint

Overview
In this practice, you perform two tests to verify that the attached security policy is functional. You
use the ValidateCreditComposite Test Web Service page to initiate an instance:
• Without providing WS-Security credentials in the SOAP header
• By supplying the WS-Security credentials in the SOAP header

Assumptions
You have created the security policy, deployed the ValidateCreditComposite application, and
attached the security policy to the SOAP entry point of the composite application as described in
Practice 15-1 and Practice 15-2.

Tasks
1. In a web browser window, if needed, log in to Oracle Enterprise Manager by using the
following steps:
a. Enter the URL http://admin.example.com:8080/em to access the Oracle
Enterprise Manager web application.
b. On the Login page, enter the username weblogic and the password for this user, and
click Login.
2. To perform a test of the attached security policy, perform the following steps:
a. If needed, in the Oracle Fusion Middleware Control Console Target Navigation pane,
expand the SOA > soa-infra (soa_server1) > default tree, click the
ValidateCreditComposite [1.0] entry, and click the Policies page.
b. On the ValidateCreditComposite [1.0] page, click Test.

c. On the ValidateCreditComposite [1.0] > Test Web Service > Request tab page, expand
the request element in the Input Arguments section, enter the following field values,
and click Test Web Service:
Field Name Field Value
CCNumber 1234-1234-1234-1234
Amount 100

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

Practices for Lesson 15: Securing SOA Composite Applications


Chapter 15 - Page 17
d. After clicking Test Web Service, what is the result of the test?
1) Answer: The “Webservice invocation failed” window is displayed.

2) In the “Webservice invocation failed” window, expand Show Additional Trace


Information. What does it tell you? Use the following image as a guide:

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

Practices for Lesson 15: Securing SOA Composite Applications


Chapter 15 - Page 18
Note: As shown in the image, the marked text indicating an “error in processing
the WS-Security security header” is a hint of the answer. The answer is that you
did not provide the WS-Security information (a valid username and password),
which is sent in the request header when the WS-Security information is requested
to invoke the service.
An instance of the ValidateCreditComposite application is not created, which you
can verify if you look on the ValidateCreditComposite [1.0] Dashboard page.
However, first proceed with the next step of this practice.
3) Close the “Webservice invocation failed” window.
3. Because you have a log assertion in the security policy that is attached to the entry point of
the ValidateCreditComposite application, you can view the log messages for the SOAP
request and response body in the diagnostic.log file.
Note: Because the composite application executes in the context of a cluster, any of the
Managed Server instances could have processed the request. Therefore, to locate the
appropriate diagnostic.log file, you may have to look in the
/u01/oracle/config/domains/edg_domain/servers/soa_server1/logs/owsm
/msglogging folder on host01, and the
/u01/oracle/config/domains/edg_domain/servers/soa_server2/logs/owsm
/msglogging folder on host02. The diagnostic.log file can be opened with the gedit
command to view its contents.

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

Practices for Lesson 15: Securing SOA Composite Applications


Chapter 15 - Page 19
Tip: The image shows that the log messages are written to a file located on soa_server1.
However, the log message may have been written to the log file in the soa_server2 folder
tree, depending on the server instance that executed the process and generated the log
message. It may be better to locate the diagnostic log messages through Oracle Enterprise
Manager Fusion Middleware Control to eliminate the manual process of finding the correct
Managed Server instance folder for the server that processed the message.

Note: Ensure that you close the log file before continuing with the next step.
4. To execute the second test with the WS-Security credentials provided for the WSS
Username Token style of security, perform the following steps:
a. On the ValidateCreditComposite [1.0] > Test Web Service > Request tab page, in the
Security section, select the WSS Username Token option, enter weblogic in the
Username field and the password for the weblogic user in the Password field, and
click Test Web Service.
Note: You can scroll down and verify that Input Arguments retained the previous
values that were entered, where CCNumber is 1234-1234-1234-1234 and amount is
100, before you click Test Web Service.

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

Practices for Lesson 15: Securing SOA Composite Applications


Chapter 15 - Page 20
b. On the ValidateCreditComposite [1.0] > Test Web Service > Response page, verify
that you get a return value of VALID.

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

Practices for Lesson 15: Securing SOA Composite Applications


Chapter 15 - Page 21
Note: The ValidateCreditComposite application has a synchronous request-response
invocation style. If the WS-Security credentials are supplied and authenticated, you do
get a response as shown for the CCNumber and amount values documented.
5. For the successful invocation of the service with the security credentials supplied, if desired,
you can view the additional log messages that are written to the diagnostic.log file,
which is located in either the
DOMAIN_HOME/servers/soa_server1/logs/owsm/msglogging folder (on host01),
or the DOMAIN_HOME/servers/soa_server2/logs/owsm/msglogging folder (on
host02) where the DOMAIN_HOME value is
/u01/oracle/config/domains/edg_domain. You can open the diagnostic.log
file by using the gedit command to view its contents.

Note: Remember to close the log file when you have finished examining its contents.
In the preceding request log message, observe that the WS-Security elements for
Username and Password are visible in plain text. Therefore, consider adding additional
assertions to encrypt the information or use policies that include already implement
encryption assertions for sensitive information.
6. On the Oracle Fusion Middleware Control Console Web page, return to the
ValidateCreditComposite [1.0] Test Web Service page and click the
ValidateCreditComposite [1.0] link at the top of the page.

7. To monitor the ValidateCreditComposite [1.0] application policy data, perform the following
steps:
a. On the ValidateCreditComposite [1.0] page, click the Policies tab.

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

Practices for Lesson 15: Securing SOA Composite Applications


Chapter 15 - Page 22
Note: The one completed instance that is listed in the Recent Instances section is for
the successful invocation of the application when WS-Security credentials are
provided. An instance will not be created when security credentials are absent.
b. On the ValidateCreditComposite [1.0] > Policies tab page, use the horizontal scrollbar
below the attached policy to view the Security Violations information.

Note: In this case, the initial test is recorded as a violation by the value of 1 that
appears in the Total Violations column.
Tip: If you do not see any violations, repeat this step for the ValidateCreditComposite
[1.0] application in the soa-infra (soa_server2) environment by navigating to the
application page from the Target Navigation pane through the soa-infra (soa_server2)
tree.

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

Practices for Lesson 15: Securing SOA Composite Applications


Chapter 15 - Page 23
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 15: Securing SOA Composite Applications


Chapter 15 - Page 24
Practices for Lesson 16:
Using Enterprise Scheduler
Chapter 16

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

Practices for Lesson 16: Using Enterprise Scheduler


Chapter 16 - Page 1
Practices for Lesson 16

Practices Overview
Oracle Enterprise Scheduler Service (ESS) is a scheduler that is part of Oracle SOA Suite 12c.
ESS has an Enterprise Manager component to manage job requests, define metadata, and
schedule jobs. You first install Enterprise Scheduler Service. After installing and verifying that
Oracle Enterprise Scheduler Service is added to the domain, you learn how to trigger a
composite by using a scheduler and how to activate and deactivate adapters by using a
schedule.

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

Practices for Lesson 16: Using Enterprise Scheduler


Chapter 16 - Page 2
Practice 16-1: Extending the Domain with Oracle Enterprise Scheduler

Overview
In this practice, you extend the Oracle WebLogic edg_domain to include Oracle Enterprise
Scheduler Service (ESS). The task of extending the domain with Oracle Enterprise Scheduler
requires:
• Creating the ESS schemas in the Oracle Database with the Repository Creation Utility
• Extending edg_domain with the Oracle Enterprise Scheduler component and targeting
the component to the existing SOA Managed Servers
• Packing the extended domain and unpacking the updated configuration on the
Managed Server hosts
• Verifying the health and accessibility of the ESS services after starting the domain

Assumptions
• The Oracle WebLogic domain (edg_domain) has been created as an Enterprise
Deployment topology with a cluster of two SOA Managed Servers.
• The Oracle WebLogic domain is running.
• The Oracle Database is running.

Tasks
In this section, the tasks to be performed include:
• Creating the ESS schemas with the Repository Configuration Utility (RCU)
• Extending the existing edg_domain with the ESS components
• Propagating the domain configuration changes to the Managed Servers in the cluster
• Verifying that the ESS services are available
• Backing up the database and domain configuration

Creating the Enterprise Scheduler Schema


In this section, you run the Repository Creation Utility (RCU) to create the ESS schema.
1. In a Terminal window (either on host01 or host02), to start the RCU, enter the following
command:
$ $MW_HOME/oracle_common/bin/rcu
2. On the Repository Creation Utility wizard pages, take the following actions:
a. On the Welcome page, click Next.
b. On the Create Repository page, accept the default (or make the) selection combination
of the Create Repository option and the System Load and Product Load option, and
click Next.
c. On the Database Connection Details page, enter the following field values, and click
Next.
Field Name Value
Host Name host02.example.com
Port 1521
Service Name orcl

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

Practices for Lesson 16: Using Enterprise Scheduler


Chapter 16 - Page 3
Username sys
Password Enter the password for the database administrator. If
you are unsure of the value, ask your instructor.
Role SYSDBA should be selected.
Note: The Database Type field should already be set to Oracle Database.
d. In the “Repository Creation Utility – Checking Prerequisites” dialog box, which indicates
that the prerequisite checks are completed, click OK.
e. On the Select Components page, take the following actions:
1) Choose the “Select existing prefix” option with the prefix value EDG.
Note: When you select the existing prefix, the AS Common Schemas entry is
expanded in the Component column.
2) In the Component column, under the AS Common Schemas entry, select the
Oracle Enterprise Scheduler check box, and click Next.
Note: After selecting the Oracle Enterprise Scheduler check box, the Schema
Owner column value in that row is updated to EDG_ESS.

f. In the “Repository Creation Utility – Checking Prerequisites” dialog box, which indicates
that the schema check is complete, click OK.
g. On the Schema Passwords page, accept the selection of (or select) the “Use same
passwords for all schemas” option and enter the same password value in the Password
and Confirm Password fields. Click Next.
Tip: For simplicity, enter the same schema password that you used when creating the
schemas for Fusion Middleware Infrastructure.
h. On the Map Tablespaces page, review the information presented for the ESS schema
and the associated tablespace, and click Next.
i. In the “Repository Creation Utility – Confirmation” dialog box, click OK.

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

Practices for Lesson 16: Using Enterprise Scheduler


Chapter 16 - Page 4
j. In the “Repository Creation Utility – Creating Tablespaces” dialog box, wait for
tablespace creation to complete, and click OK.
k. On the Summary page, click Create.
Note: After clicking Create, the “Repository Creation Utility – System Load” dialog box
is displayed. Wait for the repository system load task to complete, and the dialog box
automatically closes when the task is complete.
l. On the Completion Summary page, optionally review the log files and click Close.
Note: In the event of an error, use the log files that are accessible through the
Completion Summary page to determine the cause and take action to correct the
issues before continuing with the practice.

Extending the Domain with SOA Components


With the SOA schema created, you now extend the existing edg_domain to include the SOA
components. However, to prevent any configuration locks, saves, or activations from occurring
while extending the configuration of the domain, you shut down the AdminServer and cluster
instances.
3. To shut down the AdminServer and the cluster of Managed Server instances, in a Terminal
window, enter the following command and provide suitable values for the prompts that are
displayed:
$ /practices/scripts/domain.sh shutdown
Username [weblogic]:
Password: password
Note: Wait for the domain shutdown to complete.
4. To start the Oracle WebLogic domain configuration wizard to extend the domain, enter the
following commands in a Terminal window:
$ $MW_HOME/oracle_common/common/bin/config.sh
5. When the Fusion Middleware Configuration Wizard starts, perform the following steps to
enter values on each page to extend the domain:
a. On the Create Domain page, select the “Update an existing domain” option, enter the
path /u02/oracle/config/domains/edg_domain in Domain Location field, and
click Next.

Note: Domain Location must include the full path name of the shared folder that was
created for the Administration Server domain home that was used when creating the
infrastructure domain.

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

Practices for Lesson 16: Using Enterprise Scheduler


Chapter 16 - Page 5
b. On the Templates page, ensure that the Update Domain Using Product Templates
option is selected. Then in the Available Templates section, select the following two
template entries, and click Next.
Templates
Oracle Enterprise Scheduler Service Basic - 12.1.3.0 [oracle_common]
Oracle Enterprise Manager Plugin for ESS - 12.1.3.0 [em]
Note: To select the preceding two templates, ensure that the Template Categories is
set to All Templates, as shown in the following image:

c. On the Database Configuration Type page, the RCU Data option should already be
selected (if not, select RCU Data). All related fields should also be pre-populated,
because you already configured the domain to reference the Fusion Middleware
schemas for the Infrastructure domain. Click Get RCU Configuration after you verify
that the following fields, database connection, and credential information are correct:
Field Name Value
Vendor Oracle
Driver *Oracle’s Driver (Thin) for Service connections; …
DBMS/Service ORCL
Host Name host02.example.com
Port 1521
Schema Owner EDG_STB
Schema Password The password entered when creating the schemas by
using the RCU tool
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Using Enterprise Scheduler


Chapter 16 - Page 6
Hint: Use the following image as a guide:

Note: Confirm that the output seen in the Connection Result Log indicates that the
operation succeeded.
d. On the JDBC Component Schema (Component Datasources) page, verify that the
ESS Schema and ESS MDS Schema row entries appear in the table, and click Next.

e. On the JDBC Component Schema Test (or JDBC Test) page, the testing of the two
ESS data source connections is performed. Verify that the connection tests for the ESS
Schema and ESS MDS Schema entries are successful, and click Next.

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

Practices for Lesson 16: Using Enterprise Scheduler


Chapter 16 - Page 7
f. On the Advanced Configuration page, to complete domain configuration for the
topology, select the “Managed Server, Clusters and Coherence” check box, and click
Next.

Note: Because memory resources are low in the classroom environment, you use
Advanced Configuration to target the ESS components to the existing SOA Managed
Servers instead of creating additional Managed Servers for ESS. In an environment
where you have more memory and additional physical hosts, you can create additional
Managed Servers and clusters for the ESS components. Due to memory constraints,
the decision is to depart from the EDG reference model and configure ESS to share
the same Managed Servers to which the SOA components are targeted.
g. On the Managed Servers page, make the following changes:
1) Select the automatically created ess_server1 entry by clicking in the Server Name
field, and click Delete to remove the additional Managed Server entry.

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

Practices for Lesson 16: Using Enterprise Scheduler


Chapter 16 - Page 8
2) For each SOA Managed Server (soa_server1 and soa_server2), click the Server
Groups column drop-down list and ensure that the ESS-MGD-SVRS group is
added to the others that are already selected. After setting the Server Groups for
both Managed Servers (as shown in the following image), click Next.

h. On the Clusters page, verify that the soa_cluster1 entry is present, and click Next.
i. On the Assign Servers to Clusters page, verify that the two Managed Servers
(soa_server1 and soa_server2) are assigned to soa_cluster1, and click Next.
j. On the HTTP Proxy Applications page, accept the defaults (do not enable the proxy
application), and click Next.
Note: The WebLogic domain configuration wizard presents the HTTP Proxy
Applications page when it detects that there is at least one Managed Server in a cluster
and a Managed Server not in a cluster in the same domain. Because the load balancer
Managed Server is in the same domain as the SOA Managed Server instances, the
HTTP Proxy Applications page is displayed. You accept the default of not creating a
proxy application for the cluster because the load balancer is already configured with
the HttpClusterServlet applications to manage the HTTP traffic as required.
k. On the Coherence Clusters page, accept the default settings, and click Next.
l. On the Machines page, click the Unix Machine tab to verify that the machines created
during initial Infrastructure domain creation are present, and click Next.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Using Enterprise Scheduler


Chapter 16 - Page 9
m. On the Assign Servers to Machines page, verify that AdminServer and lbr_server are
assigned to adm_machine; soa_server1 is assigned soa_machine1; and soa_server2
is assigned soa_machine2. Click Next.

n. On the Configuration Summary page, review the details, verify that the domain creation
information is correct, and click Update.
Note: After you click Update, the Configuration Progress page is displayed. Wait until
the configuration process completes.
o. On the Configuration Progress page, when the progress bar reaches 100% indicating
completion, click Next.
p. On the Configuration Success page, click Finish.
Note: Clicking Finish closes the configuration wizard.

Updating the Load Balancer Deployed Application Targets


Due to the way the implementation of the load balancer is configured in this course, the targets
for the deployed applications must be updated after extending the domain with Enterprise
Scheduler Service.
6. To update the application deployment targets in the load balancer configuration, in a
Terminal window, execute the following command:
$ /practices/lbr/upd_targets.sh

Packing the Extended Domain Configuration


Before starting the Managed Server instances again, you propagate the extended domain
configuration to the Managed Server configuration trees on host01 and host02.
Note: These steps (7–11) may take 20–30 minutes to complete.
7. To pack the extended domain configuration template, perform the following steps (on
host01):
a. In a Terminal window on host01, enter the following commands:
$ cd /practices/practice16
$ /practices/scripts/cpdomain.sh pack edgsoaess_template.jar
Note: The name of the template file is chosen to indicate that the packaged
configuration file is extended with SOA and ESS.
Alternatively, you can enter the following commands to perform the task manually:
$ cd $MW_HOME/oracle_common/common/bin
$ ./pack.sh -managed=true
–domain=$ASERVER
-template=/practices/practice16/edgsoaess_template.jar
-template_name=edgsoaess

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

Practices for Lesson 16: Using Enterprise Scheduler


Chapter 16 - Page 10
b. Verify that the template edgsoaess_template.jar file exists in
/practices/practice16 folder by entering the following command:
$ ls /practices/practice16
Note: The ls command should display the edgsoaess_template.jar file, which
should now be accessible to host02.

Unpacking the Extended Domain Configuration on Host01


Tip: To save time, you can start on the unpack operation on host02 (described in the next
section titled “Unpacking the Extended Domain Configuration on Host02”) while waiting for the
unpack operation on host01 to complete.
8. To unpack the extended domain configuration for the soa_server1 Managed Server on
host01, enter the following commands in a Terminal window:
$ cd /practices/practice16
$ /practices/scripts/cpdomain.sh unpack edgsoaess_template.jar
Note: The cd command is optional if you are using the same Terminal window that you
used to perform the pack operation.
To perform this task manually, you could enter the following commands:
$ cd $MW_HOME/oracle_common/common/bin
$ ./unpack.sh –domain=$MSERVER
-overwrite_domain=true
-template=/practices/practice16/edgsoaess_template.jar
-log_priority=DEBUG
-log=/practices/log/unpack_edgsoaess_template.log
-app_dir=$APPHOME

Unpacking the Extended Domain Configuration on Host02


In this section, you unpack the edgsoaess_template.jar file on host02.
9. Access host02 by using the existing or a new VNC session.
10. To unpack the extended domain configuration files for soa_server2, enter the following
commands in a Terminal window on host02:
$ cd /practices/practice16
$ /practices/scripts/cpdomain.sh unpack edgsoaess_template.jar

Starting the Extended Domain and Verifying That Transaction Log Files Are Created
Before you can verify the Oracle Enterprise Scheduler configuration, you must start the domain
servers, verify that the transaction log files are created, and assign the ESSAdmin role to the
SOA Administrator group.
11. To start up the edg_domain, enter the following command in a Terminal window (either on
host01 or host02):
$ /practices/scripts/domain.sh startup
Username [weblogic]:
Password: password
Note: Wait for all the domain servers to be started.

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

Practices for Lesson 16: Using Enterprise Scheduler


Chapter 16 - Page 11
12. After starting the Managed Servers in the cluster, to validate the location and creation of the
transaction logs files, enter the following command:
$ ls $ASERVER/soa_cluster1/tlogs
Note: The output for the ls command should display several .DAT files. The following two
are created for the ESS component for each of the two SOA Managed Server instances in
which the ESS services are running:
_WLS_SOA_SERVER11000000.DAT _WLS_SOA_SERVER2000000.DAT
Tip: In the course implementation, the Oracle Enterprise Scheduler components are
targeted to the same Managed Servers that are used for the SOA components. Therefore,
the configuring the default persistence store for transaction recovery step was not required
when extending the domain with the domain configuration wizard. Because the persistence
store for transaction recovery that was configured for the SOA Managed Servers is used by
ESS, the .DAT files contain the name of each SOA Managed Server. However, if a new
Managed Server is created for the ESS components, the default persistence store for
transaction recovery for that Managed Server needs to be configured and separate
transaction log files would be created in the folder that is configured for them.

Adding the ESSAdmin Role to the SOA Administrators Group


13. To add the ESSAdmin application role to the SOA Administrators group, perform the
following steps:
a. Log in to Enterprise Manager.
b. In the Target Navigation pane, select edg_domain.
c. On the edg_domain WebLogic Domain home page, click the WebLogic Domain menu.
d. Select Security > Application Roles.
e. On the Application Roles page, in the Search section, select ESSAPP from the
Application Stripe drop-down menu, and click the Search icon.

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

Practices for Lesson 16: Using Enterprise Scheduler


Chapter 16 - Page 12
Note: After entering the specified search filters and clicking the Search icon, the result
table is populated with matching role entries.
f. On the Application Roles page, in the Search section, from the results table, select the
ESSAdmin Role Name row, and click Edit.

g. On the “Edit Application Role: ESSAdmin” page, in the Members table section, observe
that the Administrators group is already a member, and click Add.

h. In the Add Principal dialog box, select Group from the Type drop-down menu, enter
SOA in the Principal Name field with the Starts With filter, and click the Search (right
arrow) icon . In the Searched Principals result table, select SOA Administrators and
click OK.

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

Practices for Lesson 16: Using Enterprise Scheduler


Chapter 16 - Page 13
Note: Clicking OK closes the Add Principal dialog box and adds the selected entry to
the Role member list.
i. On the “Edit Application Role: ESSAdmin” page, verify that the SOA Administrators
group also appears in the Members table, and click OK.

Note: After clicking OK on the “Edit Application Role: ESSAdmin” page, you are
returned to the Applications Role page with the Information message indicating that the
ESSAdmin role is updated as shown in the following image:

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

Practices for Lesson 16: Using Enterprise Scheduler


Chapter 16 - Page 14
14. Close all web browser windows.

Verifying the Oracle Enterprise Scheduler Configuration


15. To verify that the Oracle Enterprise Scheduler component is accessible and operational
through the load balancer, perform the following steps:
a. In a web browser window or on a page, enter the URL
http://soa.example.com:8080/EssHealthCheck.
Note: The load balancer being configured to redirect HTTP requests to the HTTPS
4443 port replaces the URL with https://soa.example.com:4443/EssHealthCheck.
b. In the Authentication Required dialog box, enter the User Name weblogic_soa and
the password that you assigned to the SOA administrator user when you added the
user to the LDAP directory server, and click OK.
Note: If prompted for remembering the password for the page, you can choose
whatever option you prefer.
c. Verify that the “ESS – Diagnostic health check service” page is displayed:

d. On the “ESS – Diagnostic health check service” page, click Check Health, and verify
that the message “ESS is up and running” is displayed as the response:

16. Close the “ESS – Diagnostic health check service” web browser window or page.

Backing Up the EDG Domain and Database Schemas


Because you successfully extended the SOA domain and cluster with ESS, it is a best practice
and highly recommended that you perform a backup operation.
Hint: However, because this is the last practice for this course, the backup steps have been
documented here and are completely optional (not required).

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

Practices for Lesson 16: Using Enterprise Scheduler


Chapter 16 - Page 15
Tip: Before you continue with the backup task here, consider removing some of the backup Zip
files from the /u02/backup folder, which was created following the backup tasks performed
through the course. This is suggested to make sure that there is sufficient space for backup
files.
17. To back up the SOA and ESS cluster configuration, perform the following steps:
a. In a Terminal window on host01, enter the following commands:
$ /practices/scripts/domain.sh shutdown
Username [weblogic]:
Password: password
Note: To get a consistent backup, the domain is shut down first.
b. On host01, use the following backup.sh script commands with a second parameter to
identify the backup files with the tag (or label) name soaess.
$ /practices/scripts/backup.sh admin soaess
$ /practices/scripts/backup.sh apps soaess
$ /practices/scripts/backup.sh managed soaess
Tip: You can execute the preceding backup commands on host01 at the same time as
running the backup commands for host02, which is listed in the next step.
c. In a Terminal window on host02, enter the following commands:
Note: This time, you also back up the LDAP configuration.
$ /practices/scripts/backup.sh managed soaess
$ /practices/scripts/backup.sh ldap soaess
$ /practices/scripts/backup.sh db soaess
d. Start up the domain by entering the following command in a Terminal window (on
host01 or host02).
Note: Do not start up the domain until all the backup operations have completed.
$ /practices/scripts/domain.sh startup
Username [weblogic]:
Password: password
18. To compress the space consumed by the collection of backup archive (tar) files, enter the
following command in a Terminal window (either on host01 or host02):
$ cd /u02/backup
$ zip soaess.zip *.tar
$ rm *.tar
Note: The rm command deletes the backup archive files to reclaim the disk space that is
needed for the remaining course practices. The zip command packages all related backup
archive files into a single compressed file. If a restore operation is required, make sure that
you extract the backup archive files from the zip file first, and that you have enough disk
space to do so.
In summary, you have extended the SOA cluster with Oracle Enterprise Scheduler that has
been targeted to the two SOA Managed Servers in the SOA cluster. You have assigned the
ESSAdmin role to the SOA Administrator, verified that the transaction log files are successfully
created, verified that the Oracle Enterprise Scheduler component is operational, and taken a
backup of the extended domain configuration and database schemas.

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

Practices for Lesson 16: Using Enterprise Scheduler


Chapter 16 - Page 16
Practice 16-2: Activating and Deactivating Adapters by Using ESS

Overview
In this practice, you activate and deactivate adapters by using ESS functionality.

Assumptions
• You have completed practice 16-1 successfully.

Tasks
In this practice, you deploy an application that uses an inbound file adapter. You then activate
and deactivate the inbound file adapter, and observe the changes in behavior.

Deploying the Application


1. Deploy the application.
a. Open a Terminal window.
b. In the open Terminal window, issue the following commands:
$ cd /practices/practice16/scripts
$ ./deploy_essDemo.sh
c. When prompted, supply the username weblogic and the password for the weblogic
user.
The script runs and reports successful deployment of the application.

Creating a Schedule in ESS Enterprise Manager

2. Log in to Enterprise Manager as the weblogic_soa user.


3. In Enterprise Manager, navigate to the schedule creation screen:
a. In the Target Navigation pane, right-click Scheduling Services > ESSAPP
(soa_cluster1).
b. Select Job Requests > Define Schedules.

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

Practices for Lesson 16: Using Enterprise Scheduler


Chapter 16 - Page 17
c. Click Create.

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

Practices for Lesson 16: Using Enterprise Scheduler


Chapter 16 - Page 18
4. Configure the deactivation schedule.
a. Use the following information to set fields for the deactivate schedule. Leave any field
that is not listed with its default value.
Field Name Field Value
Name deactivateSchedule
Display Name deactivateSchedule
Package soa
Note: The package field may show the prefix path
/oracle/apps/ess/custom, before the actual field
text box.
Frequency Hourly/Minute
Every 0 hours 3 minutes
Start Date Set to 5 minutes from now.
End date Specify an end date a week or more in the future.
b. Verify your work and click OK.

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

Practices for Lesson 16: Using Enterprise Scheduler


Chapter 16 - Page 19
5. Repeat the preceding steps to configure the activation schedule. Leave any field that is not
listed with its default value.
Field Name Field Value
Name activateSchedule
Display Name activateSchedule
Package soa
Note: The /oracle/apps/ess/custom package
prefix path may appear before the actual field text
box.
Frequency Hourly/Minute
Every 0 hours 3 minutes
Start Date Set to 8 minutes from now.
End date Specify an end date a week or more in the future.
Note: Verify your work and click OK. The two schedules are listed as shown in the following
image:

Applying the Schedules to the Adapter


In this step, you schedule the adapter to activate and deactivate.
6. In the Target Navigation pane of Enterprise Manager, select the essDemo composite.

7. Select the inputFile adapter in the composite.

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

Practices for Lesson 16: Using Enterprise Scheduler


Chapter 16 - Page 20
The following screen is displayed. The arrow at the top left shows that the adapter is active.

8. Click the Adapter Schedules icon on the top-right to define the activate and deactivate
schedule as shown in the preceding step.
9. Select the two schedules.

10. Click Apply Schedules.


Note: On the service screen, notice the arrow on the upper-left. This indicates the state of
the adapter.
11. Refresh the screen periodically. At the scheduled times, the adapter deactivates and
activates, and the arrow direction changes every 3 minutes (or based on the frequency that
you configured).

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

Practices for Lesson 16: Using Enterprise Scheduler


Chapter 16 - Page 21
12. While the adapter is deactivated, execute the following commands in a Terminal window:
$ cd /practices/practice16/scripts
$ nohup ./makeData.sh &
Note: The makeData.sh script creates an input file for the deployed application every 10
seconds for the next 10 minutes. As long as the adapter is running, these files are picked
up and written to /practices/practice16/output. When the adapter is deactivated,
the input files begin to accumulate in the /practices/practice16/input directory.
When the adapter is reactivated, the accumulated files are picked up and written to the
output directory.
13. Verify the preceding behavior by observing the input and output directories of
/practices/practice16.
14. Return to the adapter activate/deactivate screen. Click Remove Schedules.
Note: The activate/deactivate jobs are canceled.

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

Practices for Lesson 16: Using Enterprise Scheduler


Chapter 16 - Page 22
Appendix A
Chapter 17

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

Appendix A
Chapter 17 - Page 1
Appendix A

Appendix Overview
This appendix contains instructions that guide you through examining the configuration of the
load balancer as a stand-alone WebLogic Managed Server implementation.
Note: This type of load balancer implementation is not recommended for production purposes; it
is intended only for instructional purposes. There are better more lightweight methods for
accomplishing the same task.

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

Appendix A
Chapter 17 - Page 2
Appendix A-1: Examining the Load Balancer HttpClusterServlets

Overview
The steps in this section guide you through the process of examining the HttpClusterServlet
instances that are deployed to the load balancer Managed Server. The HttpClusterServlet
instances receive requests from clients and forward (load balance) the requests either to the
AdminServer or to the clustered Managed Server instances in edg_domain.

Assumptions
• None

Tasks
1. To verify that the load balancer configuration is successfully completed, perform the
following in the Oracle WebLogic Server Administration Console:
Note: If required, sign in to the Oracle WebLogic Server Administration Console as the
administrator again.
a. In the Domain Structure panel, expand Environment and click Servers. On the
“Summary of Servers” page, verify that the lbr_server server entry appears in the
Servers table.

Note: The lbr_server entry is managed by the Node Manager on adm_machine and
the Listen Port is set to 8080.

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

Appendix A
Chapter 17 - Page 3
Tip: The State and Health values for lbr_server in the Servers table may be different
depending on when you perform the steps that are listed in this section of the course
material. For example, if lbr_server is started, the following image shows the expected
State and Health values that you may see:

b. On the “Summary of Servers” page, click the lbr_server Name link. On the “Settings for
lbr_server” page, under the Configuration > General tab pages, verify that the Listen
Address is soa.example.com and that the Listen Port 8080 and SSL Listen Port 4443
are both enabled.

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

Appendix A
Chapter 17 - Page 4
Note: The main listen address and ports that are shown here are used for access to
the SOA applications and the SOA clustered Managed Server instances.
c. On the “Settings for lbr_server” page, click the Protocols > Channels tab, and verify the
following:
− The Admin_Chan entry exists with the Listen Address admin.example.com and
Listen Port 8080.
− The SoaInt_Chan entry has the Listen Address soainternal.example.com with Listen
Port 8080.

Note: These two WebLogic Server channels are used to direct the HTTP requests on
their respective Listen Address and Port combinations to the appropriate server or
cluster instances in edg_domain.
d. To confirm that each network channel is associated with its own WebLogic virtual host
entry, in the Domain Structure panel, under Environment, click Virtual Hosts and
confirm the following:
− The Admin_vHost entry is associated with the Admin_Chan channel.
− The SoaInt_vHost entry is associated with the SoaInt_Chan channel.

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

Appendix A
Chapter 17 - Page 5
Note: The Virtual Hosts are components that are configured to accept requests for the
AdminServer (Admin_vHost) and internal requests for the SOA clustered servers
(SoaInt_vHost).
General Configuration Note: At this stage, you have verified that the main URL
“hostname:port” combinations have been configured to accept requests from clients, either
through the Managed Server listen address and port combination or those configured in the
virtual host and their associated channels.
2. To view the three deployed HttpClusterServlet applications, perform the following steps:
a. In the Oracle WebLogic Administration Console Domain Structure panel, click
Deployments.

b. On the “Summary of Deployments” page, in the Deployments table, verify that the
admin_httpc_servlet Web Application appears and that its Targets column contains
Admin_vHost.

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

Appendix A
Chapter 17 - Page 6
Note: The admin_httpc_servlet is configured to direct requests to the
adminvh.example.com host on port 7001. You open the WAR file to view this
information in the web.xml web application deployment descriptor.
c. On the “Summary of Deployments” page, click Next several times until you see the
soaint_httpc_servlet and soa_httpc_servlet entries.
Note: The Next link is on the right side of the Deployments table, above table
headings.

Hint: The entries appear when you get to the page “Showing 91 to 100 of 107.”

Note: soaint_httpc_servlet and soa_httpc_servlet both direct requests to either of the


two SOA virtual machines (soavh01 and soavh02) in the SOA cluster on port 8001.
The difference in their respective web.xml files is to configure HTTP requests to the
soa.example.com port 8080 to be redirected to the soa.example.com 4443 SSL port.

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

Appendix A
Chapter 17 - Page 7
3. To examine the HttpClusterServlet web application configuration for the Managed Servers
and each of its channels, perform the following steps:
a. On the host01 or host02 desktop, right-click the “oracle’s Home” desktop icon and
select Browse Folder to open the File Browser.

b. In the File Browser window, click the icon on the extreme left under the main toolbar to
change the path from buttons to a Location field.

c. In the File Browser window, in the Location field, enter /practices/lbr and press
Enter. When the files are displayed for the selected folder, right-click
admin_httpc_servlet.war and click “Open with Archive Mounter.”

d. In the File Browser window’s Places panel, click the admin_httpc_servlet.war


entry to display its contents in the right panel. In the right panel, expand WEB-INF,
right-click web.xml, and select “Open with gedit.”

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

Appendix A
Chapter 17 - Page 8
e. On the text editor’s web.xml tab page, locate the first <init-param> entry and verify
that the WebLogicCluster parameter value contains adminvh.example.com:7001.

Note: The WebLogicCluster configuration parameter causes the HTTP requests


that are sent to the admin.example.com:8080 URL to be forwarded to the actual
AdminServer instance at adminvh.example.com:7001.
f. Close the text editor window and the web.xml file, and dismount the
admin_httpc_servlet.war file by clicking the “eject” (or unmount) icon next to the
WAR file name in the Places panel.
g. In the File Browser window, (if required) navigate to the /practices/lbr folder,
right-click soa_httpc_servlet.war and select “Open with Archive Mounter.”
Navigate to and open its WEB-INF/web.xml file in the gedit text editor. Verify that the
WebLogicCluster configuration parameter value is “soavh01.example.com:8001|
soavh02.example.com:8001”.

Note: The WebLogicCluster parameter value directs requests to soa.example.com


port 8080 or 4443 to either the actual soavh01.example.com:8001 or the
soavh02.example.com:8001 host instance by using a default round-robin approach.

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

Appendix A
Chapter 17 - Page 9
Tip: If you scroll to the end of the edit window and locate the <user-data-
constraint> XML element, it should contain the <transport-
guarantee>CONFIDENTAL</transport-guarantee> element, which causes non-
SSL requests on port 8080 to be redirected to the SSL port on 4443.

h. Optionally, in the File Browser window, (if required) navigate to the /practices/lbr
folder, locate and open the soaint_httpc_servlet.war file with the Archive
Mounter, and navigate to and open its WEB-INF/web.xml file in the gedit text editor.
Verify that the value of the WebLogicCluster parameter is also
“soavh01.example.com:8001| soavh02.example.com:8001.” However, the
<transport-guarantee> child element of the <user-data-constraint>
element has the value NONE.

Note: In this case, the soainternal.example.com requests are not redirected to the SSL
port. However, redirection still occurs due to the Frontend Host setting in the domain
cluster configuration.

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

Appendix A
Chapter 17 - Page 10
Practice Script Source Code
Chapter 18

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

Practice Script Source Code


Chapter 18 - Page 1
Practice Script Source Code

This section contains the listing of all the practice scripts that are used for simplifying the
administration tasks that are performed during the course. Although the scripts are generic, they
are intended for use in the classroom environment and should not be considered as supported
software. The scripts are presented as follows as examples of how you can automate many of
the administrative tasks that can be performed by using command-line tools.
DISCLAIMER:
These scripts are provided for educational purposes only. These scripts are NOT supported by
Oracle World Wide Technical Support.
These scripts have been tested and appear to work as intended in the context of this course.
You should always run new scripts on a test instance initially.

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

Practice Script Source Code


Chapter 18 - Page 2
Scripts from the /practices/scripts Folder
Some of the scripts presented in this section are not used in the practices. However, the
additional scripts have been provided to simplify some repetitive tasks that an instructor (or
student) may perform. One example is the nmctl.sh script, which starts all the Node Manager
instances on each host, and depends on appropriate ssh security to be configured so that
commands can be executed across host01 and host02 without a password.
Note: The domain.sh and domain.py scripts, which work together, prompt for a single
password that is used for connecting to the Node Manager and the Administration Server
instances for starting and shutting down servers in the same WebLogic domain. Although the
username and password for the WebLogic Node Manager administrator is chosen to be the
same as the WebLogic Administration Server in this course, the domain.py WLST script would
not work without modification if the Node Manager and Administration Server username and
passwords are configured with different values during domain creation.

Script: addenv.sh
#!/bin/bash
cat /practices/scripts/setenv.sh >> $HOME/.bashrc
echo "$HOME/.bashrc updated."

Script: adminserver.py
if len(sys.argv) == 0:
print "Usage: wlst adminserver.py [start|stop|status]"
exit()
else:
if sys.argv[1] != "start" and sys.argv[1] != "stop" and sys.argv[1]
!= "status":
print "Usage: wlst adminserver.py [start|stop|status]"
exit()

domain_name="edg_domain"
try:
domain_path = os.environ["ASERVER"]
except:
domain_path="/u02/oracle/config/domains/" + domain_name

#lhost=java.net.InetAddress.getLocalHost().getHostName()
lhost="adminvh.example.com"
nmhost=raw_input("Hostname ["+ lhost +"]: ")
if not nmhost:
nmhost=lhost

luser="weblogic"
nmuser=raw_input("NM Username ["+ luser +"]: ")

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

Practice Script Source Code


Chapter 18 - Page 3
if not nmuser:
nmuser=luser

nmpsw="".join(System.console().readPassword("%s",["NM Password: "]))


if not nmpsw:
print "Error: Please enter the WebLogic administrator password."
exit()

#print "Domain: " + domain_path


#print "Host: " + nmhost
#print "User: " + nmuser

bootpfile=domain_path+"/servers/AdminServer/security/boot.properties"
bootpexists=os.path.exists(bootpfile)
if not bootpexists:
print "Error: "+ bootpfile +" does not exist yet. Please create the
file."
exit()

try:
# Connect to NodeManager in order to start AdminServer
nmConnect(nmuser, nmpsw, nmhost, 5556, domain_name, domain_path,
'ssl')

if sys.argv[1] == "start":
#Start Admin Server using NodeManager (boot.properties file must
exist first)
nmStart('AdminServer')
print "AdminServer started."
elif sys.argv[1] == "stop":
nmKill('AdminServer')
print "AdminServer killed or stopped."
elif sys.argv[1] == "status":
redirect('/dev/null','false')
print "AdminServer " + nmServerStatus('AdminServer')
stopRedirect()
else:
print "Error: '" + sys.arv[1] + "' is an invalid command line
parameter."

nmDisconnect()
except:
print "ERROR... check error messages for cause."

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

Practice Script Source Code


Chapter 18 - Page 4
exit()

Script: adminserver.sh
#!/bin/bash
# chkconfig: 345 99 10
#
SVCNAME="WebLogic Node Manager"
LOGFILE=/practices/log/$(basename $0 .sh).log
MW_HOME=/u01/oracle/product/fmw
DOMAIN_HOME=/u02/oracle/config/domains/edg_domain
JAVA_HOME=/usr/java/latest
PATH=$JAVA_HOME/bin:$PATH
WLST=/u01/oracle/product/fmw/oracle_common/common/bin/wlst.sh

function mlog() {
TSTAMP=$(date +"%F %H:%M:%S")
echo -e "[${TSTAMP}] $1" | tee -a $LOGFILE
}

case "$1" in
start|stop|status)
$WLST /practices/scripts/adminserver.py $1
;;
*)
echo "Usage: $0 {start|stop|status}"
exit 3
;;
esac

Script: auth.sh
#!/bin/bash
DATADIR=${2:-/practices/practice03}
case "$1" in
backup)
echo "Backing up server authentication configuration files to
$DATADIR ..."
tar cvf $DATADIR/auth_data.tar $ASERVER/config/config.xml
$ASERVER/config/fmwconfig/jps-config.xml
$ASERVER/config/fmwconfig/system-jazn-data.xml
$ASERVER/servers/AdminServer/security/boot.properties
;;
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practice Script Source Code


Chapter 18 - Page 5
restore)
if [ -f $DATADIR/auth_data.tar ]; then
echo "Restoring server authentication configuration files from
$DATADIR ..."
tar xvf $DATADIR/auth_data.tar -C /
fi
;;
*)
echo "Usage: $0 {backup|restore} [folder-path]"
exit 3
;;
esac

Script: backup.sh
#!/bin/bash

function backupDb() {
if [ -z $ORACLE_BASE ]; then
echo "Warning: \$ORACLE_BASE environment variable not set. Run on
host where database is configured."
exit 1
fi
echo "Start database backup with tag ${TAG^^}..."
sqlplus -s "/ as sysdba" <<-END
PROMPT Shutting down database...
SHUTDOWN IMMEDIATE;
EXIT
END
BACKUP_FILE=${BACKUP_DIR}/db_${TAG}.tar
tar c${V}pf ${BACKUP_FILE} ${ORACLE_BASE}/oradata/${ORACLE_SID}/* \
${ORACLE_BASE}/fast_recovery_area/${ORACLE_SID}/*
sqlplus -s "/ as sysdba" <<-END
PROMPT Starting up database...
STARTUP;
EXIT
END

echo "End database backup."


}

function backupAdminDomain() {
echo "Start AdminServer Domain backup with id ${TAG}..."

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

Practice Script Source Code


Chapter 18 - Page 6
BACKUP_FILE=${BACKUP_DIR}/admindomain_${TAG}.tar
echo "Creating backup file ${BACKUP_FILE} ..."
tar c${V}pf ${BACKUP_FILE} ${ASERVER}
echo "End AdminServer Domain backup."
}

function backupDeployPlans () {
echo "Start Deployment Plans backup with id ${TAG}..."
BACKUP_FILE=${BACKUP_DIR}/deployplans_${TAG}.tar
echo "Creating backup file ${BACKUP_FILE} ..."
tar c${V}pf ${BACKUP_FILE} ${DEPLOY_PLAN_HOME}
echo "End Deployment Plans backup."
}

function backupAdminApps() {
echo "Start AdminServer Applications backup with id ${TAG}..."
BACKUP_FILE=${BACKUP_DIR}/adminapps_${TAG}.tar
echo "Creating backup file ${BACKUP_FILE} ..."
tar c${V}pf ${BACKUP_FILE} ${APPHOME}
echo "End AdminServer Applications backup."
}

function backupDeployPlans () {
echo "Start Deployment Plans backup with id ${TAG}..."
BACKUP_FILE=${BACKUP_DIR}/deployplans_${TAG}.tar
echo "Creating backup file ${BACKUP_FILE} ..."
tar c${V}pf ${BACKUP_FILE} ${DEPLOY_PLAN_HOME}
echo "End Deployment Plans backup."
}

function backupManagedConfig() {
HOST=$(hostname -s)
echo "Start Managed Server backup on host ${HOST} with id ${TAG}..."
BACKUP_FILE=${BACKUP_DIR}/managedconfig_${TAG}_${HOST}.tar
echo "Creating backup file ${BACKUP_FILE} ..."
tar c${V}pf ${BACKUP_FILE} ${MSERVER}
echo "End Managed Server backup."
}

function backupOUD() {
OUD_HOME=/u02/oracle/product/fmw/asinst_1/OUD
BACKUPDIR=${BACKUP_DIR}

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

Practice Script Source Code


Chapter 18 - Page 7
echo "Backing up the OUD directories..."
$OUD_HOME/bin/backup --backUpAll --compress --backupDirectory
${BACKUPDIR}/oud --backupID ${TAG}
cd ${OUD_HOME}
echo "Backing up the OUD config folder..."
tar cp${V}f ${BACKUPDIR}/oud/config_${TAG}.tar config/
echo "Backing up the OUD logs folder..."
tar cp${V}f ${BACKUPDIR}/oud/logs_${TAG}.tar logs/
cd ${BACKUPDIR}
echo "Creating backup archive..."
tar cp${V}f ${BACKUPDIR}/oud_${TAG}.tar oud/
rm -rf ${BACKUPDIR}/oud
echo "Backup complete."
}

# Use parameter $2 as a tag and default to day and time in


yymimdd_HHMMSS format
TAG=${2:-$(date +%y%m%d_%H%M%S)}
V=${VERIFY}

BACKUP_DIR=/u02/backup
ASERVER=${ASERVER:-/u02/oracle/config/domains/edg_domain}
APPHOME=${APPHOME:-/u02/oracle/config/applications/edg_domain}
MSERVER=${MSERVER:-/u01/oracle/config/domains/edg_domain}
DEPLOY_PLAN_HOME=/u02/oracle/config/dp

case "$1" in
db)
backupDb ;;
admin)
backupAdminDomain ;;
apps)
backupAdminApps ;;
dplan)
backupDeployPlans ;;
managed)
backupManagedConfig ;;
ldap)
backupOUD ;;
*)
echo "Usage: $0 {admin|apps|db|dplan|ldap|managed} [tag/id]"
exit 1
;;
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practice Script Source Code


Chapter 18 - Page 8
esac

Script: build12c.xml
<project name="deploy" default="help">
<!-- This build file was automatically generated at 10:05:29 PM on
Jul 14, 2010 by weblogic.BuildXMLGen -->
<!-- BUILD PROPERTIES ADJUST THESE FOR YOUR ENVIRONMENT -->
<property name="app.name" value="default-name"/>
<property name="server.targets" value="soa_server1"/>
<property name="ear" value="${dist.dir}/${app.name}.ear"/>
<property name="verbose" value="true"/>
<property name="adminurl" value="t3://adminvh.example.com:7001"/>
<!-- Print's out the project help -->
<path id="weblogic.classpath">
<fileset dir="/u01/oracle/product/fmw/wlserver/server/lib">
<include name="weblogic.jar" />
<include name="*.jar" />
</fileset>
</path>

<taskdef name="wldeploy"
classname="weblogic.ant.taskdefs.management.WLDeploy">
<classpath refid="weblogic.classpath"/>
</taskdef>

<target name="help">
<java fork="no" classname="org.apache.tools.ant.Main">
<arg line="-projecthelp"/>
</java>
</target>
<!-- Builds the entire deploy application -->
<!-- Only compiles deploy application, no appc -->
<!-- Deletes the dest.dir to clean the build -->
<!-- Runs weblogic.appc on your application -->
<!-- Deploys the entire deploy application -->
<!-- target name="deploy"
description="Deploys (and redeploys) the entire deploy
application">
<wldeploy user="${user}" password="${password}"
adminurl="${adminurl}"
action="deploy" source="${ear}" name="${app.name}"/>
</target -->

<!-- Undeploys the entire deploy application -->


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

Practice Script Source Code


Chapter 18 - Page 9
<target name="undeploy" description="Undeploys the entire deploy
application">
<wldeploy user="${user}" password="${password}"
adminurl="${adminurl}"
action="undeploy" name="${app.name}"/>
</target>

<target name="deploy"
description="Deploys (and redeploys) the entire deploy
application">
<wldeploy action="deploy" name="${app.name}"
source="${ear}" library="false"
user="${user}" password="${password}"
verbose="false" adminurl="${adminurl}"
remote="true" upload="true"
targets="${server.targets}" />
</target>

<!-- Undeploys the entire deploy application -->


<!-- Package a standard J2EE ear for distribution -->
<!-- Package a standard exploded J2EE ear for distribution -->
<!-- Configure WebLogic Server with resources required by
application -->
<!-- For example you can configure JDBCConnection Pools and Data
Sources, and JMS Destinations etc -->
</project>

Script: configmds.py
if len(sys.argv) == 0:
print "Usage: wlst configmds.py [/path/|path/]filename.ear"
exit()

print "Updating adf-config.xml in file: " + sys.argv[1]


print "Setting repository=mds-soa, partition=soa-infra, type=DB,
jndipath=jdbc/mds/MDS_LocalTxDataSource,..."
archive = getMDSArchiveConfig(fromLocation=sys.argv[1])
archive.setAppSharedMetadataRepository(namespace='/soa/shared',
repository='mds-soa', partition='soa-infra', type='DB',
jndi='jdbc/mds/MDS_LocalTxDataSource')
print "Saving changes to file: " + sys.argv[1]
archive.save(toLocation=sys.argv[1])
print "File: " + sys.argv[1] + " updated."

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

Practice Script Source Code


Chapter 18 - Page 10
Script: configmds.sh
#!/bin/bash

while getopts "v" opt; do


case $opt in
v)
VIEWMDS=true;;
\?)
echo "Invalid option: -$OPTARG" >&2 ;;
esac
done
shift $((OPTIND-1))

WLST=/u01/oracle/product/fmw/oracle_common/common/bin/wlst.sh
EARFILE=$1
if [ -z ${EARFILE} ]; then
echo "Usage: $0 [/path/|path/]filename.ear"
exit 1
else
if [ -f ${EARFILE} ]; then
if [ -z ${VIEWMDS} ]; then
${WLST} /practices/scripts/configmds.py ${EARFILE}
else
jar xf ${EARFILE} adf/META-INF/adf-config.xml
sed -rn -e '/metadata-store-usages/,/\/metadata-store-usages/ p'
adf/META-INF/adf-config.xml
rm -rf adf/
fi
else
echo "File '${EARFILE}' not found."
exit 1
fi
fi

Script: cpdomain.sh
#!/bin/bash
MW_HOME=${MW_HOME:-/u01/oracle/product/fmw}
ASERVER=${ASERVER:-/u02/oracle/config/domains/edg_domain}
MSERVER=${MSERVER:-/u01/oracle/config/domains/edg_domain}
APPHOME=${APPHOME:-/u02/oracle/config/applications/edg_domain}
LOGDIR=/practices/log

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

Practice Script Source Code


Chapter 18 - Page 11
TEMPL_FILE=${2:-/practices/practice03/edgdomain_template.jar}
TEMPL_NAME=${TEMPL_FILE%.*}

# If the file name does not have a path prefix then add the current
working directory
if [[ "${TEMPL_FILE}" == "${TEMPL_FILE%/*.*}" ]]; then
TEMPL_FILE=${PWD}/${TEMPL_FILE}
fi

cd $MW_HOME/oracle_common/common/bin
case "$1" in
pack)
echo "Packing domain in template file ${TEMPL_FILE}..."
./pack.sh -managed=true -domain=${ASERVER} -template=${TEMPL_FILE} -
template_name=${TEMPL_NAME}
;;
unpack)
echo "Unpacking domain from template file ${TEMPL_FILE}..."
./unpack.sh -domain=${MSERVER} -overwrite_domain=true -
template=${TEMPL_FILE} -log_priority=DEBUG \
-log=${LOGDIR}/${1}_${TEMPL_NAME}.log -
app_dir=${APPHOME}
;;
*)
echo "Usage: $0 {pack|unpack} [[path/]template_file_name]"
exit 3
;;
esac

Script: deploy12c.sh
#!/bin/bash

#path found
#/u01/oracle/product/fmw/wlserver

export
ANT_HOME=/u01/oracle/product/fmw/oracle_common/modules/org.apache.ant_
1.9.2
export PATH=${PATH}:${ANT_HOME}/bin

#echo "$PATH"

export SOA_HOME=/u01/oracle/product/fmw/soa
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practice Script Source Code


Chapter 18 - Page 12
export SOA_BIN=${SOA_HOME}/bin
#export SOA_HOST=http://adminvh.example.com:7001
export SOA_HOST=http://soainternal.example.com:8080

export SAR_FILE=$1
export CONFIG_PLAN=$3
export PARTITION=$2

if [ -z "$SAR_FILE" ]
then
echo "To deploy a composite application use the following
syntax:"
echo ". "
echo " Usage: deploy12c.sh sar-file-name [partition] [config-
plan]"
echo ". "
echo " Revision is derived from the SAR file name. The sar-file-
name must be provided."
echo " The config-plan is the XML file name for the
configuration plan (if any)."
echo " The partition is set to 'default' unless specified as the
third parameter."
echo ". "
exit 1
fi

if [ -z "$PARTITION" ]
then
export PARTITION=default
echo "Setting Partition : $PARTITION"
fi

if [ -n "$CONFIG_PLAN" ]
then
export CONFIG_PLAN=-Dconfigplan=$CONFIG_PLAN
echo "Setting Configuration Plan : $CONFIG_PLAN"
fi

echo "Final SAR File : ${SAR_FILE}"


echo "Final Configuration Plan : $CONFIG_PLAN"
echo "Final Partition : $PARTITION"

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

Practice Script Source Code


Chapter 18 - Page 13
ant -f $SOA_BIN/ant-sca-deploy.xml -DserverURL=$SOA_HOST -
DsarLocation=$SAR_FILE -Doverwrite=true -DforceDefault=true
$CONFIG_PLAN -Dpartition=$PARTITION

#end

Script: deploy_ear.sh
#!/bin/bash

#path found
#/u01/oracle/product/fmw/wlserver

#export
ANT_HOME=/u01/oracle/product/fmw/oracle_common/modules/org.apache.ant_
1.9.2
#export PATH=${PATH}:${ANT_HOME}/bin

export SOA_HOME=/u01/oracle/product/fmw/soa
export SERVER_HOME=/u01/oracle/product/fmw/wlserver/server
export PATH=${PATH}:${SERVER_HOME}/lib:${SERVER_HOME}/lib/weblogic.jar
echo "$PATH"
#export SOA_HOST=http://adminvh.example.com:7001
export SOA_HOST=http://soainternal.example.com:8080

export APP_NAME=$1
export PASSWD=$3
export USER=$2

if [ -z "$APP_NAME" ]
then
echo "To deploy a ear application use the following syntax:"
echo ". "
echo " Usage: deploy_ear.sh app-name "
echo ". "
exit 1
fi

export CURR_DIR=$PWD
# Call setDomainEnv here.

DOMAIN_HOME="/u01/oracle/config/domains/edg_domain"

. ${DOMAIN_HOME}/bin/setDomainEnv.sh $*
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practice Script Source Code


Chapter 18 - Page 14
cd $CURR_DIR
echo "dir : $CURR_DIR"

echo "My domain home : $DOMAIN_HOME"


ant -file /practices/scripts/build12c.xml undeploy -
Dapp.name=$APP_NAME -Duser=$USER -Dpassword=$PASSWD -Ddist.dir=$PWD
ant -file /practices/scripts/build12c.xml deploy -Dapp.name=$APP_NAME
-Duser=$USER -Dpassword=$PASSWD -Ddist.dir=$PWD

#end

Script: domain.py
if len(sys.argv) == 0:
print "Usage: wlst domain.py [start|stop]"
exit()
else:
if sys.argv[1] != "start" and sys.argv[1] != "stop":
print "Usage: wlst domain.py [start|stop]"
exit()

domain_name="edg_domain"
try:
domain_path = os.environ["ASERVER"]
except:
domain_path="/u02/oracle/config/domains/" + domain_name

#lhost=java.net.InetAddress.getLocalHost().getHostName()
admhost="adminvh.example.com"

luser='weblogic'
admuser=raw_input("Username ["+ luser +"]: ")
if not admuser:
admuser=luser

admpsw="".join(System.console().readPassword("%s",["Password: "]))
if not admpsw:
print "Error: Please enter the WebLogic administrator password."
exit()

#print "Domain: " + domain_path


#print "Host: " + admhost
#print "User: " + admuser

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

Practice Script Source Code


Chapter 18 - Page 15
bootpfile=domain_path+"/servers/AdminServer/security/boot.properties"
bootpexists=os.path.exists(bootpfile)
if not bootpexists:
print "Error: "+ bootpfile +" does not exist yet. Please create the
file."
exit()

try:
print 'Connecting to Node Manager on '+admhost
redirect('/dev/null','false')
nmConnect(admuser, admpsw, admhost, 5556, domain_name, domain_path,
'ssl')
stopRedirect()

if sys.argv[1] == "start":
nmStart('AdminServer')
print "AdminServer started."
print 'Connecting to AdminServer...'
connect(admuser, admpsw, 't3://'+admhost+':7001')
print 'Starting the soa_cluster1 Cluster...'
start('soa_cluster1', 'Cluster')
lbrBean=getMBean('/Servers/lbr_server')
if lbrBean!=None:
print 'Starting the load balancer server %s...' %
lbrBean.getName()
start(lbrBean.getName(),lbrBean.getType())
disconnect()
elif sys.argv[1] == "stop":
print 'Connecting to AdminServer...'
connect(admuser, admpsw, 't3://'+admhost+':7001')
print 'Shutting down the soa_cluster1 Cluster...'
shutdown('soa_cluster1', 'Cluster', force="true", block="true")
lbrBean=getMBean('/Servers/lbr_server')
if lbrBean!=None:
print 'Shutting down the load balancer server %s...' %
lbrBean.getName()
shutdown(lbrBean.getName(),lbrBean.getType(), force="true",
block="true")
disconnect()
print 'Stopping the AdminServer...'
nmKill('AdminServer')
print "AdminServer killed or stopped."

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

Practice Script Source Code


Chapter 18 - Page 16
else:
print "Error: '" + sys.arv[1] + "' is an invalid command line
parameter."

nmDisconnect()
except:
print "ERROR: Check error messages for cause."

exit()

Script: domain.sh
#!/bin/bash
# chkconfig: 345 99 10
#
MW_HOME=/u01/oracle/product/fmw
JAVA_HOME=/usr/java/latest
PATH=$JAVA_HOME/bin:$PATH
WLST=/u01/oracle/product/fmw/oracle_common/common/bin/wlst.sh

case "$1" in
startup)
$WLST /practices/scripts/domain.py start
;;
shutdown)
$WLST /practices/scripts/domain.py stop
;;
*)
echo "Usage: $0 {startup|shutdown}"
exit 1
;;
esac

Script: granttxr2soa.sh
#!/bin/bash
SQLPLUS=$(find /u01 -type f -name sqlplus)
if [ -z $SQLPLUS ]; then
echo "Error: SQL*Plus application cannot be found."
exit 1
fi
${SQLPLUS} "/ as sysdba" <<-END
GRANT SELECT ON sys.dba_pending_transactions TO EDG_SOAINFRA;

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

Practice Script Source Code


Chapter 18 - Page 17
GRANT FORCE ANY TRANSACTION TO EDG_SOAINFRA;
EXIT
END

Script: initenv.sh
export TZ=$(date +%Z%z)
export JAVA_HOME=/usr/java/jdk1.7.0_55
export PATH=$JAVA_HOME/bin:$PATH
#
alias cls=clear
if [ -f /usr/bin/rlwrap ]; then
RLWRAP=/usr/bin/rlwrap
fi
SQLPLUS=$(find /u01 -type f -name sqlplus)
if [ ! -z $SQLPLUS ]; then
alias sqlplus="${RLWRAP:+rlwrap }${SQLPLUS}"
fi
RMAN=$(find /u01 -type f -name rman)
if [ ! -z $RMAN ]; then
alias rman="${RLWRAP:+rlwrap }${RMAN}"
fi
export PS1="\h:\w:\!> "

Script: install_infra.sh
#!/bin/bash
# Additional options for silent instal
# -printdiskusage -printmemory
source /practices/scripts/setjdk.sh
RESPONSE_FILE=${1:-$(find
/practices/practice03/install_fmw_infra.rsp)}
if [ ! -f $RESPONSE_FILE ]; then
RESPONSE_FILE=/practices/practice03/install_fmw_infra.rsp
fi
echo RESPONSE_FILE=$RESPONSE_FILE
if [ -f $RESPONSE_FILE ]; then
echo "Executing..."
echo "java -d64 -jar /install/soa/fmw_12.1.3.0.0_infrastructure.jar
-silent -responseFile $RESPONSE_FILE"
java -d64 -jar /install/soa/fmw_12.1.3.0.0_infrastructure.jar -
silent -responseFile $RESPONSE_FILE
else
echo "Response file '$RESPONSE_FILE' not found."
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practice Script Source Code


Chapter 18 - Page 18
echo "Usage: install_infra.sh [response_file_path]"
fi

Script: install_soa.sh
#!/bin/bash

MW_HOME=/u01/oracle/product/fmw
DOMAIN_HOME=/u02/oracle/config/domains/edg_domain
JAVA_HOME=/usr/java/latest
PATH=$JAVA_HOME/bin:$PATH
WLST=/u01/oracle/product/fmw/oracle_common/common/bin/wlst.sh
RESPONSE_FILE=$(find /practices/practice04/install_soa.rsp)

case "$1" in
silent)
echo RESPONSE_FILE=$RESPONSE_FILE
if [ -f $RESPONSE_FILE ]; then
echo "Executing..."
echo "java -d64 -jar /install/soa/fmw_12.1.3.0.0_soa.jar -silent -
responseFile $RESPONSE_FILE"
java -d64 -jar /install/soa/fmw_12.1.3.0.0_soa.jar -silent -
responseFile $RESPONSE_FILE
else
echo "Response file '$RESPONSE_FILE' not found."
echo "Usage: install_infra.sh [response_file_path]"
fi
;;
*)
java -d64 -jar /install/soa/fmw_12.1.3.0.0_soa.jar
;;
esac

Script: lbr.py
def showServers():
print "cmo" + cmo
svrList = cmo.getServers()
print svrList

if len(sys.argv) == 0:
print "Usage: wlst lbr.py [start|stop]"

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

Practice Script Source Code


Chapter 18 - Page 19
exit()
else:
if sys.argv[1] != "start" and sys.argv[1] != "stop":
print "Usage: wlst lbr.py [start|stop]"
exit()

domain_name="edg_domain"
try:
domain_path = os.environ["ASERVER"]
except:
domain_path="/u02/oracle/config/domains/" + domain_name

#lhost=java.net.InetAddress.getLocalHost().getHostName()
admhost="adminvh.example.com"

luser='weblogic'
admuser=raw_input("Username ["+ luser +"]: ")
if not admuser:
admuser=luser

admpsw="".join(System.console().readPassword("%s",["Password: "]))
if not admpsw:
print "Error: Please enter the WebLogic administrator password."
exit()

try:
if sys.argv[1] == "start":
print 'Connecting to AdminServer...'
connect(admuser, admpsw, 't3://'+admhost+':7001')
#showServers()
print 'Starting the load balancer managed server lbr_server...'
start('lbr_server', 'Server')
disconnect()
elif sys.argv[1] == "stop":
print 'Connecting to AdminServer...'
connect(admuser, admpsw, 't3://'+admhost+':7001')
#showServers()
print 'Shutting down the load balancer managed server
lbr_server...'
shutdown('lbr_server', 'Server', block="true")
disconnect()
print 'Stopping the AdminServer...'
else:
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practice Script Source Code


Chapter 18 - Page 20
print "Error: '" + sys.arv[1] + "' is an invalid command line
parameter."

nmDisconnect()
except:
print "ERROR: Check error messages for cause."

exit()

Script: lbr.sh
#!/bin/bash
# chkconfig: 345 99 10
#
MW_HOME=/u01/oracle/product/fmw
JAVA_HOME=/usr/java/latest
PATH=$JAVA_HOME/bin:$PATH
WLST=/u01/oracle/product/fmw/oracle_common/common/bin/wlst.sh

case "$1" in
start|stop)
$WLST /practices/scripts/lbr.py $1
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
;;
esac

Script: ldapadd.sh
MW_HOME=/u02/oracle/product/fmw
OUD_HOME=${MW_HOME}/asinst_1/OUD
HOST=ldap.example.com
PORT=1389

LDIF_FILE=$1
if [ -d ${OUD_HOME} ]; then
if [[ ! -z $LDIF_FILE && -f ${LDIF_FILE} ]]; then
read -s -p "Password: " LDAP_PWD
echo -e "\n"
if [ -z ${LDAP_PWD} ]; then

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

Practice Script Source Code


Chapter 18 - Page 21
echo "Error: You must provide the password for the root
(cn=Directory Manager) LDAP user."
exit 1
else
${OUD_HOME}/bin/ldapmodify -a -D "cn=Directory Manager" -w
${LDAP_PWD} -h ${HOST} -p ${PORT} -f ${LDIF_FILE}
fi
else
echo "Usage: $0 ldif-file-path"
fi
else
echo "Oracle Unified Directory (OUD) instance does not exist. Run
oud-setup to create an instance."
fi

Script: mkbootp.sh
#!/bin/bash
if [ ! -f $ASERVER/servers/AdminServer/security/boot.properties ];
then
read -p "Admin Username: " usr
read -s -p "Admin Password: " psw

if [[ -z $usr ]] || [[ -z $psw ]]; then


echo -e "\nError: You must provide both a username and password."
exit 1
fi

if [ ! -d $ASERVER/servers/AdminServer/security ]; then
mkdir -p $ASERVER/servers/AdminServer/security
fi

cat <<-EOF > $ASERVER/servers/AdminServer/security/boot.properties


username=$usr
password=$pwd
EOF
echo "Created AdminServer boot.properties file."
else
echo "AdminServer boot.properties file already exists."
fi

Script: modify_nmprops.sh
sed -e "/^QuitEnabled/ s/=.*$/=true/" $ASERVER/nodemanager.properties
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practice Script Source Code


Chapter 18 - Page 22
Script: nmctl.sh
#!/bin/bash
THISHOST=$(hostname -s)
case "$1" in
start|stop)
if [ "$THISHOST" == "host01" ]; then
/practices/scripts/nm.sh $1
/practices/scripts/nm.sh $1 soavh01.example.com
ssh host02 /practices/scripts/nm.sh $1 soavh02.example.com
else
ssh host01 /practices/scripts/nm.sh $1
/practices/scripts/nm.sh $1 soavh02.example.com
ssh host01 /practices/scripts/nm.sh $1 soavh01.example.com
fi
;;
*)
echo "Usage: $0 {start|stop}"
;;
esac

Script: nm.sh
#!/bin/bash
# chkconfig: 345 99 10
#
SVCNAME="WebLogic Node Manager"
MW_HOME=/u01/oracle/product/fmw
LISTENHOST=${2:-adminvh.example.com}
if [[ "$LISTENHOST" == "adminvh.example.com" || $LISTENHOST =~
host0[1-2].example.com ]]; then
DOMAIN_HOME=${ASERVER:-/u02/oracle/config/domains/edg_domain}
else
DOMAIN_HOME=${MSERVER:-/u01/oracle/config/domains/edg_domain}
fi
ping -c 1 ${LISTENHOST} >/dev/null
if [ $? -gt 0 ]; then
exit 2
fi
#
# Exit if the domain home does not exist yet
if [ ! -d $DOMAIN_HOME ]; then

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

Practice Script Source Code


Chapter 18 - Page 23
echo "Error: Node Manager domain does not exist. Create the domain
first."
exit 1
fi

#
# Check ListenAddress in nodemanager.properties and update if needed
#
NM_LISTENHOST=$(grep "ListenAddress="
$DOMAIN_HOME/nodemanager/nodemanager.properties)
NM_LISTENHOST=${NM_LISTENHOST/ListenAddress=/}
if [ "$LISTENHOST" != "$NM_LISTENHOST" ]; then
sed -i -e "s/^ListenAddress=.*/ListenAddress=${LISTENHOST}/"
$DOMAIN_HOME/nodemanager/nodemanager.properties
fi
LOGFILE=/practices/log/$(basename $0
.sh)_${LISTENHOST%.example.com}.log
JAVA_HOME=/usr/java/latest
PATH=$JAVA_HOME/bin:$PATH

function mlog() {
TSTAMP=$(date +"%F %H:%M:%S")
echo -e "[${TSTAMP}] $1" | tee -a $LOGFILE
}

function statusNm() {

declare rs=( $(jps -v | grep NodeManager | grep


"weblogic.RootDirectory=${DOMAIN_HOME}") )
if [ ${#rs[*]} -gt 0 ]; then
status="Started"
else
status="Stopped"
fi
}

function startNm() {
statusNm
if [ $status == "Stopped" ]; then
nohup $DOMAIN_HOME/bin/startNodeManager.sh &>> $LOGFILE &
fi
}

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

Practice Script Source Code


Chapter 18 - Page 24
function stopNm() {
statusNm
if [ $status == "Started" ]; then
mlog "Stopping ${SVCNAME}..."
$DOMAIN_HOME/bin/stopNodeManager.sh
fi
}

case "$1" in
start)
startNm
mlog "Started ${SVCNAME}.\n"
;;
restart)
stopNm
startNm
mlog "Restarted ${SVCNAME}.\n"
;;
stop)
stopNm
mlog "Stopped ${SVCNAME}.\n"
;;
status)
statusNm
echo "${SVCNAME} is ${status}."
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 3
;;
esac

Script: rcu.sh

#!/bin/bash
RCU=$(find /u01/oracle/product/fmw -name rcu -type f)
if [ "$RCU"=="" ]; then
RCU=/u01/oracle/product/fmw/oracle_common/bin/rcu
fi
read -s -p "SYS password: " dbpwd
echo ""
case $1 in
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practice Script Source Code


Chapter 18 - Page 25
"drop")
echo "$RCU dropping schemas"
$RCU -silent -dropRepository -databaseType ORACLE \
-connectString "host02.example.com:1521:orcl" -dbUser sys -dbRole
sysdba -schemaPrefix EDG \
-component MDS \
-component IAU \
-component IAU_APPEND \
-component IAU_VIEWER \
-component OPnm SS \
-component UMS \
-component WLS \
-component STB \
-f <<-END
${dbpwd}
END
;;
*)
echo "$(basename RCU) creating schemas.."
read -s -p "Schema password: " pwd
echo ""
$RCU -silent -createRepository -databaseType ORACLE \
-connectString "host02.example.com:1521:orcl" -dbUser sys -dbRole
sysdba -schemaPrefix EDG \
-component MDS \
-component IAU \
-component IAU_APPEND \
-component IAU_VIEWER \
-component OPSS \
-component UMS \
-component WLS \
-component STB \
-f <<-END
${dbpwd}
${pwd}
${pwd}
${pwd}
${pwd}
${pwd}
${pwd}
${pwd}
${pwd}
END
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practice Script Source Code


Chapter 18 - Page 26
esac

Script: restore.sh
#!/bin/bash

function restoreDb() {
if [ -z $ORACLE_BASE ]; then
echo "Warning: \$ORACLE_BASE environment variable not set. Run on host
where database is configured."
exit 1
fi

echo "Start database restore with tag ${TAG^^}..."


sqlplus -s "/ as sysdba" <<-END
PROMPT Shutting down database...
SHUTDOWN IMMEDIATE;
EXIT
END
BACKUP_FILE=${BACKUP_DIR}/db_${TAG}.tar
tar x${V}pf ${BACKUP_FILE} -C /
sqlplus -s "/ as sysdba" <<-END
PROMPT Starting up database...
STARTUP;
EXIT
END
echo "End database restore."
}

function restoreAdminDomain() {
echo "Start AdminServer Domain restore with id ${TAG}..."
BACKUP_FILE=${BACKUP_DIR}/admindomain_${TAG}.tar
if [ -f ${BACKUP_FILE} ]; then
echo "Restore file ${BACKUP_FILE} ..."
tar x${V}pf ${BACKUP_FILE} -C /
echo "End AdminServer Domain restore."
else
echo "Restore file ${BACKUP_FILE} not found."
fi
}

function restoreAdminApps() {
echo "Start AdminServer Applications restore with id ${TAG}..."
BACKUP_FILE=${BACKUP_DIR}/adminapps_${TAG}.tar

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

Practice Script Source Code


Chapter 18 - Page 27
if [ -f ${BACKUP_FILE} ]; then
echo "Restore file ${BACKUP_FILE} ..."
tar x${V}pf ${BACKUP_FILE} -C /
echo "End AdminServer Applications restore."
else
echo "Restore file ${BACKUP_FILE} not found."
fi
}

function restoreDeployPlans() {
echo "Start Deployment Plans restore with id ${TAG}..."
BACKUP_FILE=${BACKUP_DIR}/deployplans_${TAG}.tar
if [ -f ${BACKUP_FILE} ]; then
echo "Restore file ${BACKUP_FILE} ..."
tar x${V}pf ${BACKUP_FILE} -C /
echo "End Deployment Plans restore."
else
echo "Restore file ${BACKUP_FILE} not found."
fi
}

function restoreManagedConfig() {
HOST=$(hostname -s)
echo "Start Managed Server restore on host ${HOST} with id ${TAG}..."
BACKUP_FILE=${BACKUP_DIR}/managedconfig_${TAG}_${HOST}.tar
if [ -f ${BACKUP_FILE} ]; then
echo "Restore file ${BACKUP_FILE} ..."
tar x${V}pf ${BACKUP_FILE} -C /
echo "End Managed Server restore."
else
echo "Restore file ${BACKUP_FILE} not found."
fi
}

function restoreOUD() {
OUD_HOME=/u02/oracle/product/fmw/asinst_1/OUD
BACKUPDIR=${BACKUP_DIR}
echo "Unpacking backup archive..."
tar xp${V}f ${BACKUPDIR}/oud_${TAG}.tar -C ${BACKUPDIR}
echo "Restoring OUD config folder..."
tar xp${V}f ${BACKUPDIR}/oud/config_${TAG}.tar -C ${OUD_HOME}
echo "Restoring OUD logs folder..."
tar xp${V}f ${BACKUPDIR}/oud/logs_${TAG}.tar -C ${OUD_HOME}
for backend in ${BACKUPDIR}/oud/* ; do

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

Practice Script Source Code


Chapter 18 - Page 28
if [ -d ${backend} ]; then
echo "Restoring OUD backup for $(basename ${backend})..."
$OUD_HOME/bin/restore --backupDirectory ${backend} --backupID ${TAG}
fi
done
rm -rf ${BACKUPDIR}/oud
echo "Restore complete."
}

# Use parameter $2 as a tag and default to day and time in yymimdd_HHMMSS


format
TAG=${2:-$(date +%y%m%d_%H%M%S)}
V=${VERIFY}

BACKUP_DIR=/u02/backup
ASERVER=${ASERVER:-/u02/oracle/config/domains/edg_domain}
APPHOME=${APPHOME:-/u02/oracle/config/applications/edg_domain}
MSERVER=${MSERVER:-/u01/oracle/config/domains/edg_domain}
DEPLOY_PLAN_HOME=/u02/oracle/config/dp

case "$1" in
db)
restoreDb ;;
admin)
restoreAdminDomain ;;
apps)
restoreAdminApps ;;
dplan)
restoreDeployPlans ;;
managed)
restoreManagedConfig ;;
ldap)
restoreOUD ;;
*)
echo "Usage: $0 {admin|apps|db|dplan|ldap|managed}"
exit 1
;;
esac

Script: setbashrc.sh
#!/bin/bash
if [ -f $HOME/.bashrc ]; then
cp --backup=t $HOME/.bashrc $HOME/.bashrc_backup

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

Practice Script Source Code


Chapter 18 - Page 29
fi
cat /practices/scripts/initenv.sh >> $HOME/.bashrc

Script: setenv.sh
export ASERVER=/u02/oracle/config/domains/edg_domain
export APPHOME=/u02/oracle/config/applications/edg_domain
export MSERVER=/u01/oracle/config/domains/edg_domain
export MW_HOME=/u01/oracle/product/fmw
alias wlst=$MW_HOME/oracle_common/common/bin/wlst.sh

Script: setjdk.sh
#!bin/bash
export JAVA_HOME=/usr/java/jdk1.7.0_55
export PATH=$JAVA_HOME/bin:$PATH

Script: setwlsenv.sh
#!/bin/bash
ASERVER=${1:-${ASERVER:-/u02/oracle/config/domains/edg_domain}}
ENVSCRIPT=$ASERVER/bin/setUserOverrides.sh
echo '#!/bin/bash' > $ENVSCRIPT
echo 'export TZ=$(date +%Z%z)' >> $ENVSCRIPT

Script: startadmin.sh
#!/bin/bash
read -s -p "NM Password: " psw
cd /u01/oracle/product/fmw/oracle_common/common/bin
./wlst.sh <<-END
nmConnect("weblogic", "$psw", "adminvh.example.com", 5556,
"edg_domain", "/u02/oracle/config/domains/edg_domain", 'ssl')
nmStart("AdminServer")
nmDisconnect()
exit()
END

Script: startnm.sh
#!/bin/bash
cd $ASERVER/bin
nohup ./startNodeManager.sh &>> /practices/log/nm.log &

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

Practice Script Source Code


Chapter 18 - Page 30
Scripts from the /practices/lbr Folder

Script: create_lbr.py
#NEW WLST Script to create a Managed Server with Channels as a Load
Balancer
#================
def initProperties(propertyFile):
global userName
global passWord
global domainName
global domainDir
print "Loading properties from %s." % propertyFile
loadProperties(propertyFile)
#
uName=raw_input("Username [%s]: " % userName)
if uName:
userName=uName
passWord="".join(System.console().readPassword("%s",["Password: "]))
if not passWord:
print "Error: Please enter the WebLogic administrator password."
exit()
domDir=raw_input("Domain path [%s]: " % domainDir)
if domDir:
domainDir=domDir
domName=os.path.basename(domainDir)

def waitFor(secs):
print "Waiting for %s seconds" % secs
#java.lang.Thread.sleep(secs*1000)
time.sleep(secs)

def initScript():
hideDisplay()
hideDumpStack("true")
if connected=="false":
try:
URL="t3://%s:%s" % (adminServerListenAddress,
adminServerListenPort)
print "Connecting to AdminServer with URL %s" % URL
connect(userName, passWord, URL)
except WLSTException:
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practice Script Source Code


Chapter 18 - Page 31
print 'Server at '+URL+' is not running, Starting a new server'
hideDumpStack("false")
if connected=="false":
print 'Starting new server at %s with name %s' % (URL,
adminServerName)
print 'Refer to logs in %s/servers/%s/logs' % (domainDir,
adminServerName)
timeOut = Integer(TimeOut)
_startServerJvmArgs=startServerJvmArgs
if (_startServerJvmArgs=="" and
(System.getProperty("java.vendor").find("Sun")>=0 or
System.getProperty("java.vendor").find("Oracle")>=0 or
System.getProperty("java.vendor").find("Hewlett")>=0)):
_startServerJvmArgs = " -XX:MaxPermSize=256m"
if overWriteRootDir=='true':
startServer(adminServerName, domName, URL, userName, passWord,
domainDir, timeout=_timeOut.intValue(), overWriteRootDir='true',
block='true', jvmArgs=_startServerJvmArgs)
else:
startServer(adminServerName, domName, URL, userName,
passWord,domainDir, timeout=_timeOut.intValue(), block='true',
jvmArgs=_startServerJvmArgs)
startedNewServer=1
print "Started Server. Trying to connect to the server ... "
connect(userName, passWord, URL)
if connected=='false':
stopExecution('You need to be connected.')

def startTransaction():
edit()
startEdit()
print "Started transaction..."

def endTransaction():
startEdit()
save()
activate(block="true")
print "End transaction: changes saved and activated."

def endScript():
if connected:
print 'Disconnecting from AdminServer...'

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

Practice Script Source Code


Chapter 18 - Page 32
disconnect()
print 'Creating Load Balancer Managed Server instance completed.'

def create_VirtualHost(path, beanName):


cd(path)
try:
theBean = cmo.lookupVirtualHost(beanName)
if theBean == None:
print "Creating VirtualHost MBean %s in %s... " %
(beanName,path)
cmo.createVirtualHost(beanName)
except:
dumpStack()
pass

def create_Server(path, beanName):


cd(path)
try:
theBean = cmo.lookupServer(beanName)
if theBean == None:
print "Creating Server MBean %s in %s... " % (beanName,path)
cmo.createServer(beanName)
except:
dumpStack()
pass

def create_NetworkAccessPoint(path, beanName):


cd(path)
try:
theBean = cmo.lookupNetworkAccessPoint(beanName)
if theBean == None:
print "Creating NetworkAccessPoint MBean %s in %s ... "%
(beanName,path)
cmo.createNetworkAccessPoint(beanName)
except:
dumpStack()
pass

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

Practice Script Source Code


Chapter 18 - Page 33
def set_ServerAttributes(serverName, listenAddress, port, sslPort,
machineName):
print "Setting Server attributes for %s" % serverName
serverPath="/Servers/" + serverName
cd(serverPath)
set("ListenAddress", listenAddress)
set("ListenPort", port)
bean = getMBean("/Machines/" + machineName)
cmo.setMachine(bean)
print "Setting SSL attributes for %s" % serverName
cd("SSL/" + serverName)
set("Enabled", "true")
set("ListenPort", sslPort)

cd("/Servers/"+serverName+"/WebServer/"+serverName+"/WebServerLog/"+se
rverName)
print "Setting WebServerLog attributes for %s..." % serverName
set("NumberOfFilesLimited", "false")

def set_ChannelAttributes(serverName, channelName, listenAddress,


listenPort):
channelPath="/Servers/%s/NetworkAccessPoints/%s" % (serverName,
channelName)
cd(channelPath)
print "Setting Network Access Point Channel Attributes for %s" %
channelPath
set("ListenPort", listenPort)
set("HttpEnabledForThisProtocol", "true")
set("TunnelingEnabled", "false")
set("ListenAddress", listenAddress)
set("Protocol", "http")
set("PublicAddress", listenAddress)
set("ClientCertificateEnforced", "false")
set("Enabled", "true")
set("TwoWaySSLEnabled", "false")
set("OutboundEnabled", "false")

def set_VirtualHostAttributes(vHostId, vHostName, channelName,


targetName):
cd("/VirtualHosts/"+vHostId)
print "setting attributes for mbean type VirtualHost"
set("VirtualHostNames", jarray.array([vHostName], String))
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practice Script Source Code


Chapter 18 - Page 34
set("NetworkAccessPoint", channelName)
refBean0 = getMBean("/Servers/" + targetName)
theValue = jarray.array([refBean0],
Class.forName("weblogic.management.configuration.TargetMBean"))
cmo.setTargets(theValue)
cd("/VirtualHosts/"+vHostId+"/WebServerLog/"+vHostId)
print "Setting WebServerLog attributes for %s..." % vHostId
set("NumberOfFilesLimited", "false")

def deploy_WebApp(webAppPath, targetName):


try:
webAppName = os.path.splitext(os.path.basename(webAppPath))[0]
prog = deploy(webAppName, webAppPath, targetName,
securityModel="DDOnly", timeout=12000, block="true")
while prog.isRunning():
print "Deploy state is ... %s." % prog.getState()
except:
print "Error: Deploying Web Application in %s to %s." %
(webAppPath, targetName)
dumpStack()

#---- Script to create and configure the lbr_server managed server


instance
try:

propertyFilename=os.path.dirname(os.path.realpath(sys.argv[0]))+"/"+sy
s.argv[0]+".properties"
if len(sys.argv)>1:
propertyFilename=os.path.abspath(sys.argv[1])
if not os.path.exists(propertyFilename):
print "Error: Property file %s does not exist." % propertyFilename
exit()
# Set key properties and variables
initProperties(propertyFilename)
# Do additional initialization
initScript()
vhosts=vhostIds.split(",")
vhostladdrs=vhListenAddresses.split(",")
vhostlports=vhListenPorts.split(",")
vhostservlets=vhHttpServlets.split(",")
startTransaction()
# 1. Create the Managed Server instance
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practice Script Source Code


Chapter 18 - Page 35
create_Server("/", msName)
set_ServerAttributes(msName, msListenAddress, msListenPort,
msSSLPort, msMachineName)
# 2. Create the Virtual Hosts and their HTTP channels from
properties
i=0
for vh in vhosts:
virtualHostId=vh+'_vHost'
channelName=vh+'_Chan'
virtualHostName=vhostladdrs[i]
virtualHostListenPort=vhostlports[i]
print " Creating Virtual Host %s and Channel %s with Listen
Address %s:%s" % (virtualHostId, channelName, virtualHostName,
virtualHostListenPort)
create_VirtualHost("/", virtualHostId)
set_VirtualHostAttributes(virtualHostId, virtualHostName,
channelName, msName)
create_NetworkAccessPoint("/Servers/"+msName, channelName)
set_ChannelAttributes(msName, channelName, virtualHostName,
virtualHostListenPort)
i=i+1
endTransaction()
# Start Deployment operations
i=0
print 'Start deploying HttpClusterServlet instances...'
for vh in vhosts:
virtualHostId=vh+'_vHost'
httpServlet=vhostservlets[i]
print "Deploying %s to Virtual Host %s" % (httpServlet,
virtualHostId)
deploy_WebApp(httpServlet, virtualHostId)
i=i+1
print "Deploying %s to Virtual Host %s" % (managedHttpServlet,
msName)
deploy_WebApp(managedHttpServlet, msName)
finally:
endScript()

Script: create_lbr.py.properties
#WLST Script lbr.py Default Properties file
# 1. Properties to connect to the AdminServer in the specified domain
domainDir=/u02/oracle/config/domains/edg_domain
adminServerListenAddress=adminvh.example.com

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

Practice Script Source Code


Chapter 18 - Page 36
adminServerListenPort=7001
adminServerName=AdminServer
userName=weblogic
exitonerror=false
overWriteRootDir=true
TimeOut=240000
startedNewServer=0
startServerJvmArgs=
# 2. Properties for creating the Managed Server
msName=lbr_server
msListenAddress=soa.example.com
msListenPort=8080
msSSLPort=4443
msMachineName=adm_machine
#
# Values in in the following comma separated list properties
# must match their corresponding entries by position
# 3. Properties for Virtual Hosts and their Network Channels
vhostIds=Admin,SoaInt
vhListenAddresses=admin.example.com,soainternal.example.com
vhListenPorts=8080,8080
# 4. WAR file Deployment properties for Managed Server and its Virtual
Hosts
vhHttpServlets=/practices/lbr/admin_httpc_servlet.war,/practices/lbr/s
oaint_httpc_servlet.war
managedHttpServlet=/practices/lbr/soa_httpc_servlet.war

Script: create_lbr.sh
#!/bin/bash
MW_HOME=/u01/oracle/product/fmw
JAVA_HOME=/usr/java/latest
PATH=$JAVA_HOME/bin:$PATH
WLST=/u01/oracle/product/fmw/oracle_common/common/bin/wlst.sh

$WLST /practices/lbr/create_lbr.py ${1:-


${PWD}/create_lbr.py.properties}

Script: delete_lbr.py
#WLST Script to delete a Managed Server with Channels as a Load
Balancer
#This undoes the work done by create_lbr.py and useds the same
property file
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practice Script Source Code


Chapter 18 - Page 37
#================
def initProperties(propertyFile):
global userName
global passWord
global domainName
global domainDir
print "Loading properties from file %s." % propertyFile
loadProperties(propertyFile)
#
uName=raw_input("Username [%s]: " % userName)
if uName:
userName=uName
passWord="".join(System.console().readPassword("%s",["Password: "]))
if not passWord:
print "Error: Please enter the WebLogic administrator password."
exit()
domDir=raw_input("Domain path [%s]: " % domainDir)
if domDir:
domainDir=domDir
domName=os.path.basename(domainDir)

def initScript():
hideDisplay()
hideDumpStack("true")
# try connecting to a running server if it is already running ...
if connected=="false":
try:
URL="t3://%s:%s" % (adminServerListenAddress,
adminServerListenPort)
print "Connecting to AdminServer with URL %s" % URL
connect(userName, passWord, URL)
except WLSTException:
print 'Server at '+URL+' is not running, attemtping ot start a
new server'
hideDumpStack("false")
if connected=="false":
print 'Starting new server at %s with name %s' % (URL,
adminServerName)
print 'Check log messages in %s/servers/%s/logs' % (domainDir,
adminServerName)
_timeOut = Integer(TimeOut)
_startServerJvmArgs=startServerJvmArgs

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

Practice Script Source Code


Chapter 18 - Page 38
if (_startServerJvmArgs=="" and
(System.getProperty("java.vendor").find("Sun")>=0 or
System.getProperty("java.vendor").find("Oracle")>=0 or
System.getProperty("java.vendor").find("Hewlett")>=0)):
_startServerJvmArgs = " -XX:MaxPermSize=256m"
if overWriteRootDir=='true':
startServer(adminServerName, domName, URL, userName, passWord,
domainDir, timeout=_timeOut.intValue(), overWriteRootDir='true',
block='true', jvmArgs=_startServerJvmArgs)
else:
startServer(adminServerName, domName, URL, userName,
passWord,domainDir, timeout=_timeOut.intValue(), block='true',
jvmArgs=_startServerJvmArgs)
startedNewServer=1
print "Connecting to the server with %s..." % URL
connect(userName, passWord, URL)
if connected=='false':
stopExecution('You need to be connected.')

def startTransaction():
edit()
startEdit()

def endTransaction():
startEdit()
save()
activate(block="true")

def endScript():
if connected:
disconnect()
print 'Removal of Load balancer Managed Server instance completed.'

def delete_VirtualHost(path, beanName):


cd(path)
try:
theBean = cmo.lookupVirtualHost(beanName)
print theBean
if not theBean == None:

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

Practice Script Source Code


Chapter 18 - Page 39
print "Deleting VirtualHost MBean %s from %s... " %
(beanName,path)
cd('VirtualHosts')
delete(beanName, 'VirtualHost')
except:
dumpStack()
pass

def delete_Server(path, beanName):


cd(path)
try:
theBean = cmo.lookupServer(beanName)
print theBean
if not theBean == None:
print "Deleting Server MBean %s from %s... " % (beanName,path)
cd('Servers')
delete(beanName, 'Server')
except:
dumpStack()
pass

def delete_NetworkAccessPoint(path, beanName):


cd(path)
try:
theBean = cmo.lookupNetworkAccessPoint(beanName)
print theBean
if not theBean == None:
print "Deleting NetworkAccessPoint MBean %s from %s ... "%
(beanName,path)
cd('NetWorkAccessPoints')
delete(beanName, 'NetworkAccessPoint')
except:
dumpStack()
pass

def undeploy_WebApp(webAppPath, targetName):


try:
webAppName = os.path.splitext(os.path.basename(webAppPath))[0]
stopApplication(webAppName, block="true")
undeploy(webAppName, targetName, block="true")
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practice Script Source Code


Chapter 18 - Page 40
except:
print "Error: Undeploying Web Application %s from %s." %
(webAppPath, targetName)

#---- Script to create and configure the lbr_server managed server


instance
try:

propertyFilename=os.path.dirname(os.path.realpath(sys.argv[0]))+"/crea
te_lbr.py.properties"
if len(sys.argv)>1:
propertyFilename=os.path.abspath(sys.argv[1])
if not os.path.exists(propertyFilename):
print "Error: Property file %s does not exist." % propertyFilename
exit()
# Set key properties and variables
initProperties(propertyFilename)
vhosts=vhostIds.split(",")
vhostladdrs=vhListenAddresses.split(",")
vhostlports=vhListenPorts.split(",")
vhostservlets=vhHttpServlets.split(",")
# Do additional initialization
initScript()

i=0
for vh in vhosts:
virtualHostId=vh+'_vHost'
channleName=vh+'_Chan'
httpServlet=vhostservlets[i]
undeploy_WebApp(httpServlet, virtualHostId)
i=i+1
undeploy_WebApp(managedHttpServlet, msName)

startTransaction()
for vh in vhosts:
virtualHostId=vh+'_vHost'
channelName=vh+'_Chan'
delete_NetworkAccessPoint("/Servers/"+msName, channelName)
delete_VirtualHost("/", virtualHostId)
delete_Server("/", msName)
endTransaction()

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

Practice Script Source Code


Chapter 18 - Page 41
finally:
endScript()

Script: delete_lbr.sh
#!/bin/bash
MW_HOME=/u01/oracle/product/fmw
JAVA_HOME=/usr/java/latest
PATH=$JAVA_HOME/bin:$PATH
WLST=/u01/oracle/product/fmw/oracle_common/common/bin/wlst.sh

$WLST /practices/lbr/delete_lbr.py ${1:-


${PWD}/create_lbr.py.properties}

Script: upd_targets.sh
#!/bin/bash
echo "Updating Load balancer application targets."
CONFIGFILE=${ASERVER}/config/config.xml
backups=( $(ls ${ASERVER}/config/backup_config*.xml) )
nbr=${#backups[*]}
echo "Backing up 'config.xml' to 'backup_config${nbr}.xml'"
cp ${CONFIGFILE} ${ASERVER}/config/backup_config${nbr}.xml
echo "Targets before update: -----> "
sed -n -e '/admin_httpc_servlet<\/name>/,/target>/ p' \
-e '/soaint_httpc_servlet<\/name>/,/target>/ p' \
-e '/soa_httpc_servlet<\/name>/,/target>/ p' ${CONFIGFILE}
echo "Updating Load Balancer application targets..."
sed -i -e '/admin_httpc_servlet<\/name>/,/target>/
s=target.*target=target>Admin_vHost</target=' \
-e '/soaint_httpc_servlet<\/name>/,/target>/
s=target.*target=target>SoaInt_vHost</target=' \
-e '/soa_httpc_servlet<\/name>/,/target>/
s=target.*target=target>lbr_server</target=' ${CONFIGFILE}
echo "Targets after update: -----> "
sed -n -e '/admin_httpc_servlet<\/name>/,/target>/ p' \
-e '/soaint_httpc_servlet<\/name>/,/target>/ p' \
-e '/soa_httpc_servlet<\/name>/,/target>/ p' ${CONFIGFILE}
echo "Load balancer application targets updated."

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

Practice Script Source Code


Chapter 18 - Page 42
Scripts from the /practices/sql Folder

Script: reset_last_ord.sql
col max_ord_id new_value last_ord_id

delete items where ord_id = &last_ord_id;


delete orders where ord_id = &last_ord_id;
commit;
drop sequence order_seq;
create sequence order_seq start with &last_ord_id increment by 1
nocache;
undefine last_ord_id

Script: reset_ord_seq.sql
PROMPT drop sequence 'ORDER_SEQ'
DROP SEQUENCE ORDER_SEQ;
PROMPT create sequence 'ORDER_SEQ'
CREATE SEQUENCE ORDER_SEQ INCREMENT BY 1 NOCACHE START WITH
&start_value;

Script: show_items.sql
SELECT * FROM items;

Script: show_ord_items.sql
set echo off verify off
ACCEPT order_id PROMPT "Enter the Order ID: "
SELECT *
FROM orders
WHERE ord_id = &order_id;
PROMPT "Ordered Items are:"
SELECT ord_id, item_id, prod_id, price, quantity
FROM items
WHERE ord_id = &order_id;
undef order_id

Script: show_ord.sql
SELECT * FROM orders;

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

Practice Script Source Code


Chapter 18 - Page 43
Script: show_seq.sql
select sequence_name, cache_size, last_number from user_sequences
/

Script: soademo_create.sql
SPOOL soademo_create.log

PROMPT create table 'SHIPTYPES'


CREATE TABLE SHIPTYPES
(
SHIP_ID NUMBER(10) NOT NULL,
SHIP_TYPE VARCHAR2(20) NOT NULL,
SHIP_COMPANY VARCHAR2(20) NOT NULL
, CONSTRAINT SHIPTYPE_PK PRIMARY KEY
(
SHIP_ID
)
ENABLE
)
;

PROMPT create table 'EXTERNAL_STORE'


CREATE TABLE EXTERNAL_STORE
(
PROD_ID VARCHAR2(20) NOT NULL,
QUANTITY NUMBER(6)
, CONSTRAINT EXTERNAL_STORE_PK PRIMARY KEY
(
PROD_ID
)
ENABLE
)
;

PROMPT create table 'ADDRESS'


CREATE TABLE ADDRESS
(
ADDR_ID NUMBER(6) NOT NULL,
CUST_ID NUMBER(6) NOT NULL,
STREET VARCHAR2(50),
CITY VARCHAR2(40),
STATE VARCHAR2(40),
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practice Script Source Code


Chapter 18 - Page 44
ZIP VARCHAR2(20),
COUNTRY VARCHAR2(40)
, CONSTRAINT TABLE1_PK PRIMARY KEY
(
ADDR_ID
)
ENABLE
)
;

PROMPT create table 'CREDITCARDS'


CREATE TABLE CREDITCARDS
(
CARD_NUMBER VARCHAR2(20) NOT NULL,
CARD_TYPE VARCHAR2(10) NOT NULL,
CUST_ID NUMBER(6) NOT NULL,
CREDIT_LIMIT NUMBER(9, 2) NOT NULL,
STATUS VARCHAR2(20) NOT NULL,
RATING NUMBER(2)
, CONSTRAINT CREDITCARDS_PK PRIMARY KEY
(
CARD_NUMBER
)
ENABLE
)
;

PROMPT create table 'CUSTOMERS'


CREATE TABLE CUSTOMERS
(
CUST_ID NUMBER(6) NOT NULL,
FIRST_NAME VARCHAR2(40) NOT NULL,
LAST_NAME VARCHAR2(40) NOT NULL,
EMAIL VARCHAR2(40) NOT NULL,
USERNAME VARCHAR2(40) NOT NULL,
PASSWRD VARCHAR2(40) NOT NULL,
STATUS VARCHAR2(20) NOT NULL
, CONSTRAINT CUSTOMERS_PK PRIMARY KEY
(
CUST_ID
)
ENABLE

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

Practice Script Source Code


Chapter 18 - Page 45
)
;

PROMPT create table 'ITEMS'


CREATE TABLE ITEMS
(
ITEM_ID NUMBER(6) NOT NULL,
ORD_ID NUMBER(6) NOT NULL,
PROD_ID VARCHAR2(20) NOT NULL,
PRICE NUMBER(9, 2) NOT NULL,
QUANTITY NUMBER(6)
, CONSTRAINT ITEMS_PK PRIMARY KEY
(
ITEM_ID,
ORD_ID
)
ENABLE
)
;

PROMPT create table 'PRODUCTS'


CREATE TABLE PRODUCTS
(
PROD_ID VARCHAR2(20) NOT NULL,
PROD_NAME VARCHAR2(50),
RETAIL_PRICE NUMBER(9, 2)
, CONSTRAINT PRODUCTS_PK PRIMARY KEY
(
PROD_ID
)
ENABLE
)
;

PROMPT create table 'INTERNAL_STORE'


CREATE TABLE INTERNAL_STORE
(
PROD_ID VARCHAR2(20) NOT NULL,
QUANTITY NUMBER(6)
, CONSTRAINT INTERNAL_STORE_PK PRIMARY KEY
(
PROD_ID

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

Practice Script Source Code


Chapter 18 - Page 46
)
ENABLE
)
;

PROMPT create table 'PRODID_XREFS'


CREATE TABLE PRODID_XREFS
(
INT_ID VARCHAR2(20) NOT NULL,
EXT_ID VARCHAR2(20) NOT NULL
, CONSTRAINT PRODID_XREFS_PK PRIMARY KEY
(
INT_ID
)
ENABLE
)
;

PROMPT create table 'ONLINE_STORE'


CREATE TABLE ONLINE_STORE
(
PROD_ID VARCHAR2(20) NOT NULL,
QUANTITY NUMBER(6)
, CONSTRAINT ONLINE_STORE_PK1 PRIMARY KEY
(
PROD_ID
)
ENABLE
)
;

PROMPT create table 'ORDERS'


CREATE TABLE ORDERS
(
ORD_ID NUMBER(6) NOT NULL,
CUST_ID NUMBER(6) NOT NULL,
TOTAL_PRICE NUMBER(9, 2) NOT NULL,
DATE_ORDERED DATE NOT NULL,
DATE_SHIPPED DATE,
STATUS VARCHAR2(20)
, CONSTRAINT ORDERS_PK PRIMARY KEY
(

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

Practice Script Source Code


Chapter 18 - Page 47
ORD_ID
)
ENABLE
)
;

PROMPT create unique key constraint on 'PRODID_XREFS'


ALTER TABLE PRODID_XREFS
ADD CONSTRAINT PRODID_XREFS_UK1 UNIQUE
(
EXT_ID
)
ENABLE
;

PROMPT create foreign key constraint on 'ADDRESS'


ALTER TABLE ADDRESS
ADD CONSTRAINT ADDRESS_CUSTOMERS_FK1 FOREIGN KEY
(
CUST_ID
)
REFERENCES CUSTOMERS
(
CUST_ID
)
ENABLE
;

PROMPT create foreign key constraint on 'CREDITCARDS'


ALTER TABLE CREDITCARDS
ADD CONSTRAINT CREDITCARDS_CUSTOMERS_FK1 FOREIGN KEY
(
CUST_ID
)
REFERENCES CUSTOMERS
(
CUST_ID
)
ENABLE
;

PROMPT create foreign key constraint on 'ITEMS'

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

Practice Script Source Code


Chapter 18 - Page 48
ALTER TABLE ITEMS
ADD CONSTRAINT ITEMS_ORDERS_FK FOREIGN KEY
(
ORD_ID
)
REFERENCES ORDERS
(
ORD_ID
)
ENABLE
;

PROMPT create foreign key constraint on 'ITEMS'


ALTER TABLE ITEMS
ADD CONSTRAINT ITEMS_PRODUCTS_FK FOREIGN KEY
(
PROD_ID
)
REFERENCES PRODUCTS
(
PROD_ID
)
ENABLE
;

PROMPT create foreign key constraint on 'ORDERS'


ALTER TABLE ORDERS
ADD CONSTRAINT ORDERS_CUSTOMERS_FK1 FOREIGN KEY
(
CUST_ID
)
REFERENCES CUSTOMERS
(
CUST_ID
)
ENABLE
;

PROMPT create check constraint on 'CUSTOMERS'


ALTER TABLE CUSTOMERS
ADD CONSTRAINT CUSTOMERS_STATUS_CHK1 CHECK
(STATUS IN ('bronze', 'silver', 'gold', 'platinum'))

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

Practice Script Source Code


Chapter 18 - Page 49
ENABLE
;

PROMPT create sequence 'ORDER_SEQ'


CREATE SEQUENCE ORDER_SEQ INCREMENT BY 1 START WITH 100 NOCACHE;

PROMPT create sequence 'CUSTOMER_SEQ'


CREATE SEQUENCE CUSTOMER_SEQ INCREMENT BY 1 START WITH 1 NOCACHE;

PROMPT create sequence 'ADDRESS_SEQ'


CREATE SEQUENCE ADDRESS_SEQ INCREMENT BY 1 START WITH 1 NOCACHE;

SPOOL OFF

Script: soademo_data.sql
SPOOL soademo_data.log
ACCEPT password PROMPT "Password: "
DEFINE hostname=example.com
-- INSERT INTO CUSTOMERS VALUES (CUST_ID, FIRST_NAME, LAST_NAME,
EMAIL, USERNAME, PASSWRD, STATUS);
-- INSERT INTO CREDITCARDS VALUES (CARD_NUMBER, CARD_TYPE, CUST_ID,
CREDIT_LIMIT, STATUS, RATING);
-- INSERT INTO ADDRESS VALUES (ADDR_ID, CUST_ID, STREET, CITY, STATE,
ZIP, COUNTRY);

INSERT INTO CUSTOMERS VALUES (CUSTOMER_SEQ.NEXTVAL, 'Steve', 'King',


'sking@&hostname', 'sking', '&password', 'gold');
INSERT INTO CREDITCARDS VALUES ('5678-5678-5678-5678', 'ACRD',
CUSTOMER_SEQ.CURRVAL, 20000, 'VALID', 4);
INSERT INTO ADDRESS VALUES (ADDRESS_SEQ.NEXTVAL, CUSTOMER_SEQ.CURRVAL,
'2004 Charade Street', 'Demo City', 'CA', '94065', 'USA');
-- Customer Order History
-- INSERT INTO ORDERS VALUES (ORD_ID, CUST_ID, TOTAL_PRICE,
DATE_ORDERED, DATE_SHIPPED, STATUS);
-- INSERT INTO ITEMS VALUES (ITEMID, ORD_ID, PROD_ID, PROD_NAME,
PRICE, QUANTITY);

INSERT INTO CUSTOMERS VALUES (CUSTOMER_SEQ.NEXTVAL, 'Agatha',


'Christie', 'achrist@&hostname', 'achrist', '&password', 'silver');
INSERT INTO CREDITCARDS VALUES ('1234-1234-1234-1234', 'VCRD',
CUSTOMER_SEQ.CURRVAL, 20000, 'VALID', 3);
INSERT INTO ADDRESS VALUES (ADDRESS_SEQ.NEXTVAL, CUSTOMER_SEQ.CURRVAL,
'100 Test Road', 'Debug City', 'CA', '94022', 'USA');
-- Customer Order History
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practice Script Source Code


Chapter 18 - Page 50
-- INSERT INTO ORDERS VALUES (ORD_ID, CUST_ID, TOTAL_PRICE,
DATE_ORDERED, DATE_SHIPPED, STATUS);
-- INSERT INTO ITEMS VALUES (ITEMID, ORD_ID, PROD_ID, PROD_NAME,
PRICE, QUANTITY);

INSERT INTO CUSTOMERS VALUES (CUSTOMER_SEQ.NEXTVAL, 'John',


'Steinbeck', 'jstein@&hostname', 'jstein', '&password', 'bronze');
INSERT INTO CREDITCARDS VALUES ('4321-4321-4321-4321', 'MCRD',
CUSTOMER_SEQ.CURRVAL, 20000, 'INVALID', 3);
INSERT INTO ADDRESS VALUES (ADDRESS_SEQ.NEXTVAL, CUSTOMER_SEQ.CURRVAL,
'19 Limelight Blvd', 'Tinsel City', 'CA', '904020', 'USA');
-- Customer Order History
-- INSERT INTO ORDERS VALUES (ORD_ID, CUST_ID, TOTAL_PRICE,
DATE_ORDERED, DATE_SHIPPED, STATUS);
-- INSERT INTO ITEMS VALUES (ITEMID, ORD_ID, PROD_ID, PROD_NAME,
PRICE, QUANTITY);

INSERT INTO CUSTOMERS VALUES (CUSTOMER_SEQ.NEXTVAL, 'Jane', 'Austen',


'jausten@&hostname', 'jausten', '&password', 'platinum');
INSERT INTO CREDITCARDS VALUES ('8765-8765-8765-8765', 'ACRD',
CUSTOMER_SEQ.CURRVAL, 30000, 'VALID', 5);
INSERT INTO ADDRESS VALUES (ADDRESS_SEQ.NEXTVAL, CUSTOMER_SEQ.CURRVAL,
'303 Broadway Ave', 'Big Apple', 'NY', '10001', 'USA');
-- Customer Order History
-- INSERT INTO ORDERS VALUES (ORD_ID, CUST_ID, TOTAL_PRICE,
DATE_ORDERED, DATE_SHIPPED, STATUS);
-- INSERT INTO ITEMS VALUES (ITEMID, ORD_ID, PROD_ID, PROD_NAME,
PRICE, QUANTITY);

-- INSERT INTO PRODUCTS VALUES (PROD_ID, PROD_NAME, RETAIL_PRICE);


-- Guitars
INSERT INTO PRODUCTS VALUES ('SKU101', 'Electric Guitar', 1500);
INSERT INTO PRODUCTS VALUES ('SKU102', 'Hollow Body Electric', 799);
INSERT INTO PRODUCTS VALUES ('SKU103', 'Nylon Acoustic', 200);
INSERT INTO PRODUCTS VALUES ('SKU104', 'Roadworn Electric', 540);
INSERT INTO PRODUCTS VALUES ('SKU105', 'Five String Bass', 2500);
INSERT INTO PRODUCTS VALUES ('SKU106', 'Fretless Bass', 3000);
-- Amps
INSERT INTO PRODUCTS VALUES ('SKU200', 'Valve Amp 2000 ZXP', 1100);
INSERT INTO PRODUCTS VALUES ('SKU201', 'Valve Amp 1000 ZXP', 800);
INSERT INTO PRODUCTS VALUES ('SKU202', 'Solid State 200w', 700);
INSERT INTO PRODUCTS VALUES ('SKU203', 'Solid State 100w', 450);
INSERT INTO PRODUCTS VALUES ('SKU204', 'Practice Amp', 150);

-- Media Players
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

Practice Script Source Code


Chapter 18 - Page 51
INSERT INTO PRODUCTS VALUES ('SKU301', 'Media Player 1Gb', 45);
INSERT INTO PRODUCTS VALUES ('SKU302', 'Media Player 2Gb', 65);
INSERT INTO PRODUCTS VALUES ('SKU303', 'Media Player 4Gb', 99);
INSERT INTO PRODUCTS VALUES ('SKU304', 'Media Player 8Gb', 140);
INSERT INTO PRODUCTS VALUES ('SKU305', 'Media Player 120Gb', 250);

-- INSERT INTO SHIPTYPES VALUES (SHIP_ID, SHIP_TYPE, SHIP_COMPANY);


INSERT INTO SHIPTYPES VALUES (1, 'next_day', 'Express Mail');
INSERT INTO SHIPTYPES VALUES (2, 'two_day', 'Universal Post');
INSERT INTO SHIPTYPES VALUES (3, 'five_day', 'Ultimate Post');
INSERT INTO SHIPTYPES VALUES (4, 'international', 'Express Mail');

-- INSERT INTO INTERNAL_STORE VALUES (PROD_ID, QUANTITY);


-- Guitars
INSERT INTO INTERNAL_STORE VALUES ('SKU101', 5);
INSERT INTO INTERNAL_STORE VALUES ('SKU102', 5);
INSERT INTO INTERNAL_STORE VALUES ('SKU103', 5);
INSERT INTO INTERNAL_STORE VALUES ('SKU104', 10);
INSERT INTO INTERNAL_STORE VALUES ('SKU105', 4);
INSERT INTO INTERNAL_STORE VALUES ('SKU106', 3);
-- Amps
INSERT INTO INTERNAL_STORE VALUES ('SKU200', 5);
INSERT INTO INTERNAL_STORE VALUES ('SKU201', 5);
INSERT INTO INTERNAL_STORE VALUES ('SKU202', 5);
INSERT INTO INTERNAL_STORE VALUES ('SKU203', 5);
INSERT INTO INTERNAL_STORE VALUES ('SKU204', 10);
-- Media Players
INSERT INTO INTERNAL_STORE VALUES ('SKU301', 20);
INSERT INTO INTERNAL_STORE VALUES ('SKU302', 20);
INSERT INTO INTERNAL_STORE VALUES ('SKU303', 15);
INSERT INTO INTERNAL_STORE VALUES ('SKU304', 10);
INSERT INTO INTERNAL_STORE VALUES ('SKU305', 10);

-- INSERT INTO ONLINE_STORE VALUES (PROD_ID, QUANTITY);


-- Guitars
INSERT INTO ONLINE_STORE VALUES ('SKU101', 6);
INSERT INTO ONLINE_STORE VALUES ('SKU102', 8);
INSERT INTO ONLINE_STORE VALUES ('SKU103', 10);
INSERT INTO ONLINE_STORE VALUES ('SKU104', 6);
INSERT INTO ONLINE_STORE VALUES ('SKU105', 2);
INSERT INTO ONLINE_STORE VALUES ('SKU106', 3);
-- Amps

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

Practice Script Source Code


Chapter 18 - Page 52
INSERT INTO ONLINE_STORE VALUES ('SKU200', 2);
INSERT INTO ONLINE_STORE VALUES ('SKU201', 3);
INSERT INTO ONLINE_STORE VALUES ('SKU202', 4);
INSERT INTO ONLINE_STORE VALUES ('SKU203', 1);
INSERT INTO ONLINE_STORE VALUES ('SKU204', 10);
-- Media Players
INSERT INTO ONLINE_STORE VALUES ('SKU301', 10);
INSERT INTO ONLINE_STORE VALUES ('SKU302', 12);
INSERT INTO ONLINE_STORE VALUES ('SKU303', 8);
INSERT INTO ONLINE_STORE VALUES ('SKU304', 7);
INSERT INTO ONLINE_STORE VALUES ('SKU305', 8);

-- INSERT INTO EXTERNAL_STORE VALUES (PROD_ID, QUANTITY)


--===============================================
-- Use the following data for XRef Demos
--===============================================
-- Guitars
INSERT INTO EXTERNAL_STORE VALUES ('GUI001', 5);
INSERT INTO EXTERNAL_STORE VALUES ('GUI002', 5);
INSERT INTO EXTERNAL_STORE VALUES ('GUI003', 5);
INSERT INTO EXTERNAL_STORE VALUES ('GUI004', 10);
INSERT INTO EXTERNAL_STORE VALUES ('GUI005', 4);
INSERT INTO EXTERNAL_STORE VALUES ('GUI006', 3);
-- Amps
INSERT INTO EXTERNAL_STORE VALUES ('AMP001', 5);
INSERT INTO EXTERNAL_STORE VALUES ('AMP002', 5);
INSERT INTO EXTERNAL_STORE VALUES ('AMP003', 5);
INSERT INTO EXTERNAL_STORE VALUES ('AMP004', 5);
INSERT INTO EXTERNAL_STORE VALUES ('AMP005', 10);

-- Media Players
INSERT INTO EXTERNAL_STORE VALUES ('MEDP01', 20);
INSERT INTO EXTERNAL_STORE VALUES ('MEDP02', 20);
INSERT INTO EXTERNAL_STORE VALUES ('MEDP03', 15);
INSERT INTO EXTERNAL_STORE VALUES ('MEDP04', 10);
INSERT INTO EXTERNAL_STORE VALUES ('MEDP05', 10);

-- INSERT INTO PRODID_XREFS VALUES (INT_ID, EXT_ID)


INSERT INTO PRODID_XREFS VALUES ('SKU101', 'GUI001');
INSERT INTO PRODID_XREFS VALUES ('SKU102', 'GUI002');
INSERT INTO PRODID_XREFS VALUES ('SKU103', 'GUI003');
INSERT INTO PRODID_XREFS VALUES ('SKU104', 'GUI004');

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

Practice Script Source Code


Chapter 18 - Page 53
INSERT INTO PRODID_XREFS VALUES ('SKU105', 'GUI005');
INSERT INTO PRODID_XREFS VALUES ('SKU106', 'GUI006');
-- Amps
INSERT INTO PRODID_XREFS VALUES ('SKU200', 'AMP001');
INSERT INTO PRODID_XREFS VALUES ('SKU201', 'AMP002');
INSERT INTO PRODID_XREFS VALUES ('SKU202', 'AMP003');
INSERT INTO PRODID_XREFS VALUES ('SKU203', 'AMP004');
INSERT INTO PRODID_XREFS VALUES ('SKU204', 'AMP005');

-- Media Players
INSERT INTO PRODID_XREFS VALUES ('SKU301', 'MEDP01');
INSERT INTO PRODID_XREFS VALUES ('SKU302', 'MEDP02');
INSERT INTO PRODID_XREFS VALUES ('SKU303', 'MEDP03');
INSERT INTO PRODID_XREFS VALUES ('SKU304', 'MEDP04');
INSERT INTO PRODID_XREFS VALUES ('SKU305', 'MEDP05');

COMMIT;
UNDEFINE passwords
UNDEFINE hostname
SPOOL OFF

Script: soademo_drop.sql
DROP TABLE SHIPTYPES CASCADE CONSTRAINTS;
DROP TABLE PRODUCTS CASCADE CONSTRAINTS;
DROP TABLE ITEMS CASCADE CONSTRAINTS;
DROP TABLE ORDERS CASCADE CONSTRAINTS;
DROP TABLE ADDRESS CASCADE CONSTRAINTS;
DROP TABLE CREDITCARDS CASCADE CONSTRAINTS;
DROP TABLE CUSTOMERS CASCADE CONSTRAINTS;
DROP TABLE INTERNAL_STORE CASCADE CONSTRAINTS;
DROP TABLE ONLINE_STORE CASCADE CONSTRAINTS;
DROP TABLE EXTERNAL_STORE CASCADE CONSTRAINTS;
DROP TABLE PRODID_XREFS CASCADE CONSTRAINTS;
DROP SEQUENCE ORDER_SEQ;
DROP SEQUENCE CUSTOMER_SEQ;
DROP SEQUENCE ADDRESS_SEQ;

Script: soademo_user.sql
grant connect, resource to soademo identified by &password;

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

Practice Script Source Code


Chapter 18 - Page 54

You might also like