Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: The support homepage carousel is not displaying. We are working toward a resolution.

Get DML counts from Transaction Logs

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
David_Fergen
Former Employee
Former Employee

Get DML counts from Transaction Logs

Last Update:

Sep 15, 2020 3:45:17 PM

Updated By:

David_Fergen

Created date:

Sep 15, 2020 3:45:17 PM

Instructions on how to get DML counts from Transaction logs:

  1. --  Form the Online Log 
  2. -- Make sure to replace the schema and table name.:
select Operation,count(*) from  

fn_dblog(null,null)  

where Operation in ('LOP_INSERT_ROWS','LOP_MODIFY_ROW','LOP_DELETE_ROWS') 

and [PartitionId] = (select p.partition_id from sys.sysobjects s, sys.system_internals_partitions p 

where p.object_id = s.id and SCHEMA_NAME(uid) = N'DBO' and name = N'EMPLOYEE' 

) group by Operation; 

 

            3.-- Form a backup 

            4.-- Make sure to replace the schema, table name, and the name of the backup:

select Operation,count(*) from  

sys.fn_dump_dblog ('', NULL,NULL, 1, 

'D:\Temp\TLOGBackups\ReplicateSource\ReplicateSource_backup_2018_09_28_153559_0392869.trn', 

NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, 

NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, 

NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, 

NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL) 

where Operation in ('LOP_INSERT_ROWS','LOP_MODIFY_ROW','LOP_DELETE_ROWS') 

and [PartitionId] = (select p.partition_id from sys.sysobjects s, sys.system_internals_partitions p 

where p.object_id = s.id and SCHEMA_NAME(uid) = N'DBO' and name = N'EMPLOYEE' 

) group by Operation; 
Labels (1)
Contributors
Version history
Last update:
‎2020-09-15 03:45 PM
Updated by: