Question My Test System Is Connecting To The Live/main Database Of Our Server?

CONNECT -db gl2000db -N TCP -H w2kserver -S gl2000db -U 'active' .

This is the code where it connects to the database gl2000db. But the problem is, it connects to the main database in the :p(dir) instead of :D(dir).

anyway that '-db gl2000db', we changed it to a specific one. '-db D:/database/gl2000db' but it is not working. We also replace the hosts to '-H localhost'. But this does'nt worked.

Any replies will be appreciated so much :)
 

Rob Fitzpatrick

ProgressTalk.com Sponsor
The path specified by the client with the -db parameter is only relevant if the client connects via shared memory. If the client connects via TCP, i.e. it uses the -S parameter, then it is making a network socket connection to a broker using only the logical name of the database.

CONNECT -db gl2000db -N TCP -H w2kserver -S gl2000db -U 'active'
This says "connect to the "w2kserver" machine on the TCP port number that "gl2000db" resolves to in my services file and initiate a connection to the database with logical name "gl2000db", using username "active".

A few things:
  • You shouldn't have a mix of production and non-production (e.g. test) databases on the same machine. You've discovered one of many reasons why.
  • If you are going to specify service names with -S, make sure that the services file entries are consistent across all machines. For example, if you have a prod DB broker on port 6000 and a test DB broker on port 7000 on the server, but you reverse the services file entries on the client side, the client could attempt to connect to prod when you intended it to connect to test.
  • Don't give two different databases the same logical name (especially on the same server) if they have different roles. For example, if your production database is called "prod", don't create a test database somewhere else that is also called "prod". A client trying to connect to the port used by the "prod" broker will fail if it specifies "-db test" (that's a good thing). But if your databases all have the same name then that fail-safe is lost.
  • Specifying "-H localhost" will bind the broker to 127.0.0.1, allowing only connections from the local machine but not remote machines. But if the client trying to connect is on the same machine then this parameter change will have no effect.
 
Top