Tuesday, September 2, 2014

Optimizing Performance of Logos.NET SQL Server Database


I was recently tasked with making a quick review of setup and high level recommendations for the setup of a MS SQL Server based application with a client.  The following contains several generic points for any MS SQL Server based application, but is specifically appropriate for New World Systems Logos.NET application.


In many implementations of Logos.NET, there are multiple databases on the Live or Production server.  All these databases will use the same tempdb.  Microsoft best practices[1] indicate that tempdb should be associated with a number of data files equal to the number of cores on the machine.  Though this recommendation is out of date[2] (being accurate for SQL Server 2000), it remains accurate for machines up to 8 cores. 
The Logos.NET database server under my review was running on 2 quad-core processors with 64 GB of RAM and the Tempdb was associated with one data file (~1GB Init size, 10% growth) and one log file (~147MB Init size, 10% growth). 
In order to optimize performance, tempdb should be altered to have eight 1GB data files associated to it.  If this is not attainable due to disk space constraints, four 1GB data files will still provide improved performance.  It is important that the data files be the same size, as there is an existing issue with the algorithm which causes auto-grow to only grow a single file and create an I/O hotspot.  The size and number of the data files, in either case, should be sufficient to prevent the need for auto-growth, which can also have short-term negative performance implications.  Therefore, it is not sufficient to have the data files be significantly smaller with room to auto-grow.
Logos.NET relies heavily on stored procedures for the overwhelming majority of its functionality.  These stored procedures, in turn, rely heavily on temporary tables which, in turn, rely on tempdb.  Due to the large number of databases sharing the single tempdb (by design) and a single data file (against best practice recommendations), performance is likely to degrade during times of heavy use.


The parallelism was set at 5 at the time of my review, but 5 is generally too low for all except pure OLTP (which Logos.NET is not, due to clients heavy use of reporting in the application).  50 is a good initial setting and then monitor and adjust from there.[3]
Max Degree of Parallelism
Whatever the optimal setting for this, it is almost certainly not 0 (likely to cause thrashing if many queries running at once) or 1 (hurt performance of any big queries as no parallelism).  Need to load test, but best recommendations is start with 4 and adjust.[4]


Max Server Memory
Best practice would be 80% of available.  The machine under consideration had 64 GB available, and assuming 8GB for Windows I would recommend setting at 56GB.

Friday, November 22, 2013

There's a Math library for OneNote and Word!

I use OneNote as my virtual notepad.  I love being able to have my notes in whatever type of office doc, pdf, etc. sync'd and available in my SkyDrive.

I recently had an issue with math notes that caused Mathematica1 font to display as a unknown character (small rectangle which is the default character when an app cannot find the font) as seen in here. 

I resolved the font issue by using Mathematica1Mono instead (bottom of graphic), however the beneficial positive outcome of this issue lies in my stumbling upon a Math library for OneNote and Word 2013 in my search for a resolution.

(There is also a 2010 version) with these wonderful features:
  • Compute standard mathematical functions, such as roots and logarithms.
  • Compute trigonometric functions, such as sine and cosine.
  • Find derivatives and integrals, limits, and sums and products of series.
  • Perform matrix operations, such as inverses, addition, and multiplication.
  • Perform operations on complex numbers.
  • Plot 2-D graphs in Cartesian and polar coordinates.
  • Plot 3-D graphs in Cartesian, cylindrical, and spherical coordinates.
  • Solve equations and inequalities.
  • Calculate statistical functions, such as mode and variance, on lists of numbers.
  • Factor polynomials or integers.
  • Simplify or expand algebraic expressions.

Friday, November 15, 2013

A new version of .NET or Data Quality Services was installed on this machine. In order to continue to work with DQS please run 'DqsInstaller.exe -upgrade'

I recently tried to use Data Quality Services 2012 and as a result of my having applied service packs / Cumulative updates / hotfixes, etc. to my dev box, I got this error on launch of DQS:
A new version of .NET or Data Quality Services was installed on this machine. In order to continue to work with DQS please run 'DqsInstaller.exe -upgrade'.

That would be fine, if it actually worked like that.  Unfortunately, even after running this and being told I need to restart, restarting, running it again and restarting again, when I launch DQS, I got the new and improved message:

A new version of .NET or Data Quality Services was installed on this machine. In order to continue to work with DQS please run 'DqsInstaller.exe -upgrade'.
OK...I thought I had better try getting some help on the dqsinstaller and see if that leads to anything...

dqsinstaller.exe /?

Microsoft (R) DQS Installer Command Line Tool
Copyright (c) 2012 Microsoft. All rights reserved.

[11/15/2013 11:37:52 AM] DQS Installer started. Installation log will be
written to C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Log\DQS_install.log

[11/15/2013 11:37:52 AM] Parsing DqsInstaller command line arguments.
usage DqsInstaller.exe [-install | -uninstall | -upgrade |-upgradedlls | -exportkbs | -importkbs] [] [-collation] |[-instance] 'instance name'

-install   - Install Data Quality Services in the provided instance. (Default)
-uninstall - Uninstall Data Quality Services from the provided instance.
-upgrade  - Upgrade Data Quality Services for the provided instance, to current version.
-upgradedlls - Install Data Quality Services while skipping recreating the DQS databases and only upgrade DQS DLLs.
-exportkbs - Export all server knowledgebases.
-importkbs - Import knowledgebases file to server.
-collation - The collation of DB catalogs to install. The collation should be case insensitive.
 - The .dqsb filename used to import/export server backup data.
-instance - Specify the SQL Server instance name that this installer will run against.
-? - Show this usage message.

When catalog collation is not specified the default collation being used is SQL_Latin1_General_CP1_CI_AS.

List of Windows and SQL Server collations can be found at http://msdn.microsoft.com/en-us/library/ff848763.aspx

Press any key to continue...

And this sounded like it might fit the bill:

dqsinstaller.exe -upgradedlls
Wallah, all fixed!  Hope this helps if you have a similar issue.
Heads up - you will need to be a member of the fixed server admin role on the SQL Server instance where the Data Quality Database is installed.

Tuesday, June 5, 2012

Oracle BI Repository Identity Manager shows no users

Q:  When in the Oracle Business Intelligence (OBIEE) Administration Tool (Online) and I open the Identity Manager (Manage->Identity), I select BI Repository and though the roles exist, I see no users.  How can I see them?

A: Select Action from the toolbar, then in the textbox for Specify Wildchar filter to fetch users, use an asterisk.

Friday, March 27, 2009

ORA-01034 and ORA-27101 on WIndows machines

Subtitle: Overthinking the problem

Every site on the net which references these two errors:


ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist

seems to suggest that they are symptoms of either the ORACLE_SID not being set correctly or the ORACLE_HOME not being set correctly. Beyond that, they recommend checking the alert log to see if, possibly, there is some more serious problem with the database.I recently encountered these errors on a database whose windows service had started successfully. On a server with the ORACLE_SID and ORACLE_HOME set correctly; with an alert log which had no errors.

I have a simple solution to these two errors which does not involve any of these recommended approaches.

Check to ensure the database is started ;-$ FML