Topic
  • 3 replies
  • Latest Post - ‏2014-03-07T14:23:06Z by tomliotta
10AR_Massimiliano_Calvi
2 Posts

Pinned topic STRSQL command Exit without saving session

‏2014-03-03T12:20:35Z |

A customer was using the standard STRSQL command and exited after use. When he exited  chose option 2=Exit without saving session, instead of option 1=Save and exit session. Now we have lost all his cumulative SQL history. Do you know if is possible to restore something from last STRSQL backup?

  • tomliotta
    tomliotta
    41 Posts
    ACCEPTED ANSWER

    Re: STRSQL command Exit without saving session

    ‏2014-03-07T14:23:06Z  

    ThankYou very much for the answer, the problem is that the user has lost the entire history of the sql statements. You know where STRSQL command backup this logs and how to retrieve logs?

    AFAIK, if the history isn't explicitly saved, it's gone. It isn't "backed up".

    When saved during normal exit from STRSQL, it's saved in an internal MI object associated with the *USRPRF. If the same user accesses STRSQL from two devices at the same time and saves both histories, the two histories are saved in two MI objects identified by *USRPRF name and *DEVD name. It then becomes necessary for the user to signon to the matching device in order to access the matching history.

    But when a history isn't saved, the MI objects are either emptied or deleted. There is no "backup" created by the STRSQL process; there is just what is saved upon exit..

    I periodically tell STRSQL to save histories in a source file member in order to have history copies available.

    There is a slim possibility that a full restore of the system library that holds the MI objects could recover the objects. There is no way, however, to request that only those objects be restored. So, if it worked, it would unfortunately restore every other MI object in the library since there is no way to omit those. Without knowing the effects of doing that, it can't be recommended.

    IMO, the history should be considered to be lost.

    At one time, IBM could supply a procedure that helped to manipulate the objects. E.g., if multiple histories existed for a given user, you could select which one should be kept as "the history". I haven't seen it for a number of years. And it wouldn't "restore" lost histories. But if anything can be done at all, it will almost certainly require help through IBM Support at the least.

    Tom

  • krmilligan
    krmilligan
    450 Posts

    Re: STRSQL command Exit without saving session

    ‏2014-03-03T22:46:43Z  

    If the customer used the STRSQL session to create SQL objects, then they can use System i Navigator to find the objects and then use the Generate SQL task to have DB2 build the SQL source from the DB2 Catalog.

  • 10AR_Massimiliano_Calvi
    2 Posts

    Re: STRSQL command Exit without saving session

    ‏2014-03-07T12:15:14Z  

    ThankYou very much for the answer, the problem is that the user has lost the entire history of the sql statements. You know where STRSQL command backup this logs and how to retrieve logs?

  • tomliotta
    tomliotta
    41 Posts

    Re: STRSQL command Exit without saving session

    ‏2014-03-07T14:23:06Z  

    ThankYou very much for the answer, the problem is that the user has lost the entire history of the sql statements. You know where STRSQL command backup this logs and how to retrieve logs?

    AFAIK, if the history isn't explicitly saved, it's gone. It isn't "backed up".

    When saved during normal exit from STRSQL, it's saved in an internal MI object associated with the *USRPRF. If the same user accesses STRSQL from two devices at the same time and saves both histories, the two histories are saved in two MI objects identified by *USRPRF name and *DEVD name. It then becomes necessary for the user to signon to the matching device in order to access the matching history.

    But when a history isn't saved, the MI objects are either emptied or deleted. There is no "backup" created by the STRSQL process; there is just what is saved upon exit..

    I periodically tell STRSQL to save histories in a source file member in order to have history copies available.

    There is a slim possibility that a full restore of the system library that holds the MI objects could recover the objects. There is no way, however, to request that only those objects be restored. So, if it worked, it would unfortunately restore every other MI object in the library since there is no way to omit those. Without knowing the effects of doing that, it can't be recommended.

    IMO, the history should be considered to be lost.

    At one time, IBM could supply a procedure that helped to manipulate the objects. E.g., if multiple histories existed for a given user, you could select which one should be kept as "the history". I haven't seen it for a number of years. And it wouldn't "restore" lost histories. But if anything can be done at all, it will almost certainly require help through IBM Support at the least.

    Tom