Oracle® Application Server Administrator's Guide
10g Release 2 (10.1.2) Part No. B13995-02 |
|
![]() Previous |
![]() Next |
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. See the following sections:
Section 3.2, "Starting and Stopping Application Server Instances"
Follow the procedures in this section when starting an instance from scratch, for example, after restarting a host, or when you would like to stop your entire instance, for example, in preparation for shutting down your system.
Section 3.3, "Starting and Stopping Components"
Use the procedures in this section after you have started your instance and would like to start or stop individual components.
Section 3.4, "Enabling and Disabling 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).
Section 3.5, "Starting and Stopping an Oracle Application Server Environment"
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:
This section describes how to start all processes in an OracleAS Infrastructure. Follow this procedure after you have restarted your host, or any other time you would like to start up your entire OracleAS Infrastructure.
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:
If your OracleAS Infrastructure contains OracleAS Metadata Repository, start it as follows:
Set the ORACLE_HOME
environment variable to the OracleAS Infrastructure Oracle home.
Set the ORACLE_SID
environment variable to the OracleAS Metadata Repository SID (default is orcl
).
ORACLE_HOME/bin/lsnrctl start
Start the OracleAS Metadata Repository instance:
ORACLE_HOME/bin/sqlplus /nolog
SQL> connect SYS as SYSDBA
SQL> startup
SQL> quit
Start the Oracle Enterprise Manager 10g Database Control:
ORACLE_HOME/bin/emctl start dbconsole
If your OracleAS Infrastructure contains Oracle Identity Management, start it as follows:
This section describes how to stop all processes in OracleAS Infrastructure. Follow this procedure when you are preparing to shut down your host, or any other time you would like to stop your entire OracleAS Infrastructure.
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 only step 2 to stop OracleAS Metadata Repository.
Oracle Identity Management only
Follow only step 1 to stop Oracle Identity Management.
To stop OracleAS Infrastructure:
If your OracleAS Infrastructure contains Oracle Identity Management, stop it as follows:
If your OracleAS Infrastructure contains OracleAS Metadata Repository, stop it as follows:
Set the ORACLE_HOME
environment variable to the OracleAS Infrastructure Oracle home.
Set the ORACLE_SID
environment variable is set to the OracleAS Metadata Repository SID (default is orcl
).
Stop the OracleAS Metadata Repository instance:
ORACLE_HOME/bin/sqlplus /nolog
SQL> connect SYS as SYSDBA
SQL> shutdown
SQL> quit
Stop the Net Listener:
ORACLE_HOME/bin/lsnrctl stop
Stop the Oracle Enterprise Manager 10g Database Control:
ORACLE_HOME/bin/emctl stop dbconsole
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 would like to start up the entire instance.
This procedure applies to all middle-tier instance types:
J2EE and Web Cache
Portal and Wireless
Business Intelligence Discoverer
To start a middle-tier instance:
If the middle-tier instance uses OracleAS Infrastructure services, such as Oracle Identity Management or OracleAS Metadata Repository, make sure they are started.
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 OracleAS Web Cache.
Start the Application Server Control Console:
ORACLE_HOME/bin/emctl start iasconsole
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 would like to stop the entire instance.
This procedure applies to all middle-tier instance types:
J2EE and Web Cache
Portal and Wireless
Business Intelligence Discoverer
To stop a middle-tier instance:
Stop the Application Server Control Console:
ORACLE_HOME/bin/emctl stop iasconsole
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 OracleAS Web Cache.
You can use the following tools to start, stop, restart, and view the status of components:
opmnctl
: A command-line tool
Application Server Control Console: A Web-based tool
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. The opmnctl
command enables you to 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. The Application Server Control Console enables 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:
Navigate to the Application Server home page on the Application Server Control Console. Scroll to the System Components section.
In the Select column, select the components you want to start, stop, or restart.
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.
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:
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.
You cannot disable or enable components that are part of an Oracle Application Server Cluster. As a result, the Enable/Disable Components button is not available on the Application Server Home page when you are managing an instance that belongs to an OracleAS Cluster.
See Also:
|
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.
To start an Oracle Application Server environment:
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 need to start only 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.
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.
If your environment has middle-tier instances that are part of an OracleAS Cluster, start the OracleAS Clusters in any order.
See Also: Oracle Application Server High Availability Guide |
Start middle-tier instances.
If your environment contains middle-tier instances that are not part of an OracleAS Cluster, start them in any order.
To stop all processes in an Oracle Application Server environment:
Stop OracleAS Clusters.
If your environment has middle-tier instances that are part of OracleAS Clusters, stop the clusters in any order.
See Also: Oracle Application Server High Availability Guide |
Stop middle-tier instances.
If your environment contains middle-tier instances that are not part of an OracleAS Cluster, stop them in any order.
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.
Stop any OracleAS Infrastructure instances that contain only OracleAS Metadata Repository.
If your environment has OracleAS Infrastructure installations that contain only OracleAS Metadata Repository, stop those in any order.
This section contains the following special topics about starting and stopping Oracle Application Server:
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:
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 instructions.
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:
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 instructions.
There are special considerations and procedures for starting and stopping High Availability environments such as:
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="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:
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.
Before assigning the port, check to see if the port is in use by binding to it.
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="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:
Choose unique port ranges for AJP, RMI, and JMS.
Edit ORACLE_HOME2
/opmn/conf/opmn.xml
.
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"/>
Save and close the file.
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, by following these steps in each Oracle home:
Edit ORACLE_HOME
/opmn/conf/opmn.xml
.
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"/>
Save and close the file.
Reload OPMN:
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="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> |
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 |