Showing posts with label OSB. Show all posts
Showing posts with label OSB. Show all posts

Saturday, December 29, 2018

Oracle Fusion Middleware SOA/OSB Cluster Installation and Domain Setup


Introduction

This document describes the installation and configuration of the Oracle Fusion Middleware SOA/OSB Domain for the version 12.2.1.1.0.

Pre-installation Tasks

The SOA/OSB Server needs a preinstalled database. Create a database and configure it according to Oracle Documentation with help of the DBA team.
Note: All preparation tasks described below must be running on all cluster servers.

Create user oracle and group oinstall (as OS User root)

# groupadd -g 501 oinstall
# useradd -u 500 -g oinstall oracle
# usermod -g oinstall oracle
# id oracle
uid=500(oracle) gid=501(oinstall) groups=501(oinstall)

# mkdir /u01/app/oracle
# chown -R oracle:oinstall /u01/app/oracle

Enable Unicode Support

Your operating system configuration can influence the behavior of characters supported by Oracle Fusion Middleware products.
On UNIX operating systems, Oracle highly recommends that you enable Unicode support by setting the LANG and LC_ALL environment variables to a locale with the UTF-8 character set. This enables the operating system to process any character in Unicode.

Check if Unicode is enabled on the Server:

# locale

LANG=de_DE.UTF-8

LC_CTYPE="de_DE.UTF-8"

LC_NUMERIC="de_DE.UTF-8"

LC_TIME="de_DE.UTF-8"

LC_COLLATE="de_DE.UTF-8"
...

Kernel Parameter

Set the Value for the Parameter SHMMAX to min. 4294967295 in the file /etc/sysctl.conf (as root):
kernel.shmmax = 4294967295
Apply changes:
/sbin/sysctl -p

Install the required OS Packages

Kernel: 2.6.32-100.2 8.5.el6

Packages:
binutils-2.20.51.0.2-5.28.el6
compat-libcap1-1.10-1
compat-libstdc++-33-3.2.3-69.el6 for x86_64
compat-libstdc++-33-3.2.3-69.el6 for i686
gcc-4.4.4-13.el6
gcc-c++-4.4.4-13.el6
glibc-2.12-1.7.el6 for x86_64
glibc-2.12-1.7.el6 for i686
glibc-devel-2.12-1.7.el6 for i686
libaio-0.3.107-10.el6
libaio-devel-0.3.107-10.el6
libgcc-4.4.4-13.el6
libstdc++-4.4.4-13.el6 for x86_64
libstdc++-4.4.4-13.el6 for i686
libstdc++-devel-4.4.4-13.el6
libXext for i386
libXtst for i386
openmotif-2.2.3 for x86_64
openmotif22-2.2.3 for x86_64
sysstat-9.0.4-11.el6
Check if the packages are already installed (as root):
rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' binutils
binutils-2.20.51.0.2-5.42    .el6 (x86_64)


# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' compat-libcap1
compat-libcap1-1.10-1 (x86_64)

# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' compat-libstdc++-33
compat-libstdc++-33-3.2.3-69.el6 (x86_64)
compat-libstdc++-33-3.2.3-69.el6 (i686)

# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' gcc
gcc-4.4.7-11.el6 (x86_64)

# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' gcc-c++
gcc-c++-4.4.7-11.el6 (x86_64)

# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' glibc
glibc-2.12-1.149.el6 (x86_64)
glibc-2.12-1.149.el6 (i686)

# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' glibc
glibc-2.12-1.149.el6 (x86_64)
glibc-2.12-1.149.el6 (i686)

# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' glibc-devel
glibc-devel-2.12-1.149.el6 (x86_64)
glibc-devel-2.12-1.149.el6 (i686)

# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' libaio
libaio-0.3.107-10.el6 (x86_64)

# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' libaio-devel
libaio-devel-0.3.107-10.el6 (x86_64)

# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' libgcc
libgcc-4.4.7-11.el6 (x86_64)

# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' libstdc++
libstdc++-4.4.7-11.el6 (x86_64)
libstdc++-4.4.7-11.el6 (i686)

# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' libstdc++-devel
libstdc++-devel-4.4.7-11.el6 (x86_64)

# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' libXext
libXext-1.3.2-2.1.el6 (x86_64)
libXext-1.3.2-2.1.el6 (i686)

# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' libXtst
libXtst-1.2.2-2.1.el6 (x86_64)
libXtst-1.2.2-2.1.el6 (i686)

# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' openmotif
openmotif-2.3.3-8.el6 (x86_64)

# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' openmotif22
openmotif22-2.2.3-19.el6 (x86_64)

# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' sysstat
sysstat-9.0.4-27.el6 (x86_64)


If some packages are missed:
Find the package with „yum search <package name>“ and the install the package with „yum install …“

Set the OS Limits (as root)

Add following rows to the file /etc/security/limits.conf:
·       soft nofile 4096
·       hard nofile 65536
·       soft nproc 2047
·       hard nproc 16384
Add following rows to the file /etc/security/limits.d/90-nproc.conf:
·       soft nofile 4096
·       hard nofile 65536
·       soft nproc 2047
·       hard nproc 16384 

Installation:

Note: The installation will be proceeding on all the servers of cluster.

Prepare the installation media (as OS User oracle)

Download the following software from the Oracle Software Delivery Cloud:
·       Oracle Fusion Middleware Infrastructure 12.2.1.1.0
https://borysneselovskyi.files.wordpress.com/2016/07/073116_1607_weblogicser1.png?w=507
Download the Java Development Kit from the OTN:
·       jdk-8u91-linux-x64.tar.gz
·        

Create directories and copy the installation media into directories (as OS User oracle)

$ mkdir -p /u01/app/oracle/software/
$ mkdir -p /u01/app/oracle/software/JDK
$ mkdir –p /u01/app/oracle/software/WLS
$ cp jdk-8u91-linux-x64.tar.gz /opt/oracle/software/JDK
$ cp V138469-01.zip /opt/oracle/software/WLS

Prepare the directory structure for the WebLogic 12.2.1.1 (as OS User oracle):

# cd /u01/app/oracle/product
$ mkdir -p /u01/app/oracle/product/JAVA
$ mkdir -p /u01/app/oracle/product/FMW

Set the variable umask to 0027 (as OS User oracle):

$ echo "umask 027" >> ~oracle/.bash_profile

Installation JDK 1.8.0_91 (as OS User oracle)

Note: The Installation of JDK described below must be running on both servers of the cluster.
$ cd /u01/app/oracle/product/JAVA
$ tar xvfz /u01/app/oracle/software/JDK/jdk-8u91-linux-x64.tar.gz
$ mv jdk1.8.0_91 jdk
$ ln -s jdk jdk1.8.0_91

Verify JDK Version:

$ /u01/app/oracle/product/JAVA/jdk/bin/java -version
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)




Installation WebLogic Server 12.2.1.1 (as OS User oracle)

Note: The Installation of WebLogic Server described below must be running on both servers of clusters.
Navigate to software directory, extract the WebLogic software, set an environment and start the installation:
$ cd /u01/app/oracle/software/WLS
$ unzip ./V138469-01.zip
$ export JAVA_HOME=/u01/app/oracle/product/JAVA/jdk
$ export PATH=$JAVA_HOME/bin:$PATH
$ java -jar ./fmw_12.2.1.1.0_infrastructure.jar

Installation screenshots

Set Inventory Directory to /u01/app/oraInventory
1.       The “Welcome” page is displayed, click “Next“:
2.       Enable “Skip Auto Updates“:
3.       Set Oracle Home: /u01/app/oracle/product/FMW/Oracle_Home:
4.       Activate “Fusion Middleware Infrastructure“:
5.       The Prerequisite Checks must be completed without any errors and warnings:
6.       Disable the box “I wish to receive security updates“:
7.       Verify the Summary of the Installation and click the button “Install“:
8.     Verify Installation and click “Next“:
9.       Check installed components and “Finish“.
The Installation Fusion Middleware Infrastructure 12.2.1.1.0 is now completed

Installation SOA 12.2.1.1

Download and extract the following software from the Oracle Software Delivery Cloud: https://edelivery.oracle.com:
–    SOA Suite 12.2.1.1.0
–    OSB 12.2.1.1.0
Note: All tasks described in section must be running on both servers of cluster.
Navigate to software directory, extract the SOA software, set the environment and start the installation:
$ cd /u01/app/oracle/software/SOA_Suite/

$ unzip V138472-01.zip

$ export JAVA_HOME=/u01/app/oracle/product/JAVA/jdk

$ export PATH=$JAVA_HOME/bin:$PATH

$ java -jar ./fmw_12.2.1.1.0_soa.jar
1.       Welcome page click “Next“:
2.       Enable “Skip Auto Updates“:
3.       Set the Oracle Home to /u01/app/oracle/product/FMW/Oracle_Home:
4.       Activate “SOA Suite“:
5.       Prerequisite Checks:
6.       Verify the Summary of the Installation and click the button “Install“:
7.       Verify installation and click Next:
8.       Check installed components and click “Finish“:
The Installation Oracle SOA Suite 12.2.1.1.0 is now completed.

Installation Oracle Service Bus 12.2.1.1 (as OS User oracle)

Note: All tasks described in section must be running on both servers of cluster.
$ cd /u01/app/oracle/software/OSB/

$ unzip V138477-01.zip

$ export JAVA_HOME=/u01/app/oracle/product/JAVA/jdk

$ export PATH=$JAVA_HOME/bin:$PATH

$ java -jar ./fmw_12.2.1.1.0_osb.jar
1.       Welcome page click “Next“:
2.       Enable “Skip Auto Updates“:
3.       Set the Oracle Home to /u01/app/oracle/product/FMW/Oracle_Home:
4.       Activate the button “Service Bus“:
5.       Prerequisite Checks:
6.       Verify the Summary of the Installation and click the button “Install“:
7.       Verify installation and click Next:
8.       Check installed components and click “Finish“:
The Installation Oracle Servce Bus 12.2.1.1.0 is now completed.

Create Database Schemas (as OS User oracle)

Note: The creating of the database schemas must be running only once on the first server.
The database must be already created and prepared for the SOA Domain and the connectivity should be opened between the SOA Cluster servers and DB Server.
1.       Login to the server as user oracle, navigate to oracle_common directory, and start the Repository Creation Utility (RCU):
$ cd /u01/app/oracle/product/FMW/Oracle_Home/oracle_common/bin

$ ./rcu
2.       Welcome page: click “Next“:
3.       Create Repository: For the new SOA Installation choose “Create Repository“ and “System Load and Production Load“:
4.       Database Connection Details: On this Page provide the database connection information:
Database Type: Oracle Database
Host Name (database host): db.server.com
Port (Database Listener Port): 1521
Service Name (Service Name of the repository database): orcl
Username & Password: Administration Account of the SOA Database: sys/xxxxxxxx
Role (Database Admin Role: SYSDBA or SYSOPER): SYSDBA
Click “Next“:
5.       The Installer checks the database connectivity:
6.       Select Components and the Prefix for database schemas:
Following are mandatory selected components:
a.       Common Infrastructure Services (Mandatory selected components cannot be deselected)
b.       Additionally I selected “Oracle Platform Security Services“, “SOA Infrastructure“ and “Oracle Enterprise Scheduler“.
7.       The installer will check database prerequisites:
8.       Set the password for all database schemas:
9.       Choose the size of the SOA Repository (small, medium or high): Medium
10.   Map Tablespaces: On this page you can change the tablespace settings:
11.   In the next step the installer asks for the creating tablespaces for the soa repository:
Tablespaces will be created:
12.   Summary: check the details and click “Create“:
13.   Check detail and click “Close“:
The SOA Repository Creation is now completed

Create the SOA / OSB Domain (as OS User oracle)

