Wednesday, July 6, 2011

Oracle Web Logic init scrips

Simple script to start WLS.
There is one difficulty with console return after calling startWebLogic.sh and startManagedWebLogic.sh. Regarding to it I had to run it in background. If startup script runs in background it returns code which means successful completion of "&" operation. If you need to make sure services started correctly code you have two ways:
  1. do it in WLST
  2. try to catch "<Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>

This script installed at development server. As it is not a production variant and have limited number of domains I do not have to spend much time WLST script coding (which is actually python). Lately if it would be necessary I will certainly do advanced script to automatically start/stop WLS domains. There are some simple samples.

#!/bin/sh

# using of LOOPs is regarded to future improovements. May well you will
# have several Admin servers and Several Managed Servers. Just change
# the code to work with arrays.

# The only problem is to check successfull start of Java instances which is in background.

LOG_ADM="/tmp/ora_wls-admin"
LOG_MNGR="/tmp/ora_wls-nmgr"
MW_HOME="/u01/oracle/mw"
WLS_DOMAINS_ADM="base_domain"
WLS_DOMAINS_MNGD="osb_server1 Server-0"
#for compatibility with sh
ADNAME="basedomain"
MDNAME="osbserver1"

# write svn information to a header

version() {

Log " category System scripts"
Log "
author V.Bychkov"
Log " changedby $Author: bes $"
Log "
version SVN: $Id: oracle.wls-middleware 1002 2011-07-04 04:26:20Z bes $"
Log " revision SVN: $Revision: 1002 $"

Log " link       $HeadURL: file:///opt/svn/projects/scripts/oracle/init.d/oracle.wls-middleware $"
Log "# date       $Date: 2011-07-04 14:26:20 +1000 (Mon, 04 Jul 2011) $"
}


Saturday, July 2, 2011

Delete domain in Oracle WebLogic Server

There is no special tool for that. If we are talking about 11g, just delete domain directory.

For example in my configuration it is:
rm -rf /u01/oracle/mw/user_projects/domains/base_domain

it is also necessary to remove deleted domain from domains list:

[oracle@db02-app01 zone:app01]/u01/oracle/mw/wls_10.3$ cat common/nodemanager/nodemanager.domains
#
#Thu Jun 30 15:53:24 MSD 2011
wl_server=/u01/oracle/mw/wls_10.3/samples/domains/wl_server
medrec-spring=/u01/oracle/mw/wls_10.3/samples/domains/medrec-spring
base_domain=/u01/oracle/mw/user_projects/domains/base_domain
servicebus=/u01/oracle/mw/osb_11.1/../user_projects/samples/domains/servicebus
medrec=/u01/oracle/mw/wls_10.3/samples/domains/medrec

It is a good practice for me to make backup of file before modification.

Start Oracle Service Bus 11g

To start OSB firstly need to start a WLS with correct memory settings and configure WLS Servers/Domains.

Execute /opt/bea/wlserver_103/common/bin/config.sh to configure domain.

1. choose "Oracle Service Bus for Developers - 11.1.1.4 [Oracle_OSB1]" option during configuration process. After completing this step you will get configured base_domain domain with osb_server1 server instance. For the first time I decided to accept default names.

2. start WL Server with Administration Console
export USER_MEM_ARGS="-Xms1280m -Xmx1280m -XX:PermSize=128m -XX:MaxPermSize=512m"
/u01/oracle/mw/user_projects/domains/base_domain$ ./bin/startWebLogic.sh

3. Start Managed Server osb_server1
/u01/oracle/mw/user_projects/domains/base_domain$ ./bin/startManagedWebLogic.sh osb_server1