cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Is there a method / what are steps to move from using RSSD to ERSSD in Replication Server

james_morrison
Explorer
0 Kudos
304

We are currently running "Replication Server/16.0/EBF 30057 SP03 PL11 rs160sp03pl11/Linux AMD64/Linux 2.6.32.59-0.19-default x86_64/2591/OPT64/Sun Oct 24 08:05:06 2021

 

WE are using standard RSSD database tables . Is there process /methodology to switch to using ERSSD databases ?

Accepted Solutions (0)

Answers (2)

Answers (2)

ChrisBaker
Product and Topic Expert
Product and Topic Expert
0 Kudos

Attached is a 20-year old example script.

 

#!/bin/sh

echo "This script migrates ASE RSSD to ASA eRSSD";

# This function expects two parameters:
#	table_name
#	a select statement with order by using primary key
migrate()
{
	echo "Truncating target table $1...";
	echo "Truncating target table $1..." >> $0.out;
	(echo "truncate table $1" ; echo go ) | $SYBASE/$SYBASE_OCS/bin/isql -U dbo -P dbo -S $eRSSDServer
	echo "Copying table $1 from ${ASEServer}.$ASEdb to $eRSSDServer...";
	echo "Copying table $1 from ${ASEServer}.$ASEdb to $eRSSDServer..." >> $0.out;
	$SYBASE/$SYBASE_REP/bin/rs_subcmp -S $ASEServer -s $eRSSDServer -c "$2" -t dbo.$1 -U $ASEuser -u dbo -p dbo -D $ASEdb -n 0 -r $ASEpwdParam
	if [ "$?" = 1 ]
	then
		echo "Command failed for $1";
		echo "Command failed for $1" >> $0.out;
		echo -n "$SYBASE/$SYBASE_REP/bin/rs_subcmp -S $ASEServer -s $eRSSDServer -c \"";
		echo -n "$2";
		echo "\" -t dbo.$1 -U $ASEuser -u dbo -p dbo -D $ASEdb -n 0 -r $ASEpwdParam";
		echo -n "$SYBASE/$SYBASE_REP/bin/rs_subcmp -S $ASEServer -s $eRSSDServer -c \"" >> $0.out;
		echo -n "$2" >> $0.out;
		echo "\" -t dbo.$1 -U $ASEuser -u dbo -p dbo -D $ASEdb -n 0 -r $ASEpwdParam" >> $0.out;
		exit 1;
	fi
}

get_input()
{
	echo " ";
	echo -n "Please enter the ASE RSSD server name: ";
	read ASEServer;
	echo -n "Please enter the ASE RSSD db name: ";
	read ASEdb;
	echo -n "Please enter the ASE user name: " 
	read ASEuser;
	echo -n "Please enter the ASE user password: "
	read ASEpwd;
	echo -n "Please enter the ASA eRSSD server name: ";
	read eRSSDServer;

	echo " "
	echo "ASE RSSD server name: $ASEServer";
	echo "ASE RSSD db name: $ASEdb";
	echo "ASE user name: $ASEuser";
	echo "ASE user password: $ASEpwd";
	echo "ASA eRSSD server name: $eRSSDServer";
	echo -n "Is the information correct? [y/n/q]";
	read correct;
}

get_input;
while [ "$correct" != "y" ]
do
	if [ "$correct" = "q" ]
	then
		exit 0;
	fi
	get_input;
done

echo "ASE RSSD server name: $ASEServer" >> $0.out;
echo "ASE RSSD db name: $ASEdb" >> $0.out;
echo "ASE user name: $ASEuser" >> $0.out;
echo "ASE user password: $ASEpwd" >> $0.out;
echo "ASA eRSSD server name: $eRSSDServer" >> $0.out;

if [ $ASEpwd ]
then
	ASEpwdParam="-P $ASEpwd";
else
	ASEpwdParam="";
fi

# Now migrate each table
migrate rs_classes "select * from rs_classes order by classname, classtype";
migrate rs_columns "select * from rs_columns order by objid, colname";
migrate rs_config "select * from rs_config order by optionname, objid";
migrate rs_debugconfig "select * from rs_debugconfig order by optionname, objid";
migrate rs_datatype "select * from rs_datatype order by dtname";
migrate rs_databases "select * from rs_databases order by ltype, dsname, dbname";
migrate rs_diskaffinity "select * from rs_diskaffinity order by dbid_or_siteid";
migrate	rs_diskpartitions "select * from rs_diskpartitions order by logical_name"
migrate rs_erroractions "select * from rs_erroractions order by ds_errorid, errorclassid";
migrate rs_functions "select * from rs_functions order by funcname, objid";
migrate rs_ids "select * from rs_ids order by objtype";
migrate rs_idnames "select * from rs_idnames order by name1, name2, ltype";

