Tuesday, February 24, 2009

quiescing a replication system

to do this you will need to first suspend all the log transactions do this by

isql -S server_rep -U repadmin -P password

admin health
go

this well show false of quiese is not right
next run
suspend log transfer from all
go
then run
admin quiesce_force_rsi
go
then run
admin quiesce_check
go

this should now say the server is quiesce
I would recomed doing this 2 to 3 times more before restoring the log transfer as sometime it does not work.

Monday, February 9, 2009

Truncation log is filling up and its to do with replication what should I do?

Firstly run login to the box
/opt/sybase/TEST/dba/scripts : isql -S servername -Usa -P password1

1> sp_who
2> go

0 1063 recv sleep pwsys pwsys ln2p3310ap 0 ITS_FF_logins AWAITING COMMAND 0
0 1064 recv sleep jupiter_fft jupiter_fft IBLONPSP32 0 ImagineFFProd AWAITING COMMAND 0
0 1074 recv sleep herrnd herrnd 0 ImagineFFProd AWAITING COMMAND 0
0 1075 recv sleep pwsys pwsys ln2p3310ap 0 ITS_FF_logins AWAITING COMMAND 0
0 1091 recv sleep Pmccartm Pmccartm iblongsw22 0 ImagineFFProd AWAITING COMMAND 0
0 1100 recv sleep otc_book otc_book ln7p3371ap 0 MOP AWAITING COMMAND 0
0 1120 recv sleep pwsys pwsys ln2p3310ap 0 EOY_ITS_FF_logins AWAITING COMMAND 0
0 1122 sleeping sysadmin sysadmin 0 master LOG SUSPEND


after that do a select * from syslogshold
1> use master
2> go
1> select * from syslogshold
2> go
dbid reserved spid page xactid masterxactid starttime name xloid
------ ----------- ------ ----------- -------------- -------------- -------------------------- ------------------------------------------------------------------- -----------
12 0 0 102007 0x000000000000 0x000000000000 Feb 10 2009 3:13AM $replication_truncation_point 0
11 0 0 293304 0x000000000000 0x000000000000 Feb 10 2009 3:06AM $replication_truncation_point 0
10 0 0 374671 0x000000000000 0x000000000000 Feb 10 2009 3:13AM $replication_truncation_point 0
9 0 0 102145 0x000000000000 0x000000000000 Feb 10 2009 3:09AM $replication_truncation_point 0
8 0 0 565203 0x000000000000 0x000000000000 Feb 10 2009 3:14AM $replication_truncation_point 0
7 0 0 5465069 0x000000000000 0x000000000000 Feb 10 2009 3:09AM $replication_truncation_point 0
6 0 0 4154341 0x000000000000 0x000000000000 Feb 10 2009 3:06AM $replication_truncation_point 0
5 0 315 2219491 0xe3dd21000100 0x000000000000 Feb 10 2009 3:14AM $dmpxact 630
5 0 0 2279742 0x000000000000 0x000000000000 Feb 10 2009 2:03AM $replication_truncation_point 0
31516 0 12 9571 0x632500000a00 0x000000000000 Feb 10 2009 3:14AM $audit_xact 24

you will see alot of replication_trncations_point you will find that you wont beable to truncated the log, best thing to do is ask the apps team if you can kill the spid causing the troubles and break replications

when trying to truncate you will receve this error
dump tran database with truncate_only
2> go
DUMP TRANSACTION for database 'database' could not truncate the log. Either extend the log using ALTER DATABASE ... LOG ON command or eliminate the oldest active transaction in database 'database' shown in syslogshold table.


Breaking replication

dbcc settrun(ltm, ignore)
go
sp_stop_repagent(database)
go

this should now start to clear the tranlog you can now run a dump tran database with truncate_only
dump tran database with truncate_only
go


you will now need to do a resync

exec sp_addalias replogin, dbo
go
dbcc settrunc (ltm,ignore)

on warmstand by run

exec RSSD_DB..rs_zeroltm Primaryserver,DATABASE
copy over the database load it and the resume connections
log in to primary
dbcc settrunc (ltm,valid)
go
sp_start_repagent (database)
go

log in to repserver
resume connection to STANDBYDS.DATABASE
and so on