Note: The creating of the WebLogic Server Domain must be running only once on the first server: host01.
1.       Navigate to the oracle_common directory and start the Configuration Wizard:
$ cd /u01/app/oracle/product/FMW/Oracle_Home/oracle_common/common/bin

$ ./config.sh
2.       Choose “Create a new Domain“ and set the “Domain Location“ to /u01/app/oracle/user_projects/domains/soa_domain:
3.       On the next page you can add several WebLogic Server and SOA – OSB Templates.
4.       Select “SOA Suite“, “Oracle Service Bus“, “Oracle API Manager“, “Oracle Enterprise Scheduler Service Basic“, “Oracle User Messaging Service Basic“ and “Oracle OPSS REST Service Application“ (additional prerequisite components Coherence and JRF will be selected automatically).
For more information about templates please refer to oracle documentation:
5.       Specify an “Application Location“: /u01/app/oracle/user_projects/applications/soa_domain:
6.       Set the Name and Password for the WebLogic Administrator:
7.       Choose “Domain Mode“: Production and check the JDK location:
8.       Configure the database details:
9.       Specify the correct schema prefix: SOATST_STB and the information what were specified when you previously ran RCU (Chapter “Create Database Schemas“).
10.   Then click on the Button “Get RCU Configuration“:
11.   Installer checks database connectivity and click “Next“:
12.   Keep the default values and click “Next“:
13.   The installer checks the database connections:
14.   We don’t configure the Key Store. Let default values and click “Next“
15.   Activate check boxes for Administration Server, Node Manager and Topology for the advanced configuration:
16.   On the next page configure the Administration Server:
Name: AdminServer
Listen Address: x.x.x.x
Listen Port: 7001
17.   Configure the Node Manager:
Set Node Manager Type to “Per Domain Default Location“ – default
Enter Node Manager Credentials:
Username: nodemanager
Password: xxxxxxxxxxx
18.   On the page “Managed Servers“ add soa, osb, scheduler and webservices with following settings:
Managed server
Listen Address
Port
Server Group
soa_server1
x.x.x.x
7003
SOA-MGD- SVRS-ONLY
osb_server1
x.x.x.x
7004
OSB-MGD-SVRS-ONLY
ess_server1
x.x.x.x
7005
ESS-MGD-SVRS
owsm_server1
x.x.x.x
7006
JRF-MAN-SVR, WSM-CACHE-SVR, WSMPM-MAN-SVR
soa_server2
x.x.x.x
7003
SOA-MGD- SVRS-ONLY
osb_server2
x.x.x.x
7004
OSB-MGD-SVRS-ONLY
ess_server2
x.x.x.x
7005
ESS-MGD-SVRS
owsm_server2
x.x.x.x
7006
JRF-MAN-SVR, WSM-CACHE-SVR, WSMPM-MAN-SVR
We will place the four managed server (soa_server1, osb_server1, ess_server1 and owsm_server1) on the host1 and the another four managed server (soa_server2, osb_server2, ess_server2 and owsm_server2) on the host2.
Server groups in the Middleware 12c allow to target and execute of middleware components (such soa or osb) on managed servers.
For example the server group SOA-MGD-sRVC-ONLY is responsible to execute the SOA content.
Server groups JRF-MAN-SVR and WSM-CACHE-SVR / WSMPM-MAN-SRV ensure that Oracle JRF and Oracle Web Services Manager (OWSM) services target Managed Servers you are creating.
19.   Create 4 Clusters: soa_cluster1, osb_cluster1, ess_cluster1 and owsm_cluster1 and Leave all another fields default “Next“.
20.   Add Managed Servers to clusters:
ess_cluster1: ess_server1, ess_server2
osb_cluster1: osb_server1, osb_server2
owsm_cluster1: owsm_server1, owsm_server2
soa_cluster1: soa_server1, soa_server2
21.   Specify the Coherence Cluster Listen Port:
22.   Create Unix Machines for each host.
23.   Add Managed Servers to machines:
HOST1: AdminServer, ess_server1, osb_server1, owsm_server1, soa_server1
HOST2: ess_server2, osb_server2, owsm_server2, soa_server3
24.   In this we don’t configure “Virtual Targets“.
25.   We don’t create “Partitions“:
26.   Check configuration summary and press the button “Create“:
27.   The Creation of initial Domain is now completed -> Click “Next“.
28.   The SOA Domain is now created à Click “Finish“:

