HomeOracle Page 15 - Oracle Application Server 10g Architecture and Administration
Managing Application Server 10gwith dcmctl - Oracle
Get an overview of the Oracle Application Server 10g architecture, its functional components, the administrative tools for application development, and examples of commands that are used to perform frequent Application Server 10g administrative functions. This chapter is from the book, Oracle Application Server 10g Administration Handbook, by John Garmany and Donald K. Burleson (McGraw-Hill/Osborne, ISBN: 0072229586, 2004).
The Distributed Configuration Manager (DCM) is the master utility for Application Server 10g. The DCM is responsible for maintaining configuration by updating the configuration files on each server. DCM also stores the values of the parameters within each configuration file on each server within isadb. Note that if you choose not to implement the infrastructure (not recommended), the parameter files will exist as flat files on each server.
The dcmctl utility has two important argument settings, verbose (-v) and diagnostic (-d). These are important options because they provide additional diagnostic information about the state of your dcmctl commands. Starting in Application Server 10g release 9.0.4, you can use set commands to enable and disable these options:
dcmctl set –v on dcmctl set –d on
Once you have established the settings, you can use dcmctl for a variety of Application Server 10gadministrative functions. Here is an example of using dcmctl to start the HTTP server (OHS):
You can also use the dcmctl command to deploy OC4J applications, and the dcmctl commands can be embedded into command lists for the purpose of deploying them on many servers. For example, let’s create a list of dcmctl commands to deploy an OC4J application on multiple servers. Assume that we have saved this file as /home/oracle/dcm_dep.cmd on our main server:
So, how can you execute this script on all 20 of your OC4J servers? You can create a shell script to loop through a list of all servers and deploy the J2EE application on each OC4J server. This script requires the remote shell (rsh) and remote copy (rcp) UNIX commands. The rsh command is enabled by placing server host names in your .rhosts file. The rsh facility should only be implemented if all Application Server 10g servers are safe behind a firewall, because rsh allows a hack who gains access to one server to access all other servers in the .rhosts file.
deploy_oc4j.ksh
#!/bin/ksh #*************************************************** # # Copyright (c) 2003 by Donald K. Burleson # # Deploy Oracle Application Server 10g application on multiple servers # #*************************************************** # First, we must set the environment . . . . export ORACLE_BASE=/private/ias # Use this ORACLE_HOME for midtier applications #export ORACLE_HOME=$ORACLE_BASE/midtier # Use this ORACLE_HOME for infra applications export ORACLE_HOME=$ORACLE_BASE/infra SET PATH=.;$PATH;%ORACLE_HOME%dcmbin;%ORACLE_HOME%j2eehome; %ORACLE_HOME%ldapbin;%ORACLE_HOME%ldapodiadmin;%ORACLE_HOME% ocabin;%ORACLE_HOME%opmnbin;%ORACLE_HOME%portaladminplsqlsso; %ORACLE_HOME%ssolib;%ORALE_HOME%uddilib;%ORACLE_HOME%upgrade; %ORACLE_HOME%wirelessbin export ORACLE_SID=iasdb export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib #export DISPLAY=tor:2.0 # Loop through each host name . . . for host in `cat ~oracle/.rhosts|cut -d"." -f1|awk '{print $1}'|sort -u` do # Get the ORACLE_HOME on each Oracle Application Server 10g server home=`rsh $host "cat /etc/oratab|egrep ':N|:Y'|grep -v *|cut -f1/ d':'"`` # Copy the dcm command file and ear to the remote server rcp -p /home/oracle/dcm_dep.cmd ${host}:~oracle/dcm_dep.cmd rcp -p /stage/apps/app1.ear ${host}:/stage/apps/app1.ear # Set and check file permissions rsh $host "chmod 500 ~oracle/dcm_dep.cmd " rsh $host "ls -al ~oracle/dcm_dep.cmd" # Execute dcmctl to start the dcmctl shell: rsh $host "$home/dcm/bin/dcmctl shell –f ~oracle/dcm_dep.cmd" done
As you can see, the dcmctl command is very useful when you must deploy applications across many J2EE instances.
This chapter is from Oracle Application Server 10g Administration Handbook, by Garmany and Burleson. (McGraw-Hill/Osborne, 2004, ISBN: 0072229586). Check it out at your favorite bookstore today. Buy this book now.