Legal | Privacy
Forwarding Sensor Events to Oracle Streams Using Sensor Edge Server

Forwarding Sensor Events to Oracle Streams by Using the Oracle Sensor Edge Server

This tutorial shows how to use Streams Dispatcher to forward sensor events to the Sensor Data Hub through Oracle Streams.

Approximately 30 minutes

This tutorial covers the following topics:

Overview
Prerequisites
Configuring the Database
Configuring the Oracle Sensor Edge Server to Use Streams and Simulator
Summary
Related Information

Place the cursor over this icon to load and view all the screenshots for this tutorial. (Caution: Because this action loads all screenshots simultaneously, response time may be slow depending on your Internet connection.)

Note: Alternatively, you can place the cursor over each individual icon in the following steps to load and view only the screenshot associated with that step.

The Oracle Sensor Edge Server is a middle-tier component that integrates sensors and other types of command or response indication equipment with applications. Sensors are hardware or software endpoints that make observations of certain changes of state. The Sensor Edge Server uses these sensors to integrate sensor data and applications.

The Sensor Edge Server supports forwarding data to Oracle Streams as the distribution mechanism to applications and agents. You use Streams Dispatcher to forward the data. In the case of Streams Dispatcher, the events are not directly mapped to the applications. The dispatcher drops the events to the staging area. Interpretation of these events is done by the Data and Event Distribution Layer in the database.

A background job picks them up and evaluates them against a set of rules. These rules are conditions that an event can either match or not. If the condition is satisfied for this event, then an appropriate action is taken. This mechanism allows the system to be application and sensor neutral, thereby providing better quality and detail of data for goal-based and business-intelligence models to process.

 

Prerequisites

Before starting this tutorial, you should complete the following tasks:

1. Install Oracle9i Database Release 2 (or a later version).
2. Download the Oracle Sensor Edge Server software from http://otn.oracle.com and extract it to a folder on your machine. For this tutorial, the software is in the C:\edgeserver folder.

Installing the Oracle Sensor Edge Server

To install the Oracle Sensor Edge Server, perform the following steps:

1.

In Windows Explorer, navigate to C:\edgeserver\Disk1\install. Double-click setup.exe.

Place the cursor over this icon to see the image

 

2.

On the "Oracle Universal Installer: Welcome" screen, click Next.

Place the cursor over this icon to see the image

 

3.

Accept the default name and path for installation, or specify a different name and path. Then click Next.

Place the cursor over this icon to see the image

Place the cursor over this icon to see the image

 

4.

Select Complete (97MB) from the installation types. Click Next.

Place the cursor over this icon to see the image

 

5.

Enter a password for OC4J container in both the Enter Password and Confirm Password fields. Click Next.

Place the cursor over this icon to see the image

 

6.

Click Install.

Place the cursor over this icon to see the image

Place the cursor over this icon to see the image

Place the cursor over this icon to see the image

Place the cursor over this icon to see the image

Click Exit and click Yes to close the confirmation window.

 

You can configure the database for use as a sensor data archive. To configure the database, perform the following steps:

1.

Open a command window and change directory to <edgeserver_home>\edge\sql, where edgeserver_home is the folder in which the Sensor Edge Server is installed. Log in to SQL*Plus as system user by issuing the following command:

sqlplus system/<password for system>

Move your mouse over this icon to see the image

 

2.

Execute the script create_edg_user.sql. This script creates the user edge and assigns privileges to that user.
You are prompted to enter a password for the user edge. In this example, the password is edgepwd.

Move your mouse over this icon to see the image

Move your mouse over this icon to see the image

 

3.

Connect as the new user and run the scripts edg_create_streams.sql and edg_create_sdh.sql.

edg_create_streams.sql: This script creates the internal queues, ruleset, and streams-related schema. Streams Dispatcher uses the queues to propagate messages to the relevant application.


edg_create_sdh.sql: This script creates the Sensor Data Hub schema. The Sensor Data Hub is a single repository that provides a global view of all sensor information.

Move your mouse over this icon to see the image