Post-Installation Tasks

Disabling the Derby Database

Note: All tasks described in this chapter must be running on all the servers of the cluster.
$ cd /u01/app/oracle/product/FMW/Oracle_Home/wlserver/common/derby/lib/
$ mv derby.jar disable_derby.jar

Start the AdminServer via script

Enter the values for the Administration User (weblogic) and passwort when prompted:
$ cd /u01/app/oracle/user_projects/domains/soa_domain/bin
$ ./startWebLogic.sh
Enter username to boot WebLogic server:weblogic
Enter password to boot WebLogic server:xxx

Shutdown the AdminServer via script:

$ cd /u01/app/oracle/user_projects/domains/soa_domain/bin
$ ./stopWebLogic.sh

Create the file boot.properties on the server host01

$ cd /u01/app/oracle/user_projects/domains/soa_domain/servers/AdminServer
$ mkdir security
$ cd security/
$ echo -e "username=weblogic\npassword=welcome1" > boot.properties
$ cat boot.properties
username=weblogic
password=welcome1

Copying the Domain configuration from the server host01 to the host02

Save the Domain configuration on the server host01:
$ cd /u01/app/oracle/product/FMW/Oracle_Home/oracle_common/common/bin
$ ./pack.sh -domain=/u01/app/oracle/user_projects/domains/soa_domain -template=/home/oracle/soa_domain.jar -template_name=soa_domain
Output:
<< read domain from "/u01/app/oracle/user_projects/domains/soa_domain" >> succeed: read domain from "/u01/app/oracle/user_projects/domains/soa_domain"
<< write template to "/home/oracle/soa_domain.jar" .............................. >> succeed: write template to "/home/oracle/soa_domain.jar"
<< close template >> succeed: close template
Copy the file host01:/home/oracle/soa_domain.jar to the server host02
                  $ scp /home/oracle/soa_domain.jar host02.example.com:/home/oracle
Extract the domain configuration on the server host02.example.com:
$ mkdir -p /u01/app/oracle/user_projects/domains

$ mkdir -p /u01/app/oracle/user_projects/applications

$ cd /u01/app/oracle/product/FMW/Oracle_Home/oracle_common/common/bin

$ ./unpack.sh -user_name=weblogic -password=welcome1 -domain=/u01/app/oracle/user_projects/domains/soa_domain -overwrite_domain=true -template=/home/oracle/soa_domain.jar -log_priority=DEBUG -log=/tmp/unpack.log -app_dir=/u01/app/oracle/user_projects/applications
Output:
<< read template from "/home/oracle/soa_domain.jar" >> succeed: read template from "/home/oracle/soa_domain.jar"

<< set config option AppDir to "/u01/app/oracle/user_projects/applications" >> succeed: set config option AppDir to "/u01/app/oracle/user_projects/applications"

<< find User "weblogic" as u1_CREATE_IF_NOT_EXIST >> succeed: find User "weblogic" as u1_CREATE_IF_NOT_EXIST

<< set u1_CREATE_IF_NOT_EXIST attribute Password to "********" >> succeed: set u1_CREATE_IF_NOT_EXIST attribute Password to "********"

<< set u1_CREATE_IF_NOT_EXIST attribute IsDefaultAdmin to "true" >> succeed: set u1_CREATE_IF_NOT_EXIST attribute IsDefaultAdmin to "true"

<< write Domain to "/u01/app/oracle/user_projects/domains/soa_domain" ............................................................................................... >> succeed: write Domain to "/u01/app/oracle/user_projects/domains/soa_domain"

              << close template >> succeed: close template

NodeManager configuration (as OS User oracle)

