Removing CDR
Posted in 2014
Topics: High Availability & Replication, Jobs, Consulting & Announcements
11.50.FC8 I have two servers that replicate between each other. I recently did a restore of one of these severs to a third server. My objective is to define a third er server on this machine and have three way replication between these servers. The issue I am facing is that I need to first remove the existing CDR database and all its associated baggage (cdr delete tables in all databases) on the server that I just restored . However I cannot even get ER to start. cdr start complains ER is already active and cdr stop says its not active. All this is I presume the result of the restore etc. Any quick way to drop the syscdr database without just dropping it and combing thru all the databases looking for cdr_delete tables that would also need to be cleaned up ? I tried cdr delete server xxx -force but get the same "er is not active" error. I will be re-doing the restore again so if there is way to do this more cleanly I surely will appreciate it. Thanks, Mark
Hi,
We do this regularly as follows:
Bring up the database with oninit -D so that replication is bypassed.
Drop the syscdr database.
Rebuild sysmaster by running $INFORMIXDIR/etc/buildsmi.
Restart the engine.
Then you can rebuild the replication as needed.
I hope this helps.
Pam
________________________________________
From: ids-bounces@iiug.org [ids-bounces@iiug.org] On Behalf Of MARK JALKIEWICZ
[mark.jalkiewicz@verizon.net]
Sent: Thursday, March 06, 2014 5:11 PM
To: ids@iiug.org
Subject: Removing CDR [32675]
11.50.FC8
I have two servers that replicate between each other. I recently did a restore
of one of these severs to a third server. My objective is to define a third er
server on this machine and have three way replication between these servers.
The issue I am facing is that I need to first remove the existing CDR database
and all its associated baggage (cdr delete tables in all databases) on the
server that I just restored . However I cannot even get ER to start. cdr start
complains ER is already active and cdr stop says its not active. All this is I
presume the result of the restore etc. Any quick way to drop the syscdr
database without just dropping it and combing thru all the databases looking
for cdr_delete tables that would also need to be cleaned up ? I tried cdr
delete server xxx -force but get the same "er is not active" error.
I will be re-doing the restore again so if there is way to do this more
cleanly I surely will appreciate it.
Thanks,
Mark
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.
I was once told by support that you don't need to rebuild sysmaster if you
are not using update anywhere, even if you are then a restart after dropping
syscdr is just as good
Cheers
Paul
> -----Original Message-----
> From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of
> Ekstrand, Pamela A. -ND
> Sent: Thursday, March 06, 2014 4:38 PM
> To: ids@iiug.org
> Subject: RE: Removing CDR [32676]
>
> Hi,
>
> We do this regularly as follows:
>
> Bring up the database with oninit -D so that replication is bypassed.
> Drop the syscdr database.
> Rebuild sysmaster by running $INFORMIXDIR/etc/buildsmi.
> Restart the engine.
>
> Then you can rebuild the replication as needed.
>
> I hope this helps.
>
> Pam
> ________________________________________
> From: ids-bounces@iiug.org [ids-bounces@iiug.org] On Behalf Of MARK
> JALKIEWICZ
> [mark.jalkiewicz@verizon.net]
> Sent: Thursday, March 06, 2014 5:11 PM
> To: ids@iiug.org
> Subject: Removing CDR [32675]
>
> 11.50.FC8
>
> I have two servers that replicate between each other. I recently did a
restore
> of one of these severs to a third server. My objective is to define a
third er
> server on this machine and have three way replication between these
> servers.
>
> The issue I am facing is that I need to first remove the existing CDR
database
> and all its associated baggage (cdr delete tables in all databases) on the
> server that I just restored . However I cannot even get ER to start. cdr
start
> complains ER is already active and cdr stop says its not active. All this
is I
> presume the result of the restore etc. Any quick way to drop the syscdr
> database without just dropping it and combing thru all the databases
looking
> for cdr_delete tables that would also need to be cleaned up ? I tried cdr
> delete server xxx -force but get the same "er is not active" error.
>
> I will be re-doing the restore again so if there is way to do this more
> cleanly I surely will appreciate it.
>
> Thanks,
>
> Mark
>
>
> **********************************************************
> *********************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
> **********************************************************
> *********************
> Forum Note: Use "Reply" to post a response in the discussion forum.
Have you tried bringing up your engine with
oninit -D
And then drop the syscdr database and then remove all the cdr del tables?
-----Original Message-----
From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of MARK
JALKIEWICZ
Sent: Thursday, March 06, 2014 4:12 PM
To: ids@iiug.org
Subject: Removing CDR [32675]
11.50.FC8
I have two servers that replicate between each other. I recently did a restore
of one of these severs to a third server. My objective is to define a third er
server on this machine and have three way replication between these servers.
The issue I am facing is that I need to first remove the existing CDR database
and all its associated baggage (cdr delete tables in all databases) on the
server that I just restored . However I cannot even get ER to start. cdr start
complains ER is already active and cdr stop says its not active. All this is I
presume the result of the restore etc. Any quick way to drop the syscdr
database without just dropping it and combing thru all the databases looking
for cdr_delete tables that would also need to be cleaned up ? I tried cdr
delete server xxx -force but get the same "er is not active" error.
I will be re-doing the restore again so if there is way to do this more
cleanly I surely will appreciate it.
Thanks,
Mark
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.
my colleague wrote this that works on 11.5
#
# EMERGENCY kill of replication by direct deletions of tables, database and
views.
# to be run as user informix - 9.40 version.
# this is necessary sometimes when image has been restored to foreign host and
replication
# database is also restored but has wrong host and other params
# this is the SHELL version
if [ `whoami` != "informix" ]
then
echo " Please run this script as informix user"
exit 1
fi
# open sysmaster database and get databases to file db1
echo "select name from sysdatabases" | dbaccess sysmaster > /tmp/db1
2>/dev/null
# cat /tmp/db1
# get table names from each database (make command file db2, ouput in db3)
echo "scanning databases for cdr_deltab tables"
awk '
BEGIN { OFS=""; FS=" "; }
/name/ {
print ("echo DATABASE " , $2);
print ("echo \\\\"select tabname from systables\\\\" | dbaccess ", $2, "
2>/dev/null" );
} ' /tmp/db1 > /tmp/db2 2>/dev/null
. /tmp/db2 > /tmp/db3
# cat /tmp/db2
# finally ! create drop commands for each cdrdeltab table
echo "Dropping cdr_deltab tables"
awk '
BEGIN { OFS=""; FS=" "; }
/DATABASE/ {
db=$2;
}
/cdr_deltab/ {
print ("echo \\\\"DB ", db, " Dropping Table ", $2 "\\\\"");
print ("echo \\\\"drop table ", $2 ,"\\\\" | dbaccess ", db, " 2>/dev/null" );
} ' /tmp/db3 > /tmp/db2
# cat /tmp/db2
. /tmp/db2
# Now drop the cdr extra tables and views;
echo "Cleaning out sysmaster replication tables"
echo " drop view syscdrgrp" | dbaccess sysmaster 2>/dev/null
echo " drop view syscdrserver" | dbaccess sysmaster 2>/dev/null
echo " drop view syscdrerror" | dbaccess sysmaster 2>/dev/null
echo " drop view syscdrgrppart" | dbaccess sysmaster 2>/dev/null
echo " drop view syscdrrepl" | dbaccess sysmaster 2>/dev/null
echo " drop view syscdrpart" | dbaccess sysmaster 2>/dev/null
echo " drop view syscdrqueued" | dbaccess sysmaster 2>/dev/null
echo " drop view syscdrtxproc" | dbaccess sysmaster 2>/dev/null
echo "delete from syscdrack_buf where 1=1" | dbaccess sysmaster 2>/dev/null
echo "delete from syscdrack_txn where 1=1" | dbaccess sysmaster 2>/dev/null
echo "delete from syscdrctrl_buf where 1=1" | dbaccess sysmaster 2>/dev/null
echo "delete from syscdrctrl_txn where 1=1" | dbaccess sysmaster 2>/dev/null
echo "delete from syscdrprog where 1=1" | dbaccess sysmaster 2>/dev/null
echo "delete from syscdrq where 1=1" | dbaccess sysmaster 2>/dev/null
echo "delete from syscdrrecv_buf where 1=1" | dbaccess sysmaster 2>/dev/null
echo "delete from syscdrrecv_txn where 1=1" | dbaccess sysmaster 2>/dev/null
echo "delete from syscdrs where 1=1" | dbaccess sysmaster 2>/dev/null
echo "delete from syscdrsend_buf where 1=1" | dbaccess sysmaster 2>/dev/null
echo "delete from syscdrsend_txn where 1=1" | dbaccess sysmaster 2>/dev/null
echo "delete from syscdrsync_buf where 1=1" | dbaccess sysmaster 2>/dev/null
echo "delete from syscdrsync_txn where 1=1" | dbaccess sysmaster 2>/dev/null
echo "delete from syscdrtx where 1=1" | dbaccess sysmaster 2>/dev/null
#echo "Dropping syscdr"
#echo "drop database syscdr" | dbaccess sysmaster 2>/dev/null
rm /tmp/db1
rm /tmp/db2
rm /tmp/db3
echo "clean up is done !!"
/home/informix/replication [informix wldbp654 dbp654_ecms_live]