Chinaunix首页 | 论坛 | 博客
  • 博客访问: 61479
  • 博文数量: 6
  • 博客积分: 1435
  • 博客等级: 上尉
  • 技术积分: 240
  • 用 户 组: 普通用户
  • 注册时间: 2006-01-13 11:01
文章分类
文章存档

2008年(6)

我的朋友

分类: 数据库开发技术

2008-08-07 17:04:36

ODBC Merant (Intersolv) 32-bit Setup -Remote OIB & Remote Database

Summary:

You have a 32-bit non-Progress application (for example, MS-Access)
on a PC client and you want to connect to a Progress database on a
remote machine using ODBC.

The PC client (windows 95, 98 or NT) has client networking version
8.2a or greater installed locally (or points to a network
installation) and will connect to a database on an NT or Unix machine
via ODBC (the OIBroker).

Step by step details:

Part 1.  The Database - NT

Part 1 refers to having a database running on an NT server,
and includes steps that need to be performed on this NT server.
If your database is on a UNIX machine, go to Part 2.

A. Your database is probably already up and running.  Make a
   note of how it was started.  It is probably something like:

   _mprosrv.exe databasename -H hostname -S servicename1 -N TCP

   Hostname is the name of the NT server machine.  Servicename1
   is an entry in the services file that is associated with a
   port number. (See knowledgebase 17365 or more information on
   the services file)

B. Starting the OIBroker

   The OIBroker is a listener that waits for a 3rd party ODBC
   client (i.e. your non-progress application) to call to it.
   At that point, the OIBroker spawns an OIDriver to complete
   the connection to the database.  You only need one OIBroker
   running on your system.  It doesn't matter how many databases
   you will need to connect to or how many  drivers will need
   to be started.

   (NOTE: Most configurations will start the OIBroker on the same
   machine as the database and will therefore make a direct
   connection (shared memory connection) to the database.  There
   are a few situations that require the OIBroker to run on a
   different machine, or to make a remote connection to the database.
   If your situation requires such a configuration, go to
   Part 5. Alternate configurations for more information before
   continuing)

   You will need to set the following environment variables.

   DLC=
   PROMSGS=\promsgs
   IDLC=
   IPROMSGS=\promsgs

   prooibrk=\bin\oibrkr32.exe
   prooidrv=\bin\oidrvr32.exe

   where is replaced by the actual path.  To set
   them, go to the System Icon in the Control Panel and click on
   the Environment tab. Set them as System Environment Variables -
   not User Environment Variables.

   Now, make another entry in the services file, associated with
   a different port number for the OIBroker, for example
   servicename2. (NOTE: This SAME EXACT entry will need to be made
   to the services file on the PC client machine also.  See Part 3
   below)

   To actually start the OIBroker use the following command:

oibrkr32.exe -SV -S servicename2 -H hostname -N TCP

   where is replaced by the actual path.
   You can verify that it started successfully by starting the NT
   task manager and verifying that there is an oibrkr32 process
   in the process list.

C. Shutting down the OIBroker

          **DO NOT shut the OIBroker down now**

   The instructions are given here for completeness.

_mprshut.exe -SV -H hostname -S servicename2 -N tcp

   where the -H, -S values are the same ones used when the OIBroker
   was started.

   Go to Part 3.

Part 2.  The Database Machine - Unix

Part 2 refers to having a database running on a UNIX machine,
and includes steps that need to be performed on this Unix
machine. If your database is on an NT server, go to Part 1.

A. Your database is probably already up and running.  Make a
   note of how it was started.  It is probably something like:

_mprosrv databasename -H hostname -S servicename1 -N tcp

   Hostname is the name of the UNIX machine.  Servicename1
   is an entry in the services file that is associated with a
   port number. (The services file is usually located in /etc.)