Server host1:
Edit file nodemanager.properties:
$ cd /u01/app/oracle/user_projects/domains/soa_domain/nodemanager

$ vi nodemanager.properties
Change parameter:
Old:
                  CrashRecoveryEnabled=false
New:
CrashRecoveryEnabled=true
Start NodeManager:
$ cd /u01/app/oracle/user_projects/domains/soa_domain/bin

$ nohup ./startNodeManager.sh &
Server host02:
Edit file nodemanager.properties:
$ cd /u01/app/oracle/user_projects/domains/soa_domain/nodemanager
$ vi nodemanager.properties
Change parameter:
Old:
ListenAddress=x.x.x.x
CrashRecoveryEnabled=false
New:
ListenAddress=x.x.x.x
CrashRecoveryEnabled=true

Start NodeManager:

$ cd /u01/app/oracle/user_projects/domains/soa_domain/bin
$ nohup ./startNodeManager.sh &

Start AdminServer via NodeManager and WLST on the Server host01 (as OS User oracle)

Start wlst:
$ /u01/app/oracle/product/FMW/Oracle_Home/oracle_common/common/bin/wlst.sh
Connect to NodeManager:
wlst> nmConnect('nodemanager','welcome1', 'x.x.x.x','5556','soa_domain','/u01/app/oracle/user_projects/domains/soa_domain')
Start AdminServer:
wls:/nm/soa_proddomain> nmStart('AdminServer')
Output:
Starting server AdminServer ...
Successfully started server AdminServer ...

Execute nmEnroll commando on the second server: host02 (as OS User oracle)

Start wlst:
$ /u01/app/oracle/product/FMW/Oracle_Home/oracle_common/common/bin/wlst.sh
Connect to AdminServer (AdminServer must be running):
wlst:/offline> connect('weblogic','welcome1','t3://192.168.75.32:7001')
Execute nmEnroll command:
wlst:/soa_domain/serverConfig/> nmEnroll('/u01/app/oracle/user_projects/domains/soa_domain','/u01/app/oracle/user_projects/domains/soa_domain/nodemanager')
Output.
Enrolling this machine with the domain directory at /u01/app/oracle/user_projects/domains/soa_domain ...
Successfully enrolled this machine with the domain directory at /u01/app/oracle/user_projects/domains/soa_domain.

Restart the NodeManager:

$ cd /u01/app/oracle/user_projects/domains/soa_domain/bin
$ ./stopNodeManager.sh
$ nohup ./startNodeManager.sh &

Start all Managed Servers via AdminConsole

Open the Browser and go to http://x.x.x.x:7001/console
Starting all Managed Servers via WebLogic Server Admin Console:
All Managed Servers are running:
Get your familiar with the new look of the Enterprise Manager:
Open the page: http://x.x.x.x:7001/em:

Prepare the WebLogic Server domain for the auto start

Server host01:
Create directory (as OS User oracle):
[oracle@host01 ~]$ mkdir /u01/app/oracle/scripts
[oracle@host01 ~]$ chmod 744 /u01/app/oracle/scripts
[oracle@host01 ~]$ cd /u01/app/oracle/scripts
Create scripts in the directory /u01/app/oracle/scripts (as OS User oracle)
Create script /home/oracle/scripts/fmw_nodemanager.sh:
#!/bin/bash
## fmw_nodemanager.sh

DOMAIN_HOME=/u01/app/oracle/user_projects/domains/soa_domain
WORK_DIR=/u01/app/oracle/scripts
export DOMAIN_HOME WORK_DIR

case "$1" in
  start)
    nohup ${DOMAIN_HOME}/bin/startNodeManager.sh > ${WORK_DIR}/nodemanager.out 2>&1 &
    ;;
  stop)
    ${DOMAIN_HOME}/bin/stopNodeManager.sh
    ;;
  *)
    echo "usage: $0 [start|stop]"
    exit 2
    ;;
esac

Create script /u01/app/oracle/scripts/fmw_admin_and_ms.sh:
#!/bin/bash
## fmw_admin_and_ms.sh

