Skip Headers
Oracle® Application Server Administrator's Guide
10g Release 3 (10.1.3.2.0)

Part Number B32196-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

3 Starting and Stopping

This chapter describes 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. See 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:

For information about stopping the entire environment, including a 10.1.4 or 10.1.2 OracleAS Infrastructure connected to the middle-tier instance, see Section 3.4.

3.2.1 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 restarted your host, or any other time you want to start up the entire instance.

To start a middle-tier instance:

  1. If the middle-tier instance is associated with OracleAS Infrastructure services, such as Oracle Identity Management, make sure the services are started. See Section 3.4.3 for more information.

  2. Start the middle-tier components:

    (UNIX) ORACLE_HOME/opmn/bin/opmnctl startall
    (Windows) ORACLE_HOME\opmn\bin\opmnctl startall
    
    

    This command starts OPMN and all OPMN-managed processes such as Oracle HTTP Server, OC4J instances, and the Application Server Control Console.

Alternatively, on Windows, you can start the middle tier from the Windows Start menu. For example, to start an Oracle Application Server on Windows 2000, select Start > Programs > Oracle - Oracle_home_name > Oracle Process Manager > Start Oracle Process Manager. This starts OPMN and all processes managed by OPMN.

3.2.2 Stopping a Middle-Tier Instance

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

To stop a middle-tier instance, use the following command:

(UNIX) ORACLE_HOME/opmn/bin/opmnctl stopall
(Windows) ORACLE_HOME\opmn\bin\opmnctl stopall

This command stops OPMN and all OPMN-managed processes such as Oracle HTTP Server, OC4J instances, and the Application Server Control Console.

Alternatively, on Windows, you can stop the middle tier from the Windows Start menu. For example, to stop an Oracle Application Server instance on Windows 2000, select Start > Programs > Oracle - Oracle_home_name > Oracle Process Manager > Stop Oracle Process Manager. This stops OPMN and all processes managed by OPMN.

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 often be used interchangeably. For example, you can start a component using opmnctl and stop it using the Application Server Control Console.

Although the two tools can be used interchangeably, they offer different features. With the opmnctl command, you can start and stop sub-processes within components, as well as the entire component. With the Application Server Control Console, you can view components that cannot be started or stopped, but whose status depends on other components.

3.3.1 Starting and Stopping Components Using opmnctl

You can use the opmnctl command-line tool to start and stop components. It is located in the following directory:

(UNIX) ORACLE_HOME/opmn/bin
(Windows) ORACLE_HOME\opmn\bin

To start, stop, or restart a component using opmnctl:

opmnctl stopproc ias-component=component
opmnctl startproc ias-component=component
opmnctl restartproc ias-component=component

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

opmnctl stopproc process-type=process
opmnctl startproc process-type=process
opmnctl restartproc process-type=process

To start, stop, or restart an application, such as Application Server Control:

opmnctl startproc application=app_name
opmnctl stopproc application=app_name
opmnctl restartproc application=app_name

To view the status of components and processes:

opmnctl status -l

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

3.3.2 Starting and Stopping Components Using Application Server Control Console

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

  1. Navigate to the Cluster Topologies home page on the Application Server Control Console.

  2. In the Members section, for View By, select Application Servers.

  3. In the Select column, select the components you want to start, stop, or restart. (Click Expand All to show all the components.)

  4. Click the Start, Stop, or Restart button on the top right of the Members section.

You can also start and stop individual components on each component home page.

3.4 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 OracleAS 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.

This section contains the following topics:

Note:

In this chapter, OracleAS Infrastructure refers to a Release 10.1.4 or Release 2 (10.1.2) OracleAS Infrastructure.

For information about associating a 10g Release 3 (10.1.3.2.0) middle-tier instance with an OracleAS Infrastructure, see Section 6.6.

3.4.1 Starting an Oracle Application Server Environment

To start an Oracle Application Server environment:

  1. Start any OracleAS Infrastructure that contains only OracleAS Metadata Repository.

    If your environment has OracleAS Infrastructure installations that contain only OracleAS Metadata Repository, start those in any order. Note that for these installation types, you only need to start OracleAS Metadata Repository. You do not need to start any processes with opmnctl and you do not need to start the Application Server Control Console. See Section 3.4.3, "Starting 10.1.4 or 10.1.2 OracleAS Infrastructure" for more information.

  2. Start the OracleAS Infrastructure that contains Oracle Identity Management.

    If your environment uses Oracle Identity Management, start the OracleAS Infrastructure that contains Oracle Internet Directory. If this OracleAS Infrastructure contains OracleAS Metadata Repository, start that before you start Oracle Internet Directory. See Section 3.4.3, "Starting 10.1.4 or 10.1.2 OracleAS Infrastructure" for more information.

  3. Start middle-tier instances.

    Start middle-tier instances in any order. See Section 3.2.1, "Starting a Middle-Tier Instance" for more information.

