SQL Assistant - History window no available

Tools & Utilities
Teradata Employee

SQL Assistant - History window no available

We've installed the "SQL Assistant 13.10.0.05", but when we want to view the history window this is disabled.

Some web sites told us we need to run the AccessDataBaseEngine.exe and we did it, but It didn't work.

Could you help us with this?

Thanks.

1 REPLY

Re: SQL Assistant - History window no available

After SQL Assistant (SQLA) v14.0 is updated, the History from the previous version is not automatically inserted to the SQLA History table created in Version 14.0.  Because of this condition, the following manual work-around can be used, if recovery of the SQLA history is desiredNote:  Your prior SQLA version’s history list has not been lost.  J

  1. Use Windows Explorer to navigate to the directory in which the SQLA History files are located:
    1. This path is/should be [ C:\Users\<UserID>\My Documents\NCR\Queryman ]
      1. Note:  If the two files below are not found in the above path, an alternate path may be:
      2. [ C:\Users\<UserID>\AppData\Roaming\Teradata\SQL Assistant ]
    2. Two SQLA files should be present, which are:
      1. [ queryman.MDB ]   (Old History) and
      2. [ SQLHistory.MDB ] (New/Current History- has been running since the v14.0 upgrade )
    3. Note:  If the extents of files are not observable and you wish to have the extents displayed, go to the appendix of this document, regarding the process to display/hide the extents of files.
  2. Next, begin the setup for importing your Old History into the New/Current History
  3. Verify you are resident in path:  [ C:\Users\<UserID>\My Documents\NCR\Queryman ]
  4. The screen is shown below, as it desirably should appear (contact Quincy Leslie, if it does not)
  5.  
  6. Right click on the Directory window, somewhere below the two .MDB files
  7. Hover over “New” , then slide right and up and click on “Microsoft Access Database”
  8. A new MS Access database should appear with extent “accdb”, as shown below
  9. You may right click on the database/file name and change it, such as to “sqla-transfer.accdb”, etc.
  10.  
  11.  
  12. This new database will be used as a temporary work space.
  13. Open this database (“yourfilename.accdb”) by double-clicking it. 
    1. MS Access is opened and the applications screen below will appear:
  14.  
  15. Links:  The next process will create links to the two History MDB files, which are MS Access tables
  16. Click header tab “External Data”, to obtain screen as per below
  17.  
  18. Click the pink icon labeled “Access”, which brings up the “Get External Data – Access Database” screen
  19. Click the button “Link to the data source by creating a linked table.”
  20. The screen will appear as below:
  21.  
  22. Next link to the two (2) tables, per the files named- See “Create the Links as follows” below:
    1. queryman.MDB   (old history)
    2. SQLHistory.MDB (new/curr history)
    3. Note:  You will not import the databases – just create links.
  23. Create the Links as follows:
    1. Note: linked tables will be noted by a “+” marked before the table name, after linked
  24. Insert the path for the first file name into the “File name:”  field.
    1. Copy this next path inside the brackets and insert this path to “File name:” field
    2.  [ C:\Users\<UserID>\Documents\NCR\Queryman ]
    3.  
  25. Change the <UserID> to your EmplID and click “Browse” and reach the folder Queryman.
  26. Click on file name “queryman.MDB”
  27.  
  28. [ queryman.MDB ] Old History Linking
  29. Single Click on the queryman .MDB file/table (old history) highlighting it, to prepare for linking,
  30. Click on the “Open” button
  31. The “External Data -  Access Data” will pop up again, with the file name appended to the path
  32. See screen shot below.
  33. Ensure that the “Link to…” choice is clicked- see below
  34. Click the “OK” button, which links to the queryman .MDB
  35. The Linked Table panel will appear with “QTHIST” listed (if queryman.MDB was selected)
  36. The link is almost, but not yet, complete
  37. Please scroll further in this document
  38.  
  39. Again, the Link Tables panel will appear with “QTHIST” listed, if queryman.MDB was linked.
  40.  
  41. Left click on the QTHIST item, highlighting it
  42. Click the OK button
  43. The queryman.MDB table/file has now been linked and appears as under Tables (see below)
  44. It is still named QTHIST;
  45. Please rename “QTHIST” to “oldhist”
  46. Rename it by Right-Clicking and selecting “Rename” from the Drop down choices
    1. Type in “oldhist”
  47.  
  48. The renamed table will appear as “oldhist”.
  1.  [ SQLHistory.MDB ] / New History Link
  2. To link to the SQLHistory.MDB table/file (New History), repeat the above process
  3. Select SQLHistory.MDB, instead of queryman.MDB
  4. Please ensure that you click on “Link to…” in the “Get External Data – Access Database” panel
  5. Once you have linked to queryman.MDB, please rename to “newhist”
  6. After both tables are linked, the Access App screen should appear as:
  7.  
  8. Review the content of each table
  9. Please review the content of both tables by double clicking on each table.  Specifically, observe the number of rows in the newhist table, as found in the bottom of the screen:
  10. Make a note of the total records in newhist, before later appending the oldhist records.
  11. The appearance will be:
  12. Display “newhist” table
    1. Note1:  usually the newhist row count will usually only be 20-200 rows
    2. note2:  the newhist high count below is because it is after one of my test runs
  13.  
  14.  
  15.  
  16. End newhist display
  17. Display “oldhist” table rows
  18.  
  19.  
  20. End oldhist display
  21. Preparing for Recovery of Old History
  22. Clear both the table row listings: 
    1. Right Click on either table’s tab, oldhist or newhist
    2. Click on “Close All” from the drop down list (or close one at a time, if desired, via “Close”)
    3. Or---
    4. Click “X” in the upper RH corner, once for each Database name, until both are closed.
    5. If you tweaked the listing of either table, such as widening a column, the message below will appear
    6. The safest choice is to click “No”
    7.  
    8. Both table’s row listings will be dropped
  23. Dropping Links and Re-Linking (optional)
  24. If, for whatever reason before recovery, you wish to drop the links and re-link either or both tables:
    1. Do as follows:
    2. Right Click on the table to be de-linked
    3.  
  25. Right click on desired table name, as listed above
  26. Choose “delete” from the drop down choices (about the middle)
  27.  
  28. Click Yes button to de-link. 
  29. Undo De-Link:  If you de-link inadvertently, you can undo that action by either:
    1. Ctrl-Z or press the Undo logo (blue back-circle logo)
    2. The table will return to a linked state
  30. You can always re-link, when desired (see instructions above in document).
  31. Recovery of Old History
  32. Recovery of the old history is run via SQL implemented with MS Access. 
  33. The SQL is below:
  34. Create a new Query and change to SQL view, as follows:
  35. Click on the “Create” tab on the Access header
  36.  
  37. Click on the “Query Design” icon above
  38. The “Show Table” panel will appear (see next page).
  39. Click on the “Close” button on that panel.
  40.  
  41. After “Close” button is pressed, a Header of tabs with a blank query screen will remain, per below:
    1. The MS Access screen will appear, as in the screen shot below:
      1. The tab “Query Tools” will be in a chosen state
      2. The tab “Query1” (in Peach) will have appeared over the blank panel.
      3. The icon SQL View” will be displayed
  42.  
  43.  
  44. Press the “SQL View” logo (upper LH Corner, under “File” tab) icon and cause the SQL term “SELECT;” to appear and be highlighted.  This means that SELECT; is in a state to be edited. 
  45.  
  46. Please become resident or remain resident in the Word Document and “Copy” the following SQL statement, under the “SQL Statement” heading on the next page (Ctrl-C, Copy, etc.) and within/between  the row of equal signs “====….”
    1. (SQL is two pages down)
  47. After you copy the SQL, return to the MS Access screen and insert the SQL via “Right Click” and choose “Paste” from the choices.
  48. If you already inserted some SQL, the following screen will appear.  Note that “SQL View” will have been replaced by the “View” icon.  In that state, you can use Ctrl-V or Right-click, choose Paste to insert the SQL.
  49.  
  50. After the insertion of SQL, the screen should appear as follows:
  51.  


  1. SQL Statement (to copy and paste)