B. Starting the OIBroker

   The OIBroker is a listener that waits for a 3rd party ODBC
   client to call to it.  At that point, the OIBroker spawns an
   OIDriver to complete the connection to the database.  You only
   need one OIBroker running on your system.  It doesn't matter
   how many databases you will need to connect to or how many
   drivers will need to be started.

   (NOTE: Most configurations will start the OIBroker on the same
   machine as the database and will therefore make a direct
   connection (shared memory connection) to the database.  There
   are a few situations that require the OIBroker to run on a
   different machine, or to make a remote connection to the database.
   If your situation requires such a configuration, go to
   Part 5. Alternate configurations for more information before
   continuing)

   You will need to set the following environment variables.

   DLC=;export DLC
   PROMSGS=/promsgs;export PROMSGS
   IDLC=;export IDLC
   IPROMSGS=/promsgs;export IPROMSGS

   PROOIBRK=/bin/_prooibk;export PROOIBRK
   PROOIDRV=/bin/_prooidv;export PROOIDRV

   where is replaced by the actual path.

   Now, make another entry in the services file, associated with
   a different port number for the OIBroker, for example
   servicename2. (NOTE: This SAME EXACT entry will need to be made
   to the services file on the PC client machine also.  See Part 3
   below)

   To actually start the OIBroker use the following command
   from the dlc/bin directory:

_prooibk -SV -S servicename2 -H hostname -N tcp

   where is replaced by the actual path. You can
   verify that it started successfully by using the following
   command:

   ps -ef |grep _prooibk

   On AIX, the process doesn't show when you grep the process itself,
try
   ps -ef |grep servicename2

C. Shutting down the OIBroker

          **DO NOT shut the OIBroker down now**

   The instructions are given here for completeness.

_mprshut.exe -SV -H hostname -S servicename2 -N tcp

   where the -H, -S values are the same ones used when the OIBroker
   was started.

Part 3.  The PC Client

A.  You need to set the following environment variables on the
    PC client:

    DLC=
    PROMSGS=\promsgs
    IDLC=
    IPROMSGS=\promsgs

    where is replaced by the actual path.

    If the PC client is windows 95 or 98, the above variables
    should be set in the autoexec.bat file using the set command,
    and then then reboot the pc.

    If the PC client is NT, go to the System Icon in the Control
    Panel and click on the Environment tab. Set them as
    system environment variables - not User Environment Variables.

B.  Make an entry in the services file on this pc client machine,
    for the OIBroker.  (See knowledgebase 17365 or more information
    on the services file) It has to be exactly the same as the entry
    made on the database machine for the OIBroker, i.e. same name,
    and port number.

Part 4.  Configuring the ODBC Datasource

You will now define your ODBC Datasource using the ODBC
Administrator.  The ODBC Administrator can be accessed from
the control panel by using the ODBC-32 icon.

One datasource will be needed for each database you will connect
to.  Therefore if you intend to use your non-progress application
to connect to three Progress databases, you will need three
distinct datasources.

Within the administrator, click Add, and select the Merant 3.60
(or 3.50) 32-Bit Progress driver.  Do NOT select the SQL-92 driver
unless your target database is version 9 or higher.  Click Finish
and begin configuring the new datasource.

A.  General Tab

    You will only need to fill in 2 fields here; the datasource
    name and the database name.  Assign a name to the datasource-
    it can be anything you like.  Then, type the name of the
    database in the database name field (for example, sports).

B.  OID/OIB Options Tab

    The three entries on this screen, are the same three network
    parameters you used when starting the OIBroker in Part 1 or 2
    above.

    Protocol will be tcp
    Service Name is the same -S value used when starting the OIBroker
       (servicename2 from the example)
    Host name is the name of the machine that the OIBroker is
       running on

C.  Database Options Tab

    This screen refers to how the OIDriver will connect with the
    database.  Because the OIBroker (and OIDrivers spawned) are on
    the same machine as the database, you will use DIRECT for
    Database Access.

    Database Path refers to the path on the server machine where
    the database is located.

    If the database resides on an NT machine in directory
    c:\progress\dbs then the database path here will be
    c:\progress\dbs\

    *** BE SURE TO PUT THE trailing \ on the database path! ***

    If the database resides on a UNIX machine in directory
    /usr/progress/dbs then the database path here will be
    /usr/progress/dbs/

    *** BE SURE TO PUT THE trailing / on the database path! ***

    Operating system can be set to ignore for all platforms.

