Help get this topic noticed by sharing it on Twitter, Facebook, or email.

Problem with Loginhistory table

Hi! I am using dbamp to replicate my SF tables. I am unable to get the loginhistory table to replicate or refresh. I am able to query the table through the linked server and pull back the data. However I want to this table to be refreshed daily to my sql instance as my other tables do.

I think the issue with this table is that there is not created date, modified date or sysmodstamp. the only date field is the last login date. Is there a way I can force a daily replication of this table?
1 person has
this question
+1
Reply
  • The salesforce API often struggles with this table, particularly if the sf user is NOT a system admin.

    Can you post the output from the sf_replicate of the table ?
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned

  • thanks for the quick response! here is what was posted to my log table. The table structure is there but no rows in the loginhistory...

    Ending - Operation Successful.
    Rename previous table from LoginHistory_Previous to LoginHistory
    Drop LoginHistory if it exists.
    16:06:50: DBAmpNet2 Operation successful.
    16:06:50: 0 rows copied.
    16:06:27: Parameters: exportsoap LoginHistory_Previous H-GSR-DEV\DEV_GSR_LZ SFDC SFDW
    16:06:27: DBAmpNet2 3.4.9.0 (c) Copyright 2015-2017 forceAmp.com LLC
    Create LoginHistory_Previous with new structure.
    Drop LoginHistory_Previous if it exists.
    Parameters: SFDW LoginHistory Version: V3.4.5
    Ending - Branching to SF_Replicate.
    Table does not contain a timestamp column needed to refresh. Using SF_Replicate to create table.
    Using Schema Error Action of yes
    Parameters: SFDW LoginHistory Yes no Version: V3.4.5
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned

  • Ask your salesforce admin of the user on the security page of the linked server is a system admin. Maybe that user does not have access to that table on salesforce.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned

  • I am sure that the connected user is a sysadmin as the link server I am using for both dbamp and the direct query is under the same account. IF I can get data using a select * from sfdw...loginhistory, but the dbamp sf_refresh\sf_replicate do not load the empty table, then I think there is an issue with the dbamp exe...

    I could always write something myself that handles this however I would rather understand why the standard sprocs are not working in this case.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned

  • There was a bug in that version of DBAmp when replicating the LoginHistory table. Upgrade to the latest version of DBAmp and retry the command: http://forceamp.com/upgrade.htm

    Make sure you follow all of the instructions in the upgrade.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned

  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned

  • Justin, will you please share the actyak bug fix for the LoginHistory object?
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned

  • One of the functions was not operating properly, we corrected this in version 3.5.1. If you upgrade to the latest version of DBAmp, it should have the fix in it.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned

  • Justin,
    thanks for the info ... can you email me (or I you) directly for the changes? We have customized your procedures and would like to include this change.
    Ric Murri
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned

  • We do not provide line by line changes. Also, it is entirely possible that the change was not in a proc but rather code.

    We change the proc code almost every release. If you want to have customized versions, I strongly advise you to "wrap" our proc with your code rather than customize our procs. Otherwise you will have to compare the source of the proc with your customized version and bring your changes forward every time you upgrade.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned

  • Bill, thanks so I have now upgraded (including the procedures) to version 3.5.4 and I get this when running this statement: Exec sfdcprod.dbo.SF_ReplicateLarge 'sfdcprod', 'LoginHistory'

    Select @ENDID_OUT = Id from openquery(sfdcprod,'select Id from Login_QueryAll where Id > ''000000000000000'' order by Id asc limit 1 offset 99999')
    OLE DB provider "DBAmp.DBAmp" for linked server "sfdcprod" returned message "Error 1 : INVALID_TYPE: sObject type 'Login' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.".
    14:16:22: Retry query to determine next Id boundary.
    OLE DB provider "DBAmp.DBAmp" for linked server "sfdcprod" returned message "Error 1 : INVALID_TYPE: sObject type 'Login' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.".
    14:16:23: Retry query to determine next Id boundary.
    OLE DB provider "DBAmp.DBAmp" for linked server "sfdcprod" returned message "Error 1 : INVALID_TYPE: sObject type 'Login' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.".
    14:16:23: Retry query to determine next Id boundary.
    OLE DB provider "DBAmp.DBAmp" for linked server "sfdcprod" returned message "Error 1 : INVALID_TYPE: sObject type 'Login' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.".
    14:16:23: Retry query to determine next Id boundary.
    OLE DB provider "DBAmp.DBAmp" for linked server "sfdcprod" returned message "Error 1 : INVALID_TYPE: sObject type 'Login' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.".
    14:16:23: Query to determine next Id boundary failed after 5 retries.
    --- Ending SF_ReplicateLarge. Operation FAILED.
    Msg 50000, Level 16, State 1, Procedure SF_ReplicateLarge, Line 516
    --- Ending SF_ReplicateLarge. Operation FAILED.

    It appears that the dynamic sql that builds this is incorrectly appending _QueryAll to this statement? If I change it to read the following it works: Select Id from openquery(sfdcprod,'select Id from LoginHistory where Id > ''000000000000000'' order by Id asc limit 1 offset 99999')

    If I decide not to run sf_replicateLarge but instead run sf_ReplicateHistory via the following:
    Exec sfdcprod.dbo.SF_ReplicateHistory 'sfdcprod', 'LoginHistory'
    then I get:
    --- Starting SF_ReplicateHistory for LoginHistory V3.5.4
    14:22:36: Drop LoginHistory_Previous if it exists.
    14:22:36: Create LoginHistory_Previous with new structure.
    OLE DB provider "DBAmp.DBAmp" for linked server "sfdcprod" returned message "Error 1 : INVALID_TYPE: sObject type 'Login' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.".
    14:22:36: Error occurred populating the _Previous table.
    14:22:36: Error: Cannot get the column information from OLE DB provider "DBAmp.DBAmp" for linked server "sfdcprod".
    --- Ending SF_ReplicateHistory. Operation FAILED.

    (1 row(s) affected)
    Msg 50000, Level 16, State 1, Procedure SF_ReplicateHistory, Line 254
    --- Ending SF_ReplicateHistory. Operation FAILED.

    It again seems to not be handling the LoginHistory table quite right?
    thanks I look forward to your response and welcome your ideas.
    Ric Murri
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned

  • SF_ReplicateLarge has been deprecated and should not be used for this table.

    Can you try to run sf_replicate on this table instead and report the result ?
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned

  • Bill, that is good info (there is probably somewhere that you list all of the deprecated items?). It (running sf_replicate to get LoginHistory) worked!
    Do I need to use sf_replicate to keep it up to date? (running sf_refresh yields: "Table does not contain a timestamp column needed to refresh. Using SF_Replicate to create table.")
    Thanks and again I look forward to your response.
    Ric Murri
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned

  • That table cannot be refreshed so you will need to replicate only.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned