Skip Headers
Oracle® Application Server Administrator's Guide
10g Release 2 (10.1.2)
B13995-06
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

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. 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:

3.2.1 Starting an Application Server Instance

To start an entire application server instance, including the Infrastructure and the middle tier, such as when you have restarted your host, you can use the runstartupconsole command.

If the Infrastructure and middle tier is installed on the same host, run the following command from the middle-tier Oracle home:

(UNIX) ORACLE_HOME/bin/runstartupconsole.sh start all
(Windows) ORACLE_HOME\bin\runstartupconsole.bat start all

Now, all processes in both the Infrastructure and middle tier are started.

The command starts the following in the Infrastructure Oracle home:

  • The OracleAS Metadata Repository instance

  • The Net Listener

  • OracleAS Infrastructure processes such as Oracle Identity Management components, Oracle Internet Directory, OC4J_Security, DCM, and OPMN

  • Enterprise Manager, including Application Server Control Console and Database Control

The command starts the following in the middle-tier Oracle home:

  • OPMN and all OPMN-managed processes such as DCM, Oracle HTTP Server, OC4J instances, and OracleAS Web Cache, OracleAS Forms Services, and OracleAS Reports Services

  • Enterprise Manager Application Server Control Console

If you want to start the Infrastructure and middle tier, but not Enterprise Manager, run the following command from the middle-tier Oracle home:

(UNIX) ORACLE_HOME/bin/runstartupconsole.sh start allas
(Windows) ORACLE_HOME\bin\runstartupconsole.bat start allas

If you want to start only Enterprise Manager, but in both the Infrastructure and middle tier, run the following command from the middle-tier Oracle home:

(UNIX) ORACLE_HOME/bin/runstartupconsole.sh start allem
(Windows) ORACLE_HOME\bin\runstartupconsole.bat start allem

If the Infrastructure and middle tier are installed on separate hosts, see Section 3.2.3, "Starting OracleAS Infrastructure" and Section 3.2.5, "Starting a Middle-Tier Instance".

3.2.2 Stopping an Application Server Instance

To stop an entire application server instance, including the Infrastructure and the middle tier, such as when you are preparing to shut down your host, you can use the runstartupconsole command.

If the Infrastructure and middle tier is installed on the same host, run the following command from the middle-tier Oracle home

(UNIX) ORACLE_HOME/bin/runstartupconsole.sh stop all
(Windows) ORACLE_HOME\bin\runstartupconsole.bat stop all

Now, all processes in both the Infrastructure and middle tier are stopped.

The command stops the following in the Infrastructure Oracle home:

  • The OracleAS Metadata Repository instance

  • The Net Listener

  • OracleAS Infrastructure processes such as Oracle Identity Management components, Oracle Internet Directory, OC4J_Security, DCM, and OPMN

  • Enterprise Manager, including Application Server Control Console and Database Control

The command stops the following in the middle-tier Oracle home:

  • OPMN and all OPMN-managed processes such as DCM, Oracle HTTP Server, OC4J instances, and OracleAS Web Cache, OracleAS Forms Services, and OracleAS Reports Services

  • Enterprise Manager Application Server Control Console

If you want to stop the Infrastructure and middle tier, but not Enterprise Manager, run the following command from the middle-tier Oracle home:

(UNIX) ORACLE_HOME/bin/runstartupconsole.sh stop allas
(Windows) ORACLE_HOME\bin\runstartupconsole.bat stop allas

If you want to stop only Enterprise Manager, but in both the Infrastructure and middle tier, run the following command from the middle-tier Oracle home:

(UNIX) ORACLE_HOME/bin/runstartupconsole.sh stop allem
(Windows) ORACLE_HOME\bin\runstartupconsole.bat stop allem

If the Infrastructure and middle tier are installed on separate hosts, see Section 3.2.4, "Stopping OracleAS Infrastructure" and Section 3.2.6, "Stopping a Middle-Tier Instance".

3.2.3 Starting OracleAS Infrastructure

To start all processes in an OracleAS Infrastructure, such as when you have restarted your host, use the following command in the Infrastructure Oracle home:

(UNIX) ORACLE_HOME/bin/runstartupconsole.sh start
(Windows) ORACLE_HOME\bin\runstartupconsole.bat start

When you run this command in the Infrastructure home, it starts the following:

  • The OracleAS Metadata Repository instance

  • The Net Listener

  • OracleAS Infrastructure processes such as Oracle Identity Management components, Oracle Internet Directory, OC4J_Security, DCM, and OPMN

  • Oracle Enterprise Manager 10g, including Application Server Control Console and Database Control

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

3.2.4 Stopping OracleAS Infrastructure

To stop all processes in an OracleAS Infrastructure, such as when you are preparing to shut down the host, use the following command in the Infrastructure Oracle home:

(UNIX) ORACLE_HOME/bin/runstartupconsole.sh stop
(Windows) ORACLE_HOME\bin\runstartupconsole.bat stop

When you run this command in the Infrastructure home, it stops the following:

  • The OracleAS Metadata Repository instance

  • The Net Listener

  • OracleAS Infrastructure processes such as Oracle Identity Management components, Oracle Internet Directory, OC4J_Security, DCM, and OPMN

  • Oracle Enterprise Manager 10g, including Application Server Control Console and Database Control

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

3.2.5 Starting a Middle-Tier Instance

To start all processes in a middle-tier instance, take the following steps:

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

    If they are not started, use the command described in Section 3.2.3, "Starting OracleAS Infrastructure", or start both the middle-tier instance and its associated Infrastructure, using the procedure described in Section 3.2.1, "Starting an Application Server Instance".

  2. Start the middle-tier instance by using the following command:

    (UNIX) ORACLE_HOME/bin/runstartupconsole.sh start
    (Windows) ORACLE_HOME\bin\runstartupconsole.bat start
    
    

    When you run this command in a middle-tier Oracle home, it starts the following:

    • OPMN and all OPMN-managed processes such as DCM, Oracle HTTP Server, OC4J instances, and OracleAS Web Cache, OracleAS Forms Services, and OracleAS Reports Services

    • Oracle Enterprise Manager 10g Application Server Control Console

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

3.2.6 Stopping a Middle-Tier Instance

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

(UNIX) ORACLE_HOME/bin/runstartupconsole.sh stop
(Windows) ORACLE_HOME\bin\runstartupconsole.bat stop

When you run this command in a middle-tier Oracle home, it stops the following:

  • OPMN and all OPMN-managed processes such as DCM, Oracle HTTP Server, OC4J instances, and OracleAS Web Cache, OracleAS Forms Services, and OracleAS Reports Services

  • Oracle Enterprise Manager 10g Application Server Control Console

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

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 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. For example, you can start and stop OracleAS Web Cache, or you can start and stop only the OracleAS Web Cache admin sub-process. With the Application Server Control Console, you can view components that cannot be started or stopped, but whose status depends on other components. For example, the Application Server Control Console displays the status of the Single Sign-On component, whose status depends on the HTTP_Server.

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 view the status of components and processes:

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 Components Using Application Server Control Console

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 the Application Server Control Console. Scroll to the System Components section.

  2. In the Select column, select 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.

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

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 the Application Server Control Console.

You can enable and disable components using the Application Server Control Console. On the Application Server Home page, click Enable/Disable Components.

From the resulting page, you can select which components to enable or disable. Notice that components that are dependent on each other are grouped, and are enabled or disabled together.

When you enable or disable components, consider the following restrictions and additional information:

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

3.5.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.2.3, "Starting 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.2.3, "Starting OracleAS Infrastructure" for more information.

  3. Start OracleAS Clusters.

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

  4. Start middle-tier instances.

    If your environment contains middle-tier instances that are not part of an OracleAS Cluster, start them in any order. See Section 3.2.5, "Starting a Middle-Tier Instance" for more information.

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 OracleAS Clusters, stop the clusters in any order.

  2. Stop middle-tier instances.

    If your environment contains middle-tier instances that are not part of an OracleAS Cluster, stop them in any order. See Section 3.2.6, "Stopping a Middle-Tier Instance" for more information.

  3. 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. See Section 3.2.4, "Stopping OracleAS Infrastructure".

  4. Stop any OracleAS Infrastructure instances that contain only OracleAS Metadata Repository as described in Section 3.2.4, "Stopping OracleAS Infrastructure".

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

3.6 Starting and Stopping: Special Topics

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

3.6.1 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 the Application Server Control Console. You can start Log Loader in the following ways:

  • Using the following command:

    (UNIX) ORACLE_HOME/opmn/bin/opmnctl startproc ias-component=LogLoader
    (Windows) ORACLE_HOME\opmn\bin\opmnctl startproc ias-component=LogLoader
    
    
  • By clicking Start on the Log Loader page in the Application Server Control Console. See Section 5.5.1, "Starting and Stopping Log Loader" for more information.

Log Loader is stopped when you issue the opmnctl stopall command; however it is not stopped when you issue a Stop All operation in the Application Server Control Console. In the latter case, you can stop Log Loader in the following ways:

  • Using the following command:

    (UNIX) ORACLE_HOME/opmn/bin/opmnctl stopproc ias-component=LogLoader
    (Windows) ORACLE_HOME\opmn\bin\opmnctl stopproc ias-component=LogLoader
    
    
  • By clicking Stop on the Log Loader page in the Application Server Control Console. See Section 5.5.1, "Starting and Stopping Log Loader" for more information.

3.6.2 Starting and Stopping in High Availability Environments

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

  • DCM-Managed Oracle Application Server Cluster

  • Manually Managed Oracle Application Server Cluster

  • Oracle Application Server Cold Failover Cluster

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


    See:

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

3.6.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 (for example, to start an OracleAS 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 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="ajp" range="12501-12600"/>
    <port id="rmi" range="12401-12500"/>
    <port id="jms" range="12601-12700"/>
    ...
  </process-type>
  <process-type id="OC4J_SECURITY" ... >
    ...
    <port id="ajp" range="12501-12600"/>
    <port id="rmi" range="12401-12500"/>
    <port id="jms" range="12601-12700"/>
  </process-type>
<ias-component id="OC4J">
  ...
  <process-type id="home" ... >
    ...
    <port id="ajp" range="12501-12600"/>
    <port id="rmi" range="12401-12500"/>
    <port id="jms" range="12601-12700"/>
    ...
  </process-type>
  <process-type id="OC4J_SECURITY" ... >
    ...
    <port id="ajp" range="12501-12600"/>
    <port id="rmi" range="12401-12500"/>
    <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="ajp" range="12501-12600"/>
    <port id="rmi" range="12401-12500"/>
    <port id="jms" range="12601-12700"/>
    ...
  </process-type>
  <process-type id="OC4J_SECURITY" ... >
    ...
    <port id="ajp" range="12501-12600"/>
    <port id="rmi" range="12401-12500"/>
    <port id="jms" range="12601-12700"/>
  </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:

    (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="ajp" range="12501-12600"/>
    <port id="rmi" range="12401-12500"/>
    <port id="jms" range="12601-12700"/>
    ...
  </process-type>
  <process-type id="OC4J_SECURITY" ... >
    ...
    <start timeout="600" retry="10"/>
    ...
    <restart timeout="720" retry="10"/>
    <port id="ajp" range="12501-12600"/>
    <port id="rmi" range="12401-12500"/>
    <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="ajp" range="12501-12600"/>
    <port id="rmi" range="12401-12500"/>
    <port id="jms" range="12601-12700"/>
    ...
  </process-type>
  <process-type id="OC4J_SECURITY" ... >
    ...
    <start timeout="600" retry="10"/>
    ...
    <restart timeout="720" retry="10"/>
    <port id="ajp" range="12501-12600"/>
    <port id="rmi" range="12401-12500"/>
    <port id="jms" range="12601-12700"/>
  </process-type>

3.6.4 Forcing a Shut Down of OracleAS Metadata Repository

If you find that the OracleAS 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:

  • No new connections are allowed, nor are new transactions allowed to be started, after the statement is issued.

  • Any uncommitted transactions are rolled back. (If long uncommitted transactions exist, this method of shutdown might not complete quickly, despite its name.)

  • Oracle does not wait for users currently connected to the database to disconnect. Oracle implicitly rolls back active transactions and disconnects all connected users.

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


See Also:

Oracle Database Administrator's Guide in the Oracle Database 10g documentation library