Skip Headers

Oracle Application Server 10g Administrator's Guide
10g (9.0.4)

Part Number B10376-01
Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Go to previous page Go to next page

3
Starting and Stopping

This chapter describes various procedures for starting and stopping Oracle Application Server.

It contains the following topics:

3.1 Overview of Starting and Stopping Procedures

Oracle Application Server is a flexible product that you can start and stop in different ways, depending on your requirements. This chapter contains the following sections:

3.2 Starting and Stopping Application Server Instances

This section describes how to start and stop application server instances. It contains the following topics:

Note that Oracle provides scripts that perform the procedures in this section. You can find them on the "OracleAS RepCA and Utilities" CD-ROM in the utilities/startup directory.

3.2.1 Starting an Infrastructure

This section describes how to start all processes in an Infrastructure. You can follow this procedure after you have rebooted your host, or any other time you would like to start up your entire Infrastructure.

This procedure applies to all Infrastructure types:

To start an Infrastructure:

  1. If your Infrastructure contains a Metadata Repository, start it as follows:

    1. Set the ORACLE_HOME environment variable to the Infrastructure Oracle home.

    2. Set the ORACLE_SID environment variable to the Metadata Repository SID (default is asdb).

    3. Start the Net Listener:

      ORACLE_HOME/bin/lsnrctl start
      
      
    4. Start the Metadata Repository instance:

      ORACLE_HOME/bin/sqlplus /nolog
      SQL> connect SYS as SYSDBA
      SQL> startup
      SQL> quit
      
      
  2. If your Infrastructure contains Identity Management, start is as follows:

    1. Start components:

      ORACLE_HOME/opmn/bin/opmnctl startall
      
      

      This command starts OPMN and all OPMN-managed processes such as DCM, Oracle HTTP Server, OC4J instances, and Oracle Internet Directory.

    2. Start Application Server Control:

      ORACLE_HOME/bin/emctl start iasconsole
      

3.2.2 Stopping an Infrastructure

This section describes how to stop all processes in an Infrastructure. You can follow this procedure when you are preparing to shut down your host, or any other time you would like to stop your entire Infrastructure.

This procedure applies to all Infrastructure types:

To stop an Infrastructure:

  1. If your Infrastructure contains Identity Management, stop it as follows:

    1. Stop Application Server Control:

      ORACLE_HOME/bin/emctl stop iasconsole
      
      
    2. Stop components:

      ORACLE_HOME/opmn/bin/opmnctl stopall
      
      

      This command stops OPMN and all OPMN-managed processes such as DCM, Oracle HTTP Server, OC4J instances, and Oracle Internet Directory.

  2. If your Infrastructure contains a Metadata Repository, stop it as follows:

    1. Set the ORACLE_HOME environment variable to the Infrastructure Oracle home.

    2. Set the ORACLE_SID environment variable is set to the Metadata Repository SID (default is asdb).

    3. Stop the Metadata Repository instance:

      ORACLE_HOME/bin/sqlplus /nolog
      SQL> connect SYS as SYSDBA
      SQL> shutdown
      SQL> quit
      
      
    4. Stop the Net Listener:

      ORACLE_HOME/bin/lsnrctl stop
      

3.2.3 Starting a Middle-Tier Instance

This section describes how to start all processes in a middle-tier instance. You can follow this procedure after you have rebooted your host, or any other time you would like to start up the entire instance.

This procedure applies to all middle-tier instance types:

To start a middle-tier instance:

  1. If the middle-tier instance uses Infrastructure services, such as Identity Management or a Metadata Repository, make sure they are started.

  2. Start components:

    ORACLE_HOME/opmn/bin/opmnctl startall
    
    

    This command starts OPMN and all OPMN-managed processes such as DCM, Oracle HTTP Server, OC4J instances, Web Cache, Forms, and Reports.

  3. Start the Application Server Control:

    ORACLE_HOME/bin/emctl start iasconsole
    

3.2.4 Stopping a Middle-Tier Instance

This section describes how to stop all processes in a middle-tier instance. You can follow this procedure when you are preparing to shut down your host, or any other time you would like to stop the entire instance.

