4 Understanding Process Control of Oracle Internet Directory Components

This chapter describes the Oracle Internet Directory process control architecture and related concepts for the LDAP server and the replication server processes. It includes starting, stopping, and monitoring the Oracle Internet Directory processes and some best practices for process control.

This chapter includes the following sections:

For information on creating and destroying Oracle Internet Directory server instances, see Chapter 8, "Managing Oracle Internet Directory Instances."

For information about starting and stopping the Oracle Directory Integration and Provisioning server, see the chapter on managing the Oracle Directory Integration and Provisioning server in Oracle Fusion Middleware Administrator's Guide for Oracle Directory Integration Platform.

4.1 Oracle Internet Directory Process Control Architecture

The Oracle Process Manager and Notification Server (OPMN) is a daemon process that monitors Oracle Fusion Middleware system components, including Oracle Internet Directory. Oracle Enterprise Manager Fusion Middleware Control uses OPMN to stop or start instances of Oracle Internet Directory. If you stop or start Oracle Internet Directory components from the command line, you use opmnctl, the command-line interface to OPMN

OPMN is responsible for the direct start, stop, restart and monitoring of the daemon process, OIDMON (ORACLE_HOME/bin/oidmon). OIDMON is responsible for the process control of an Oracle Internet Directory instance. In 11g Release 1, you can have multiple instances of Oracle Internet Directory on the same Oracle instance on the same node. The recommended way to create a new Oracle Internet Directory instance is to create a Oracle Fusion Middleware component of type OID. Each Oracle Internet Directory instance created in this manner has its own OIDMON.

Figure 4-1 shows the overall architecture for Oracle Internet Directory process control. For each Oracle Fusion Middleware component of type OID, OPMN spawns an OIDMON process. The figure shows two components, oid1 and oid2. OIDMON spawns the OIDLDAPD dispatcher process, then the dispatcher process spawns one or more OIDLDAPD server processes.

Beginning with Oracle Internet Directory 11g Release 1 (11.1.1.7.0), the OIDLDAPD process is separated as the OIDDISPD (dispatcher) process and the OIDLDAPD (server) process. On UNIX and Linux systems, however, the ps -ef command will continue to show both of these processes as OIDLDAPD at runtime.

If replication is configured for that instance, OIDMON spawns a replication server process. Each dispatcher process has its own non-SSL and SSL port for receiving requests. The number of OIDLDAPD server processes that the dispatcher spawns for a component is controlled by the attribute orclserverprocs in the instance-specific configuration entry for the component.

Figure 4-1 Oracle Internet Directory Process Control

Surrounding text describes Figure 4-1 .

See Also:

Chapter 8, "Managing Oracle Internet Directory Instances" for information about creating new Oracle Internet Directory instances.

4.2 The ODS_PROCESS_STATUS Table

Oracle Internet Directory process information is maintained in the ODS_PROCESS_STATUS table in the ODS database user schema. OIDMON reads the contents of the table at a specified interval and acts upon the intent conveyed by the contents of that table. The interval is controlled by the value of the sleep command line argument used at OIDMON startup, and the default value is 10 seconds.

Table 4-1 describes the information in the ODS_PROCESS_STATUS table that is relevant to process control:

Table 4-1 Process Control Items in the ODS_PROCESS_STATUS Table

Item Meaning

Instance

Unique instance number for a given server ID on a given host

PID

Process ID of the server that is up and running

ServerID

Server ID (2=OIDLDAPD, 3=OIDREPLD)

Flags

Command line arguments that must be passed to the server instance

Hostname

Name of the host on which this server must be present

State

State of the Server Instance (0=stop, 1=start, 2=running, 3=restart, 4=shutdown, 5=failed-over, 7=delete, 8=add). OIDMON updates the state.

RetryCount

Number of attempts to start the server instance before it could be started successfully

Instancename

Name of the server instance, for example: server1

Compname

Name of the server component, for example: OID1


Notes:

  • There is a uniqueness constraint on: Instance, Instancename, Compname, ServerID, and Hostname.

  • Details about ODS_PROCESS_STATUS are provided here for informational purposes only. Do not attempt to modify this table directly.

4.3 Starting, Stopping, and Monitoring of Oracle Internet Directory Processes

This section describes the events that occur when OPMN starts and stops Oracle Internet Directory. It also describes process monitoring. This section includes the following topics:

4.3.1 Oracle Internet Directory Snippet in opmn.xml

When OPMN starts OIDMON, it determines what arguments to use based on the Oracle Internet Directory snippet in the OPMN configuration file, ORACLE_INSTANCE/config/OPMN/opmn/opmn.xml. The following is a sample Oracle Internet Directory snippet:

<ias-component id="<componentName>">
 <process-type id="OID" module-id="OID">
  <process-set id="OID" numprocs="1">
   <environment>
      <variable id="TNS_ADMIN" value="ORACLE_INSTANCE/config" />
      <variable id="DB_CONNECT_STR" value="db_alias" />
   </environment>
   <module-data>
    <category id="oidmon-parameters">
     <data id="start-cmdline-opts" value="connect=$DB_CONNECT_STR start"/>
     <data id="stop-cmdline-opts" value="connect=$DB_CONNECT_STR stop"/>
    </category>
    </module-data>
   </process-set>
  </process-type>
 </ias-component>

Two tags are specific to Oracle Internet Directory:

  • Oracle Internet Directory component-specific directives for OPMN are located under the tag <ias-component id="OID" status="enabled>.

  • OIDMON-related requirements are located under the tag <category id="oidmon parameters">. There should be only one such directive.

