DBA Tips Archive for Oracle


Administrative Commands

by Jeff Hunter, Sr. Database Administrator


The following document provides a brief introduction to several of the most used commands that can be performed by the OC4J administrator. OC4J provides the admin.jar command-line utility that is used to performing actions like deploying applications, restarting OC4J, and shutting down the OC4J server. For the purpose of this document, I will provide all examples using a fictitious application called my_app.

admin.jar Overview

After starting the OC4J server, you can administer the server using the admin.jar command-line tool. The basic syntax for using the admin.jar tool is as follows:
  java -jar admin.jar ormi://<oc4j_host>:<oc4j_ormi_port> <admin_id>  <admin_password>  <options>

The following listing is an overview of the variables used with the admin.jar tool:

Example Administrative Commands

Starting OC4J Instance
% java -jar oc4j.jar
Node started with id=-2479157545
Oracle9iAS ( Containers for J2EE initialized
Shutting Down OC4J
% java -jar admin.jar ormi://localhost admin manager -shutdown
Restarting OC4J
% java -jar admin.jar ormi://localhost admin manager -restart
Deploying an Application
Register the J2EE application (generally the EJBs / business logic):
% java -jar admin.jar ormi://localhost admin manager -deploy -file $OC4J_HOME/j2ee/home/applications/my_app.ear -deploymentName my_app -targetPath applications/
   This step creates the entry in the server.xml file for the my_app application

To bind the Web application through the admin.jar tool, use the following:

% java -jar admin.jar ormi://localhost admin manager -bindWebApp my_app my_app-web http-web-site /my_app
   This creates the <web-app> entry element in the http-web-site.xml configuration file.
Undeploy Application
% java -jar admin.jar ormi://localhost admin manager -undeploy my_app
Listing All Available Sites
% java -jar admin.jar ormi://localhost admin manager -site -list
All available sites:
Name    :       Default Oracle9iAS Containers for J2EE Web Site
Port    :       4169
Host    :
Secure  :       false

Name    :       Oracle9iAS Containers for J2EE HTTP Web Site
Port    :       8888
Host    :
Secure  :       false

Copyright (c) 1998-2018 Jeffrey M. Hunter. All rights reserved.

All articles, scripts and material located at the Internet address of http://www.idevelopment.info is the copyright of Jeffrey M. Hunter and is protected under copyright laws of the United States. This document may not be hosted on any other site without my express, prior, written permission. Application to host any of the material elsewhere can be made by contacting me at jhunter@idevelopment.info.

I have made every effort and taken great care in making sure that the material included on my web site is technically accurate, but I disclaim any and all responsibility for any loss, damage or destruction of data or any other property which may arise from relying on it. I will in no case be liable for any monetary damages arising from such loss, damage or destruction.

Last modified on
Wednesday, 04-Dec-2002 00:00:00 EST
Page Count: 14022