search cancel

Upload Replication : Bulk copy failed

book

Article ID: 32001

calendar_today

Updated On:

Products

CA Client Automation - Asset Management CA Client Automation - IT Client Manager CA Client Automation

Issue/Introduction

During execution of Upload Replication job following error appears :

Upload - Replication Job Done. Warning: though the job was completed, an error occurred: Bulk copy failed for table: inv_generalinventory_item. Please examine the log file for more details

 

 

 

Similar error could occurs on tables inv_generalinventory_tree and ca_discovered_software :

 

Upload - Replication Job Done. Warning: though the job was completed, an error occurred: Bulk copy failed for table: inv_generalinventory_tree. Please examine the log file for more details

 

Upload - Replication Job Done. Warning: though the job was completed, an error occurred: Bulk copy failed for table: ca_discovered_software. Please examine the log file for more details

 

 

Environment

Release: 12.9, 14.0

 

Cause

Engine is using SQL bulk copy method for replication of tables inv_generalinventory_item, inv_generalinventory_tree and ca_discovered_software.

In order to do the bulk copy, 3 tables are created on the Enterprise database :
ca_itrm.bulk_<domainid>_<engineid>_item
ca_itrm.bulk_<domainid>_<engineid>_tree
ca_itrm.bulk_<domainid>_<engineid>_software
 
 
<domainid> : it is the domainid of DOMAIN (column domain_id of table ca_n_tier)
<engineid> : it is the engine ID of Engine (column unit_id of table ca_agent)

 

Example :

 

If user ca_itrm had temporary the sysadmin privileges on Enterprise database, the bulk tables could have been created with dbo schema.

In this case same bulk tables could appear with dbo and ca_itrm schema.

Example :

 

These duplicates tables could cause an error during Upload Replication.

 

 

Resolution

1- On Enterprise database, open Microsoft SQL Server Management Studio.
Go under Security - Logins.
Right click on ca_itrm and select properties.
Make sure that sysadmin is not checked in Server Roles

 

2- Do a backup of Enterprise mdb database 

 

3- Delete the bulk_* tables with dbo owner on Enterprise mdb database :
 
dbo.bulk_<domainid>_<engineid>_tree
dbo.bulk_<domainid>_<engineid>_item
dbo.bulk_<domainid>_<engineid>_software

 

Remark :

dbo.bulk_* tables could also be dropped by using this SQL Script on Enterprise mdb :

DECLARE @tblname NVARCHAR(64)
DECLARE @sql VARCHAR(400)
  
DECLARE Result_Cursor CURSOR for
SELECT o.name 
FROM sysobjects o, sysusers u WHERE o.xtype='U' and o.name like 'bulk_%' and o.uid=u.uid
and u.name ='dbo'
 
OPEN Result_Cursor
FETCH NEXT FROM Result_Cursor INTO @tblname
WHILE @@FETCH_STATUS = 0
BEGIN
  
  SET @sql='DROP TABLE dbo.' + @tblname
  EXEC (@sql)
  
FETCH NEXT FROM Result_Cursor INTO @tblname
END
CLOSE Result_Cursor
DEALLOCATE Result_Cursor

Attachments