Manually Configuring Sensor Data Repository and Sensor Data Streams
Manually Configuring Sensor Data Repository (SDR) and
Sensor Data Streams (SDS)This tutorial shows how to manually configure Sensor Data Repository
and Sensor Data Streams. Approximately
30 minutes.
This
tutorial covers the following topics:
Place
the cursor over this icon to load and view all the
screenshots for this tutorial. (Caution: This action loads all screenshots simultaneously,
so, depending on your Internet connection, may result in a slow response time.)
Note:
Alternatively, you can place the cursor over an individual icon in the following
steps to load and view only the screenshot associated with that step. You can
hide an individual screenshot by clicking it.
You
can configure Sensor Data Repository and Sensor Data Streams at the time of installing
Oracle Sensor Edge Server. If you did not configure them at the time of installation,
you can manually deploy them later by executing the post-installation scripts
as described in this OBE. Sensor Data Repository (SDR)
is a collection of database tables, views, and PL/SQL packages for storing and
querying sensor event data. SDR is specifically designed to store various types
of sensor data such as EPCs and temperature readings. The database schema stores
status and diagnostic information from Sensor Edge Server, and serves as the single
repository for sensor data. Oracle Sensor Edge Server
supports using Sensor Data Streams (SDS) as one of the event distribution method.
When events are read in the devices, they are normalized by the drivers and sent
to filters for filtering. After the data is cleansed and filtered, they are passed
to the dispatchers for distribution. Oracle Sensor Edge Server uses plug-ins called
"dispatchers" to communicate with applications and event distribution
systems. One of the built-in dispatchers is the Streams Dispatcher. The Streams
Dispatcher is a plug-in that sends and receives events using Oracle Streams technology. Instead
of talking directly to an application, the Streams Dispatcher hands off all the
events into a Streams Staging area. Once the events are dropped off in the staging
area, a background job will pick them up and evaluate them against a set of rules.
A rule is a condition that can be either matched or not matched by an event. If
the condition is satisfied for this event, a corresponding user-defined action
will be taken. Back
to Topic List Before starting this tutorial, you should complete
the following tasks:
| 1. |
Have access to or have installed Standard or Enterprise Edition
of Oracle Database 9i Release 2 or later version. The steps to install the database
are shown in Installing
Oracle Database 10g on Windows tutorial. Install Oracle9i Database
Release 2 (or a later version). | |
2. | Have access to or have installed
Oracle Application Server 10g 10.1.3. You can download Oracle Application
Server 10g 10.1.3 software from here. | | 3. | Have
access to or have installed Oracle Sensor Edge Server. You can download Oracle
Sensor Edge Server software from here.
Please do not configure Sensor Data Repository (SDR) or Sensor Data Streams (SDS)
during this installation. | | 4. | Download
the modified copy of edg_create_streams.sql file from here.
Replace the file in ORACLE_HOME\edge\stage\sql\10.1.3
directory with this copy. | Back
to Topic List You also have the option
of deploying only SDR or only SDS.
First, you
must setup a database instance. You can either use the Standard or Enterprise
Edition of the Database, but it has to be 9.2 or higher. Once you have the instance,
note down the Global Database Name (GDN), and the administrator username and password.
If the database instance is on a separate machine, you will need to edit the ORACLE_HOME/network/admin/tnsnames.ora
file on the Oracle Sensor Edge Server machine to add the GDN to it. To
deploy the SDR schema to your database, perform the following steps:
| 1. | Open a command window
and change directory to <edgeserver_home>\edge\sql\10.1.3 where edgeserver_home
is the folder in which edge server is installed. Log in to SQL*Plus as system
user by issuing the following command: sqlplus
system/<password for system> |
| 2. | Execute the
create_edg_sda_user.sql
script. This script will create the edge
user and assign privileges to the user. You are prompted to enter a password
for the edge user. In this example,
the password is edge.
| | 3. | Connect
as the new user and run the edg_sda_with_edgeuser.sql
script located in ORACLE_HOME/edge/stage/SQL/10.1.3. This script creates
the user and the schema for the sensor data archive user. | | 4. | If
necessary, exit from sqlplus. SQL> exit 
|
After you execute the scripts, you will now
have a user in your database called EDGE. All the necessary schemas and data are
created under that user. The background jobs are also started automatically.
Back to Topic List
To connect the Sensor Edge Server to the Sensor Data Repository, complete the
following steps:
| 1. | Verify that your OC4J
server is running (You can verify this by using either the Application Server
Control or by using opmnctl command). opmnctl
status If OC4J Server is not running, start the OC4J Server using
the following command. Switch to the command prompt, change directory to ORACLE_HOME\opmn\bin
and issue the command opmnctl
startall
| | 2. | Open a browser
window and enter the URL for Oracle Enterprise Manager: http://<hostname>.<domain>:<port
number for HTTP service>/em Enter the OC4J administrator username
and OC4J administrator password. Click Login. |
| 3. | Click the home
link in the Cluster Topology page to navigate to the OC4J Home page. | | 4. | Click
Administration in the OC4J Home page. | | 5. | Scroll
down to Services. Click the icon next to JDBC Resources. | | 6. | Click
Create under Data Sources | | 7. | Select
Native Data Source and click Continue. | | 8. | Enter
the following values: Name: edge/SensorDataRepositoryDS JNDI
Location: edge/SensorDataRepositoryDS Data Source Class: oracle.jdbc.pool.OracleDataSource Login
Timeout (seconds): 20 JDBC URL: Enter the jdbc URL to your database.
For example - jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_ LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=yourhost.us.oracle.com)( PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=your_service_ name)))
or you can click Generate URL from Connection and provide the following details: Driver
Type: thinDB DB Host Name: <hostname>.<domain> DB Listener Port:
1521 DB Identifier Type: Service Name SID/Service Name: your_service_name Username:
edge Use Cleartext Password: edge Click Test Connection. | | 9. | Click
Test. | | 10. | Click
Finish. Click
Logout to exit from Oracle Enterprise Manager. | | 11. | Open
a browser window and enter the URL for Sensor Edge Server: http://<hostname>.<domain>:<port>/edge Enter
the OC4J administrator username and OC4J administrator password that you provided
at the time of installation. Click Login. | | 12. | Select
Yes from the drop-down list for Use Archive in the General Settings page.
Click Save Changes. | | 13. | Click
the Enterprise Manager link to restart OC4J. Note:
If you are configuring SDS right away, you do not have to restart Enterprise Manager
now, but you can do so after you finish configuring SDS. |
Back to Topic
List
Before deploying Sensor Data Streams,
make sure that Oracle Database is running in ArchiveLog mode, with automatic archiving
enabled. To change the Oracle Database mode from noarchivelog mode to archivelog
mode:
| 1. | Log in to SQL*Plus as
the sys user by issuing the following
command: sqlplus sys/<password
for sys> as sysdba
| | 2. | Verify
that the database is in noarchivelog mode: select
log_mode from v$database; | | 3. | Shut
down the database. Mount the database without opening it to change the log mode.
SQL>shutdown immediate; SQL>exit sqlplus
"/ as sysdba" SQL>startup
mount; | | 4. | Change
the log mode. SQL> alter database
archivelog; | | 5. | Open
the database. SQL> alter database
open; | | 6. | Verify
that the database is in archivelog mode. SQL>
select log_mode from v$database; | | 7. | Start
the archiver. SQL> show parameter
log_archive start; |
For additional information, please
refer to the appropriate version of the Oracle Database Administrators Guide. Back
to Topic List
To manually deploy
Sensor Data Streams, complete the following steps:
| 1. | Open a command window
and change directory to <edgeserver_home>\edge\SQL\10.1.3 where edgeserver_home
is the folder in which edge server is installed. Log in to SQL*Plus as sys
user by issuing the following command: sqlplus
sys/<password for sys> as sysdba
| | 2. | Execute
the grant_edg_user.sql script
located in ORACLE_HOME\edge\stage\sql\10.1.3.
| | 3. | Connect as
the new edge user and run the edg_create_streams.sql
script located in ORACLE_HOME/edge/stage/SQL/10.1.3. This script creates
the Oracle Sensor Edge Server event queue, roles, and ruleset. |
Back
to Topic List
To connect Sensor Edge Server to Sensor Data Streams, use the following procedure:
| 1. | Verify that your OC4J
server is running (You can verify this by using either the Application Server
Control or by using the opmnctl command). opmnctl
status If OC4J Server is not running, start the OC4J Server using
the following command. Switch to the command prompt, change directory to ORACLE_HOME\opmn\bin
and issue the command: opmnctl
startall
| | 2. | Open a browser
window and enter the URL for Oracle Enterprise Manager: http://<hostname>.<domain>:<port>/em Enter
the OC4J administrator username and the OC4J administrator password that you provided
at the time of installation. Click Login. |
| 3. | Click the home
link in Cluster Topology page to navigate to the OC4J Home page. | | 4. | Click
Administration in the OC4J Home page. | | 5. | Scroll
down to JMX, click the icon next to System MBean Browser. | | 6. | Click
the + (plus) icon next to oc4j and navigate to J2EEServer > standalone
> J2EEApplication > default. | | 7. | Click
Operations.
| | 8. | Click createNativeDataSource
to create the data source to connect to the database on which the Sensor Data
Repository schema is installed. | | 9. | Enter
the following values: dataSourceName: edge/StreamsDS user:
edge password: Enter the password that you chose when you ran the create_edg_user.sql
script. jndiLocation: edge/StreamsDS loginTimeout: 20 dataSourceClass:
oracle.jdbc.pool.OracleDataSource url: Enter the jdbc URL to your
database. For example - jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_ LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=yourhost.us.oracle.com)( PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=your_service_ name))) Click
Invoke Operation. | | 10. | Open
a browser window and enter the URL for Sensor Edge Server: http://<hostname>.<domain>:HTTP
Server port/edge Enter the OC4J username and OC4J administrator password
that you provided at the time of installation. Click Login. | | 11. | Scroll
down the Edge Server Configuration page and click Change Dispatcher. | | 12. | Select
Streams Dispatcher V2. Click Select. | | 13. | Click
Save Changes. | | 14. | Click
the Enterprise Manager link to restart OC4J. The streams dispatcher will
attempt to connect to the Sensor Data Streams schema. |
Back to
Topic List
In
this lesson, you have learned how to:
 | Manually
deploy SDR |  | Manually
deploy SDS |  | Configure
SES to use SDR and SDS | Back
to Topic List
 | To
learn more about Sensor Edge Server, refer to additional OBEs on the OTN
Web site |  | To
ask a question about this OBE tutorial, post a query on the OBE Discussion Forum |
Back to Topic List
Place the cursor over this icon to hide all screenshots.
|