This discussion is archived
1 Reply Latest reply: Apr 17, 2013 10:01 AM by Marcus Rangel RSS

share script about ocsg & weblogic

999926 Newbie
Currently Being Moderated
111setConnEnv.sh :

#!/bin/bash

# Set the general domain environment.
. ~/ocsgCourse/domains/labDomain/bin/setDomainEnv.sh

# The setDomainEnv script changes the working directory.
# Use popd to jump back to where we were.
popd

# Set general environment variables to be used in all WLST scripts.
USERNAME="weblogic"
export USERNAME

PASSWORD="p4ssw0rd"
export PASSWORD

HOSTNAME="localhost"
export HOSTNAME

PORT="8001"
export PORT


222start_lab_pte.sh :

#!/bin/sh

. /opt/ocsg500/wlserver_10.3/common/bin/commEnv.sh
/opt/ocsg500/ocsg_pds_5.0/pte/run.sh


333startWebLogic.sh :

#!/bin/sh

# WARNING: This file is created by the Configuration Wizard.
# Any changes to this script may be lost when adding extensions to this configuration.

DOMAIN_HOME="/home/oracle/ocsgCourse/domains/labDomain"

${DOMAIN_HOME}/bin/startWebLogic.sh $*


444setDomainEnv.sh :

#!/bin/sh

# WARNING: This file is created by the Configuration Wizard.
# Any changes to this script may be lost when adding extensions to this configuration.

# --- Start Functions ---

BP=100
SP=$BP

pushd()
{
     if [ -z "$1" ]
     then
          return
     fi

     SP=`expr $SP - 1`
     eval _stack$SP=`pwd`
     cd $1
     return
}

popd()
{
     if [ $SP -eq $BP ]
     then
          return
     fi
     eval cd \${_stack$SP}
     SP=`expr $SP + 1`
     return
}


# --- End Functions ---

# *************************************************************************
# This script is used to setup the needed environment to be able to start Weblogic Server in this domain.
#
# This script initializes the following variables before calling commEnv to set other variables:
#
# WL_HOME - The BEA home directory of your WebLogic installation.
# JAVA_VM - The desired Java VM to use. You can set this environment variable before calling
# this script to switch between Sun or BEA or just have the default be set.
# JAVA_HOME - Location of the version of Java used to start WebLogic
# Server. Depends directly on which JAVA_VM value is set by default or by the environment.
# USER_MEM_ARGS - The variable to override the standard memory arguments
# passed to java.
# PRODUCTION_MODE - The variable that determines whether Weblogic Server is started in production mode.
# DOMAIN_PRODUCTION_MODE
# - The variable that determines whether the workshop related settings like the debugger,
# testconsole or iterativedev should be enabled. ONLY settable using the
# command-line parameter named production
# NOTE: Specifying the production command-line param will force
# the server to start in production mode.
#
# Other variables used in this script include:
# SERVER_NAME - Name of the weblogic server.
# JAVA_OPTIONS - Java command-line options for running the server. (These
# will be tagged on to the end of the JAVA_VM and
# MEM_ARGS)
#
# For additional information, refer to the WebLogic Server Administration
# Console Online Help(http://e-docs.bea.com/wls/docs92/ConsoleHelp/startstop.html).
# *************************************************************************

WL_HOME="/opt/ocsg50/wlserver_10.3"
export WL_HOME

BEA_JAVA_HOME="/opt/ocsg50/jrockit_160_17_R28.0.0-677"
export BEA_JAVA_HOME

SUN_JAVA_HOME="/opt/ocsg50/jdk160_18"
export SUN_JAVA_HOME

WLNG_HOME="/opt/ocsg50/ocsg_5.0"
export WLNG_HOME

if [ "${JAVA_VENDOR}" = "BEA" ] ; then
     JAVA_HOME="${BEA_JAVA_HOME}"
     export JAVA_HOME

else
     if [ "${JAVA_VENDOR}" = "Sun" ] ; then
          JAVA_HOME="${SUN_JAVA_HOME}"
          export JAVA_HOME
     else
JAVA_VENDOR="Oracle"
          export JAVA_VENDOR
