Easy way to find DBAMP Errors from the Log (sf_replicate, sf_refresh, sf_replicateAll, sf_refreshAll Errors)

Typically sf_replicateAll, sf_refreshAll procedures log all activities in DBAmp_Log table on the same database. Now the challenge is… I see about 1200 records in the table for each execution of sf_refreshAll! It takes long to find the actual error!

Simple SQL Script is created to find all errors in last 7 days; This helps me to find the error quickly…

SQL Query:

-- 1. Find all the tables which are impacted and errors using below query
-- Find all errors in DBAMP Log for last 1 week -- Refresh
-- NOTE: Run the query on the database where DBAMP is installed

select Log2.* from DBAmp_Log Log1
join DBAmp_Log Log2 on Log2.SPName=Log1.SPName and datepart(dd, Log1.Logtime ) = datepart(dd, Log2.Logtime )
where Log1.Status  not in  ('Successful', 'Message', 'Starting') --= 'Failed'
and Log1.Logtime > dateadd(dd,-7,getdate())
order by Log2.LogTime desc 


This entry was posted in knowledge, Script, SQL, SQL Query and tagged , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s