Re: Reinitialize EDR
Posted in 2000
Topics: High Availability & Replication, SQL Development & Query Writing, Server Administration, Migration, Import/Export & Data Conversion
Andrea:
In our environment, we have 1-way replication, ie, Primary-Target
To reinitialize replication, we:
1. Restore our Test databases.
2. Query the replicants defined as
#!/bin/ksh
# PROD to TEST - This step sets up the next step. You may have more
partdef's depending on # of DB's
dbaccess syscdr >/dev/null 2>&1 <<!
update partdef set db = 'test' where db = 'prod'!
#
# Record Format: for unload
# Field Desc
# 1 Replicate Name
# 2 Part State (Primary)
# 3 Db (Primary)
# 4 Owner (Primary)
# 5 Table (Primary)
# 6 Select Statement
# 7 Part State (Target)
# 8 Db (Target)
# 9 Owner (Target)
# 10 Table (Target)
# 11 Select Statement
#
dbaccess syscdr >/dev/null 2>&1 <<!
UNLOAD TO ${Data}
SELECT repname,
p.partstate, p.db, p.owner, p.table, p.selecstmt,
t.partstate, t.db, t.owner, t.table, p.selecstmt
FROM repdef r,
partdef p,
partdef t
WHERE r.repid = p.repid
AND p.repid = t.repid
AND p.partmode = 'P'
AND t.partmode = 'R'!
cat ${Data} |
nawk -v p_grp=${p_group} \\
-v t_grp=${t_group} \\
'BEGIN { FS="|" }
{
printf "cdr define repl -C \\"ignore\\" -S tran -A -R %s \\\\\\n", $1
printf " \\"P %s@g_%s:%s.%s\\" \\"%s\\" \\\\\\n",$3,p_grp,$4,$5,$6
printf " \\"R %s@g_%s:%s.%s\\" \\"%s\\" \\n",$8,t_grp,$9,$10,$11
printf "cdr start repl %s\\n",$1
printf "\\n"
}
' >replsets.ksh
3: Recreate ER (cdr drop and cdr define)
4. Run replsets.ksh to recreate replication.
HTH
Steve Romankiw
Andrea Verni wrote:
> Hi guys,
>
> I'm tyring to set up EDR between two test servers.
>
> Is it possible that I have to make 'oninit -iy' each time I want to
> start with EDR from scratch ?
>
> Exactly... the first time I start with EDR all works perfectly, then I
> delete the replication, delete the server but when I try to re-define
> the remote server with command
>
> cdr define server --connet=remote_server --init --sync=g_local g_remote
>
> I get this error:
>
> Replication already active.
>
> I tried to drop 'syscdr' database but it seams not enough. I saw that
> also sysmaster keeps information about edr so...
>
> what is the correct way to recreate an edr environment WITHOUT
> re-initialize the whole server ?
>
> TIA
--
Steve Romankiw
Chubb / Executive Risk
82 Hopmeadow Street
Simsbury, CT 06070
Steve Romankiw wrote: > > Andrea: > > In our environment, we have 1-way replication, ie, Primary-Target > To reinitialize replication, we: Well, I tried to do succesfully as follow: 1. cdr stop replicate <rep_name> 2. cdr disconnect server <remote> 3. cdr delete server <local> 4. cdr delete server <remote> points 3,4 has been submitted on both server (in case of update anywhere). It works! Thanks. AV