3.4.2 Stopping an Oracle Application Server Environment

To stop all processes in an Oracle Application Server environment:

  1. Stop middle-tier instances.

    If your environment contains middle-tier instances, stop them in any order. See Section 3.2.2, "Stopping a Middle-Tier Instance" for more information.

  2. Stop the OracleAS Infrastructure that contains Oracle Identity Management.

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

  3. Stop any OracleAS Infrastructure instances that contain only OracleAS Metadata Repository.

    If your environment has OracleAS Infrastructure instances that contain only OracleAS Metadata Repository, stop those in any order. See Section 3.4.4, "Stopping 10.1.4 or 10.1.2 OracleAS Infrastructure" for more information.

3.4.3 Starting 10.1.4 or 10.1.2 OracleAS Infrastructure

If your middle tier is connected to a Release 10.1.4 or Release 2 (10.1.2) OracleAS Infrastructure instance, you can stop the Infrastructure from that instance.

This procedure applies to all OracleAS Infrastructure types:

  • Oracle Identity Management and OracleAS Metadata Repository

    Follow both steps to start Oracle Identity Management and OracleAS Metadata Repository.

  • OracleAS Metadata Repository only

    Follow only Step 1 to start OracleAS Metadata Repository. You do not need to perform the second step of starting Oracle Identity Management because you do not need OPMN or the Application Server Control Console in a OracleAS Metadata Repository-only installation.

  • Oracle Identity Management only

    Follow only Step 2 to start Oracle Identity Management. Make sure the OracleAS Metadata Repository that supports Oracle Identity Management (residing in another Oracle home) is already started.

To start OracleAS Infrastructure:

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

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

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

    3. Start the Net Listener:

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

      ORACLE_HOME/bin/sqlplus /nolog
      SQL> connect SYS as SYSDBA
      SQL> startup
      SQL> quit
      
      
    5. Start the Oracle Enterprise Manager 10g Database Control:

      (UNIX) ORACLE_HOME/bin/emctl start dbconsole
      (Windows) ORACLE_HOME\bin\emctl start dbconsole
      
      
  2. If your OracleAS Infrastructure contains Oracle Identity Management, start it as follows:

    1. Start components:

      (UNIX) ORACLE_HOME/opmn/bin/opmnctl startall
      (Windows) 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 the Application Server Control Console:

      (UNIX) ORACLE_HOME/bin/emctl start iasconsole
      (Windows) ORACLE_HOME\bin\emctl start iasconsole
      
      

      Alternatively, on Windows, you can start the Application Server Control Console using the Windows Services control panel. The name of the service for the Application Server Control uses the following format:

      OracleOracleHomeNameASControl
      
      

      See Section A.1 for more information on starting Application Server Control.

Alternatively, on Windows, you can start the Infrastructure from the Programs menu: Start > Programs > Oracle Application Server Infrastructure - Infra_name > Start instanceName.

3.4.4 Stopping 10.1.4 or 10.1.2 OracleAS Infrastructure

If your middle tier is connected to a Release 10.1.4 or Release 2 (10.1.2) OracleAS Infrastructure instance, you can stop the Infrastructure from that instance.

This procedure applies to all OracleAS Infrastructure types:

  • Oracle Identity Management and OracleAS Metadata Repository

    Follow both steps to stop Oracle Identity Management and OracleAS Metadata Repository.

  • OracleAS Metadata Repository only

    Follow Step 2 only to stop OracleAS Metadata Repository.

  • Oracle Identity Management only

    Follow Step 1 only to stop Oracle Identity Management.

To stop OracleAS Infrastructure:

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

    1. Stop the Application Server Control Console:

      (UNIX) ORACLE_HOME/bin/emctl stop iasconsole
      (Windows) ORACLE_HOME\bin\emctl stop iasconsole
      
      

      Alternatively, on Windows, you can stop the Application Server Control Console using the Services control panel. See Section A.1 for more information.

    2. Stop components:

      (UNIX) ORACLE_HOME/opmn/bin/opmnctl stopall
      (Windows) 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 OracleAS Infrastructure contains OracleAS Metadata Repository, stop it as follows:

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

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

    3. Stop the OracleAS 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
      
      
    5. Stop the Oracle Enterprise Manager 10g Database Control:

      (UNIX) ORACLE_HOME/bin/emctl stop dbconsole
      (Windows) ORACLE_HOME\bin\emctl stop dbconsole
      
      

Alternatively, on Windows, you can stop the Infrastructure from the Programs menu: Start > Programs > Oracle Application Server Infrastructure - Infra_name > Stop instanceName.

3.5 Starting and Stopping: Special Topics

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

3.5.1 Starting and Stopping in High Availability Environments

There are special considerations and procedures for starting and stopping High Availability environments such as:

  • Oracle Application Server Clusters

  • Oracle Application Server Cold Failover Clusters

  • Oracle Application Server Disaster Recovery (includes starting and stopping the ASG component)

    See:

    Oracle Application Server High Availability Guide for information about starting and stopping in high-availability environments

