Connecting to a PROGRESS database on a different server

mahesh_babu76

New Member
My situation is as follows:

I have the MFG/Pro database and programs running on "Server A". But, I would like to connect to another database (PROGRESS) residing on a different server "Server B" through one of my program in "Server A".

Can anyone pls tell me how I can make an inter server database connection possible?. Can some one provide a sample code of the CONNECT statement or anything which can do this.

Thanks
Mahesh
 

bulklodd

Member
Look up CONNECT statement in documentation.

Here's a snippet with CONNECT:

CONNECT VALUE("-db <dbname> -H ServerB -S <port> -ld <newname> -U <userid> -P <password>") NO-ERROR.
IF NOT CONNECTED("<newname>") THEN
MESSAGE "Db <newname> isn't connected." VIEW-AS ALERT-BOX ERROR.

Pay attention to ld parameter if you have two connected databases you should assign for them different logical names. I suppose you know values of the other parameters.
 

joey.jeremiah

ProgressTalk Moderator
Staff member
I don't think there's any sense in us just quoting from the book
I also don't think we would be helping you in this way.

You can find plenty of examples on remote ( client/server ) connections
either in the "Programming Handbook" tutorial or the "Startup Parameters" doc.
You can download all the 50 somewhat book set off psdn.com ( for free ofcourse ).

Here's a preview ... basicall you'll need to bring up the database on "Server
B" either locally on the same server or remotely using the dbman command line
util or the Progress Explorer as part of the adminserver framework.

Then it's just a straight forward client/server connection from "Server A"
with the -H -S parameters ( host name/ip address and service name/port number ).
Either as a startup parameter -db <somedatabase> -H -S
or from your program using the connect <somedatabase> -H -S command.

Ofcourse there are all sorts of exceptions and and other things worth noting,
but that's why I think picking up the doc would be best. HTH
 

mahesh_babu76

New Member
Thanks. I'll try this. Meanwhile, can you pls let me know the way to find out the host name / service name / port no in any server for a given database?
 

bulklodd

Member
mahesh_babu76 said:
Thanks. I'll try this. Meanwhile, can you pls let me know the way to find out the host name / service name / port no in any server for a given database?

You should open a db log file to determine this values. For example, here's log file fragment:

Code:
12:39:55 BROKER  0: Multi-user session begin. (333)
12:39:55 BROKER  0: Begin Physical Redo Phase at 0 . (5326)
12:39:55 BROKER  0: Physical Redo Phase Completed at blk 0 off 6145 upd 3. (7161)
12:39:55 BROKER  0: This server is licensed for local logins only. (4393)
12:39:56 BROKER  0: Started for bq41d using TCP, pid 2792. (5644)
12:39:56 BROKER  0: PROGRESS Version 10.0A build 1412 SP01 on WINNT . (4234)
12:39:56 BROKER  0: Server started by ksv on CON:. (4281)
12:39:56 BROKER  0: Started using pid: 2792. (6574)
12:39:56 BROKER  0: Physical Database Name (-db): sports. (4235)
12:39:56 BROKER  0: Database Type (-dt): PROGRESS. (4236)
12:39:56 BROKER  0: Force Access (-F): Not Enabled. (4237)
12:39:56 BROKER  0: Direct I/O (-directio): Not Enabled. (4238)
12:39:56 BROKER  0: Number of Database Buffers (-B): 48. (4239)
12:39:56 BROKER  0: Maximum private buffers per user (-Bpmax): 12. (9422)
12:39:56 BROKER  0: Excess Shared Memory Size (-Mxs): 16385. (4240)
12:39:56 BROKER  0: The shared memory segment is not locked in memory. (10014)
12:39:56 BROKER  0: Current Size of Lock Table (-L): 8192. (4241)
12:39:56 BROKER  0: Hash Table Entries (-hash): 13. (4242)
12:39:56 BROKER  0: Current Spin Lock Tries (-spin): 6000. (4243)
12:39:56 BROKER  0: Number of Semaphore Sets (-semsets): 1. (6526)
12:39:56 BROKER  0: Crash Recovery (-i): Enabled. (4244)
12:39:56 BROKER  0: Database Blocksize (-blocksize): 4096. (6573)
12:39:56 BROKER  0: Delay of Before-Image Flush (-Mf): 3. (4245)
12:39:56 BROKER  0: Before-Image File I/O (-r -R): Reliable. (4247)
12:39:56 BROKER  0: Before-Image Truncate Interval (-G): 60. (4249)
12:39:56 BROKER  0: Before-Image Cluster Size: 524288. (4250)
12:39:56 BROKER  0: Before-Image Block Size: 8192. (4251)
12:39:56 BROKER  0: Number of Before-Image Buffers (-bibufs): 5. (4252)
12:39:56 BROKER  0: BI File Threshold size (-bithold): 0.0   Bytes. (9238)
12:39:56 BROKER  0: BI File Threshold Stall (-bistall): Disabled. (6552)
12:39:56 BROKER  0: After-Image Stall (-aistall): Not Enabled. (4254)
12:39:56 BROKER  0: Number of After-Image Buffers (-aibufs): 5. (4256)
12:39:56 BROKER  0: Storage object cache size (-omsize): 1024 (8527)
12:39:56 BROKER  0: Maximum Number of Clients Per Server (-Ma): 1. (4257)
12:39:56 BROKER  0: Maximum Number of Servers (-Mn): 5. (4258)
12:39:56 BROKER  0: Minimum Clients Per Server (-Mi): 1. (4259)
12:39:56 BROKER  0: Maximum Number of Users (-n): 6. (4260)
12:39:56 BROKER  0: Host Name (-H): ksv. (4261)
12:39:56 BROKER  0: Service Name (-S): bq41d. (4262)
12:39:56 BROKER  0: Network Type (-N): TCP. (4263)
12:39:56 BROKER  0: Character Set (-cpinternal): iso8859-1. (4264)
12:39:56 BROKER  0: Parameter File: Not Enabled. (4282)
12:39:56 BROKER  0: Minimum Port for Auto Servers (-minport): 3000. (5648)
12:39:56 BROKER  0: Maximum Port for Auto Servers (-maxport): 5000. (5649)
12:39:56 BROKER  0: This broker supports both 4GL and SQL server groups. (8865)
12:39:56 BROKER  0: Created shared memory with segment_id: 10878976 (9336)

If you'd like to connect to this db your CONNECT statement should look in such way:

CONNECT VALUE("-db sports -H ksv -S bq41d ").

Pay attention to -S parameter 'bq41ds' is a port name on 'ksv' server but not on yours. To resolve this name you should use 'services' file on 'ksv' server to detect port number and use it instead of 'bq41d'. For example in ksv's 'services' there's a line:

bq41d 2206/tcp

In this case you should change CONNECT statement

CONNECT VALUE("-db sports -H ksv -S 2206 ").
 
If you intend to communicate between databases on different servers on a regular basis, you can store the relavent connect information in db fields for quick lookup purposes (this assumes it will change relatively infrequently).

The examples given so far are for traditional Client-Server interaction - you may like to delve into the Appserver, you can then do all sorts of communication between client and server processes. This may not be practical in your environment with the applications you are using though.
 
mahesh_babu76 said:
Meanwhile, can you pls let me know the way to find out the host name / service name / port no in any server for a given database?
Not quite the same as you are asking here, but the DBPARAM function will give you some relavent info if you are already connected.

KB P9967
Title: "How to retrieve connection information and more for a connected Database?"

http://tinyurl.com/99nar
 

joey.jeremiah

ProgressTalk Moderator
Staff member
Progress doesn't just makeup those parameters ( host name/service name )
It's up to you or your company to setup your network configuration

I'd recommend either asking your network admin or your app vendor.
Other then that you can take some on-line crash course on the topic

For more specific information ( on finding/setting hostname/ip address
and service name/port number ) we need to know what OS you're running on
 
Top