JAVA_HOME="/opt/ocsg50/jrockit_160_17_R28.0.0-677"
          export JAVA_HOME
     fi
fi

# We need to reset the value of JAVA_HOME to get it shortened AND
# we can not shorten it above because immediate variable expansion will blank it

JAVA_HOME="${JAVA_HOME}"
export JAVA_HOME

SAMPLES_HOME="${WL_HOME}/samples"
export SAMPLES_HOME

DOMAIN_HOME="/home/oracle/ocsgCourse/domains/labDomain"
export DOMAIN_HOME

LONG_DOMAIN_HOME="/home/oracle/ocsgCourse/domains/labDomain"
export LONG_DOMAIN_HOME

if [ "${DEBUG_PORT}" = "" ] ; then
     DEBUG_PORT="8453"
     export DEBUG_PORT
fi

if [ "${SERVER_NAME}" = "" ] ; then
SERVER_NAME="AdminServer"
     export SERVER_NAME
fi

# Disable WLS WebService exception trace
JAVA_OPTIONS="${JAVA_OPTIONS} -Dweblogic.wsee.component.exception=false"

# Optional ORB configuration
#JAVA_OPTIONS="${JAVA_OPTIONS} -Dwlng.corba.host=localhost"
#JAVA_OPTIONS="${JAVA_OPTIONS} -Dwlng.corba.port=10001"
#JAVA_OPTIONS="${JAVA_OPTIONS} -Dwlng.corba.thread_pool_size=100"
#JAVA_OPTIONS="${JAVA_OPTIONS} -Dwlng.corba.request_timeout=10000"
#JAVA_OPTIONS="${JAVA_OPTIONS} -Dwlng.corba.connect_timeout=3000"

JAVA_OPTIONS="${JAVA_OPTIONS} -Docsg.dir.name=ocsg_5.0"
JAVA_OPTIONS="${JAVA_OPTIONS} -Dpds.dir.name=ocsg_pds_5.0"
JAVA_OPTIONS="${JAVA_OPTIONS} -Dmodules.dir.name=modules"

export JAVA_OPTIONS


POINTBASE_FLAG="false"
export POINTBASE_FLAG

enableHotswapFlag=""
export enableHotswapFlag

PRODUCTION_MODE=""
export PRODUCTION_MODE

doExitFlag="false"
export doExitFlag
verboseLoggingFlag="false"
export verboseLoggingFlag
while [ $# -gt 0 ]
do
     case $1 in
     nodebug)
          debugFlag="false"
          export debugFlag
          ;;
     production)
          DOMAIN_PRODUCTION_MODE="true"
          export DOMAIN_PRODUCTION_MODE
          ;;
     notestconsole)
          testConsoleFlag="false"
          export testConsoleFlag
          ;;
     noiterativedev)
          iterativeDevFlag="false"
          export iterativeDevFlag
          ;;
     noLogErrorsToConsole)
          logErrorsToConsoleFlag="false"
          export logErrorsToConsoleFlag
          ;;
     nopointbase)
          POINTBASE_FLAG="false"
          export POINTBASE_FLAG
          ;;
     doExit)
          doExitFlag="true"
          export doExitFlag
          ;;
     noExit)
          doExitFlag="false"          export doExitFlag
          ;;
     verbose)
          verboseLoggingFlag="true"
          export verboseLoggingFlag
          ;;
     enableHotswap)
          enableHotswapFlag="-javaagent:${WL_HOME}/server/lib/diagnostics-agent.jar"
          export enableHotswapFlag
          ;;
     *)
          PROXY_SETTINGS="${PROXY_SETTINGS} $1"
          export PROXY_SETTINGS
          ;;
     esac
     shift
done

if [ "${DOMAIN_PRODUCTION_MODE}" = "true" ] ; then
     PRODUCTION_MODE="${DOMAIN_PRODUCTION_MODE}"
     export PRODUCTION_MODE
fi

if [ "${PRODUCTION_MODE}" = "true" ] ; then
     debugFlag="false"
     export debugFlag
     testConsoleFlag="false"
     export testConsoleFlag
     iterativeDevFlag="false"
     export iterativeDevFlag
fi

