Today I had to migrate an old wss 3.0 site to Sql 2012 R2.

Made backup of the old DB and transfered it to the new server. Then restored it and tried.

STSADM –o addcontentdb –url http://ssps001:7242 -databasename _wss_content_old -databaseserver SDBA001

But if failed and upgrade.log at (C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions12LOGS) stated:

[SPManager]
[ERROR] [12/22/2013 8:33:39 PM]: Upgrade [SPContentDatabase Name=WSS_CONTENT_OLD
Parent=SPDatabaseServiceInstance] failed.
[SPManager] [ERROR] [12/22/2013 8:33:39 PM]: Invalid object
name ‘dbo.trace_xe_action_map’.

So with a little bit of searching I found that out I have to create a synonym in the context to the database:

use
[WSS_CONTENT_DATABASE]
go
CREATE SYNONYM [dbo].[trace_xe_action_map]
FOR [sys].[trace_xe_action_map];
CREATE SYNONYM [dbo].[trace_xe_event_map]
FOR [sys].[trace_xe_event_map];
go
And after this it worked and database got attached succesfully.