This procedure applies to all middle-tier instance types:

To stop a middle-tier instance:

  1. Stop Application Server Control:

    ORACLE_HOME/bin/emctl stop iasconsole
    
    
  2. Stop components:

    ORACLE_HOME/opmn/bin/opmnctl stopall
    
    

    This command stops OPMN and all OPMN-managed processes such as DCM, Oracle HTTP Server, OC4J instances, Web Cache, Forms, and Reports.

3.3 Starting and Stopping Components

You can use the following tools to start, stop, restart, and view the status of components:

These tools are completely compatible--they both use OPMN as their underlying technology for managing processes--and can be used interchangeably. For example, you can start a component using opmnctl and stop it using Application Server Control.

Although the two tools can be used interchangeably, they offer different features. The opmnctl command allows you to start and stop sub-processes within components, as well as the entire component. For example, you can start and stop Web Cache, or you can start and stop only the Web Cache Admin sub-process. Application Server Control allows you to view components that cannot be started or stopped, but whose status depends on other components. For example, it displays the status of the Single Sign-On component, whose status depends on the HTTP_Server.

3.3.1 Starting and Stopping Using opmnctl

To start, stop, or restart a component:

ORACLE_HOME/opmn/bin/opmnctl stopproc ias-component=component
ORACLE_HOME/opmn/bin/opmnctl startproc ias-component=component
ORACLE_HOME/opmn/bin/opmnctl restartproc ias-component=component

To start, stop, or restart the sub-process of a component:

ORACLE_HOME/opmn/bin/opmnctl stopproc process-type=process
ORACLE_HOME/opmn/bin/opmnctl startproc process-type=process
ORACLE_HOME/opmn/bin/opmnctl restartproc process-type=process

To view the status of components and processes:

ORACLE_HOME/opmn/bin/opmnctl status

To learn more about using opmnctl, refer to Oracle Process Manager and Notification Server Administrator's Guide.

3.3.2 Starting and Stopping Using Application Server Control

You can start, stop, restart, and view status of components on the Application Server home page:

  1. Navigate to the Application Server home page on Application Server Control. Scroll to the System Components section.

  2. Select the checkboxes in the Select column for the components you want to start, stop, or restart.

  3. Click the Start, Stop, or Restart button on the top right of the System Components section.

3.4 Enabling and Disabling Components

When you disable a component, you prevent it from starting when you start the application server instance, and you remove it from the list of System Components displayed on the Application Server home page.

When you enable a component, you allow it to start when you start the application server instance, and it appears in the list of System Components displayed on Application Server Control.

You can enable and disable components using Application Server Control. On the Application Server home page, click Enable/Disable Components. You can select which components to enable or disable. Notice that components that are dependent on each other are grouped, and are all enabled or disabled together.


Note:

If you use the backup and recovery procedures documented in this book, you must run bkp_restore.pl -m config after you enable or disable components so the proper components are registered with the OracleAS Backup and Recovery Tool.


3.5 Starting and Stopping an Oracle Application Server Environment

This section provides procedures for starting and stopping an Oracle Application Server environment. An environment can consist of multiple Infrastructure and middle-tier instances distributed across multiple hosts. These instances are dependent on each other and it is important to start and stop them in the proper order.

You can follow these procedures when you need to completely shut down your Oracle Application Server environment. For example, when preparing to perform a complete backup of your environment, or apply a patch.

3.5.1 Starting an Oracle Application Server Environment

To start an Oracle Application Server environment from scratch:

  1. Start Metadata Repository-only Infrastructures.

    If your environment has Infrastructure installations that contain only a Metadata Repository, start those in any order. Note that for these installation types, you only need to start the Metadata Repository. You do not need to start any processes with opmnctl and you do not need to start Application Server Control.

    See Also:

    Section 3.2.1, "Starting an Infrastructure"

  2. Start the Infrastructure that contains Identity Management.

    If your environment uses Identity Management, start the Infrastructure that contains Oracle Internet Directory. If this Infrastructure contains a Metadata Repository, start that before you start Oracle Internet Directory.

    See Also:

    Section 3.2.1, "Starting an Infrastructure"

  3. Start OracleAS Clusters.

    If your environment has middle-tier instances that are part of OracleAS Clusters, start the clusters in any order.

    See Also:

    Oracle Application Server 10g High Availability Guide

  4. Start middle-tier instances.

    If your environment contains middle-tier instances that are not part of OracleAS Clusters, start them in any order.

    See Also:

    Section 3.2.3, "Starting a Middle-Tier Instance"