# If you want to override the default Patch Classpath, Library Path and Path for this domain,
# Please uncomment the following lines and add a valid value for the environment variables
# set PATCH_CLASSPATH=[myPatchClasspath] (windows)
# set PATCH_LIBPATH=[myPatchLibpath] (windows)
# set PATCH_PATH=[myPatchPath] (windows)
# PATCH_CLASSPATH=[myPatchClasspath] (unix)
# PATCH_LIBPATH=[myPatchLibpath] (unix)
# PATCH_PATH=[myPatchPath] (unix)

. ${WL_HOME}/common/bin/commEnv.sh

#Add WLNG store schema directory to WLS extension directories
WEBLOGIC_EXTENSION_DIRS=${WEBLOGIC_EXTENSION_DIRS}${CLASSPATHSEP}${DOMAIN_HOME}/config/store_schema

WLS_HOME="${WL_HOME}/server"
export WLS_HOME

WLI_HOME="${WL_HOME}/integration"
export WLI_HOME

MEM_ARGS="-Xms256m -Xmx512m"
if [ "${PRODUCTION_MODE}" = "true" ] ; then
MEM_ARGS="-Xms512m -Xmx512m"

if [ "${JAVA_VENDOR}" = "Sun" ] ; then
MEM_ARGS="${MEM_ARGS} -Xmn256m -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=90"
fi
else
if [ "${JAVA_VENDOR}" = "Sun" ] ; then
MEM_ARGS="${MEM_ARGS} -XX:CompileThreshold=8000 -XX:PermSize=256m"
fi
fi
export MEM_ARGS

if [ "${JAVA_VENDOR}" = "Sun" ] ; then
     MEM_ARGS="${MEM_ARGS} -XX:MaxPermSize=256m"
     export MEM_ARGS
fi

if [ "${JAVA_VENDOR}" = "HP" ] ; then
     MEM_ARGS="${MEM_ARGS} -XX:MaxPermSize=128m"
     export MEM_ARGS
fi

# IF USER_MEM_ARGS the environment variable is set, use it to override ALL MEM_ARGS values

if [ "${USER_MEM_ARGS}" != "" ] ; then
     MEM_ARGS="${USER_MEM_ARGS}"
     export MEM_ARGS
fi

JAVA_PROPERTIES="-Dplatform.home=${WL_HOME} -Dwls.home=${WLS_HOME} -Dwli.home=${WLI_HOME}"
export JAVA_PROPERTIES

# To use Java Authorization Contract for Containers (JACC) in this domain,
# please uncomment the following section. If there are multiple machines in
# your domain, be sure to edit the setDomainEnv in the associated domain on
# each machine.
#
# -Djava.security.manager
# -Djava.security.policy=location of weblogic.policy
# -Djavax.security.jacc.policy.provider=weblogic.security.jacc.simpleprovider.SimpleJACCPolicy
# -Djavax.security.jacc.PolicyConfigurationFactory.provider=weblogic.security.jacc.simpleprovider.PolicyConfigurationFactoryImpl
# -Dweblogic.security.jacc.RoleMapperFactory.provider=weblogic.security.jacc.simpleprovider.RoleMapperFactoryImpl

JAVA_PROPERTIES="${JAVA_PROPERTIES} ${EXTRA_JAVA_PROPERTIES}"
export JAVA_PROPERTIES

ARDIR="${WL_HOME}/server/lib"
export ARDIR

pushd ${LONG_DOMAIN_HOME}

# Clustering support (edit for your cluster!)

if [ "${ADMIN_URL}" = "" ] ; then
     # The then part of this block is telling us we are either starting an admin server OR we are non-clustered
     CLUSTER_PROPERTIES="-Dweblogic.management.discover=true"
     export CLUSTER_PROPERTIES
else
     CLUSTER_PROPERTIES="-Dweblogic.management.discover=false -Dweblogic.management.server=${ADMIN_URL}"
     export CLUSTER_PROPERTIES
fi

if [ "${LOG4J_CONFIG_FILE}" != "" ] ; then
     JAVA_PROPERTIES="${JAVA_PROPERTIES} -Dlog4j.configuration=file:${LOG4J_CONFIG_FILE}"
     export JAVA_PROPERTIES
