Oracle Dynamic Services User's and Administrator's Guide Release 9.0.1 Part Number A88783-01 |
|
After the dsinstall.sql
script has been run, a package named DS_Properties is created as a result of installing the DSSYS schema. Through this package, you can call a setProperty procedure to change system properties of your current Dynamic Services instance. The advanced installation options include the following:
Section 4.1 through Section 4.6 describe these advanced installation options that are provided in the installation package. These options can be invoked with the individual scripts described in each section. Most of these scripts call the DS_Properties.setProperty procedure.
Important: In part of Section 4.3.1, directory paths often show only the UNIX path "/" specification. If you are installing on a Windows NT system, the path specification is "\" and you must make this change, as needed, for the installation to be successful. |
This installation option coincides with the PL/SQL deployment view described in Section 1.3.2.
dssys_plsql_init.sql
that is provided to grant the necessary permissions to user DSSYS.
ds/sql
on UNIX systems or ds\sql
on Windows NT systems) of the ds_plsql_init.sql
file.sqlplus SYS/<SYS-password>
dssys_plsql_init.sql
script as follows:
SQL> @dssys_plsql_init.sql
Running this script grants the necessary permissions to user DSSYS.
ds_plsql.sql
that is provided to install the PL/SQL interface.
ds/sql
) or on Windows NT systems (ds\sql
) of the ds_plsql.sql
file.sqlplus DSSYS/<DSSYS-password>
ds_plsql.sql
script as follows:
SQL> @ds_plsql.sql
The following happens upon running this ds_plsql.sql
script:
ds_plsql.log
file is checked to verify the installation of the package.Describe the DynamicServices package by issuing the following command at a SQL*Plus prompt.
SQL> desc DynamicServices
A sample, anonymous PL/SQL block is run to test the functions, having already registered the YahooPortfolio service as described in Section 3.2. A sample PL/SQL script demo/consumer/sample.sql
on UNIX systems or demo\consumer\sample.sql
on Windows NT systems, found in the Dynamic Services installation directory, tests the DynamicServices package that was just installed.
Refer to Section 5.2 for a more detailed description of how you can use the PL/SQL interface.
Dynamic Services offers a persistent auditing feature in which events that can be thrown during execution, can be monitored. The monitoring process involves triggering of services to be executed upon receipt of a certain event. These services that get triggered are called monitor services. A standalone monitor utility enables the process of auditing these events. Persistent auditing performs among other tasks, service execution logging and event failure notification. See Section 4.2.6 for an example of using the logger monitor service.
Because Dynamic Services makes use of Oracle Advanced Queuing for delivering event messages, you must also set the dynamic init.ora
parameter aq_tm_processes
for your database instance to a non-zero value (for example, set it to 1) as shown in Example 4-1.
aq_tm_processes = 1
Refer to Oracle Advanced Queuing documentation for more information. Restart the database instance after you modify the init.ora
file.
By default, monitor services (which are mostly JDBC services), insert entries into tables under the DSSYS schema. If you changed the password for DSSYS, modify the default DSSYS password in the MonitorInstall.dss
file to reflect that change.
Before installing the event monitor services, you must first configure the MonitorInstall.dss
file in the etc/dsadmin
directory on UNIX systems or etc\dsadmin
directory on Windows NT systems to point to the database where the monitor services will write information. (Most of these monitor services are database services that just load some processed information into tables.) Make this the same database as the one used for the Dynamic Services engine instance shown in Example 4-2. To make use of the of the notifier service, which is an SMTP service, you must also configure the SMTP mail related properties in the MonitorInstall.dss
file.
On UNIX systems: bin/dsadmin -i etc/dsadmin/MonitorInstall.dss On Wimdows NT systems: bin\dsadmin -i etc\dsadmin\MonitorInstall.dss
Then, run the dsmoninstall.sql
script in the ds/sql
directory on UNIX systems or ds\sql
directory on Windows NT systems. Running this SQL script will install the tables required by the monitor services.
ds/sql
on UNIX systems or ds\sql
on Windows NT systems) of the dsmoninstall.sql
file.sqlplus DSSYS/<DSSYS-password>
dsmoninstall.sql
script as follows:
SQL> @dsmoninstall.sql
A set of default services is installed from the etc/services
directory on UNIX systems or etc\services
directory on Windows NT systems, using the DSAdmin command-line utility with some scripts. These services are invoked by the event monitor utility that is described in Section 4.2.3. It is important to note that none of the monitor services throws events. This prevents an infinite loop from happening where the same monitor services are invoked for the event that they throw.
In addition to the DSAdmin command-line utility, there is also an event monitor command-line tool called dsmon
on UNIX systems (dsmon.bat
on Windows NT systems). This tool lets you start and stop the event monitor, which executes monitor services upon receipt of events published by the Dynamic Services engine. Monitor services are services that are associated with a monitor and conform to a service interface called EventHandlerTemplate. These services are located in the etc/services
directory on UNIX systems or etc\services
directory on Windows NT systems. The correct syntax for running this utility is shown in Example 4-3.
Note: On Windows NT, you must customize the SET ORACLE_HOME line in |
dsmon -u dssys/<dssys-password>@Direct -e start
Note: Information presented in Example 4-3 is case-sensitive. |
Using the event monitor utility, you can connect to a Dynamic Services engine; start or stop the monitor; and have control over the output level of the messages during the execution of the monitor services.
The next step is to enable persistent auditing. With the default installation in dsinstall.sql
, event messages are disabled in the properties table. Example 4-4 shows the setProperty PL/SQL procedure calls that enable event logging for the logging and warning event types.
connect dssys/<dssys-password>; SQL> exec DS_Properties.setProperty('DS_EV_LOGGING_enabled', 'true'); SQL> commit;
Configure persistent auditing to enable event messages only for the event types you want.
Start the event monitor using the command shown in Example 4-5.
dsmon -u dssys/<dssys-password>@Direct -e start
Note: After starting the event monitor on Windows NT systems, the DOS prompt does not display again. You must use another DOS window to issue the stop command shown in Example 4-6. |
Stop the event monitor using the command shown in Example 4-6.
dsmon -u dssys/<dssys-password>@Direct -e stop
When you issue this stop event monitor command, you post a stop request in the queue and the event monitor stops.
One of the monitor services that is used is called the logger monitor service. It loads a logging event message into a raw log table in the database. The log table is an object table with the object definition as shown in Example 4-7.
CREATE OR REPLACE TYPE raw_logging_typ AS OBJECT ( base raw_event_typ, -- Raw event type (base) operation VARCHAR2(512), -- Oper: connect, lookup, execute, session status VARCHAR2(512), -- Status of the operation: open, fail, close comm_msg VARCHAR2(4000) -- Communication Message ); /
The dependent object raw_event_typ
has a definition as shown in Example 4-8.
CREATE OR REPLACE TYPE raw_event_typ AS OBJECT ( time_stamp DATE, -- Time stamp of the event service_id VARCHAR2(512), -- Maximum length of a service ID string connection_id VARCHAR2(256), -- Maximum DSConnection ID for a DSE user request_id VARCHAR2(256), -- Maximum request ID for a DSE user consumer_id VARCHAR2(256), -- Maximum length of a DB user engine_id VARCHAR2(128) -- Engine identifier (instance of DSE) ); /
With an object table created based on the raw_logging_typ
object, you can then make SQL queries to give a good view of the logging events that are thrown during service execution, as shown in Example 4-9.
column timestamp format a14 column service format a37 column consumer format a8 column operation format a8 column status format a6 select TO_CHAR(t.base.time_stamp, 'MM/DD@HH24:MI:SS') as timestamp, t.base.consumer_id as consumer, t.operation as operation, t.base.service_id as service, t.status as status from raw_logging_table t order by t.base.time_stamp asc; -- The following is a sample of some logging event information that -- might display from running the SQL query.
TIMESTAMP CONSUMER OPERATIO SERVICE STATUS -------------- -------- -------- ------------------------------------- ------ 12/07@12:05:20 DSSYS CONNECT OPEN 12/07@12:05:33 DSSYS LOOKUP OPEN 12/07@12:05:33 DSSYS LOOKUP CLOSE 12/07@12:05:36 DSSYS EXECUTE urn:com.cnnfn:finance.portfolio03 OPEN 12/07@12:05:53 DSSYS EXECUTE urn:com.cnnfn:finance.portfolio03 CLOSE 12/07@12:06:23 DSSYS CONNECT CLOSE 6 rows selected.
There are certain service properties used by the logger monitor service that are set when the logger monitor service is installed. These service properties involve the database URL as well as the schema in the database that contains the raw log tables, and are therefore necessary for the logging monitor service to function properly. These service properties are described in the script files mentioned in Section 4.2.2.
This installation option coincides with the HTTP deployment view described in Section 1.3.3.
Dynamic Services can make use of the Apache servlet engine for handling remote HTTP communication between its service consumers and the Dynamic Services engine. To enable HTTP communications, first you must configure the Apache/Jserv servlet engine (see Section 4.3.1), and then configure the DSAdmin utility to use the Dynamic Services HTTP driver, DSHTTPDriver (see Section 4.3.2).
The following instructions assume that you have Apache/JServ installed. Any Web server with a servlet container will work, provided that the changes are done correctly to the correct files. In this step, it is required that you configure your installation of Apache/Jserv to install a new Dynamic Services zone. The following is the list of tasks you must perform (refer to JServ documentation for more information on how to create new zones):
jserv.conf
file.
This file is usually found within the Jserv/etc
directory on UNIX systems or Jserv\etc
directory on Windows NT systems under your Apache installation.
Note: For an Oracle9i Release 1 (9.0.1) installation, the |
Configure a new ds
mount point by adding the new lines shown as follows:
# Oracle Dynamic Services Zone ApJServMount /ds /ds
jserv.properties
file.
This file is found in the same directory as the jserv.conf
file. Make the following modifications:
Modify the wrapper.bin line to show<JAVA2_HOME> shown as follows. <JAVA2_HOME> is your Java 2 SDK installation directory.
wrapper.bin=<JAVA2_HOME>/bin/java
ds
zone.
Append to the zones line, the ds
zone as follows:
zones = <existing zones>, ds
ds
zone properties as follows:
ds.properties=ORACLE_HOME/ds/etc/Apache_JServ/zones/ds/ds.properties
Add all the necessary libraries needed by Dynamic Services as shown in the following list of necessary modifications.
# ---------------------------------------- # XML / XSD Parser from Oracle # ---------------------------------------- wrapper.classpath=ORACLE_HOME/lib/xmlparserv2.jar wrapper.classpath=ORACLE_HOME/lib/xschema.jar # ---------------------------------------------- # Oracle JDBC Driver (Compliant with JDK 1.2) # ---------------------------------------------- wrapper.classpath=ORACLE_HOME/jdbc/lib/classes12.zip # -------------- # JMS / AQ Stuff # -------------- wrapper.classpath=ORACLE_HOME/rdbms/jlib/jmscommon.jar wrapper.classpath=ORACLE_HOME/rdbms/jlib/aqapi.jar # ---------------- # JNDI /LDAP Stuff # ---------------- wrapper.classpath=ORACLE_HOME/jlib/providerutil.jar wrapper.classpath=ORACLE_HOME/jlib/ldap.jar wrapper.classpath=ORACLE_HOME/jlib/jndi.jar # ---------------------------------------- # JSSE # ---------------------------------------- wrapper.classpath=ORACLE_HOME/ds/lib/jsse.jar wrapper.classpath=ORACLE_HOME/ds/lib/jnet.jar wrapper.classpath=ORACLE_HOME/ds/lib/jcert.jar # --------------- # XMLSQL and XSQL # --------------- wrapper.classpath=ORACLE_HOME/rdbms/jlib/xsu12.jar wrapper.classpath=ORACLE_HOME/lib/oraclexsql.jar # ------------------------------- # Oracle Dynamic Service Engine # ------------------------------- wrapper.classpath=ORACLE_HOME/ds/lib/ds.jar
Ensure that <ORACLE_HOME> and <LD_LIBRARY_PATH> environment variables are properly set on UNIX and that the <ORACLE_HOME> and <PATH>
environment variables are properly set on Windows NT as follows:
On UNIX, set:
wrapper.env=ORACLE_HOME=<your_oracle_home> wrapper.env=LD_LIBRARY_PATH=<your_oracle_home>/lib
On Windows NT, set:
wrapper.env=ORACLE_HOME=<your_oracle_home> wrapper.env=PATH=<your_oracle_home>\bin
/ds/etc/Apache_JServ/zones/ds/ds.properties
on UNIX systems or <ORACLE_HOME>\ds\etc\Apache_JServ\zones\ds\ds.properties
on Windows NT systems and make the following modifications:
Change the location of the Dynamic Services jar file as follows:
repositories=ORACLE_HOME/ds/lib/ds.jar
Change the driver to be used by the DSServlet as a servlet property by using the appropriate connection string for your database instance as follows:
servlets.default.initArgs=DS_ORCL_URL=jdbc:oracle:thin:@<your-host>:<your-port:<your-SID>
To restart Apache on UNIX, execute the following commands:
cd <Apache installation directory> On UNIX systems: bin/apachectl restart On Windows NT systems: bin\apachectl restart
On Windows NT, restart the Apache server from the Start bar. For Oracle9i Release 1 (9.0.1), start from your Oracle home, select Oracle HTTP Server, then Start HTTP Server powered by Apache.
After the Apache/JServ installation is completed, you can use the DSHTTPDriver with the DSAdmin utility after you perform the following tasks:
etc/dsadmin/DSAdminConfig.xml
file on UNIX systems or etc\dsadmin\DSAdminConfig.xml
file on Windows NT systems.This installation option coincides with the JMS deployment view described in Section 1.3.3.
A SQL script named dsjms_aqinit.sql
is provided to install the JMS option.
ds/sql
) on UNIX systems or (ds\sql
) on Windows NT systems of the dsjms_aqinit.sql
file.sqlplus DSSYS/<DSSYS-password>
dsjms_aqinit.sql
script as follows:
SQL> @dsjms_aqinit.sql
Running the dsjms_aqinit.sql
script in a SQL*Plus session as the DSSYS user, creates all the tables and queues necessary for JMS communications.
To configure and run the JMS daemon, perform the following tasks:
etc/dsadmin/DSAdminConfig.xml
configuration file on UNIX systems or the etc\dsadmin\DSAdminConfig.xml
configuration file on Windows NT systems that is used to run the daemon. The following code example shows the specific parameters that you must configure in this configuration file.
. . . <DS_CONNECTION_DESCRIPTOR name="JMSDAEMON"> <annotation> -| For Nickname "JMSDAEMON": | These are specifications of the JMS driver class +| that will be used as well as the URL to be used with it </annotation> <DS_DRIVER>oracle.ds.driver.DSDirectDriver</DS_DRIVER> <DS_URL>jdbc:oracle:thin:@your-host:your-port:your-sid</DS_URL> <JMSD_LOG_FILE>logs/jmsd.log</JMSD_LOG_FILE> <JMSD_NUM_THREADS>10</JMSD_NUM_THREADS> </DS_CONNECTION_DESCRIPTOR> . . .
On UNIX systems:
bin/dsjmsd -u dssys/dssys@JMSDAEMON -c etc/dsadmin/DSAdminConfig.xml -e start
On Windows NT systems: bin\dsjmsd -u dssys/dssys@JMSDAEMON -c etc\dsadmin\DSAdminConfig.xml -e start
Note: Before running the |
Also, in your DSAdminConfig.xml
file, uncomment the DS_CONNECTION_DESCRIPTOR element for the JMSDAEMON nickname.
For future reference, the following code example shows how to stop the JMS daemon.
On UNIX systems: bin/dsjmsd-u dssys/dssys@JMSDAEMON -c etc/dsadmin/DSAdminConfig.xml -e stop
On Windows NT systems: bin\dsjmsd-u dssys/dssys@JMSDAEMON -c etc\dsadmin\DSAdminConfig.xml -e stop
Before configuring the DSAdmin utility to enable JMS communications, you must note that for all service consumer applications that want to use the JMS communication path, the database users that represent them must be granted the AQ_Administrator_Role privilege. The client library needs to register itself as an asynchronous subscriber to the response queue for asynchronous executions. Note that DSSYS is already granted that role. To configure the DSAdmin utility to enable JMS communications, perform the following tasks:
etc/dsadmin/DSAdminConfig.xml
configuration file on UNIX systems or the etc\dsadmin\DSAdminConfig.xml
configuration file on Windows NT systems.During runtime, requests are sent to the request queue in this database. The requests are picked up by the daemon that is communicating with this same database, and used in a service execution that returns a response. That response is submitted to a response queue in the same database, to be picked up asynchronously by the initial request submitter.
As installed in the dsinstall.sql
script, the instance of the Dynamic Services engine is a standalone instance with its own storage for the registry. To increase scalability, you may want to install multiple Dynamic Services engines communicating with a central master Lightweight Directory Access Protocol (LDAP) registry (see Figure 1-8). First, you must successfully install the Oracle Internet Directory (OID) LDAP server with all the appropriate schemas.
To set up LDAP with OID, you must install OID (see Section 4.5.1.1), and then install the Dynamic Services LDAP schema (see Section 4.5.1.2).
To install Oracle Internet Directory, run the Oracle Installer of your Oracle9i Release 1 (9.0.1) distribution and choose the Oracle9i Management and Integration option. Then, select Oracle Internet Directory from the list of displayed products. For more information, refer to Oracle installation instructions.
Before proceeding in the installation, verify the following:
oidmon
instance is running. If not, run the following command to start it.
oidmon connect=OIDDB1 sleep=10 start
OIDDB1 is the system identifier (SID) of the database instance created by the OID installer.
oidldapd
server is running. If not, run the following command to start an instance of the OID LDAP server.
oidctl connect=OIDDB1 server=oidldapd instance=1 start
Then, proceed with the installation of the Dynamic Services LDAP schema and issue the following command from a command-line shell:
On UNIX systems:
ldapmodify -h oracledev1-sun.us.oracle.com -p 389 -D "cn=orcladmin" -w "welcome" -v -c -f $
<ORACLE_HOME>/ds/ldif/oiddsschema.ldif
On Windows systems:
ldapmodify -h oracledev1-sun.us.oracle.com -p 389 -D "cn=orcladmin" -w "welcome" -v -c -f $
<ORACLE_HOME>\ds\ldif\oiddsschema.ldif
Table 4-1 describes the ldapmodify command-line options that can be used for installing the Dynamic Services LDAP schema.
The oiddsschema.ldif
file includes all the necessary steps for the installation of the Dynamic Services schema into OID. These steps are:
After successfully installing the Dynamic Services LDAP schema, the next step is to create default entries for Dynamic Services, such as the release number of the product and the root of the User Profile Subtree. Issue the command shown in Example 4-10 to do this.
On UNIX systems:
ldapmodify -h oracledev1-sun.us.oracle.com -p 389 -D "cn=orcladmin" -w "welcome" -v -c -f
<ORACLE_HOME>/ds/ldif/oiddsdit.ldif
On Windows NT systems:
ldapmodify -h oracledev1-sun.us.oracle.com -p 389 -D "cn=orcladmin" -w "welcome" -v -c -f
<ORACLE_HOME>\ds\ldif\oiddsdit.ldif
Note: In this release, the |
In order to change this instance of the Dynamic Services engine into one that communicates with the master LDAP server, you must change some properties in the properties table. This is done by executing the two setProperty PL/SQL procedure calls shown in Example 4-11.
exec DS_Properties.setProperty('oracle.ds.registry.defaultRegistry', 'oracle.ds.registry.DSMasterMirrorRegistry'); exec DS_Properties.setProperty('oracle.ds.registry.ldap.providerUrl', 'ldap://your.ldap.server:389');
The first call instructs the instance to go to a master LDAP server for the central master registry rather than to itself (the default value that was set during installation is 'oracle.ds.registry.DSSimpleRegistry'). The second call points your instance to the correct LDAP server for its registry communications.
You must change your.ldap.server to the host name of the machine that is running Oracle Internet Directory.
After you complete the preceding step, perform the following tasks:
DSAdminShell.Registry.Engine
subshell to register your engine with the central master registry; however, this step is optional and needed only for management purposes.DSAdminShell.Registry.Engine
subshell to see the directives available to manage the list of engines that communicate with the central master registry.Table 4-2 describes the Dynamic Services properties that you can change after installing Dynamic Services.
The properties are stored in the installed DSSYS schema. To set a property:
sqlplus DSSYS/<DSSYS-password>
SQL> EXECUTE DS_PROPERTIES.setProperty('<property name>', '<property
value>');
SQL> SET SERVEROUTPUT ON;
SQL> EXECUTE DS_Properties.show;
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|