[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference orarep::nomahs::dec_data_distributor

Title:The Replication Option for Rdb
Notice:Product renamed to Replication Option for Rdb
Moderator:BROKE::PROTEAU
Created:Wed Mar 02 1994
Last Modified:Wed Jun 04 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:287
Total number of notes:1231

208.0. "NEW or EXISTING filename with Replication definition?" by ORAREP::CHEFS::MACLEOD () Fri Apr 19 1996 13:26

	Hi,

	I need some help with a DDD definition for a replication database.

	Replication is the type I need, as the target database (RDB) will be
	read only, and the source database (RDB) will be updated frequently
	After it's inital laod will it will grow steadily.

	If I specify "TO NEW FILENAME" in the to-clause, it will create a 
	new database with each transfer.

	But if I specify "TO EXISTING FILENAME" in the to-clause, It fails
	in the initial create.

	So, should I alter the definition after the first successful transfer
	to use "TO EXISTING FILENAME"?

	I was hoping that DDD will create the inital database and then update 
	with each transfer without any need to change the definition.
	But am I wrong.


	Thanks for any ideas.


	Ferdy
T.RTitleUserPersonal
Name
DateLines
208.1Here's how it worksBROKE::PROTEAUJean-Claude ProteauFri Apr 19 1996 18:1155
Ferdy,

You can do what you want to do, and you have two choices.  You can either ue
the TO NEW clause or the TO EXISTING clause.

TO NEW FILENAME
---------------

If you use this clause in your CREATE TRANSFER statement, DDD will behave as
follows.

The first time the transfer executes, DDD will create the target database,
add to it the definitions of the tables you want replicated, and then transfer
a snapshot of the table data.  By snapshot I mean all the data in the table
or (if you specified a selective WHERE clause) all the data in the table that
matches your selection criteria.

The second and subsequent executions of the transfer will not create a new
target database.  These are called replication update transfers.  They read the
changes which have occurred in the Rdb source database and apply those changes
to the target tables.  The part that must have seemed confusing is that this
is an existing database at this point.  True enough.  The distinction between
TO NEW FILENAME and TO EXISTING FILENAME is relevant for the initial replication
transfer, not replication updates.

If you were performing EXTRACTION transfers, subsequent executions would indeed
create a new target database each time.

TO EXISTING FILENAME
--------------------

Alternatively, you can create your own target database to begin with and then
ask DDD to transfer into that existing database.  The TO EXISTING FILENAME
option was added primarily when you want to transfer tables into someone else's
database -- a database that already exists.

    "But if I specify "TO EXISTING FILENAME" in the to-clause, It fails in
    the initial create."

Yes, that is because DDD expects the target database to exist.  It does not
create one when the TO EXISTING FILENAME clause is used.

    "So, should I alter the definition after the first successful transfer
    to use 'TO EXISTING FILENAME'?"

I hope my explanation above makes it clear you should not alter the definition
after the first successful transfer.

    "I was hoping that DDD will create the inital database and then update 
    with each transfer without any need to change the definition."

That's what happens when you use TO NEW FILENAME.

Claude