3.5.2 Enabling and Disabling Components

You cannot enable and disable components. However, you can create or remove OC4J instances, as described in Section 6.1.

3.5.3 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, OPMN may return an error similar to 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 caused by two different Oracle homes on the same host using the same port ranges for RMI, JMS, and AJP ports, and an OC4J instance in one Oracle home 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="12501-12600"/>
<port id="rmi" range="12401-12500"/>
<port id="jms" range="12601-12700"/>

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="default-web-site"
     range="12501-12600" protocol="ajp"/>
    <port id="rmi" range="12401-12500"/>
    <port id="rmis" range="12701-12800"/>
    <port id="jms" range="12601-12700"/>
    ...
  </process-type>
  <process-type id="OC4J_WebCenter" ... >
    ...
    <port id="default-web-site"
     range="12501-12600" protocol="ajp"/>
    <port id="rmi" range="12401-12500"/>
    <port id="rmis" range="12701-12800"/>
    <port id="jms" range="12601-12700"/>
  </process-type>
<ias-component id="OC4J">
  ...
  <process-type id="home" ... >
    ...
    <port id="default-web-site
       range="12501-12600" protocol="ajp"/>
    <port id="rmi" range="12401-12500"/>
    <port id="rmis" range="12701-12800"/>
    <port id="jms" range="12601-12700"/>
    ...
  </process-type>
  <process-type id="OC4J_WebCenter" ... >
    ...
    <port id="default-web-site"
     range="12501-12600" protocol="ajp"/>
    <port id="rmi" range="12401-12500"/>
    <port id="rmis" range="12701-12800"/>
    <port id="jms" range="12601-12700"/>
  </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 range assignments are the same across Oracle homes, and you received the error shown at the beginning of this section, then probably 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="default-web-site"
     range="12501-12600" protocol="ajp"/>
    <port id="rmi" range="12401-12500"/>
    <port id="rmis" range="12701-12800"/>
    <port id="jms" range="12601-12700"/>
    ...
  </process-type>
  <process-type id="OC4J_WebCenter" ... >
    ...
    <port id="default-web-site"
     range="12501-12600" protocol="ajp"/>
    <port id="rmi" range="12401-12500"/>
    <port id="rmis" range="12701-12800"/>
    <port id="jms" range="12601-12700"/>
  </process-type>
<ias-component id="OC4J">
  ...
  <process-type id="home" ... >
    ...
    <port id="default-web-site"
     range="4601-4700" protocol="ajp"/>
    <port id="rmi" range="4701-4800"/>
    <port id="rmis" range="4901-4999"/>
    <port id="jms" range="4801-4900"/>
    ...
  </process-type>
  <process-type id="OC4J_WebCenter" ... >
    ...
    <port id="default-web-site"
     range="4601-4700" protocol="ajp"/>
    <port id="rmi" range="4701-4800"/>
    <port id="rmis" range="4901-4999"/>
    <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:

    (UNIX) ORACLE_HOME/opmn/bin/opmnctl reload
    (Windows) ORACLE_HOME\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 attempts 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, by following these steps 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:

    (UNIX) ORACLE_HOME/opmn/bin/opmnctl reload
    (Windows) ORACLE_HOME\opmn\bin\opmnctl reload
    
    

Table 3-3 shows an example of the opmn.xml file in two Oracle homes on the same host after the retry count has been increased to 10.

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="default-web-site"
     range="12501-12600" protocol="ajp"/>
    <port id="rmi" range="12401-12500"/>
    <port id="rmis" range="12701-12800"/>
    <port id="jms" range="12601-12700"/>
    ...
  </process-type>
  <process-type id="OC4J_WebCenter" ... >
    ...
    <start timeout="600" retry="10"/>
    ...
    <restart timeout="720" retry="10"/>
    <port id="default-web-site"
     range="12501-12600" protocol="ajp"/>
    <port id="rmi" range="12401-12500"/>
    <port id="rmis" range="12701-12800"/>
    <port id="jms" range="12601-12700"/>
  </process-type>
<ias-component id="OC4J">
  ...
  <process-type id="home" ... >
    ...
    <start timeout="600" retry="10"/>
    ...
    <restart timeout="720" retry="10"/>
    <port id="default-web-site"
     range="12501-12600" protocol="ajp"/>
    <port id="rmi" range="12401-12500"/>
    <port id="rmis" range="12701-12800"/>
    <port id="jms" range="12601-12700"/>
    ...
  </process-type>
  <process-type id=""OC4J_WebCenter" ... >
    ...
    <start timeout="600" retry="10"/>
    ...
    <restart timeout="720" retry="10"/>
    <port id="default-web-site"
     range="12501-12600" protocol="ajp"/>
    <port id="rmi" range="12401-12500"/>
    <port id="rmis" range="12701-12800"/>
    <port id="jms" range="12601-12700"/>
  </process-type>