Proxy Databases

Proxy databases are not created by default when you configure the Adaptive Servers as companions. They are created in the remote server only if you configure for Failover using the with_proxydb option of sp_companion. The discussion in this chapter assumes you used sp_companion with the with_proxydb option. The companions still failover whether or not you include the with_proxydb option when you configure the Adaptive Servers as companion server; the proxy database are created dynamically as they are needed. For more information about sp_companion with_proxydb, see the Adaptive Server Reference Manual.

Databases in companion servers are either primary or proxy databases. Primary database are where the data is physically located. Each proxy database corresponds to a primary database; it has the same name as the primary database, and proxy entries for all the objects in the primary database, but it contains no data.

After you configure the companions for failover and the proxy databases are created, the user databases are visible to both companions. This means that you can perform transactions on a primary database from either companion. For example, if a primary companion named PERSONEL1 includes a database named salary, its secondary companion, MONEY1, includes a salary proxy database. You can perform inserts, updates, and deletes on salary from either MONEY1 or from PERSONEL1. Also, sysdatabases on either companion lists the salary database. For example, the following query produces the same result on both PERSONEL1 and MONEY1:

1> select name from sysdatabases
 name                           
 ------------------------------ 
 master                         
 model                          
 salary
 sybsystemdb                    
 sybsystemprocs                 
 tempdb