4.3.2 OPMN Starting Oracle Internet Directory

Oracle Internet Directory is started as follows:

Note:

When you use opmnctl to start only Oracle Internet Directory instances, the opmn.xmlparameters are not reloaded as they are when you use opmnctl startall. Execute opmnctl reload to reload the changes in the file ORACLE_INSTANCE/config/OPMN/opmn/opmn.xml.

4.3.3 OPMN Stopping of Oracle Internet Directory

Oracle Internet Directory is stopped as follows:

Note:

When you use opmnctl to start only Oracle Internet Directory instances, the opmn.xmlparameters are not reloaded as they are when you use opmnctl startall. Execute opmnctl reload to reload the changes in the file ORACLE_INSTANCE/config/OPMN/opmn/opmn.xml.

4.3.4 Process Monitoring

OPMN does not monitor server processes directly. OPMN monitors OIDMON and OIDMON monitors the server processes. The events are as follows:

  • When you start OIDMON through OPMN, OPMN starts OIDMON and ensures that OIDMON is up and running.

  • If OIDMON goes down for some reason, OPMN brings it back up.

  • OIDMON monitors the status of the Oracle Internet Directory dispatcher process, LDAP server processes, and replication server process and makes this status available to OPMN and Fusion Middleware Control. The opmnctl status command can show OIDLDAPD process PIDS because OIDMON sends OPMN that information.

4.4 Oracle Internet Directory Replication Server Control and Failover

This section describes process control and failover for the Oracle Internet Directory replication server (oidrepld) in a Maximum Availability Architecture (MAA), including:

4.4.1 Understanding the OID Monitor and Replication Server Failover

On each node, the Oracle Process Manager and Notification Server (OPMN) is responsible for the direct start, stop, restart, and monitoring of the OID Monitor process (oidmon). The OID Monitor is then responsible for the process control of an Oracle Internet Directory component, including the LDAP server processes and the replication server (oidrepld) process, if replication is configured for the instance.

In a Maximum Availability Architecture (MAA), these processes run as follows:

  • Multiple OID Monitor processes can be running on a node and can connect to the same Oracle database. Each OID Monitor is responsible for an Oracle Internet Directory component, such as oid1 and oid2. However, only one OID Monitor performs high availability operations.

  • If replication is configured, the replication server process should be running on only one node at any given time.

Every 60 seconds, the OID Monitor reports that it is running by sending a message to the Oracle database. The OID Monitor also polls the database to determine if any of the other nodes have failed. The OID Monitor uses the ODS_PROCESS_STATUS and ODS_SHM tables to communicate the starting and stopping of processes and the metadata changes across the nodes.

On the node running the replication server, the OID Monitor detects if the replication server is not responding and then tries to restart it. If the restart fails, the replication server is started on one of the surviving nodes, using the following logic:

  • Pull logic: If an OID Monitor detects that another OID Monitor is down on another node for more than the configured time (specified by the orclfailoverenabled attribute), then the OID Monitor treats that node as failed and starts the replication server on its node.

  • Push logic: The local OID Monitor on a node can push a failed replication server to another node by requesting that the OID Monitor on the other node start the process. An OID Monitor cannot start a replication server process on another node.

Later, if the failed node comes back up and the OID Monitor is restarted on that node, the OID Monitor will detect that another node is running the replication server. The OID Monitor will then request that the OID Monitor on the other node stop the replication server so that it can start the replication server on the original node.

4.4.2 Enabling Failover for Oracle Internet Directory Processes

The orclfailoverenabled attribute is a configuration entry ("cn=configset,cn=oidmon,cn=subconfigsubentry") that configures failover for Oracle Internet Directory processes.

This attribute specifies the failover time in minutes before the OID Monitor will start failed processes on a surviving node. The default failover time is 5 minutes. A value of zero (0) specifies that Oracle Internet Directory processes will not fail over to another node.

For example, if the OID Monitor on NodeB detects that NodeA has not responded for the time specified by orclfailoverenabled, NodeB considers NodeA as having failed. NodeB then retrieves the necessary information from the Oracle database about the Oracle Internet Directory processes that were running on NodeA and tries to start them on NodeB.

To check the orclfailoverenabled attribute for the current failover time:

ldapsearch -h oid_host  p oid_port -D "cn=orcladmin" -q -s base \
-b "cn=configset,cn=oidmon,cn=subconfigsubentry" objectclass=* orclfailoverenabled

To specify a different failover time, set the value of the orclfailoverenabled attribute. For example, to set the failover time to 10 minutes:

ldapmodify -h oid_host  p oid_port -D "cn=orcladmin" -q -f enablerepl.ldif

where enablerepl.ldif contains:

dn: cn=configset,cn=oidmon,cn=subconfigsubentry
changetype: modify
replace: orclfailoverenabled
orclfailoverenabled: 10

4.5 Oracle Internet Directory Process Control–Best Practices

The recommended approach for using opmnctl and oidctl is as follows:

  • Use opmnctl to stop or start Oracle Internet Directory as a component. That is, use it to stop or start all Oracle Internet Directory LDAP and replication server instances.

    • Using opmnctl to stop Oracle Internet Directory causes OPMN to issue an oidmon stop, which results in OIDMON shutting down all configured LDAP and replication server instances.

    • Using opmnctl to start Oracle Internet Directory causes OPMN to issue an oidmon start, which results in OIDMON starting up all configured LDAP and replication server instances.

    See Also:

  • Use oidctl to stop and start an Oracle Internet Directory Replication Server Instance without affecting the associated OIDMON and LDAP server instance managed by OIDMON.

    See Also: