The ma_admin utility provides two command line parameters that support creating a Mirror Replication Agent instance using a resource file, and validating resource files.
ma_admin {-vr res_file | -r res_file}
-vr res_file
Validates the specified resource file (res_file), without creating a Mirror Replication Agent instance or making any change in the environment.
-r res_file
Creates a Mirror Replication Agent instance, based on the contents of the specified resource file (res_file).
A resource file is an ASCII text file that contains configuration information for the Mirror Replication Agent instance to be created by the ma_admin utility.
The ma_admin parameters in the resource file allow you to specify the following options, in addition to creating a Mirror Replication Agent instance:
Create the instance user login in the primary data server, and grant all required permissions.
Start the new instance after it is created.
Initialize the new instance after it starts.
Record mirror log device information in the log device repository after the instance is initialized.
When you validate a resource file with ma_admin
-vr, no other action is taken, and no Mirror Replication Agent instance
is created.
The following sections describe how to use a resource file:
Resource file templates, ase.rs (for ASE) and oracle.rs (for Oracle) are provided in the init subdirectory of the Mirror Replication Agent installation directory. For example:
C:\sybase\MA-15_2\init\ase.rs
or
C:\sybase\MA-15_2\init\mssql.rs
or
C:\sybase\MA-15_2\init\oracle.rs
The resource file template contains comments that describe each configuration parameter and its value.
Sybase recommends that you validate each resource file
before you create a Mirror Replication Agent instance using that resource file.
Copy the resource file template ma.rs to another file that you will edit to create the new resource file. For example:
cp oracle.rs pubs2.rs
Here, pubs2.rs is the name of the new resource file you want to create.
If you have an existing resource file, you can copy that file to create a new resource file, instead of copying the template.
Use your preferred text editor to edit the resource file copy that you created.
After you create a new resource file, you should validate it. See “Validating a resource file”.
The ma_admin resource file is an ASCII text file that you can edit using any standard text editor.
Resource file contents must conform to the following:
Configuration parameters for both the Mirror Replication Agent and the ma_admin utility must use the following format:
param=value
where:
param is the name of the configuration parameter.
value is the value of the configuration parameter.
Spaces are not allowed before or after the = symbol,
or within the value string.
Each param=value
statement
must occur on a separate line.
If a default value exists for a configuration parameter,
you can specify the default value with the string USE_DEFAULT
:
param=USE_DEFAULT
Here, param is the name of the configuration parameter.
The following ma_admin configuration parameters require a value of yes or no:
create_pds_username
start_instance
initialize_instance
Any string other than yes is interpreted as no.
Blank lines and lines that begin with the # symbol
are ignored in the resource file.
When you invoke the ma_admin utility with the -vr option, the utility validates the specified resource file and returns information about the validation process.
The ma_admin utility validates resource files by:
Verifying uniqueness of the Mirror Replication Agent administration port number and instance name
Verifying access to the primary data server, Replication Server, and RSSD
Verifying the host name, port number, database name, user login, and password on each server
Verifying the Replication Server database connection for the primary database
Verifying that the pds_username user has all the required permissions at the primary database
Verifying that the primary database redo logs are correctly configured
Verifying access to mirror log devices, if specified in the resource file
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. No entities are changed or created as a result of this process.
Sybase recommends that you validate a new resource file
before you create a Mirror Replication Agent instance using the new resource file.
Invoke the ma_admin utility, specifying the -vr option and the name of the resource file:
ma_admin -vr res_file
where res_file is the name of the resource file you want to validate.
For example, if the resource file is named pubs2.rs, enter the following at the command prompt:
ma_admin -vr pubs2.rs
Validation results are returned as either:
Resource_file
processing completed
.
or
Resource_file processing
completed with errors.
If the validation is successful, you can skip step 2, and use the resource file to create a Mirror Replication Agent instance. See “Creating an instance with a resource file”.
If the validation encounters errors, continue to step 2.
Use the following procedure to correct validation errors:
Review the error messages to determine the cause of the failure.
Edit the resource file to correct the appropriate values.
Invoke ma_admin -vr again, specifying the name of the resource file.
Repeat this step until the resource file is successfully validated.
When you invoke the ma_admin utility with the -r option, the utility first validates the specified resource file, as described in “Validating a resource file”, except:
If the Mirror Replication Agent primary database user login does
not exist in the primary data server, the utility creates it, if
specified in the resource file (create_pds_username=yes
).
If the user login does exist in the primary data server but does
not have all the required privileges, set create to yes,
to have the utility grant all required permissions.
If the Mirror Replication Agent primary database user login does exist in the primary data server, has all the required privileges, and the resource file specifies that it should be created, the utility returns an error message and does not create the instance. (This error would be caught in the validation process described in “Validating a resource file”.)
If the resource file specifies that the new Mirror Replication Agent instance
should be initialized (initialize_instance=yes
),
then:
The Mirror Replication Agent primary database user
login must either exist in the primary data server, or be created
by the ma_admin utility (create_pds_username=yes
).
The resource file must specify that the Mirror Replication Agent instance
should be started (start_instance=yes
).
Otherwise, the utility returns an error message and does not create the instance.
After validating the resource file successfully, the ma_admin utility does the following:
Creates and configures a Mirror Replication Agent instance, based on the contents of the specified resource file.
Creates or grants all required privileges for the instance user, if specified in the resource file.
Starts the new Mirror Replication Agent instance, if specified in the resource file.
Initializes the new Mirror Replication Agent instance, if specified in the resource file.
Records mirror log device information in the log device repository, if specified in the resource file.
The utility also returns information about the instance created and the result.
If instance creation fails, the ma_admin utility returns an error message and information about the failure.
Sybase recommends that you validate a new resource file
before you create a Mirror Replication Agent instance using the new resource file. See “Validating a resource file”.
Creating a Mirror Replication Agent instance
Invoke the ma_admin utility, specifying the -r option and the name of the resource file:
ma_admin -r res_file
where res_file is the name of the resource file.
For example, if the resource file is named pubs2.rs, enter the following at the command prompt:
ma_admin -r pubs2.rs
Results are returned as either:
Resource_file
processing completed
.
or
Resource_file processing
completed with errors.
If the instance creation is successful, you can begin using the new Mirror Replication Agent instance.
If the instance creation fails, you may have to:
Drop the Mirror Replication Agent user from the primary database.
Delete all files and subdirectories in the instance directory, and delete the instance directory from the Mirror Replication Agent installation directory.
Edit the resource file to correct the appropriate values.
If the instance creation fails, use the following recovery
procedure before you attempt to create the instance again.
Recovering from instance creation errors
If the resource file does not specify that the instance user login be created in the primary data server, skip this step and continue with step 2.
If the resource file specifies that the instance user login
be created in the primary data server (that is, create_pds_username=yes
),
then:
Check the primary database to determine if the instance user was added.
Check that the pds_sa_username has sufficient privileges to create the instance login at the primary database.
Edit the resource file to specify that the instance
user login should not be created in the primary data server (create_pds_username=no
).
If the Mirror Replication Agent primary database user login is successfully
created before the instance creation fails, you must either:
Edit the resource file to set the value of the create_pds_username parameter to no, or
Log in to the primary data server and drop the instance login.
Check the Mirror Replication Agent base directory on the Mirror Replication Agent host to determine if a new instance directory was created. The Mirror Replication Agent base directory is:
%SYBASE%\MA-15_2
where %SYBASE% is the Mirror Replication Agent installation directory.
If you do not find a new instance directory in the Mirror Replication Agent base directory, skip step 3 and continue with step 4.
If you find a new instance directory in the Mirror Replication Agent base directory, continue with step 3.
To delete the new instance directory, you have two options:
Use the ma_admin utility to delete the instance:
ma_admin -d inst_name
where inst_name is the name of the instance you want to delete, or
Use operating system commands to delete all of the files and subdirectories in the new instance directory, and then delete the new instance directory.
Review the error messages to find the cause of the instance creation failure, and if necessary, edit the resource file to correct the appropriate values.
After editing the resource file, use ma_admin to validate the resource file:
ma_admin -vr res_file
where res_file is the name of the resource file.
See “Validating a resource file” for more information.
After you complete the recovery procedure, you can retry creating the Mirror Replication Agent instance.