3.5.2 Stopping an Oracle Application Server Environment

To stop all processes in an Oracle Application Server environment:

  1. Stop OracleAS Clusters.

    If your environment has middle-tier instances that are part of clusters, stop the clusters in any order.

    See Also:

    Oracle Application Server 10g High Availability Guide

  2. Stop middle-tier instances.

    If your environment contains middle-tier instances that are not part of a cluster, stop them in any order.

    See Also:

    Section 3.2.4, "Stopping a Middle-Tier Instance"

  3. Stop the Infrastructure that contains Identity Management.

    If your environment uses Identity Management, stop the Infrastructure that contains Oracle Internet Directory. If this Infrastructure contains a Metadata Repository, stop that as well.

    See Also:

    Section 3.2.2, "Stopping an Infrastructure"

  4. Stop Metadata Repository-only Infrastructures.

    If your environment has Infrastructure installations that contain only a Metadata Repository, stop those in any order.

    See Also:

    Section 3.2.2, "Stopping an Infrastructure"

3.6 Starting and Stopping: Special Topics

This section contains the following special topics about starting and stopping Oracle Application Server:

3.6.1 Use opmnctl Instead of Other Command-Line Tools to Start and Stop

In Oracle9i Application Server Release 2 (9.0.2 and 9.0.3), dcmctl was the recommended command-line tool for starting and stopping Oracle HTTP Server, OC4J, and OPMN. Other command-line tools, such as webcachectl, were used to start the rest of the components.

In Oracle Application Server 10g (9.0.4), you should use opmnctl to start all components in your instance, with the exception of the following:

3.6.2 Starting and Stopping Log Loader

The method for starting and stopping Oracle Application Server Log Loader is different from other components.

Log Loader is not started when you issue the opmnctl startall command or when you perform a Start All operation in Application Server Control. You can start Log Loader in the following ways:

Log Loader is not stopped when you issue a Stop All operation in Application Server Control. You can stop Log Loader in the following ways:

3.6.3 Starting and Stopping in High Availability Environments

The following high availability solutions require special procedures for starting and stopping:

3.6.4 Resolving OC4J Errors When Starting Multiple Instances

If you have multiple Oracle Application Server installations on one host and you start them at the same time (for example, to start a cluster), OPMN may return an error like the following:

<process-type id="my_OC4J_instance">
  <process-set id="default_island">
    <process id="93388820" pid="24711" status="Stopped" index="1"     
log="/disk1/oracleas/opmn/logs/OC4J~my_OC4J_instance~default_island~1" 
operation="request" result="failure">
      <msg code="-21" text="failed to restart a managed process after the 
maximum retry limit">
      </msg>

This error indicates that an OC4J instance (my_OC4J_instance) failed to start. The problem could be due to the fact that two different Oracle homes on the same host use the same port ranges for RMI, JMS, and AJP ports, and an OC4J instance in one Oracle home is trying to use the same port as an OC4J instance in another Oracle home.

For example, assume you have two Oracle Application Server installations on one host that reside in ORACLE_HOME1 and ORACLE_HOME2. Each installation contains one or more OC4J instances, and each OC4J instance is assigned a port range for AJP, RMI, and JMS ports.

You can check OC4J port range assignments by examining the opmn.xml file in both Oracle homes:

ORACLE_HOME1/opmn/conf/opmn.xml
ORACLE_HOME2/opmn/conf/opmn.xml

In each file, locate the OC4J instance entries, which start with a line like the following:

<process-type id="home" module-id="OC4J" ... >

Within each entry, locate the RMI, JMS, and AJP port ranges, which looks like this:

<port id="ajp" range="3301-3400"/>
<port id="rmi" range="3201-3300"/>
<port id="jms" range="3701-3800"/>

