Home | Previous Page | Next Page   Setting Up and Managing Enterprise Replication > Preparing the Replication Environment > Preparing the Disk >

Setting Up Send and Receive Queue Spool Areas

The term data queue refers to both the send queue and the receive queue. Enterprise Replication collects information from the logical logs and places the data to be transferred in the send queue. Then Enterprise Replication transfers the contents of the send queue to the receive queue on the target server. Enterprise Replication on the target reads the data from the receive queue and applies the changes to the tables on the target server.

The send and receive queues reside in memory and are managed by the Reliable Queue Manager (RQM). The CDR_QUEUEMEM configuration parameter (CDR_QUEUEMEM Configuration Parameter) specifies the amount of memory space that is available for the data queues.

When a queue in memory fills (for the receive queue, this only occurs with large transactions), the transaction buffers are written (spooled) to disk. Spooled transactions consist of transaction records (headers that contain internal information for Enterprise Replication), replicate information (summaries of the replication information for each transaction), and row data (the actual replicated data). Spooled transaction records and replication records are stored in transaction tables and replication tables in a single dbspace. Spooled row data is stored in one or more sbspaces.

Important:
To prevent the send and receive queues from spooling to disk, see Preventing Memory Queues from Overflowing.

Transaction Record dbspace

By default, the transaction records and replication records are stored in the root dbspace. Because Enterprise Replication and other database servers become unavailable if the root dbspace fills, you should define a single, separate dbspace for the send and receive queue transaction records and replication records before you define the replication server.

To determine the size of your transaction record dbspace, you must determine the estimated number of transactions in a given period. You should allocate 110 bytes per transaction to the dbspace and allocate enough disk space to store 24 hours of transaction records. For example, if your network is down for 24 hours, and you estimate that you will log 1000 transactions each day, the size of the transaction record dbspace should be at least 108 kilobytes (110 bytes * 1000 transactions / 1024).

To create the transaction record dbspace, use onspaces -c. For example, to create a 110 kilobyte dbspace called er_dbspace using raw disk space on UNIX with an offset of 0, enter:

onspaces -c -d er_dbspace -p /dev/raw_dev1 -o 0 -s 110

The pathname for the dbspace cannot be longer than 256 bytes.

Set the CDR_QHDR_DBSPACE configuration parameter (CDR_QHDR_DBSPACE Configuration Parameter) in the ONCONFIG file to the location of the transaction record dbspace (er_dbspace, in this example).

Warning:
Do not change the value of CDR_QHDR_DBSPACE after you initialize Enterprise Replication on a server.

For information on creating dbspaces, see the chapter on managing disk space in the IBM Informix Dynamic Server Administrator's Guide and the utilities chapter in the IBM Informix Administrator's Reference.

Row Data sbspaces

Replicated data might include UDT and CLOB or BLOB data types. Therefore, the spooled row data is stored as smart large objects in one or more sbspaces.

Important:
Before starting Enterprise Replication, you must create at least one sbspace for spooled row data and set the CDR_QDATA_SBSPACE configuration parameter to its location.

The CDR_QDATA_SBSPACE configuration parameter accepts multiple sbspaces, up to a maximum of 32 sbspaces. Enterprise Replication can support a combination of logging and non-logging sbspaces for storing spooled row data. If CDR_QDATA_SBSPACE is configured for multiple sbspaces, then Enterprise Replication uses all appropriate sbspaces in round-robin order. For more information, see CDR_QDATA_SBSPACE Configuration Parameter.

Creating sbspaces for Spooled Row Data

Follow these guidelines when creating sbspaces for spooled row data:

Warning:
When the row data sbspaces fill, Enterprise Replication hangs until you either resolve the problem that is causing Enterprise Replication to spool or allocate additional disk space to the sbspaces. For more information, see Preventing Memory Queues from Overflowing.

To create row data sbspaces, use the onspaces -c utility. For example, to create a 4-megabyte sbspace, called er_sbspace, using raw disk space on UNIX with an offset of 0, enter:

onspaces -c -S er_sbspace -p /dev/rdsk/c0t1d0s4 -o 0 -s 4000\
    -m /dev/rdsk2/c0t1d0s4 0 \
    -Df "AVG_LO_SIZE=2,LOGGING=OFF" 
 

The pathname for an sbspace cannot be longer than 256 bytes.

The -m option specifies the location and offset of the sbspace mirror. The -Df option specifies default behavior of the smart large objects stored in the sbspace:

Set the CDR_QDATA_SBSPACE configuration parameter in the ONCONFIG file to the location of the row data sbspace (er_sbspace, in this example). For more information, see CDR_QDATA_SBSPACE Configuration Parameter.

Warning:
Do not change the value of CDR_QDATA_SBSPACE after you initialize Enterprise Replication.
Logging Mode for sbspaces

Enterprise Replication uses the default log mode that the sbspace was created with for spooling row data.

Create sbspaces with a default logging mode of ON or OFF according to the types of transactions Enterprise Replication replicates:

Warning:
Do not change the Enterprise Replication sbspace default log mode while Enterprise Replication is running. To change the default log mode, follow the procedure below.

You can change the default logging mode of the row data sbspace if you have more than one sbspace specified by the CDR_QDATA_SBSPACE configuration parameter.

To change the default logging mode of a row data sbspace
  1. Shut down the database server.
  2. Remove the sbspace from the CDR_QDATA_SBSPACE configuration parameter value list.
  3. Start the database server in recovery mode.
  4. Wait for all the smart large objects to get deleted from the sbspace. Use the onstat -g smb lod command to check for smart large objects stored in an sbspace.
  5. Change the default logging mode for the sbspace.
  6. Add the sbspace name to the CDR_QDATA_SBSPACE configuration parameter value list.
  7. Shut down and restart the database server using the onmode -ky and oninit commands.
Dropping a Spooled Row Data sbspace

You can drop a row data sbspace if you have more than one sbspace specified by the CDR_QDATA_SBSPACE configuration parameter.

Dropping a row data sbspace
  1. Shutdown the database server.
  2. Remove the sbspace from the CDR_QDATA_SBSPACE configuration parameter value list.
  3. Start the database server in recovery mode.
  4. Wait for all the smart large objects to get deleted from the sbspace. Use the onstat -g smb lod command to check for smart large objects stored in a sbspace.
  5. Drop the sbspace.
Warning:
Do not drop an Enterprise Replication row data sbspace using the onspaces -d -f (force) command.
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]