migrate rs_locater "select * from rs_locater order by sender, type";
migrate rs_maintusers "select * from rs_maintusers order by destid";
migrate rs_objects "select * from rs_objects order by objname";
migrate rs_oqid "select * from rs_oqid order by origin_site_id, q_number, q_type";
migrate rs_queues "select * from rs_queues order by number, type";
migrate rs_exceptshdr "select * from rs_exceptshdr order by sys_trans_id";
migrate rs_exceptscmd "select * from rs_exceptscmd order by cmd_id";
migrate rs_exceptslast "select * from rs_exceptslast order by error_db, origin";
migrate rs_repdbs "select * from rs_repdbs order by dbid";
migrate rs_routes "select * from rs_routes order by dest_rsid, source_rsid";
migrate rs_rules "select * from rs_rules order by subid, colnum";
migrate rs_segments "select * from rs_segments order by partition_id, partition_offset";
migrate rs_sites "select * from rs_sites order by id";
migrate rs_funcstrings "select * from rs_funcstrings order by classid, funcid, name";
migrate rs_subscriptions "select * from rs_subscriptions order by subid";
migrate rs_systext "select * from rs_systext order by parentid, texttype, sequence";
migrate rs_translation "select * from rs_translation order by classid, source_dtid";
migrate rs_users "select * from rs_users order by username";
migrate rs_repobjs "select * from rs_repobjs order by objid, dbid";
migrate rs_queuemsg "select * from rs_queuemsg order by q_number, q_type, q_seg, q_blk, q_row";
migrate rs_queuemsgtxt "select * from rs_queuemsgtxt order by q_number, q_type, q_seg, q_blk, q_row, q_seq";
migrate rs_recovery "select * from rs_recovery order by id";
migrate rs_version "select * from rs_version order by siteid";
migrate rs_routeversions "select * from rs_routeversions order by dest_rsid, source_rsid";
migrate rs_articles "select * from rs_articles order by articlename, pubid";
migrate rs_publications "select * from rs_publications order by pubname, pdbid";
migrate rs_whereclauses "select * from rs_whereclauses order by wclauseid";
migrate rs_statcounters "select * from rs_statcounters order by counter_id";
migrate rs_statdetail "select * from rs_statdetail order by run_id, instance_id, instance_val, counter_id";
migrate rs_statrun "select * from rs_statrun order by run_id";
migrate rs_dbreps "select * from rs_dbreps order by dbid, dbrepname";
migrate rs_dbsubsets "select * from rs_dbsubsets order by dbrepid, type, owner, name";
migrate rs_lastcommit "select * from rs_lastcommit order by origin";
migrate rs_threads "select * from rs_threads order by id";

 

This is provided without any warranties.  As this is an older example, you will probably have to alter it to ensure all objects are migrated correctly.

 

Mark_A_Parsons
Contributor
0 Kudos

There is no official method for converting between RSSD and eRSSD other than rebuilding the repserver from scratch ... and hope a) you saved all RCLs (version control?) or b) you have a reliable means of reverse engineering the current repserver.

Having said that ...

The (e)RSSD is just a database so in theory a conversion should be possible but you would need to do quite a bit of testing to verify everything works as expected.

Off the top of my head ... and assuming you're not moving to another host (eg, big endian to little endian) ... IF I were to attempt this I'd want to start by figuring out what, if any, differences exist between RSSD and eRSSD data:

  1. make note of the contents of the ID/RSSD tables - rs_ids, rs_idnames
  2. build a new repserver (using an ASE/RSSD) in a development environment (there should already be at least one other repserver you can use for testing routes)
  3. perform all possible operations against this repserver, eg, configs, primary/replicate db connections, table/db repdefs, table/db subs, article/pub (?), custom function-string/database/repserver classes, custom function strings, routes to/from the new repserver (make sure upstream objects are copied into new RS/RSSD), create a sub in the downstream RS (make sure the sub info is copied back in to this RS/RSSD's system tables), run some data through the system to 'exercise' all repdefs/subs, etc
  4. bcp out all RSSD tables
  5. drop the repserver and reset the ID/RSSD tables (rs_ids, rs_idnames) to their original values (see step #1); follow-on diffs are going to be a lot easier if all internal ids (object/repserver/db/repdef/subs/etc id's are identical)
  6. rebuild the new repserver (using an eRSSD) in the development environment; ideally copy the ASE/RSSD's *.rs file and update with the eRSSD details (objective being to use the same repserver name, the same stable queue/partition, etc)
  7. perform all of the same operations as in step #3 (and in the same order so as to insure the same internal id's are generated)
  8. bcp out all eRSSD tables
  9. sort and diff the (e)RSSD/bcp data sets and make notes of any differences; of particular interest will be the question of whether or not you have to deal with byte swapping

At this point you should have a good idea of what, if any, differences exist between the RSSD and eRSSD tables.  With these differences in hand you should be able to plan a data migration (to include any necessary modifications to RSSD data before inserting into the eRSSD).

Next step would be to designate a RS (ASE/RSSD) guinea pig (in a development/test environment) for testing the actual migration.  NOTE: keep in mind the following may trash/corrupt/kill the guinea pig RS instance so make sure this isn't an important guinea pig.

  1. you'll need a blank eRSSD; consider copying the SQLAnywhere components from step #6 (above); rename directories/files as needed; startup the SQLAnywhere database and truncate all eRSSD tables
  2. shutdown the guinea pig repserver (currently using ASE/RSSD)
  3. bcp out the RSSD data; perform any data modifications per the diffs (see step #9 - above)
  4. bcp the (modified) RSSD data into the eRSSD
  5. shutdown the SQLAnywhere database
  6. update the RS config file and create the eRSSD config file; add eRSSD entries to the interfaces file; mimic the files created during RS/eRSSD build - step #6 (above)
  7. cross your fingers and startup the RS (eRSSD) instance

I'm probably missing something ...