fi

JAVA_PROPERTIES="${JAVA_PROPERTIES} ${CLUSTER_PROPERTIES}"
export JAVA_PROPERTIES

# Clear the pre_classpath here in case an application template wants to set it before the larger pre_classpath is invoked below

PRE_CLASSPATH=""
export PRE_CLASSPATH

JAVA_DEBUG=""
export JAVA_DEBUG

if [ "${debugFlag}" = "true" ] ; then
     JAVA_DEBUG="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=${DEBUG_PORT},server=y,suspend=n -Djava.compiler=NONE"
     export JAVA_DEBUG
     JAVA_OPTIONS="${JAVA_OPTIONS} ${enableHotswapFlag} -ea -da:com.bea... -da:javelin... -da:weblogic... -ea:com.bea.wli... -ea:com.bea.broker... -ea:com.bea.sbconsole..."
     export JAVA_OPTIONS
else
     JAVA_OPTIONS="${JAVA_OPTIONS} ${enableHotswapFlag} -da"
     export JAVA_OPTIONS
fi

if [ ! -d ${JAVA_HOME}/lib ] ; then
     echo "The JRE was not found in directory ${JAVA_HOME}. (JAVA_HOME)"
     echo "Please edit your environment and set the JAVA_HOME"
     echo "variable to point to the root directory of your Java installation."
     popd
     read _val
     exit
fi

if [ "${POINTBASE_FLAG}" = "true" ] ; then
     DATABASE_CLASSPATH="${POINTBASE_CLASSPATH}"
     export DATABASE_CLASSPATH
else
     DATABASE_CLASSPATH="${POINTBASE_CLIENT_CLASSPATH}"
     export DATABASE_CLASSPATH
fi

POST_CLASSPATH=""
export POST_CLASSPATH

POST_CLASSPATH="${POST_CLASSPATH}${CLASSPATHSEP}${DATABASE_CLASSPATH}${CLASSPATHSEP}${ARDIR}/xqrl.jar"
export POST_CLASSPATH

# PROFILING SUPPORT

JAVA_PROFILE=""
export JAVA_PROFILE

SERVER_CLASS="weblogic.Server"
export SERVER_CLASS

JAVA_PROPERTIES="${JAVA_PROPERTIES} ${WLP_JAVA_PROPERTIES}"
export JAVA_PROPERTIES

JAVA_OPTIONS="${JAVA_OPTIONS} ${JAVA_PROPERTIES} -Dwlw.iterativeDev=${iterativeDevFlag} -Dwlw.testConsole=${testConsoleFlag} -Dwlw.logErrorsToConsole=${logErrorsToConsoleFlag}"
export JAVA_OPTIONS

# -- Setup properties so that we can save stdout and stderr to files

if [ "${WLS_STDOUT_LOG}" != "" ] ; then
     echo "Logging WLS stdout to ${WLS_STDOUT_LOG}"
     JAVA_OPTIONS="${JAVA_OPTIONS} -Dweblogic.Stdout=${WLS_STDOUT_LOG}"
     export JAVA_OPTIONS
fi

if [ "${WLS_STDERR_LOG}" != "" ] ; then
     echo "Logging WLS stderr to ${WLS_STDERR_LOG}"
     JAVA_OPTIONS="${JAVA_OPTIONS} -Dweblogic.Stderr=${WLS_STDERR_LOG}"
     export JAVA_OPTIONS
fi

# ADD EXTENSIONS TO CLASSPATHS

if [ "${EXT_PRE_CLASSPATH}" != "" ] ; then
     PRE_CLASSPATH="${EXT_PRE_CLASSPATH}${CLASSPATHSEP}${PRE_CLASSPATH}"
     export PRE_CLASSPATH
fi

if [ "${EXT_POST_CLASSPATH}" != "" ] ; then
     POST_CLASSPATH="${POST_CLASSPATH}${CLASSPATHSEP}${EXT_POST_CLASSPATH}"
     export POST_CLASSPATH
fi

if [ "${WEBLOGIC_EXTENSION_DIRS}" != "" ] ; then
     JAVA_OPTIONS="${JAVA_OPTIONS} -Dweblogic.ext.dirs=${WEBLOGIC_EXTENSION_DIRS}"
     export JAVA_OPTIONS