--=============================

INSERT INTO newhist (

EndDate, Source, Elapsed, RowCnt, ErrCd, Msg, Notes,

[SQL],

StmtCnt, StmtType, SQLType,

[User],

 DBSTime, FetchTime, Seq

 )

SELECT

[RUNDATE]+[RUNTIME] AS Expr4,

oldhist.ODBCDRV,

Format([ELTIME],"hh:nn:ss"".000""") AS Expr5,

oldhist.MAXROWS,

0 AS Expr1,

oldhist.SQLMESSAGE,

oldhist.SQLNOTES,

oldhist.SQLSTRING,

0 AS Expr2,

' ' AS Expr3,

oldhist.SQLTYPE,

oldhist.ODBCUSER,

Format([DBMSTIME],"  hh:nn:ss"".000""") AS Expr6,

Format([FETCHTIME],"  hh:nn:ss"".000""") AS Expr7,

[QTCOUNTER]-(SELECT MIN(QTCOUNTER) FROM oldhist )

+1+(SELECT MAX(Seq) FROM oldhist ) AS Expr8 

FROM oldhist;

--=================

  1. Note:  not totally “pretty” formatted, but can just copy as is.
  1. This SQL is utilized “as is”, if you already have entries in the new History file. If your new History file is still empty, remove the text +(SELECT MAX(Seq) FROM oldhist )  from the SQL.
  2. See Perform SQL Run below to execute the Query and the entries from the Old History file will be appended to the New History. You can then delete the Temporary database, after success is verified.

Perform SQL Run (about to append old history to new history)

Click on the “! Run” icon as in the screen below .  The “Enter Parameter Value”, “Seq” panel will come up.  Enter the number of records + “1” found in the “newhist” table into the Seq field.  This will cause the Surrogate Sequential number for the records appended to newhist, to start at the current number of records in newhist + “1”.  E.g., if newhist contains 100 records, then the first Sequential number of the records appended will be “101”.

Enter the newhist number of records + 1.  Click OK.  The SQL will run.

Validate SQL Run:   The SQL may either run or fail with an error message.  However, if there is no error message, it will not report back when complete.  Wait 5-10 seconds and observe the content of newhist

Verify Content of “newhist” table link:    After running the SQL, open the newhist table and all of both the old and new entries should be present.  The number of records should equal the total of the oldhist records + the newhist records, that existed before running the SQL.

This ends the process to recover the Old History of SQL Assistant, by merging to the current history.

Verify the SQL History under SQL Assistant

If SQL Assistant is open, then close it.  In any event, open/re-open SQL Assistant.  It may require 10-15 seconds, as the updated history is accessed.  Prior to your logging into one of the Teradata servers, the updated history will appear, e.g. as shown below:

This is the End of Recovering SQL Assistant History Instructions