D.  Advanced Tab

    There is nothing on this form that is required to be filled in.

Click OK.  This completes the definition of the ODBC Datasource
and you should now be able to use your non-progress application
to connect to the Progress database via the ODBC.

Part 5.  Alternate Configurations

   If you have completed Parts 1-4 above, your configuration is
   complete, and you should not go forward with the directions
   that follow.

   Most configurations will start the OIBroker on the same
   machine as the database and will therefore make a direct
   connection (shared memory connection) to the database.  There
   are a few situations that require the OIBroker to run on a
   different machine, or to make a remote connection to the database.
   The specifics of these situations will not be discussed here.

   After reviewing the specifics below, you should start back at
   Part 1, and proceed through Parts 1-4 making the noted changes
   below.

A. If you need to have your OIBroker running on a machine other
   than the database machine:

   Part 1B (or 2B) will be performed on the "different machine".
   For example, if the OIBroker has to run on the pc client the
   environment variables prooibrk and prooidrv need be set
   (appropriately for the version of windows), the service name
   for the OIBroker needs be made to the services file on the pc,
   and then the OIBroker can be started.

   This scenario will then require that the OIBroker make a remote
   connection to the database, so follow the steps in B below.

B. If the OIBroker (& OIDriver) needs to make a remote connection
   to the database, Part 4C above would read as follows:

   Database Options Tab

    This screen refers to how the OIDriver will connect with the
    database.  Because the OIBroker (and OIDrivers spawned) are not
    on the same machine as the database, you will use VIA SERVER for
    Database Access, and you will specify the network protocols
    used when starting the database:

    Protocol will be tcp.
    Service Name is the same -S value used when starting the
      database (servicename1 from the example)
    Host Name will be the -H value used when starting the database

References To Written Documentation or Other
KnowledgeBase Documents: 17365

------------
How to start and stop an OID or an OIB under UNIX

This document helps to use an OID or an OIB under UNIX operating
systems accessed from a distant machine by a product such as Intersolv
ODBC or an ESQL small client application.

For VMS, or NT look at the commands Prooidrv, Prooibrk and Proshut
in your "System administration guide", "System administration
reference", "Embedded SQL Guide and Reference", or your "ODBC driver
Guide" manuals.


1. Pre-requisite
   -------------

Depending on the configuration you want to use, you will need to
start a server on your database.

- Client-server configurations:
  You need to start a server on your database with networking
  parameters specified.

     proserve dbname -N TCP -S prosv01 (-H is optional)

- Self-service configuration:
  You need to start a server on your database. There is no need for
  networking parameters here.

     proserve sports

- Single-user configuration:
  There is no need of a server up and running on your database.


2. Starting/stopping an OID
   ------------------------

To establish a connection via a Remote OID to a Progress database (in
self-service mode or in client-server mode), we need first to have an
OID running.


2.1. Environment variables
     ---------------------

The OID needs some of the environment settings used by the sever.
Some of them are particularly needed by the OID. Those variables
are:

- DLC: This variable is used by the OID to check the Progress.cfg
- PATH: This variable has to contain the $DLC/bin directory, otherwise
  the OID will not be started in the next part. (There should be a
  script in that directory named 'prooidrv' that will be used to start
  the OID.)
- PROOIDRV: You can also set this variable to $DLC/bin/_prooidv in
  your UNIX environment or in the script used to start the OID. This
  variable is not needed but it can be used to start the OID.
  Consequently its setting is highly recomended. (at the UNIX prompt
  type: set PROOIDRV=$DLC/bin/_prooidv; export PROOIDRV)


2.2. Command to start manually an OID
     --------------------------------