Table 3-1 illustrates the problem of having the same OC4J port assignments in two Oracle homes--the AJP, RMI, and JMS port ranges in ORACLE_HOME1 are identical to the AJP, RMI, and JMS port ranges in ORACLE_HOME2. (Note that this example only lists the relevant lines from the opmn.xml.)

Table 3-1 Example of Identical Port Ranges in Two Oracle Homes
OC4J Port Ranges in ORACLE_HOME1/opmn/conf/opmn.xml OC4J Port Ranges in ORACLE_HOME2/opmn/conf/opmn.xml
<ias-component id="OC4J">
  ...
  <process-type id="home" ... >
    ...
    <port id="ajp" range="3301-3400"/>
    <port id="rmi" range="3201-3300"/>
    <port id="jms" range="3701-3800"/>
    ...
  </process-type>
  <process-type id="OC4J_SECURITY" ... >
    ...
    <port id="ajp" range="3301-3400"/>
    <port id="rmi" range="3201-3300"/>
    <port id="jms" range="3701-3800"/>
  </process-type>
<ias-component id="OC4J">
  ...
  <process-type id="home" ... >
    ...
    <port id="ajp" range="3301-3400"/>
    <port id="rmi" range="3201-3300"/>
    <port id="jms" range="3701-3800"/>
    ...
  </process-type>
  <process-type id="OC4J_SECURITY" ... >
    ...
    <port id="ajp" range="3301-3400"/>
    <port id="rmi" range="3201-3300"/>
    <port id="jms" range="3701-3800"/>
  </process-type>

Port allocation for all OC4J instances within an Oracle Application Server instance is controlled by OPMN. So, having overlapping port ranges within a single opmn.xml file is not a problem. However, when two OPMNs on a host start processes at the same time, there is no coordination between them on port usage.

The algorithm OPMN uses to assign a port is:

  1. Choose a port from the port range that is not currently marked as allocated to any processes managed by the OPMN in the local instance.

  2. Before assigning the port, check to see if the port is in use by binding to it.

  3. If the port is not in use (that is, OPMN could bind to it), then unbind and assign the port to a process (such as an OC4J instance) so it can bind to it, updating internal data structures with this assignment information.

In between the time that OPMN unbinds from the port and the assigned process binds to the port, it is possible for another process to bind to the port. This could be another OPMN on the host, or any other process that happens to try to bind to the same port number.

If your port ranges assignments are the same across Oracle homes, and you received the error shown at the beginning of this section, then what probably happened is that two OPMN processes tried to bind the same port for their OC4J instances. There is no way to eliminate this problem completely (because there is a rare chance that a non-OPMN process could try to bind to the port at the same time) but you can reconfigure OPMN to reduce the chance of encountering it.

There are two options for addressing this problem:

Option 1: Assign Unique Port Ranges to Each Oracle Home

You can assign unique OC4J port ranges to each Oracle home, as shown in Table 3-2. Then the OPMN in ORACLE_HOME1 and the OPMN in ORACLE_HOME2 will not attempt to use the same port numbers when assigning OPMN ports, and will not attempt to bind to the same port.

Table 3-2 Example of Using Unique Port Ranges in Two Oracle Homes
OC4J Port Ranges in ORACLE_HOME1/opmn/conf/opmn.xml OC4J Port Ranges in ORACLE_HOME2/opmn/conf/opmn.xml
<ias-component id="OC4J">
  ...
  <process-type id="home" ... >
    ...
    <port id="ajp" range="3301-3400"/>
    <port id="rmi" range="3201-3300"/>
    <port id="jms" range="3701-3800"/>
    ...
  </process-type>
  <process-type id="OC4J_SECURITY" ... >
    ...
    <port id="ajp" range="3301-3400"/>
    <port id="rmi" range="3201-3300"/>
    <port id="jms" range="3701-3800"/>
  </process-type>
