Shell script to stop weblogic , forms, reports , ohs instance in 12.2.1.4

 

Create an env file with following details.

 Note: It is assumed that boot.properties file is configured with weblogic username and password. Otherwise the script will prompt for username and password.

cat /home/oracle/app_env

ORACLE_BASE=/d01/app/oracle; export ORACLE_BASE

ORACLE_HOME=$ORACLE_BASE/product/12.2.1.4; export ORACLE_HOME

MW_HOME=$ORACLE_HOME ; export MW_HOME

WLS_HOME=$MW_HOME/wlserver; export WLS_HOME

WL_HOME=$WLS_HOME  ;export WLS_HOME

DOMAIN_HOME=/d01/app/oracle/product/12.2.1.4/user_projects/domains/prod_domain; export DOMAIN_HOME

JAVA_HOME=/usr/java/jdk1.8.0_231-amd64; export JAVA_HOME

export OHS_INST=/d01/app/oracle/product/12.2.1.4/user_projects/domains/prod_domain/config/fmwconfig/components/OHS/instances/ohs1 ;export OHS_INST

PATH=$JAVA_HOME/bin:$PATH ; export PATH

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

export FORMS_PATH=/d01/app/oracle/product/12.2.1.4/forms; export FORMS_PATH

 

Here, ORACLE_BASE stands for oracle base

ORACLE_HOME stands for middleware home

MW_HOME also stands for middleware home

DOMAIN_HOME stands for domain home

OHS_INST stands for Oracle HTTP Server instance home

 

Now create shell script

vi stop_services.sh

# Start NodeManager

#!/bin/bash

. /home/oracle/app_env

 

echo "*************************Stopping Ohs Instance ********************************"

 

# Stop the web tier.

$DOMAIN_HOME/bin/stopComponent.sh ohs1

 

sleep 5

 

echo "*************************Stopping Standalone Report Server ********************************"

 

$DOMAIN_HOME/bin/stopComponent.sh rep_server1_prod

 

sleep 5

echo "*************************Stopping Forms Services ********************************"

 

# Stop the managed Servers

$DOMAIN_HOME/bin/stopManagedWebLogic.sh WLS_FORMS

 

sleep 5

 

echo "*************************Stopping Reports Services ********************************"

 

$DOMAIN_HOME/bin/stopManagedWebLogic.sh WLS_REPORTS

 

sleep 5

 

echo "*************************Stopping WebLogic********************************"

 

# Stop the WebLogic Domain

$DOMAIN_HOME/bin/stopWebLogic.sh

 

sleep 5

echo "*************************Stopping NodeManager********************************"

 

$DOMAIN_HOME/bin/stopNodeManager.sh

 

echo "*************************All Services are stopped now!********************************"

 

 

No comments:

Post a Comment