Move your mouse over this icon to see the image

Exit SQL*Plus.

 

Configure the Streams Dispatcher and Internal Simulator to handle the sensor events. The edgeserver.xml file defines all the parameters and runtime settings for the Oracle Sensor Edge Server. When the server starts up, it reads this file to set up all the runtime data and load all the necessary components and extensions.

 

1.

Open the edgeserver.xml file that is in the <edgeserver_home>\edge\config folder. Observe the various tags, of which the following are the most important:

<EdgeServer>: Is the root element. It contains tags to set various tuneable parameters


<DispatcherList>: Specifies all the dispatchers that are uploaded to the system. It contains an array
of <Dispatcher>, which defines all uploaded dispatchers. There can only be only one <DispatcherList> in the <EdgeServer> node.


<CurrentDispatcher>: Defines which dispatcher to use and its parameters


<DeviceGroups>: Contains the actual device and filter instances to load at run time

Most of the tags in the edgeserver.xml configuration file require you to define a unique identifier so that they can be referenced by other tags. The identifier is defined in the attribute ID and must be unique across the file (although they do not have to be consecutive).

Look for the <Dispatcher> tag for Streams Dispatcher and examine the attributes and parameters tag. Observe that there are three parameters for Streams Dispatcher: url, username, and password. Make a note of the value in the ID attribute of the <Dispatcher> tag.

Move your mouse over this icon to see the image

 

2.

Examine the <CurrentDispatcher> tag.

Move your mouse over this icon to see the image

Note that the dispatcher is set to NullDispatcher with reference 3.

 

3.

Set the dispatcher to Streams Dispatcher and change the value of the reference attribute to the value you noted in
step 1. For each parameter defined in the Streams Dispatcher extension, you should have a <ParameterInst> entry in your current dispatcher. You have already observed that there are three parameters in the Streams Dispatcher extension: url, username, and password. Provide values for all three parameters, as shown in the following screenshot:
Note: Download and save the sample.xml file on your hard disk. You can copy and paste the <CurrentDispatcher> tag from this file.

Change the database SID in the value for the parameter called url. In this example, the SID used is ping.

Move your mouse over this icon to see the image

Save the edgeserver.xml file.

 

4.

If you add a device to the Sensor Edge Server, it picks up the events from the device. Add an internal simulator to the Sensor Edge Server. In the edgeserver.xml file, search for the edge simulator driver and observe that the ID is 43. Also note that the simulator has one parameter with the ID 45 and name FileName.

Move your mouse over this icon to see the image

 

5.

Search for device groups in the XML file. Observe that there are currently no devices in the <DeviceList>. The tag is therefore closed.

Move your mouse over this icon to see the image

 

6.

Modify the file to add the device, as shown in the following screenshot. Then save the file.
Note: You can copy and paste the <DeviceList> tag from the sample.xml file that you downloaded in step 3.

Move your mouse over this icon to see the image

 

1.

Start the OC4J server. Switch to the command prompt, change the directory to <edgeserver_home>\j2ee\home, and issue the following command:

java -jar oc4j.jar

Move your mouse over this icon to see the image

 

2.

Each time you start your server, it begins dropping events. An edge*.log file must be created in the following location: <edgeserver_home>\edge\log. Open the file and verify the events that are being dispatched.

Move your mouse over this icon to see the image

 

3.

Open another command prompt and log in to SQL*Plus as edge user. Execute the following query:

SELECT count(*) FROM SDH_EVENTS;

Move your mouse over this icon to see the image

Move your mouse over this icon to see the image

 

In this lesson, you have learned how to:

Install the Oracle Sensor Edge Server

Configure Streams Dispatcher for sensor events

Plug in a simulator to simulate an RFID device

Related Information

To learn about Oracle Sensor Edge Server Enterprise Edition, refer to this OBE on OTN.
To ask a question about this OBE tutorial, post a query on the OBE Discussion Forum.

Place the cursor on this icon to hide all screenshots.

Copyright © 2005 Oracle Corporation. All rights reserved.

 

 

 

 

E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy