3 Administrating Oracle CEP Standalone-Server Domains

This chapter describes how to create, configure, and use a single-server domain, including:

3.1 Creating an Oracle CEP Standalone-Server Domain

After you install Oracle CEP, use the Configuration Wizard to create a new domain to deploy your applications. The Configuration Wizard creates, by default, the domains in the ORACLE_CEP_HOME/user_projects/domains directory, where ORACLE_CEP_HOME refers to the Oracle CEP installation directory such as d:/oracle_cep. You can, however, create a domain in any directory you want.

The Configuration Wizard creates a single default server in the domain; all the server-related file are located in a subdirectory of the domain directory named the same as the server (such a c:\oracle_cep\user_projects\domains\my_domain\defaultserver). Additionally, the Configuration Wizard allows you to:

  • Configure the server's administration user and password.

  • Configure the default server to use a database or database driver that is different from the default. In this case, you need to customize the JDBC settings to point to the appropriate database.

  • Configure the server's listen port.

  • Configure the password for the identity keystore and private keystore.

You can use the Configuration Wizard in the following modes:

3.1.1 Creating an Oracle CEP Standalone-Server Domain Using the Configuration Wizard in Graphical Mode

The following procedure shows how to invoke and use the Configuration Wizard in graphical mode by executing the relevant command script for both Windows or Unix.

Note:

On Windows, you can also invoke the Configuration Wizard using the Start menu:
Start > All Programs > Oracle Complex Event Processing 11gR1 > Tools > Configuration Wizard

To create an Oracle CEP standalone-server domain using the Configuration Wizard in graphical mode:

  1. Open a command window and set your environment as described in "Setting Your Development Environment" in the Oracle Complex Event Processing Getting Started.

  2. Change to the ORACLE_CEP_HOME/ocep_11.1/common/bin directory, where ORACLE_CEP_HOME refers to the main Oracle CEP installation directory, such as /oracle_cep:

    prompt> cd /oracle_cep/ocep_11.1/common/bin
    
  3. Invoke the config.cmd (Windows) or config.sh (UNIX) command to invoke the wizard:

    prompt> config.sh
    

    After the Configuration Wizard has finished loading, you will see a standard Oracle Welcome window.

    Note:

    The Oracle CEP Configuration Wizard is self-explanatory; however, if you want more information about using the tool, continue reading this procedure.
  4. Click Next.

  5. In the Choose Create or Update Domain window, choose Create a New Oracle CEP Domain.

  6. Click Next.

  7. Enter the name of the administrator user for the default server of the domain.

  8. Click Next.

  9. Enter basic configuration information about the default server in the domain. In particular:

    • Enter the name of the default server. This name will also be used as the name of the directory that contains the default server files.

    • The listen port for Oracle CEP itself. Default is 9002.

    • The secure listen port. Default is 9003.

  10. Click Next.

  11. Enter and confirm the password for the Oracle CEP domain identity keystore.

    By default, the password for the certificate private key will be the same as the password for the identity keystore.

    Note:

    The Oracle CEP Server will not start unless the password for certificate private key is the same as the password for the identity keystore. Do not uncheck Use Keystore Password and do not enter a private key password.
  12. Click Next.

  13. Decide whether or not to update the JDBC datasource configuration:

    The Configuration Wizard bases the creation of a new domain on the Oracle CEP domain template; by default, this template does not configure any JDBC datasource for a domain. This means that, unless you change the default domain template used by the Configuration Wizard, if you choose No at this step, no JDBC data source is configured. If you want to configure a JDBC data source, choose Yes at this step to proceed to the page in which you can enter the data source information.

    1. To create a JDBC datasource:

      • Select Yes.

      • Click Next.

      • Enter the new JDBC datasource values in Configure Database Properties window.

        In the top section, enter the name of the datasource. Then select the database type (Oracle or Microsoft SQL Server) and corresponding drivers; you can also browse to new drivers using the Browse/Append button.

        In the lower section, enter the details about the database to which this data source connects, such as its name, the name of the computer that hosts the database server, the port, and the name and password of the user that connects to the database. The JDBC connection URL is automatically generated for you based on this information.

      • Click Next.

    2. To not create a JDBC datasource:

      • Select No.

      • Click Next.

  14. In the Configure Server window, enter the name of the new domain and the full pathname of its domain location.

    The configuration wizard creates the domain using its domain name in the domain location directory.

    Note:

    Oracle recommends you always use the default domain location to create your domains:
    • On UNIX, the default domain is: ORACLE_CEP_HOME/user_projects/domains.

    • On Windows, the default domain is: ORACLE_CEP_HOME\user_projects\domains.

  15. Click Create.

    If the creation of the domain succeeded, you will see a message similar to the following in the Creating Domain window:

    Domain created successfully!
    Domain location: C:\oracle_cep\user_projects\domains\ocep_domain
    
  16. Click Done.

