Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / December 2007

Tip: Looking for answers? Try searching our database.

Automatic client reroute

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
hummingbirdlj@gmail.com - 11 Dec 2007 06:26 GMT
I have a couple questions about setting up automatic client reroute.
First, after setting the alternate server for a database, is there a
way to verify the settings later on?  The next thing is I've added
these values for my HADR pair, but I'm not sure I'm testing the basic
functionality correctly.  I connect to the primary, then issue a
switch role takeover, then attempt to continue running SQL against the
database (I've also tried a connect with the now deactivated
database).  In all cases, I still get the SQL30081 error, so have
obviously done something wrong.

Thanks,
Lisa
Mark A - 11 Dec 2007 07:07 GMT
>I have a couple questions about setting up automatic client reroute.
> First, after setting the alternate server for a database, is there a
[quoted text clipped - 8 lines]
> Thanks,
> Lisa

How are you submitting the SQL statements? Using type 2 driver or type 4
driver?
hummingbirdlj@gmail.com - 11 Dec 2007 07:10 GMT
I am using type-2 right now (although later on, will need to use
type-4).  Thanks.

> <hummingbir...@gmail.com> wrote in message
>
[quoted text clipped - 15 lines]
> How are you submitting the SQL statements? Using type 2 driver or type 4
> driver?
Mark A - 11 Dec 2007 13:31 GMT
>I am using type-2 right now (although later on, will need to use
> type-4).  Thanks.

If you do a "db2 list db directory" on your client, it will show the
alternate server info from the last time the client successfully connected
to the primary database. If the information is not correct, then something
is wrong.

When you start using type 4, then things get a bit more complicated since,
although the alternate server information is returned to the client upon
connection, it is not persisted anywhere for use by the client, unless the
client saves it somewhere. You will have to do some research on how to use
Automatic Client Reroute with a type 4 connection. The version 9 driver may
offer some improvements over version 8, but I am not 100 sure about that.
hummingbirdlj@gmail.com - 11 Dec 2007 18:35 GMT
Thanks for the information to list the alternate server information.
I see that it is set properly.  I've found that a connection is
automatically re-established to the same primary server, if the
connection is lost.  However, if I try the following, I still get the
SQL30081 error:
1) connect to hadr primary database
2) execute a hadr switch roles
3) execute a query, which should result in a connection to the new
primary

Is there anything else I need to set-up in this case?  I've set the
client registry settings for the number of connection retry attempts
and the interval.  Thanks.
Mark A - 12 Dec 2007 00:41 GMT
> Thanks for the information to list the alternate server information.
> I see that it is set properly.  I've found that a connection is
[quoted text clipped - 9 lines]
> client registry settings for the number of connection retry attempts
> and the interval.  Thanks.
Mark A - 12 Dec 2007 00:49 GMT
> Thanks for the information to list the alternate server information.
> I see that it is set properly.  I've found that a connection is
[quoted text clipped - 9 lines]
> client registry settings for the number of connection retry attempts
> and the interval.  Thanks.

That's not exactly how it works. Try this from a DB2 command window:

1) Connect to the primary HADR db.
2) Issue a select statement.
3) Switch roles (issue takeover command on standby)
4) Issue another select statement. You will get an error message saying that
a takeover has occurred and asking you to retry the last SQL statement (I
don't recall the error number or exact text).
5) Retry the last query executed (it should work this time, getting data
from the standby).

If the above does not work, then you do have some sort of problem. Try
cataloging the database on the standby server (which is now primary) as a
type 2 connection and try to connect from DB2 command window. If that does
not work, make sure you can connect to the standby (now primary) as a local
user on the standby database server.
hummingbirdlj@gmail.com - 12 Dec 2007 06:54 GMT
Well, my explanation wasn't clear, but I tried exactly what you had
suggested from the DB2 command window.  After the role switch, the
connection is not established to the new primary.  The alternate
server and port information is correct in the list db information,
however.

I also tried the second test you suggested, and that also fails with
the sql30081 error.  One thought I had is if both servers require the
same user id and password for the connection.  I can't update the
passwords right now to match, or I'd try.

Thanks again.

> 1) Connect to the primary HADR db.
> 2) Issue a select statement.
[quoted text clipped - 10 lines]
> not work, make sure you can connect to the standby (now primary) as a local
> user on the standby database server.
Mark A - 12 Dec 2007 08:13 GMT
> Well, my explanation wasn't clear, but I tried exactly what you had
> suggested from the DB2 command window.  After the role switch, the
[quoted text clipped - 8 lines]
>
> Thanks again.

Yes, the user ids and passwords must match. Everything about the two
databases should be the same including all the tablesapce container paths
(or else certain DDL statements will not work).

It is not absolutely necessary for the instance names to be the same, but it
is recommended (especially now that TSA allows them to be the same).
Obviously, you can only do this if you have 2 different host names for
primary and standby.
hummingbirdlj@gmail.com - 12 Dec 2007 18:17 GMT
I got a window to change the password, and now I'm all set.  Thanks
very much for all of your help!

> Yes, the user ids and passwords must match. Everything about the two
> databases should be the same including all the tablesapce container paths
> (or else certain DDL statements will not work).
Mike Springgay - 12 Dec 2007 15:35 GMT
Is your original type 2 connection using TCP/IP ? Automatic Client
Reroute support is only provided for TCP/IP connections. If you are
using the type 2 via local (IPC) connectivity no re-routing will be
done.  Please make sure you've cataloged a database alias that connects
using TCP/IP to the database.

Please provide your connectivity information (i.e db2 list db directory
if not using connection strings).

> Well, my explanation wasn't clear, but I tried exactly what you had
> suggested from the DB2 command window.  After the role switch, the
[quoted text clipped - 23 lines]
>> not work, make sure you can connect to the standby (now primary) as a local
>> user on the standby database server.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.