fi

WLNG_CLASSPATH="${WLNG_HOME}/server/lib/wlng"

JAVA_OPTIONS="${JAVA_OPTIONS} -Djava.endorsed.dirs=${WLNG_CLASSPATH}/endorsed"
JAVA_OPTIONS="${JAVA_OPTIONS} -Dwlss.replication=colocated -Dwlss.allow.warm.restart=true"
JAVA_OPTIONS="${JAVA_OPTIONS} -Dreplica.client.init.retry=5000"
JAVA_OPTIONS="${JAVA_OPTIONS} -Dreplica.client.timer.poll.allowance=30000"
JAVA_OPTIONS="${JAVA_OPTIONS} -Dreplica.client.timer.checkup.timeout=30000"

JAVA_OPTIONS="${JAVA_OPTIONS}"
export JAVA_OPTIONS

# SET THE CLASSPATH

CLASSPATH="${PRE_CLASSPATH}${CLASSPATHSEP}${WEBLOGIC_CLASSPATH}${CLASSPATHSEP}${POST_CLASSPATH}${CLASSPATHSEP}${WLP_POST_CLASSPATH}"
export CLASSPATH

JAVA_VM="${JAVA_VM} ${JAVA_DEBUG} ${JAVA_PROFILE}"
export JAVA_VM


555startManagedWeblogic.sh :

#!/bin/sh

# WARNING: This file is created by the Configuration Wizard.
# Any changes to this script may be lost when adding extensions to this configuration.

# --- Start Functions ---

usage()
{
     echo "Need to set SERVER_NAME and ADMIN_URL environment variables or specify"
     echo "them in command line:"
     echo "Usage: $1 SERVER_NAME {ADMIN_URL}"
     echo "for example:"
     echo "%1 managedserver1 http://localhost:7001"
}

# --- End Functions ---

# *************************************************************************
# This script is used to start a managed WebLogic Server for the domain in
# the current working directory. This script can either read in the SERVER_NAME and
# ADMIN_URL as positional parameters or will read them from environment variables that are
# set before calling this script. If SERVER_NAME is not sent as a parameter or exists with a value
# as an environment variable the script will EXIT. If the ADMIN_URL value cannot be determined
# by reading a parameter or from the environment a default value will be used.
#
# For additional information, refer to the WebLogic Server Administration
# Guide (http://e-docs.bea.com/wls/docs92/adminguide)
# *************************************************************************

# Set SERVER_NAME to the name of the server you wish to start up.

DOMAIN_NAME="labDomain"

ADMIN_URL="http://localhost:8001"

# Set WLS_USER equal to your system username and WLS_PW equal

# to your system password for no username and password prompt

# during server startup. Both are required to bypass the startup

# prompt.

WLS_USER=""
export WLS_USER

WLS_PW=""
export WLS_PW

# Set JAVA_OPTIONS to the java flags you want to pass to the vm. i.e.:

# set JAVA_OPTIONS=-Dweblogic.attribute=value -Djava.attribute=value

JAVA_OPTIONS="-Dweblogic.security.SSL.trustedCAKeyStore="/opt/ocsg50/wlserver_10.3/server/lib/cacerts" ${JAVA_OPTIONS}"

# Set JAVA_VM to the java virtual machine you want to run. For instance:

# set JAVA_VM=-server

JAVA_VM=""

# Set SERVER_NAME and ADMIN_URL, they must by specified before starting

# a managed server, detailed information can be found at

# http://e-docs.bea.com/wls/docs92/adminguide

if [ "$1" = "" ] ; then
     if [ "${SERVER_NAME}" = "" ] ; then
          usage %0
          exit
     fi
else
     SERVER_NAME="$1"
     shift
fi

if [ "$1" = "" ] ; then
     if [ "${ADMIN_URL}" = "" ] ; then
          usage %0
          exit
     fi
else
     ADMIN_URL="$1"
     shift
fi

# Export the admin_url whether the user specified it OR it was sent on the command-line

ADMIN_URL="${ADMIN_URL}"
export ADMIN_URL