3.2 Updating an Oracle CEP Standalone-Server Domain

Use the Configuration Wizard to update an existing server in a domain.

The Configuration Wizard creates, by default, the domains in the ORACLE_CEP_HOME/user_projects/domains directory, where ORACLE_CEP_HOME refers to the Oracle CEP installation directory such as d:/oracle_cep. You can, however, create a domain in any directory you want.

The Configuration Wizard creates a single default server in the domain; all the server-related file are located in a subdirectory of the domain directory named the same as the server (such as c:\oracle_cep\user_projects\domains\my_domain\defaultserver).

You can update only the following configuration options of an existing standalone-server in your domain:

  • The listen port.

  • The configuration of the JDBC datasource.

You can use the Configuration Wizard in the following modes:

3.2.1 How to Update an Oracle CEP Standalone-Server Domain Using the Configuration Wizard in Graphical Mode

The following procedure shows how to invoke and use the Configuration Wizard in graphical mode by executing the relevant command script for both Windows or Unix.

Note:

On Windows, you can also invoke the Configuration Wizard using the Start menu:
Start > All Programs > Oracle Complex Event Processing 11gR1 > Tools > Configuration Wizard

For clarity, it is assumed in this section that you want to update a server called productionServer whose server-related files are located in the C:\oracle_cep\user_projects\domains\mydomain\productionServer directory.

To update an Oracle CEP standalone-server domain using the Configuration Wizard in graphical mode:

  1. Open a command window and set your environment as described in "Setting Your Development Environment" in the Oracle Complex Event Processing Getting Started.

  2. Change to the ORACLE_CEP_HOME/ocep_11.1/common/bin directory, where ORACLE_CEP_HOME refers to the main Oracle CEP installation directory, such as /oracle_cep:

    prompt> cd /oracle_cep/ocep_11.1/common/bin
    
  3. Invoke the config.cmd (Windows) or config.sh (UNIX) command to invoke the wizard:

    prompt> config.sh
    

    After the Configuration Wizard has finished loading, you will see a standard Oracle Welcome window.

    Note:

    The Oracle CEP Configuration Wizard is self-explanatory; however, if you want more information about using the tool, continue reading this procedure.
  4. Click Next.

  5. In the Choose Create or Update Domain window, select Update an existing Oracle CEP domain.

  6. Click Next.

  7. In the text box, enter the full pathname of the server directory that contains the files for the server you want to update.

    In this example, the value is C:\oracle_cep\user_projects\domains\mydomain\productionServer.

  8. Click Next.

  9. Update the listen ports for the server.

    Note:

    To prevent any conflicts when all servers are running at the same time, be sure that you do not enter the same values used by other servers in the domain.
  10. Click Next.

  11. Decide whether or not to update the JDBC datasource configuration:

    1. To update the JDBC datasource configuration:

      • Select Yes.

      • Click Next.

      • Enter the new JDBC datasource values.

    2. To leave the JDBC datasource configuration unchanged:

      • Select No.

      • Click Next.

  12. Click Update to update the server.

3.3 Starting and Stopping an Oracle CEP Server in a Standalone-Server Domain

You can start and stop an Oracle CEP standalone-server using any of the Oracle CEP Visualizer, Oracle CEP IDE for Eclipse, or command line scripts.

This section describes:

3.3.1 How to Start an Oracle CEP Standalone-Server Using the startwlevs Script

Each Oracle CEP server directory contains a command script that starts a server instance; by default, the script is called startwlevs.cmd (Windows) or startwlevs.sh (UNIX).

