Oracle Application Server 10g Administrator's Guide 10g (9.0.4) Part Number B10376-01 |
|
This chapter describes various procedures for starting and stopping Oracle Application Server.
It contains the following topics:
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:
Follow the procedures in this section when starting an instance from scratch, for example, after a reboot, or when you would like to stop your entire instance, for example, in preparation for shutting down your system.
Use the procedures in this section after you have started your instance and would like to start or stop individual components.
This section describes how to disable components (prevent them from starting when you start an instance) and enable components (allow them to start when you start an instance).
This section describes how to perform an orderly shutdown of your entire environment.
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.
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:
Follow both steps to start Identity Management and the Metadata Repository.
Follow only the first step to start the Metadata Repository. You do not need to perform the second step of starting Identity Management because you do not need OPMN or Application Server Control in a Metadata Repository only installation.
Follow only the second step to start Identity Management. Make sure the Metadata Repository that supports Identity Management (residing in another Oracle home) is already started.
To start an Infrastructure:
ORACLE_HOME
environment variable to the Infrastructure Oracle home.
ORACLE_SID
environment variable to the Metadata Repository SID (default is asdb
).
ORACLE_HOME
/bin/lsnrctl start
ORACLE_HOME
/bin/sqlplus /nolog
SQL> connect SYS as SYSDBA
SQL> startup
SQL> quit
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:
Follow both steps to stop Identity Management and the Metadata Repository.
Follow only the second step to stop the Metadata Repository.
Follow only the first step to stop Identity Management.
To stop an Infrastructure:
ORACLE_HOME
environment variable to the Infrastructure Oracle home.
ORACLE_SID
environment variable is set to the Metadata Repository SID (default is asdb
).
ORACLE_HOME
/bin/sqlplus /nolog
SQL> connect SYS as SYSDBA
SQL> shutdown
SQL> quit
ORACLE_HOME
/bin/lsnrctl stop
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:
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.
ORACLE_HOME
/bin/emctl start iasconsole
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:
ORACLE_HOME
/bin/emctl stop iasconsole
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.
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.
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.
You can start, stop, restart, and view status of components on the Application Server home page:
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.
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.
To start an Oracle Application Server environment from scratch:
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.
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.
If your environment has middle-tier instances that are part of OracleAS Clusters, start the clusters in any order.
If your environment contains middle-tier instances that are not part of OracleAS Clusters, start them in any order.
To stop all processes in an Oracle Application Server environment:
If your environment has middle-tier instances that are part of clusters, stop the clusters in any order.
If your environment contains middle-tier instances that are not part of a cluster, stop them in any order.
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.
If your environment has Infrastructure installations that contain only a Metadata Repository, stop those in any order.
This section contains the following special topics about starting and stopping Oracle Application Server:
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:
ocactl
to start and stop, refer to Oracle Application Server Certificate Authority Administrator's Guide.
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:
ORACLE_HOME
/opmn/bin/opmnctl startproc ias-component-LogLoader
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:
ORACLE_HOME
/opmn/bin/opmnctl stopproc ias-component-LogLoader
ORACLE_HOME
/opmn/bin/opmnctl stopall
The following high availability solutions require special procedures for starting and stopping:
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.xmlORACLE_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
.)
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:
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:
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.
To do this:
ORACLE_HOME2
/opmn/conf/opmn.xml
.
<port id="ajp" range="4601-4700"/> <port id="rmi" range="4701-4800"/> <port id="jms" range="4801-4900"/>
ORACLE_HOME2
/opmn/bin/opmnctl reload
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.
To do this, in each Oracle home:
ORACLE_HOME
/opmn/conf/opmn.xml
.
<start timeout="600" retry="10"/> <restart timeout="720" retry="10"/>
ORACLE_HOME
/opmn/bin/opmnctl reload
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.
|
![]() Copyright © 2002, 2003 Oracle Corporation. All Rights Reserved. |
|