SERVER_NAME="${SERVER_NAME}"
export SERVER_NAME

DOMAIN_HOME="/home/oracle/ocsgCourse/domains/labDomain"

if [ "$1" = "" ] ; then
     # Call Weblogic Server with our default params since the user did not specify any other ones
     ${DOMAIN_HOME}/bin/startWebLogic.sh nodebug nopointbase noiterativedev notestconsole
else
     # Call Weblogic Server with the params the user sent in INSTEAD of the defaults
     ${DOMAIN_HOME}/bin/startWebLogic.sh $1 $2 $3 $4 $5 $6 $7 $8 $9
fi




666startPointBaseConsole :

#!/bin/sh

# WARNING: This file is created by the Configuration Wizard.
# Any changes to this script may be lost when adding extensions to this configuration.

# Call setDomainEnv here to get the correct pointbase port

DOMAIN_HOME="/home/oracle/ocsgCourse/domains/labDomain"

. ${DOMAIN_HOME}/bin/setDomainEnv.sh

${WL_HOME}/common/bin/startPointBaseConsole.sh -port=${POINTBASE_PORT}




777startWebLogic.sh :

#!/bin/sh

# WARNING: This file is created by the Configuration Wizard.
# Any changes to this script may be lost when adding extensions to this configuration.

# --- Start Functions ---

stopAll()
{
     # We separate the stop commands into a function so we are able to use the trap command in Unix (calling a function) to stop these services
     if [ "X${ALREADY_STOPPED}" != "X" ] ; then
          exit
     fi
     # STOP POINTBASE (only if we started it)
     if [ "${POINTBASE_FLAG}" = "true" ] ; then
          echo "Stopping PointBase server..."
          ${WL_HOME}/common/bin/stopPointBase.sh -port=${POINTBASE_PORT} -name=${POINTBASE_DBNAME} >"${DOMAIN_HOME}/pointbaseShutdown.log" 2>&1

          echo "PointBase server stopped."
     fi

     ALREADY_STOPPED="true"
     # Restore IP configuration the node manager starts IP Migration
     if [ "${SERVER_IP}" != "" ] ; then
          ${WL_HOME}/common/bin/wlsifconfig.sh -removeif "${IFNAME}" "${SERVER_IP}"
     fi
}

# --- End Functions ---

# *************************************************************************
# This script is used to start WebLogic Server for this domain.
#
# To create your own start script for your domain, you can initialize the
# environment by calling @USERDOMAINHOME/setDomainEnv.
#
# setDomainEnv initializes or calls commEnv to initialize the following variables:
#
# BEA_HOME - The BEA home directory of your WebLogic installation.
# JAVA_HOME - Location of the version of Java used to start WebLogic
# Server.
# JAVA_VENDOR - Vendor of the JVM (i.e. BEA, HP, IBM, Sun, etc.)
# PATH - JDK and WebLogic directories are added to system path.
# WEBLOGIC_CLASSPATH
# - Classpath needed to start WebLogic Server.
# PATCH_CLASSPATH - Classpath used for patches
# PATCH_LIBPATH - Library path used for patches
# PATCH_PATH - Path used for patches
# WEBLOGIC_EXTENSION_DIRS - Extension dirs for WebLogic classpath patch
# JAVA_VM - The java arg specifying the VM to run. (i.e.
# - server, -hotspot, etc.)
# USER_MEM_ARGS - The variable to override the standard memory arguments
# passed to java.
# PRODUCTION_MODE - The variable that determines whether Weblogic Server is started in production mode.
# POINTBASE_HOME - Point Base home directory.
# POINTBASE_CLASSPATH
# - Classpath needed to start PointBase.
#
# Other variables used in this script include:
# SERVER_NAME - Name of the weblogic server.
# JAVA_OPTIONS - Java command-line options for running the server. (These
# will be tagged on to the end of the JAVA_VM and
# MEM_ARGS)
#
# For additional information, refer to the WebLogic Server Administration
# Console Online Help(http://e-docs.bea.com/wls/docs92/ConsoleHelp/startstop.html).
# *************************************************************************

# Call setDomainEnv here.