<ias-component id="OC4J">
  ...
  <process-type id="home" ... >
    ...
    <port id="ajp" range="4601-4700"/>
    <port id="rmi" range="4701-4800"/>
    <port id="jms" range="4801-4900"/>
    ...
  </process-type>
  <process-type id="OC4J_SECURITY" ... >
    ...
    <port id="ajp" range="4601-4700"/>
    <port id="rmi" range="4701-4800"/>
    <port id="jms" range="4801-4900"/>
  </process-type>

To do this:

  1. Choose unique port ranges for AJP, RMI, and JMS.

  2. Edit ORACLE_HOME2/opmn/conf/opmn.xml.

  3. For each OC4J instance in the file, change AJP, RMI, and JMS to use the new unique port ranges. For example:

    <port id="ajp" range="4601-4700"/>
    <port id="rmi" range="4701-4800"/>
    <port id="jms" range="4801-4900"/>
    
    
  4. Save and close the file.

  5. Reload OPMN:

    ORACLE_HOME2/opmn/bin/opmnctl reload
    
Option 2: Increase the Maximum Number of Retries for Starting OC4J Instances

OPMN attempts to start processes a certain number of times before declaring failure. For process types with port ranges, if the failure to start the process is due to the process not being able bind to the assigned port number, OPMN will attempt to start the process with a different port number in the specified range. You can have identical port ranges in two Oracle homes, and increase the number of times OPMN attempts to restart a process, so eventually OPMN will choose a port that works. This does not completely eliminate the problem, because there is a chance that OPMN will not find a port that works in 10 tries, but it does reduce the chance of encountering the problem.

The parameter that controls the number of retries is "retry". The default value is 2. You can increase the parameter to a higher number, for example, 10, as shown in Table 3-3.

Table 3-3 Example of Increasing the Retry Count in Two Oracle Homes
OC4J Port Ranges in ORACLE_HOME1/opmn/conf/opmn.xml OC4J Port Ranges in ORACLE_HOME2/opmn/conf/opmn.xml
<ias-component id="OC4J">
  ...
  <process-type id="home" ... >
    ...
    <start timeout="600" retry="10"/>
    ...
    <restart timeout="720" retry="10"/>
    <port id="ajp" range="3301-3400"/>
    <port id="rmi" range="3201-3300"/>
    <port id="jms" range="3701-3800"/>
    ...
  </process-type>
  <process-type id="OC4J_SECURITY" ... >
    ...
    <start timeout="600" retry="10"/>
    ...
    <restart timeout="720" retry="10"/>
    <port id="ajp" range="3301-3400"/>
    <port id="rmi" range="3201-3300"/>
    <port id="jms" range="3701-3800"/>
  </process-type>
<ias-component id="OC4J">
  ...
  <process-type id="home" ... >
    ...
    <start timeout="600" retry="10"/>
    ...
    <restart timeout="720" retry="10"/>
    <port id="ajp" range="3301-3400"/>
    <port id="rmi" range="3201-3300"/>
    <port id="jms" range="3701-3800"/>
    ...
  </process-type>
  <process-type id="OC4J_SECURITY" ... >
    ...
    <start timeout="600" retry="10"/>
    ...
    <restart timeout="720" retry="10"/>
    <port id="ajp" range="3301-3400"/>
    <port id="rmi" range="3201-3300"/>
    <port id="jms" range="3701-3800"/>
  </process-type>

To do this, in each Oracle home:

  1. Edit ORACLE_HOME/opmn/conf/opmn.xml.

  2. For each OC4J instance in the file, increase the retry value for start and restart. For example:

     <start timeout="600" retry="10"/>
     <restart timeout="720" retry="10"/>
    
    
  3. Save and close the file.

  4. Reload OPMN:

    ORACLE_HOME/opmn/bin/opmnctl reload
    

3.6.5 Shutting Down OracleAS Metadata Repository with the IMMEDIATE Option

If you find that the Metadata Repository instance is taking a long time to shut down, you can use the following command to force an immediate shutdown:

SQL> shutdown immediate

Immediate database shutdown proceeds with the following conditions:

The next startup of the database will not require any instance recovery procedures.

See Also:

Oracle9i Database Administrator's Guide in the Oracle9i Database documentation library


Go to previous page Go to next page
Oracle
Copyright © 2002, 2003 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index