DOMAIN_HOME=/u01/app/oracle/user_projects/domains/soa_domain
ORACLE_HOME=/u01/app/oracle/product/FMW/Oracle_Home
WORK_DIR=/u01/app/oracle/scripts
export DOMAIN_HOME ORACLE_HOME WORK_DIR
WLST=${ORACLE_HOME}/oracle_common/common/bin/wlst.sh
export WLST

case "$1" in
  start)
    ${WLST} ${WORK_DIR}/start_admin.py
    ${WLST} ${WORK_DIR}/start_ms.py
    ;;
  start_admin)
    ${WLST} ${WORK_DIR}/start_admin.py
    ;;
  start_ms)
    ${WLST} ${WORK_DIR}/start_ms.py
    ;;
  stop)
    ${WLST} ${WORK_DIR}/stop_ms.py
    ${WLST} ${WORK_DIR}/stop_admin.py
    ;;
  stop_admin)
    ${WLST} ${WORK_DIR}/stop_admin.py
    ;;
  stop_ms)
    ${WLST} ${WORK_DIR}/stop_ms.py
    ;;
  *)
    echo "usage: $0 [start|start_admin|start_ms|stop|stop_admin|stop_ms]"
    exit 2
    ;;
esac
Create script /u01/app/oracle/scripts/start_admin.py:
nmConnect('nodemanager','welcome1, 'x.x.x.x','5556','base_domain','/u01/app/oracle/user_projects/domains/soa_domain')
nmStart('AdminServer')
Create script /u01/app/oracle/scripts/stop_admin.py:
nmConnect('nodemanager','welcome1, 'x.x.x.x','5556','base_domain','/u01/app/oracle/user_projects/domains/soa_domain')
nmKill('AdminServer')
Create script /u01/app/oracle/scripts/start_ms.py:
nmConnect('nodemanager','welcome1, 'x.x.x.x','5556','base_domain','/u01/app/oracle/user_projects/domains/soa_domain')
nmStart('owsm_server1')
nmStart('osb_server1')
nmStart('soa_server1')
nmStart('ess_server1')
Create script /u01/oracle/scripts/stop_ms.py:
nmConnect('nodemanager','welcome1, 'x.x.x.x','5556','base_domain','/u01/app/oracle/user_projects/domains/soa_domain')
nmKill('ess_server1')
nmKill('soa_server1')
nmKill('osb_server1')
nmKill('owsm_server1')
Set permissions:
$ chmod -R 747 /u01/app/oracle/scripts
Integrate start-stop-scripts in Linux run-level (as OS user root)
Create script /etc/init.d/oracle (as root):
#!/bin/sh
# chkconfig: 345 99 10
# description: Oracle auto start-stop script.
# Set ORA_OWNER to the user id of the owner of the
export HOME=/u01/app/oracle/scripts
ORA_OWNER=oracle

if [ ! -f ${HOME}/fmw_nodemanager.sh \
  -o ! -f ${HOME}/fmw_admin_and_ms.sh     \
  -o ! -f ${HOME}/start_admin.py     \
  -o ! -f ${HOME}/stop_admin.py     \
  -o ! -f ${HOME}/start_ms.py     \
  -o ! -f ${HOME}/stop_ms.py ]
then
  echo "Oracle FMW startup: cannot start"
  exit
fi

case "$1" in
  'start')
    su $ORA_OWNER -c "$HOME/fmw_nodemanager.sh start"
    sleep 120
    su $ORA_OWNER -c "$HOME/fmw_admin_and_ms.sh start"
    ;;
  'stop')
    su $ORA_OWNER -c "${HOME}/fmw_admin_and_ms.sh stop"
    su $ORA_OWNER -c "${HOME}/fmw_nodemanager.sh stop"
    ;;
esac

Integrate the script /etc/init.d/oracle in run-levels (as root):
# chmod 700 /etc/init.d/oracle
# cd /etc/init.d
# chkconfig --add oracle
Check ( as root):
# chkconfig --list oracle
oracle 0:off 1:off 2:off 3:on 4:on 5:on 6:off
Server host2:
Create directory (as OS User oracle):
$ mkdir /u01/app/oracle/scripts
$ chmod 744 /u01/app/oracle/scripts
$ cd /u01/app/oracle/scripts
Create scripts in the directory /u01/app/oracle/scripts (as OS User oracle)
Create script /u01/app/oracle/scripts/fmw_nodemanager.sh:
#!/bin/bash
## fmw_nodemanager.sh
DOMAIN_HOME=/u01/app/oracle/user_projects/domains/soa_domain
WORK_DIR=/u01/app/oracle/scripts
export DOMAIN_HOME WORK_DIR
case "$1" in
  start)
    nohup ${DOMAIN_HOME}/bin/startNodeManager.sh > ${WORK_DIR}/nodemanager.out 2>&1 &
    ;;
  stop)
    ${DOMAIN_HOME}/bin/stopNodeManager.sh
    ;;
  *)
    echo "usage: $0 [start|stop]"
    exit 2
    ;;