DOMAIN_HOME="/home/oracle/ocsgCourse/domains/labDomain"

. ${DOMAIN_HOME}/bin/setDomainEnv.sh $*

SAVE_JAVA_OPTIONS="${JAVA_OPTIONS}"

SAVE_CLASSPATH="${CLASSPATH}"

# Start PointBase

PB_DEBUG_LEVEL="0"

if [ "${POINTBASE_FLAG}" = "true" ] ; then
     ${WL_HOME}/common/bin/startPointBase.sh -port=${POINTBASE_PORT} -debug=${PB_DEBUG_LEVEL} -console=false -background=true -ini=${DOMAIN_HOME}/pointbase.ini >"${DOMAIN_HOME}/pointbase.log" 2>&1

fi

JAVA_OPTIONS="${SAVE_JAVA_OPTIONS}"

SAVE_JAVA_OPTIONS=""

CLASSPATH="${SAVE_CLASSPATH}"

SAVE_CLASSPATH=""

trap 'stopAll' 1 2 3 15


if [ "${PRODUCTION_MODE}" = "true" ] ; then
     WLS_DISPLAY_MODE="Production"
else
     WLS_DISPLAY_MODE="Development"
fi

if [ "${WLS_USER}" != "" ] ; then
     JAVA_OPTIONS="${JAVA_OPTIONS} -Dweblogic.management.username=${WLS_USER}"
fi

if [ "${WLS_PW}" != "" ] ; then
     JAVA_OPTIONS="${JAVA_OPTIONS} -Dweblogic.management.password=${WLS_PW}"
fi

CLASSPATH="${CLASSPATH}${CLASSPATHSEP}${MEDREC_WEBLOGIC_CLASSPATH}"

echo "."

echo "."

echo "JAVA Memory arguments: ${MEM_ARGS}"

echo "."

echo "WLS Start Mode=${WLS_DISPLAY_MODE}"

echo "."

echo "CLASSPATH=${CLASSPATH}"

echo "."

echo "PATH=${PATH}"

echo "."

echo "***************************************************"

echo "* To start WebLogic Server, use a username and *"

echo "* password assigned to an admin-level user. For *"

echo "* server administration, use the WebLogic Server *"

echo "* console at http://hostname:port/console *"

echo "***************************************************"

# Set up IP Migration related variables.

# Set interface name.

if [ "${Interface}" != "" ] ; then
     IFNAME="${Interface}"
else
     IFNAME=""
fi

# Set IP Mask.

if [ "${NetMask}" != "" ] ; then
     IPMASK="${NetMask}"
else
     IPMASK=""
fi

# Perform IP Migration if SERVER_IP is set by node manager.

if [ "${SERVER_IP}" != "" ] ; then
     ${WL_HOME}/common/bin/wlsifconfig.sh -addif "${IFNAME}" "${SERVER_IP}" "${IPMASK}"
fi

# START WEBLOGIC

echo "starting weblogic with Java version:"

${JAVA_HOME}/bin/java ${JAVA_VM} -version

if [ "${WLS_REDIRECT_LOG}" = "" ] ; then
     echo "Starting WLS with line:"
     echo "${JAVA_HOME}/bin/java ${JAVA_VM} ${MEM_ARGS} ${JAVA_OPTIONS} -Dweblogic.Name=${SERVER_NAME} -Djava.security.policy=${WL_HOME}/server/lib/weblogic.policy ${PROXY_SETTINGS} ${SERVER_CLASS}"
     ${JAVA_HOME}/bin/java ${JAVA_VM} ${MEM_ARGS} ${JAVA_OPTIONS} -Dweblogic.Name=${SERVER_NAME} -Djava.security.policy=${WL_HOME}/server/lib/weblogic.policy ${PROXY_SETTINGS} ${SERVER_CLASS}
else
     echo "Redirecting output from WLS window to ${WLS_REDIRECT_LOG}"
     ${JAVA_HOME}/bin/java ${JAVA_VM} ${MEM_ARGS} ${JAVA_OPTIONS} -Dweblogic.Name=${SERVER_NAME} -Djava.security.policy=${WL_HOME}/server/lib/weblogic.policy ${PROXY_SETTINGS} ${SERVER_CLASS} >"${WLS_REDIRECT_LOG}" 2>&1
fi

stopAll

popd

# Exit this script only if we have been told to exit.

if [ "${doExitFlag}" = "true" ] ; then
     exit
fi



888stopManagedWeblogic.sh :

#!/bin/sh

# WARNING: This file is created by the Configuration Wizard.
# Any changes to this script may be lost when adding extensions to this configuration.

# --- Start Functions ---

usage()
{
     echo "You must have a value for SERVER_NAME either set as an environment variable or the first parameter on the command-line."
     echo "ADMIN_URL defaults to t3://localhost:7001 if not set as an environment variable or the second command-line parameter."
     echo "USER_NAME and PASSWORD are required for shutting the server down when running in production mode:"
     echo "Usage: $1 {SERVER_NAME} {ADMIN_URL} {USER_NAME} {PASSWORD}"
     echo "for example:"
     echo "%1 managedserver1 t3://localhost:7001 weblogic weblogic"
}

# --- End Functions ---

# *************************************************************************
# This script is used to stop a managed WebLogic Server for the domain in
# the current working directory. This script reads in the SERVER_NAME and
# ADMIN_URL as positional parameters, sets the SERVER_NAME variable, then
# calls the startWLS.cmd script under ${WL_HOME}/server/bin.
#
# Other variables that startWLS takes are:
#
# WLS_USER - cleartext user for server startup
# WLS_PW - cleartext password for server startup
# JAVA_OPTIONS - Java command-line options for running the server. (These
# will be tagged on to the end of the JAVA_VM)
# JAVA_VM - The java arg specifying the VM to run. (i.e. -server,
# -hotspot, etc.)
#
# For additional information, refer to the WebLogic Server Administration
#
# Guide (http://e-docs.bea.com/wls/docs92/adminguide)
#
# *************************************************************************

# Set SERVER_NAME and ADMIN_URL, they must by specified before starting

# a managed server, detailed information can be found at

# http://e-docs.bea.com/wls/docs92/adminguide

if [ "$1" = "" ] ; then
     if [ "${SERVER_NAME}" = "" ] ; then
          usage %0
          exit
     fi
else
     SERVER_NAME="$1"
     export SERVER_NAME
     shift
fi

if [ "$1" = "" ] ; then
     if [ "${ADMIN_URL}" = "" ] ; then
ADMIN_URL="t3://localhost:8001"
          export ADMIN_URL
     fi
else
     ADMIN_URL="$1"
     export ADMIN_URL
     shift
fi

DOMAIN_HOME="/home/oracle/ocsgCourse/domains/labDomain"

${DOMAIN_HOME}/bin/stopWebLogic.sh $1 $2





999stopWebLogic.sh :


#!/bin/sh

# WARNING: This file is created by the Configuration Wizard.
# Any changes to this script may be lost when adding extensions to this configuration.

if [ "$1" != "" ] ; then
     userID="username='$1',"
     shift
else
     if [ "${userID}" != "" ] ; then
          userID="username='${userID}',"
     fi
fi

if [ "$1" != "" ] ; then
     password="password='$1',"
     shift
else
     if [ "${password}" != "" ] ; then
          password="password='${password}',"
     fi
fi

# set ADMIN_URL

if [ "$1" != "" ] ; then
     ADMIN_URL="$1"
     shift
else
     if [ "${ADMIN_URL}" = "" ] ; then
ADMIN_URL="t3://localhost:8001"
     fi
fi

# Call setDomainEnv here because we want to have shifted out the environment vars above

DOMAIN_HOME="/home/oracle/ocsgCourse/domains/labDomain"

. ${DOMAIN_HOME}/bin/setDomainEnv.sh

echo "connect(${userID} ${password} url='${ADMIN_URL}',adminServerName='${SERVER_NAME}')" >"shutdown.py"
echo "shutdown('${SERVER_NAME}','Server')" >>"shutdown.py"
echo "exit()" >>"shutdown.py"

echo "Stopping Weblogic Server..."

${JAVA_HOME}/bin/java ${JAVA_OPTIONS} weblogic.WLST shutdown.py 2>&1

echo "Done"

exit

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points