Monday, March 2, 2009

FAQs – February 2009

New Environment Variable

The ads.ini file can be used to set several Advantage properties such as aliases, server type, communication type etc…. When an Advantage application starts it first looks in the directory where the exe is run from then in the Windows directory. In most cases this is sufficient, however, Windows Vista does not allow users to modify directories under Program Files.

Advantage will now ( version and use an environment variable called ADS_PATH as a search path to the ads.ini file. This will override the default exe directory then Windows directory then search path mechanism. For more information you can read this knowledgebase article.

ARC SQL Debugging

One of the new features in ARC 9.x is the SQL debugger. This is a very useful for writing and testing SQL scripts. As an additional feature of the debugger you can right-click on a stored procedure and select Debug. This will bring up the SQL window populated with an Execute Procedure command and the parameter names. Simply fill in the parameter values and run the script, the SQL stored procedure will execute and stop at the breakpoints you have set.

After you have debugged the SQL procedure once using this method the EXECUTE command is saved so the next time you select Debug from the context menu the same debug script, with the parameter values, will be opened. This is very convenient since you do not have to go back and determine valid parameter values each time you wish to debug the script.

However, if the procedure parameters change you will have to manually change the script since it is cached. Once the change is made it will be saved and the new SQL will be used for executing the procedure. These cached scripts can be found in My Documents\Advantage Data Architect\DebugDriverScripts and are named <connectionname>.debug.<procedurename>.sql. Deleting this file will force ARC to regenerate the script.

Are Deleted Records Backed Up by Advantage Online Backup

With DBF files the deleted records are always backed up. There is a setting for DBF tables named ShowDeleted which will display records marked for deletion. This setting is not used during backups but it is used when exporting DBFs from ARC, see this KB Item.  Backups of Advantage tables (ADT) never include deleted records.

When a backup is restored a re-index is performed to ensure that it is current. Any records marked for deletion in a DBF file will be restored, but still marked as deleted. A restore of an ADT file will not include any deleted records.

Slow Index Open After Abnormal Server Shutdown

If the Advantage Server is shut down abnormally, (i.e power failure, service hang or user end process) a recovery process is initiated when the server is started again. Any transactions that were in progress when the service was stopped are rolled back restoring the data to the state it was in before the transaction was started. With Advantage 8 and newer indexes are also checked for corruption when they are first opened after an abnormal shutdown.

If the index is corrupted the Advantage server will re-index the file when possible. This causes the initial open of the table to be delayed until the re-index is completed. This re-index is only applied if index caching is enabled, which is the default. You can disable index caching by setting the MAX_CACHE_MEMORY configuration value to 0. However, this can reduce performance of Advantage so we recommend using the default cache settings.

No comments: