Detecting duplicate pages in the broker database

It should never happen, but somehow it occasionally does: duplicate records in your broker database. For example: if you have a deployer for staging and another one for live, but you accidentally point them to the same broker database. When this happens, you might end up with 2 (or more) pages in the broker, with the same publication ID and the same URL.

Do you want to know if this is the case for you? Read on.

In the PAGES table in the broker DB, any combination of a URL and a publication ID should be unique. Unfortunately, there is no constraint to prevent this situation. Tridion relies purely on the assumption that you never point 2 different deployers to the same broker DB.

To find out if this has happened to you, open SQL Server Studio (if you’re on Oracle you can open SQL Developer or something like that) and run the following query on the broker database:

select publication_id, url, count(*) as qty
from Page
group by publication_id, url
having count(*) > 1

This gives you a list of all the duplicates. You can then try to find out which one is correct (in other words: which one corresponds with the correct item in the Tridion Content Manager), and which one is the corruption.

Next step would be to remove the corrupted record. I will blog about that some other time. Just one hint: NEVER delete the record manually. This would lead you to forfeit your right to support.