This section describes the following configuration steps required for replication from the primary database:
Create a Rep Server connection to the primary database
Create a database replication definition
Create the database replication subscription
Set up sequence replication support
To create a Rep Server connection to the primary
database
Verify you are at the $SYBASE/MRO-12_6/scripts directory.
Before executing the oracle_create_rs_primary_connection.sql script against your Rep Server, change all occurrences of value {pds}.{pdb} to the name of the Rep Server connection used to connect to Oracle where:
pds – rs_source_ds (located in $SYBASE/mro-12_6/init/mro.rs)
pdb – rs_source_db (located in $SYBASE/mro-12_6/init /mro.rs)
For example, NY.NYora92.
Change sys and sys_pwd to the user ID and password of the Oracle user who will have permission to apply DML operations against all user tables that will be replicated where:
sys – the user ID of the Oracle user (sys)
sys_pwd – the password of the Oracle user (change_on_install)
While not immediately used, this user must be a valid
user in the Oracle database.
The following command creates a Rep Server connection to the primary database example:
create connection to NY.NYora92set error class rs_sqlserver_error_classset function string class rs_oracle_function_classset username sysset password change_on_installwith log transfer on, dsi_suspendedgo
Execute the script in Rep Server:
isql –Usa –P –SSAMPLE_RS -i oracle_create_rs_primary_connection.sql
A message is displayed that indicates the Rep Server connection to the primary database is created.
To create the database replication definition
Before executing the oracle_create_rs_db_repdef.sql script, change the value of “{pds}.{pdb}” to the name of the connection string you defined for the primary database, where:
pds – rs_source_ds (located in $SYBASE/mro-12_6/init/mro.rs)
pdb – rs_source_db (located in $SYBASE/mro-12_6/init/rs)
For example,
NY.NYora92
The following is a database replication definition example:
create database replication definition NY_repdef1 with primary at NY.NYora92 replicate DDL go
Connect to the Rep Server and execute the following command:
isql -Usa -P –SSAMPLE_RS -i oracle_create_rs_db_repdef.sql
A message is displayed that indicates the database replication definition is created.
To create the database replication subscription
Before executing the oracle_create_rs_db_sub.sql script, change the “{pds}.{pdb}” and “{rds}.{rdb}'”to the appropriate connection name, where:
pds – rs_source_ds (located in $SYBASE/mro-12_6/init/mro.rs)
pdb – rs_source_db (located in $SYBASE/mro-12_6/init/mro.rs)
rds – DCO Server name (DCOServer)
rdb – any valid identifier (It is recommended that you use the Oracle SID name)
The following is a create database replication subscription example:
create subscription NY_sub1 for database replication definition NY_repdef1 with primary at NY.NYora92 with replicate at DCOServer.oratest2 without materialization go
Connect to Rep Server and execute the following command:
isql -Usa -P –SSAMPLE_RS -i oracle_create_rs_db_sub.sql
A message is displayed that indicates the subscription is in the process of being created.
To set up sequence replication support
Install the rs_update_sequence stored procedure. Use SQLPLUS to run the oracle_create_replicate_sequence_proc.sql stored procedure at the standby site:
sqlplus maintuser/password@oracle_create_replicate_sequence_proc.sql
The following is returned:
SQL*Plus: Release 9.2.0.1.0 - Production on Tue Jun 20 10:32:03 2006Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.Connected to: Oracle9i Enterprise Edition Release 9.2.0.1.0 - 64bit Production With the Partitioning, OLAP and Oracle Data Mining optionsJServer Release 9.2.0.1.0 - Production Procedure created.Grant succeeded.
Exit sqlplus.
For more information about sequence replication, see the Mirror Activator for Oracle Administration Guide, Appendix C, “Mirror Replication Agent and Oracle Databases.”
To create a function replication definition for rs_update _sequence, edit the oracle_create_rs_sequence_repdef.sql script, changing all occurrences of the value {pds}.{pdb} to the name of the MRO connection used by your MRO, where:
pds – rs_source_ds (located in $SYBASE/mro-12_6/init/mro.rs)
pdb – rs_source_db (located in $SYBASE/mro-12_6/init/mro.rs)
The following is the function replication definition for sequence replication after editing:
create function replication definition REP_UPDATE_SEQUENCE with primary at NY.NYora92 deliver as RS_UPDATE_SEQUENCE ( @"SEQUENCENAME" varchar(32768), @"SEQUENCEVALUE" numeric, @"INCREMENT" numeric ) send standby all parameters go
Connect to the Rep Server and execute the following command:
isql -Usa -P –SSAMPLE_RS -i oracle_create_rs_sequence_repdef.sql
A message is displayed that indicates a functional sequence replication definition is created.