A single installation of the Mirror Replication Agent can support replication from multiple databases; however, one Mirror Replication Agent instance is needed for each ASE database to be replicated. This section describes how to prepare and create a Mirror Replication Agent for ASE instance:
To prepare for a Mirror Replication Agent instance
Determine the default settings you want.
By default, Mirror Replication Agent is configured to mark every user table in the primary database for replication, and to create a replication definition for every table marked. Although these settings may be reasonable for production environments, they may not be useful in a test or proof-of-concept environment, where only a subset of tables are being replicated. If you do not want automatic the table marking or replication definition generation options, change the settings of two Mirror Replication Agent configuration parameters: pdb_automark_tables and pdb_auto_create_repdefs.
For more information about the configuration parameters, refer to the Mirror Replication Agent Reference Manual.
Locate the sample resource file.
The majority of configuration values required to create and initialize a Mirror Replication Agent can be recorded and stored in a resource file. Using it provides a means to record or retain the configuration information for a Mirror Replication Agent for ASE instance, allowing an instance to be removed and re-created.A sample resource file is located in the Mirror Replication Agent $SYBASE/MA-15_1/init/ase.rs directory.
To create a Mirror Replication Agent instance
Go to the $SYBASE/MA-15_1/init directory.
Create an instance resource file by copying the resource file template $SYBASE/MA-15_1/init/ase.rs file to another file that contains the configuration information for a new instance:
cp ase.rs myma.rs
Using a text editor, change the values assigned to the properties listed in Table 1-2:
Parameter |
Description |
Example values |
---|---|---|
instance_name |
Any valid name. |
myma |
admin_port |
Port number that Mirror Replication Agent will use. |
20000 |
pds_host_name |
Machine (host) where ASE is installed. |
repit |
pds_port_number |
Port number for ASE. |
5600 |
pds_database_name |
Name of database replicated from the primary data server. |
foo |
pds_username |
A valid user name that has “sa” and replicate roles. |
sa |
pds_password |
Password for pds_username. |
sa_ps
|
create_pds_username |
Specifies whether or not the ma_admin utility, invoked without the -r option, should create the Mirror Replication Agent primary database user login if the login does not already exist in the primary data server. For information about the ma_admin utility -r option, see the Mirror Activator Administration Guide. |
yes |
pds_sa_username |
System admin name. |
sa |
pds_sa_password |
System admin name password. |
sa_ps
|
rs_host_name |
Machine where Replication Server is installed. |
repit |
rs_port_number |
Port where Replication Server is installed. |
11752 |
rs_username |
User ID that Mirror Replication Agent uses to access primary Replication Server; it must have CONNECT SOURCE and CREATE OBJECT capabilities. |
SAMPLE_RS_ra |
rs_password |
Password for rs_username. |
SAMPLE_RS_ra_ps |
rs_charset |
Character set that Replication Server is using.
|
iso_1 |
rs_source_ds |
ASE server of the primary database. |
repit151i |
rs_source_db |
Primary database. |
foo |
rssd_host_name |
Machine where RSSD resides. |
repit |
rssd_port_number |
Port number where RSSD resides. |
11751 |
rssd_database_name |
Database name for RSSD. |
SAMPLE_RS_ERSSD |
rssd_username |
Valid user for RSSD. |
SAMPLE_RS_RSSD_maint |
rssd_password |
Password for rssd_username. |
SAMPLE_RS_RSSD_maint_ps |
disable_rat |
Disable Mirror Replication Agent thread. |
yes |
start_instance |
Start the instance that was created. |
yes |
initialize_instance |
Initialize the Mirror Replication Agent instance.
|
yes |
ra_devicepath_x |
Primary database log mirror location information. These parameter names must be unique in the format ra_devicepath_x, where x is a unique sequential number and the parameter value contains both the device name and the device path separated by a comma. |
ra_devicepath_1= logA, /dev/pubs2/logA.dat |
Validate and execute the new instance resource file:
$SYBASE/MA-15_1/bin/ma_admin.sh -vr myma.rs
where myma.rs is the path name of the resource file.
Validation results are returned as either:
Response_file processing completed, or
Response_file processing completed with errors.
If any validation fails, the ma_admin utility returns an error message and information about the failure. You can repeat the validation process as many times as necessary until it executes without error. No entities are changed or created because of this process.
After the resource file has been validated, allow the ma_admin utility to create the MRA instance:
$SYBASE/MA-15_1/bin/ma_admin.sh -r myma.rs
A message appears, indicating that response file processing is completed.
If in your resource file you set start_instance to yes and
the log indicates that the Mirror Replication Agent instance was
started, skip this step, and continue with the next section.
Change to the instance directory and run Mirror Replication Agent in the background:
cd $SYBASE/MA-15_1/myma
Execute the RUN file in the background, for example:
./RUN_myma &
Your Mirror Replication Agent for ASE is now running.
Using the example settings specified in the resource file, the Mirror Replication Agent will:
Stop, disable, and preserve the secondary truncation point of the current ASE Mirror Replication Agent thread
Mark the primary database with sp_reptostandby
WARNING! If you have a large amount of text or image data in existing tables, the sp_reptostandby might take a long time to complete.
Read all the tables in the primary database and prepare them for replication
Initialize the Mirror Replication Agent