To start an Oracle CEP standalone-server using the startwlevs script:

  1. Ensure that the JAVA_HOME variable in the server start script points to the correct Oracle JRockit JDK. If it does not, edit the script.

    The server start script is located in the server directory under the main domain directory. For example, the default server directory of the HelloWorld domain is located in ORACLE_CEP_HOME/ocep_11.1/samples/domains/helloworld_domain/defaultserver, where ORACLE_CEP_HOME refers to the main Oracle CEP installation directory, such as /oracle_cep.

    1. If using the Oracle JRockit JDK installed with Oracle CEP, the JAVA_HOME variable should be set as follows:

      For UNIX:

      JAVA_HOME=ORACLE_CEP_HOME/jrockit_160_20
      

      For Windows:

      set JAVA_HOME=ORACLE_CEP_HOME\jrockit_160_20
      

      where ORACLE_CEP_HOME refers to the installation directory of Oracle CEP 10.3, such as /oracle_cep (UNIX) or c:\oracle_cep (Windows).

    2. If using the Oracle JRockit JDK installed with Oracle JRockit Real Time, the JAVA_HOME variable should be set as follows:

      For UNIX:

      JAVA_HOME=ORACLE_RT_HOME/JROCKIT_RT_HOME
      

      For Windows:

      set JAVA_HOME=ORACLE_RT_HOME\JROCKIT_RT_HOME
      

      where ORACLE_RT_HOME refers to the installation directory of Oracle JRockit Real Time, such as /jrockit (UNIX) or c:\jrockit (Windows), and JROCKIT_RT_HOME refers to JRockit Real Time directory.

  2. Open a command window and change to the server directory of the domain directory. For example, to start the HelloWorld sample server:

    prompt> cd C:\oracle_cep\ocep_11.1\samples\domains\helloworld_domain\defaultserver
    
  3. Execute the startwlevs.cmd (Windows) or startwlevs.sh (UNIX) script:

    prompt> startwlevs.cmd
    

    If you are using the Oracle JRockit JDK included in Oracle JRockit Real Time, enable the deterministic garbage collector by passing the -dgc parameter to the command:

    prompt> startwlevs.cmd -dgc
    

Note:

On HP-UX, to avoid an OutOfMemoryError, you may need to increase the MaxPermSize to 256 in startwlevs.sh. For example: -XX:MaxPermSize=256m.

3.3.2 How to Stop an Oracle CEP Standalone-Server Using the stopwlevs Script

Each Oracle CEP server directory contains a command script that stops a server instance; by default, the script is called stopwlevs.cmd (Windows) or stopwlevs.sh (UNIX).

Note:

The following procedure does not stop an Oracle CEP stand-alone server running in SSL mode. To stop an Oracle CEP stand-alone server running in SSL mode, run the wlevs.Admin utility, as described in Section A.4, "Running wlevs.Admin Utility in SSL Mode."

To stop an Oracle CEP standalone-server using the stopwlevs script:

  1. Open a command window and change to the server directory. For example, to stop the running HelloWorld sample server:

    prompt> cd C:\oracle_cep\ocep_11.1\samples\domains\helloworld_domain\defaultserver
    
  2. Execute the stopwlevs.cmd (Windows) or stopwlevs.sh (UNIX) script.

    Use the -url argument to pass the URL that establishes a JMX connection to the server you want to stop. This URL takes the form service:jmx:msarmi://host:port//jndi/jmxconnector, where host refers to the computer hosting the server and port refers to the server's JNDI port, configured in config.xml file. For example:

    prompt> stopwlevs.sh -url service:jmx:msarmi://ariel:9002/jndi/jmxconnector
    

    In the example, the host is ariel and the JMX port is 9002. The 9002 port is the netio port defined in the Oracle CEP server config.xml configuration file. MSA security uses it for JMX connectivity.

    See Section A.6, "Connection Arguments" for additional details about the -url argument.

    Note:

    on Windows, do not stop the Oracle CEP server by clicking the Close button in the command prompt in which you started it. Always stop the Oracle CEP server using the stopwlevs.cmd script or Ctrl-C.