Proxy databases

Proxy databases are not created by default when you configure Adaptive Servers as companions in an asymmetric setup. 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. Proxy databases are created dynamically as they are needed. See the Reference Manual: Procedures.

Do not use the with_proxydb on a symmetric setup.

Databases in companion servers are either primary or proxy databases. Primary databases are where 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 PERSONNEL1 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 PERSONNEL1. Also, sysdatabases on either companion lists the salary database. For example, the following query produces the same result on PERSONNEL1 and MONEY1:

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

NoteWhen the primary companion fails over, all current connections to proxy databases on the secondary server are terminated and disconnected. During failback, the secondary companion reverses the process, mounting the primary databases and then re-creating the proxy databases.