esac

Create script /u01/app/oracle/scripts/fmw_ms.sh:
#!/bin/bash
## fmw_ms.sh
DOMAIN_HOME=/u01/app/oracle/user_projects/domains/soa_domain
ORACLE_HOME=/u01/app/oracle/product/FMW/Oracle_Home
WORK_DIR=/u01/app/oracle/scripts
export DOMAIN_HOME ORACLE_HOME WORK_DIR
WLST=${ORACLE_HOME}/oracle_common/common/bin/wlst.sh
export WLST
case "$1" in
  start)
    ${WLST} ${WORK_DIR}/start_ms.py
    ;;
  stop)
    ${WLST} ${WORK_DIR}/stop_ms.py
    ;;
  *)
    echo "usage: $0 [start|stop]"
    exit 2
    ;;
esac



Create script /u01/app/oracle/scripts/start_ms.py:
nmConnect('nodemanager','welcome1, 'x.x.x.x','5556','base_domain','/u01/app/oracle/user_projects/domains/soa_domain')
nmStart('owsm_server2')
nmStart('osb_server2)
nmStart('soa_server2')
nmStart('ess_server2')
Create script /u01/app/oracle/scripts/stop_ms.py:
nmConnect('nodemanager','welcome1, 'x.x.x.x','5556','base_domain','/u01/app/oracle/user_projects/domains/soa_domain')
nmKill('ess_server2')
nmKill('soa_server2')
nmKill('osb_server2')
nmKill('owsm_server2')
Set permissions:
$ chmod -R 747 /home/oracle/scripts
Integrate start-stop-scripts in Linux run-level (as OS user root)
Create script /etc/init.d/oracle (as root):
#!/bin/sh
# chkconfig: 345 99 10
# description: Oracle auto start-stop script.
# Set ORA_OWNER to the user id of the owner of the
export HOME=/u01/app/oracle/scripts
ORA_OWNER=oracle
if [ ! -f ${HOME}/fmw_nodemanager.sh \
  -o ! -f ${HOME}/fmw_ms.sh     \
  -o ! -f ${HOME}/start_ms.py     \
  -o ! -f ${HOME}/stop_ms.py ]
then
  echo "Oracle FMW startup: cannot start"
  exit
fi
case "$1" in
  'start')
    su $ORA_OWNER -c "$HOME/fmw_nodemanager.sh start"
    sleep 120
    su $ORA_OWNER -c "$HOME/fmw_ms.sh start"
    ;;
  'stop')
    su $ORA_OWNER -c "${HOME}/fmw_ms.sh stop"
    su $ORA_OWNER -c "${HOME}/fmw_nodemanager.sh stop"
    ;;
esac

Integrate the script /etc/init.d/oracle in run-levels (as root):
# chmod 700 /etc/init.d/oracle
# cd /etc/init.d
# chkconfig –add oracle
Check (as root):
# chkconfig --list oracle
oracle 0:off 1:off 2:off 3:on 4:on 5:on 6:off