The following is the final part of a six-part series on Oracle Application Server 10g administration. Each tip...
By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
is excerpted from the Osborne Oracle Press book, "Oracle Application Server 10g administration handbook," by John Garmany and Don Burleson. Check back frequently for the next installment, or go to the main series page for all installments.
Distributed Configuration Management
The Distributed Configuration Management utility can be used instead of EM for some management activities, but not all. The dcmctl utility only manages the OHS/OC4J portion of the instance. It can be used within scripts to automate maintenance functions. If you are working with one instance, you will either need to pass dcmctl, the instance's ORACLE_HOME variable, or set it before executing the command. To avoid confusion, it is good practice to always set environmental variables in the script before executing either opmnctl or dcmctl. In a cluster environment, failure to set the appropriate ORACLE_HOME could result in making changes to the wrong instance. You can also use the environment variable ORACLE_DCM_JVM_ARGS to pass arguments to the Java Virtual Machine.
The dcmctl utility can be started so that commands can be directly entered using the command shell.
$ dcmctl shell dcmctl> createcomponent -ct oc4j -co OC4J_T2 dcmctl> exit $Dcmctl also has an extensive help listing obtained with the help argument.
$ dcmctl helpDcmctl arguments are made up of a one-word command and a set of options, all of which are case insensitive. Options start with a dash, followed by the option in short or long format, followed by the option's arguments. In the previous example, the command is createcomponent and the options are –ct and –co. First, let's discuss the options available and then introduce the commands. Options have a long and short format:
|Short Format||Long Format||Description|
|-i||-instance||Instance name (Oracle9iAS Instance)|
|-d||-debug||Print stack trace on exception|
|-l||-logdir||Location for the error log log.xml|
|-o||-oraclehome||ORACLE_HOME for that command|
|-t||-timeout||Max time to complete command (default: 45sec)|
|-v||-verbose||Verbose listing of state and error messages|
Now that we have defined the options, you can begin using the commands. Since dcmctl is used mostly within scripts, you need to be able to start and stop the instances/components. The following command starts the porta904 instance. Notice that we use the fully qualified instance name.
$ dcmctl start -i porta904.appsvr.localdomain.com Current State for Instance:porta904.appsvr.localdomain.com Component Type Up Status In Sync Status ======================================================================= 1 HTTP_Server HTTP_Server Up True 2 OC4J_Demos OC4J Up True 3 OC4J_Portal OC4J Up True 4 OC4J_Testing OC4J Up True 5 OC4J_Wireless OC4J Up True 6 home OC4J Up TrueThe dcmctl utility starts the instance and then provides a list of the current state. To stop the instance, you have two options, the stop command or the shutdown command. The shutdown command is used to stop the instance and OPMN/DCM, and is used to shut everything down before restarting or shutting down the server. The restart command will start an already down system, or shut down and restart a running system. Lastly, the getstate command returns the state of the instance/component.
$ dcmctl stop -co OC4J_Testing Current State for Instance:porta904.appsvr.localdomain.com Component Type Up Status In Sync Status ======================================================================= 1 OC4J_Testing OC4J Down TrueHere, we stop the OC4J_Testing container using dcmctl. One dcmctl command has already been introduced a number of times in previous chapters and at the beginning of this chapter. If you manually change a configuration file, you must update the repository using the updateConfig command.
$dcmctl updateConfigThis command reads the configuration files and updates the repository data. You can specify the container as OHS or OC4J with the –co option. The default is both.
About the authors
A senior Oracle trainer with Burleson Consulting, John Garmany is also a respected Oracle expert and author and chosen by Oracle Press to write the "officially authorized edition" for the "Oracle Application Server 10g administration handbook." John also serves as a writer for DBAZine, "Oracle Internals" and has authored several popular Oracle books.
Don Burleson is one of the world's top Oracle database experts with more than 20 years of full-time DBA experience. He specializes in creating database architectures for very large online databases and he has worked with some of the world's most powerful and complex systems. Don's professional Web sites include www.dba-oracle.com and www.remote-dba.net.