A single installation of the MRO can support replication from multiple databases. Each Oracle database to be replicated can be connected by one MRO instance. This section describes how to prepare for an instance creation.
To prepare the MRO instance
Obtain the Oracle JDBC driver, which must be acquired from Oracle, and update the classpath.
To find the JDBC connection that communicates with the primary Oracle instance, locate the JDBC driver that was available when the Oracle release was originally created, usually found at $ORACLE_HOME/jdbc/lib/ojdbc14.jar.
MRO requires a newer version of the JDBC driver with the latest corrections, which you can obtain from Oracle.
Refer to the release bulletin or EBF letter of your MRO to obtain the correct version of the JDBC driver.
Add the JDBC driver to the CLASSPATH environment variable. For example, you could append the existing CLASSPATH to the new JDBC driver that was downloaded and add the following command to the .login script of a UNIX user:
setenv CLASSPATH /path_name/ojdbc14.jar:$CLASSPATH
Additional information about the JDBC driver requirements and setup can be found in the Mirror Activator Replication Agent Installation Guide, Chapter 2, Setup and Configuration, in section titled “Setting up Mirror Replication Agent connectivity.”
Record the Oracle connectivity details for the primary Oracle database. You can find these values from any machine where an Oracle SQLPLUS session can be used to connect to the desired Oracle instance. The ORACLE_SID is from the environment variable, $ORACLE_SID. Obtain host and port information from the file called $ORACLE_HOME/network/admin/tnsnames.ora.
Record the following:
Host name of the Oracle database that the TNS listener is operating on ($ORACLE_SID)
Port number the TNS listener is monitoring
ORACLE_SID value for the instance you wish to connect to
(Optional) If your operating system has a Java 1.2.x compatible JRE or JDK installed, you can use Oracle’s isql demo items to verify Java 1.2.x, and to connect to Oracle using the JDBC driver and the connection information.To perform this validation, refer to the Oracle9i JDBC Developer's Guide and Reference guide, in the section titled, “Verifying a JDBC Client Installation.”
Obtain a local copy of the Oracle timezone file, so MRO can correctly process the Oracle timestamp with timezone datatype.
This step is only required if the MRO is on a different
machine (host) than the Oracle host and does not have access to
the Oracle files.
There are two timezone files under the Oracle installation directory:
The following binary file is the default file that contains the most commonly used time zones and is smaller:
* $ORACLE_HOME/oracore/zoneinfo/timezone.dat
The following binary file contains the larger set of defined time zones:
* $ORACLE_HOME/oracore/zoneinfo/timezlrg.dat
The Oracle instance uses the timezone file from the ORA_TZFILE environment variable. If ORA_TZFILE is not set, use the default timezone file.Determine which timezone file is used by the primary Oracle instance and make a copy of that file available on the machine hosting the MRO.
These files are platform dependent. You cannot use a timezone file from
a little endian platform on a big endian platform, or visa versa.
Determine the desired default settings
By default, MRO is configured to mark every user table in the primary oracle database for replication, and to create a replication definition for every table marked.While these settings may be reasonable for production environments, they may not be desired in a test or proof of concept environment, where only a subset of tables are being replicated. If automatic table marking or replication definition generation options are not desired, you should change the settings of MRO configuration parameters pdb_automark_tables and pdb_auto_create_repdefs.
Additional information about the configuration parameters can be found in the Mirror Replication Agent for Oracle Reference Guide.
Locate the sample resource file.
The majority of configuration values required to create and initialize a MRO can be recorded and stored in a resource file. Using it provides a means to record or retain the configuration information for a MRO instance, allowing an instance to be removed and re-created.A sample resource file can be found in the MRO directory $SYBASE/MRO-12_6/init/mro.rs.
Create an instance resource file.
Copy the resource file template $SYBASE/MRO-12_6/init/mro.rs to another file that contains the configuration information for a new instance, for example:
cp mro.rs mymro.rs
Using a text editor, alter the values assigned to properties in the resource file so that they match the values required for your environment. The majority of these values are host, port, user, and password information for the Oracle, RS, and RSSD connections.The resource file is self-documenting, with each parameter described. If you require additional information about the resource file or its usage, refer to the Mirror Replication Agent Administration Guide, Chapter 2, Setup and Configuration, in section titled, “Creating a Mirror Replication instance using resource files.”
Parameter |
Description |
Values (for example) |
---|---|---|
instance name |
any valid name |
my_mro |
admin_port |
port number that MRO will use |
9030 (if in use, select a different port number) |
pds_host_name |
machine (host) where Oracle is installed |
crane |
pds_port_number |
port number for Oracle |
1521 (if in use, select a different port number) |
pds_database_name |
$ORACLE_SID |
testoral |
pds_username |
same as created previously in step 1, page 6 |
MRO_USER |
pds_password |
password for pds_username |
sybase |
pds_sa_username |
system admin name |
system |
pds_sa_password |
system admin name password |
manager |
rs_host_name |
machine where Rep Server is installed |
localhost |
rs_port_number |
port where Rep Server is installed |
11752 |
rs_username |
Rep Server user with connect source capability |
SAMPLE_RS_ra |
rs_password |
password for rs_username |
SAMPLE_RS_ra_ps |
rs_source_ds |
valid name representing data server of Oracle primary database |
NY |
rs_source_db |
valid name representing database of Oracle primary database |
NYora92 |
rssd_host_name |
machine where RSSD resides |
localhost |
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 |
ddl_username |
user name that can execute DDL commands |
DDLuser |
ddl_password |
password created for ddl_ username |
password (created previously) |
pdb_timezone_file |
path to the pdb_timezone-file |
/software/oracle/Ora9i/oracore /zoneinfo/timezone.dat |
WARNING! The rs_source_ds and the rs_source_db values must match the “pds.pdb” values of your Replication Server’s primary connection name.
Create and execute the new instance resource file.
Be sure your CLASSPATH environment variable points to
the correct Oracle JDBC driver before proceeding.
Using the MRO mro_admin utility, validate the settings in the resource file using the –vr parameter, for example:
$SYBASE/MRO-12_6/bin/mro_admin.sh -vr mymro.rs
where mymro.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 mro_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 mro_admin utility to create the MRO instance, using the –r parameter, for example:
$SYBASE/MRO-12_6/bin/mro_admin.sh -r mymro.rs
Validation results are returned as either:
Response_file processing completed, or
Response_file processing completed with errors
If you require additional information about the resource file or its use, refer to the Mirror Replication Agent Administration Guide, Chapter 2, “Setup and Configuration,” in the section titled, “Creating a Mirror Replication instance using resource files.”
Change to the $SYBASE directory and run the MRO:
$SYBASE/MRO-12_6/my_mro
Execute the RUN file. For example:
./RUN_my_mro &
Your MRO is now running.