Depending on the configuration you choosed you will have to start the
OID in different ways. But first you will have to start the server
according to your configuration.

- Client-server configuration:
  You will have to start the OID with the following parameters.

     prooidrv -db dbname -S prosv01 -H host-machine -N TCP
              -SV -S prosv02 -N TCP -m2

- Self-Service configuration:
  The OID needs to be started with the following parameters.

     prooidrv -db dbname -SV -S prosv02 -N TCP -m2

- Single-user configuration:
  The OID needs to be started with the following parameters.

     prooidrv -db dbname -SV -S prosv02 -N TCP -m2


2.3. Command to stop the OID
     -----------------------

Type the following at the UNIX prompt for any of the previous
configuration: proshut -SV -S prosv02


2.4. Note
     ----

If you establish a connection to an OID started manually and then
close the connection, you will not find your OID process anymore. It
automatically shuts down.

If you are not able to establish a connection to a remote OID, try
first a connection to your database via a Local OID.


3. Starting/stopping an OIB
   ------------------------

To establish a connection via a Remote OIB to a Progress database (in
self-service mode or in client-server mode), we first need to have an
OIB running.


3.1. Environment variables
     ---------------------

The OIB as well needs some of the environment settings used by the
server. Some of them are particularly needed by the OID. Those
variables are:

- DLC: This variable is used by the OIB to check the progress.cfg
- PATH: This variable has to contain the $DLC/bin directory, otherwise
  the OIB will not start. (There should be a script in that directory
  named 'prooibrk' that will be used to start the OIB.)
- PROOIDRV: This variable is used by the OIB to spawn the OID.
  Consequently this variable is NEEDED and has to be set to
  $DLC/bin/_prooidv and then exported. (at the UNIX prompt type:
  set PROOIDRV=$DLC/bin/_prooidv; export PROOIDRV)
- PROOIBRK: You can also set this variable to $DLC/bin/_prooibk in
  your UNIX environment or in the script used to start the OIB. This
  variable is not needed but it can be used to start the OIB.
  Consequently its setting is highly recomended. (at the UNIX prompt
  type: PROOIBRK=$DLC/bin/_prooibk; export PROOIBRK)


3.2. Command to start an OIB
     -----------------------

The command to start an OIB is the same regardless of the
configuration you are using. The function of the OIB is to spawn an
OID for you with the parameters you will pass to establish then a
database connection.

Thus, at UNIX prompt, you just have to type:

     prooibrk -SV -S prosv02 -N tcp


3.3. Command to stop the OIB
     -----------------------

Here as well, the command to stop the OIB is the same for any
configuration used to access one database with an OIB. at UNIX prompt,
type:

     proshut -SV -S prosv02


4. Notes
   -----


4.1. For the server
     --------------

- The service used to connect to a remote server is prosv01. It is
  defined in the services files stored on the UNIX machine where the
  database is located, and the machine where the OID/OIB is running
  (if those two machines are different).


4.2 For the OID/OIB
    ---------------

- The service used to connect to a remote OID/OIB is 'prosv02'. It is
  defined in the services files stored on the UNIX machine where the
  OID/OIB is running and the machine from which you will connect them.
- The host machine where the remote database is located is named
  'host-machine' and has been defined in the host file stored on the
  UNIX machine where the OID/OIB is running (this is needed only for
  a client-server configuration).
- If you don't have the 'prooidrv' and the 'prooibrk' script located
  in the $DLC/bin directory then you can set the environment variables
  PROOIDRV and/or PROOIBRK and replace 'prooidrv' and 'prooibrk' in
  the command lines used to start an OID/OIB by $PROOIDRV and
  $PROOIBRK respectively. You can also replace 'prooidrv' and
  'prooibrk' in the command lines by $DLC/bin/_prooidv and
  $DLC/bin/_prooibk respectively.

IMPORTANT NOTE: An OID/OIB configured in client-server is ONLY
                qualified to run on a Progress 7.3C UNIX database
                server and above.

阅读(1832) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~