This script can be used to start all of the required services on an ODSM server.  It assumes that the repository database resides on the same host as your WLS/ODSM server.

The start-up sequence consists of:

  1. Start the repository database and listener
  2. Start the WLS server
  3. Start the Managed WLS Server (ODSM)
  4. Start processes with opmnctl
#!/bin/sh
# ----------------------------------------------------------------
# Script name : start_odsm_servers.sh
# Calling args : None
# Purpose : Start all services required for ODSM/LDAP
# ----------------------------------------------------------------
# VARIABLE SETTINGS
# ----------------------------------------------------------------
# Notes : Paths and O/S environment variable settings for repository 
# database and listener are not included in this example.
# Set the variables below to match your environment.
# ----------------------------------------------------------------
export DOMAIN_HOME=/u01/Middleware/user_projects/domains/IDMDomain
export DOMAIN_NAME=wls_ods1
export HOST_NAME=`hostname`
export REPOSITORY_SID=orcl
export REPOSITORY_HOME=/orabase/product/11.2.0.3
export WLS_USER=weblogic
export WLS_PASSWORD=Super_5ecr3t

# ----------------------------------------------------------------
# RUN-TIME PROCEDURE
# ----------------------------------------------------------------
# Make sure the repository database and listener are up
# ----------------------------------------------------------------
if [ `ps -ef | grep ${REPOSITORY_SID} | grep pmon | grep -v grep | wc -l` -eq 0 ]; then
 sqlplus / as sysdba <<EOF
 startup;
 exit 
EOF
 sleep 10
fi

if [ `ps -ef | grep lsnr${REPOSITORY_SID} | grep -v grep | wc -l` -eq 0 ]; then
 ${REPOSITORY_HOME}/bin/lsnrctl start lsnr${REPOSITORY_SID}
 sleep 5
fi

# ----------------------------------------------------------------
# boot.properties files are required to automatically start WLS
# The passwords are automatically obfuscated when WLS starts
# ----------------------------------------------------------------
BOOTPROP_A=${DOMAIN_HOME}/servers/${DOMAIN_NAME}/security/boot.properties
BOOTPROP_B=${DOMAIN_HOME}/servers/AdminServer/security/boot.properties
for thisBOOTER in ${BOOTPROP_A} ${BOOTPROP_B}; do
 $ECHO "Verifying ${thisBOOTER}"
 if [ ! -f ${thisBOOTER} ]; then
 echo "username=${WLS_USER}" >${thisBOOTER}
 echo "password=${WLS_PASSWORD}" >>${thisBOOTER}
 fi
 chmod 600 ${thisBOOTER}
 $ECHO "\nDone\n\n"
done
$ECHO "Starting up the AdminServer"
# ----------------------------------------------------------------
# Outputs are redirected to the AdminServer.log in
# /orabase/Middleware/user_projects/domains/IDMDomain/servers/AdminServer/logs
# ----------------------------------------------------------------nohup $DOMAIN_HOME/bin/startWebLogic.sh >/dev/null 2>/dev/null &
# ----------------------------------------------------------------
# Wait for some seconds to make sure the AdminServer is listening
# before we attempt to start up the individual managed servers.
# The managed servers will need to connect in order
# for the EM applications to be able to "see" these instances
# ----------------------------------------------------------------
sleep 120
$ECHO "Starting up ODSM domain wls_ods1"
nohup $DOMAIN_HOME/bin/startManagedWebLogic.sh ${DOMAIN_NAME} t3://${HOST_NAME}:7001/ >/dev/null 2>/dev/null &

$ECHO "Log directory contents"
$ECHO "${LOGDIR}"
cd ${LOGDIR}
ls -l

$ECHO "Starting opmnctl processes"

${ORACLE_INSTANCE}/bin/opmnctl stopall
${ORACLE_INSTANCE}/bin/opmnctl startall
${ORACLE_INSTANCE}/bin/opmnctl status
exit 0

Special thanks to Colin Brown at Oracle for sharing his version of the script with me on https://communities.oracle.com.