Hi guys,
our SQL-Server drives me crazy. One day everything works fine and next day - no changes were made - everything slows down - ok not everything, but esp. looking at the item ledger entry.
We are using SQL 2005, navision.exe 4.0SP2 (Version 4.0.2.22611)
Our database has a size of round about 50 GB.
The Perfmon show that the the buffer cache hit ratio goes down to 80% (my NSC told me, that it should normaly be at 98-99%)
Then the latch waits/sec goes up from 0-2 to 25-50. Is this normal?
What I'm also interested in, is the question, why the server only use 2 GB RAM (there are still 5 GB available) that means, why doesn't use it more RAM for caching?
Thanks for help
René
0
Comments
It might be because of SQL Server expanding the files, or because you run some kind of script that reindexes or something like that.
RIS Plus, LLC
http://www.microsoft.com/sql/prodinfo/features/compare-features.mspx
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Is it possible, that I have to activate the higher memory (AWE option) or does the sql server do this by his own?
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
At the moment I'm updating the statistics. I saw that the SQL-server-agent stopped his job 3 days ago and did not update the table-statistics. Maybe this will help.
I had a client : Monday all ok, Tuesday too, but from Wednesday until Friday it went worse by the day to be ok on Monday. I did only a SQL-statistic in the WE. From that moment, I did it all days and all worked well.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Freelance Dynamics AX
Blog : http://axnmaia.wordpress.com/
I was also much surprised that SQL suffers so much performance-problems if you don't update SQL statistics enough. I thought once a week was enough.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
The problem occured during the day again although updating statistics and indexes.
What I did at last is shut down the SQL-Server and started it again. From that point everything works fine (up to now) :P
I think it is a microsoft problem and I'm waiting for the next servicepack. :?
Freelance Dynamics AX
Blog : http://axnmaia.wordpress.com/
Are there other "features" in that build?
I also didn't realize that not updating the stats would have such an impact.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Build 23099 (Update 03 for Dynamics-NAV 4.0 SP2) has two modes for a security structure...one is "Standard" and the other is "Enhanced". As you've already read the white paper, I will not get into details, but the Standard security is a much needed answer to the synchronization issues that clients have encountered in the past. The Standard security model is probably just the same security model that was used in versions prior to 4.0, and worked great.
When you install Update 03, it re-creates all of the SIFT tables in the database. This hints at possible optimizations/data corrections to the existing data, as it is a very extensive update. Sadly, Microsoft does not give a "change log" with the update that states specifically what was fixed. I'm sure that this exists, but I have never found it through any of my contacts.
I would highly recommend that you upgrade to Dynamics-NAV 4.0 SP2 Update 03 (Build 23099) as there are known issues with SQL Server 2005 and all versions prior to this update. Some Dynamics-NAV functions are broken prior to build 23099, and can cause you to have some extremely strange results.
As for your performance issues, do you have detailed specifications on your environment? The first place to start is with hardware (RAID arrays, et cetera), and from there look into the database configuration. Are you optimizing indexes constantly? Are you filling/padding any indexes? Was auto grow enabled in your database? Do you have fragmentation within the database, and is it extent fragmentation or logical fragmentation?
You could run the following command (change the company name to the proper company in your database) and post the results into this thread to try to determine why the Item Ledger Entry table is slowing down...
After restarting a server and opening a table, remember, that there will be a "pause" as the SQL Server starts buffering the indexes within the database for large tables. This is sometimes called the "warm-up" phase, but after this has occurred, the database should perform acceptably with this happening rarely.
Anyways, feel free to message me directly if you have any specific questions (or post in this thread of course
Vice President, Deployment Operations
Symbiant Technologies, Inc.
http://www.symbiantsolutions.com
I would like to run the Updat Statistics everynight but it runs for about 18 hours (no kidding).
When I create the Maintenance Plan and add the "Update Statistics Task" I get a change to select the Database (no problem there
A) All Existing Statistics
C) Index Statistics Only
Can I choose B or C to speed up the task (my guess is that C is the only one Navision uses, but I'm not sure) or must I choose A (which then takes about 18 hours)
...
Everybody on-line.
...
Looking good!
I think there are a couple of ways to address your problem...I'll put my 2 cents in and then I'm sure that someone else will want to as well.
*NOTE: My Server is these examples is SYMBIANTISV and the database that I am working in is "nTier Architecture Services (4_0 SP2 Update 03)"
The way that I would address this issue would be to create a "maintenance table". This table would be basically similar to the following:
In this table, you would populate the tables that you would like to have the statistics updated, and when they should update the statistics. After you have populated this (if a table did not exist in this list, then it would not be processed). The group is a number that you assign the tables to, so that you can then choose (based upon a job setup) on how to optimize the tables.
Let's say that we want Group 1 to update every Monday, Wednesday, and Friday. We want Group 2 to update every Tuesday and Thursday. We also want all tables to be updated on Saturday night. We need to do two things to accomplish this. We need to create a stored procedure that handles the update, and then create jobs that call this stored procedures with parameters. The stored procedure could look something like this:
Now that I have the base code done, I would go ahead and add a job that executes on Monday, Wendesday, and Friday...and it would look as follows:
My table setup (just added a couple of records for this example) would look as follows:
Table_Name: CRONUS USA, Inc_$XBRL Schema
Statistic_Update_Group: 1
Table_Name: CRONUS USA, Inc_$XBRL Linkbase
Statistic_Update_Group: 1
Table_Name: CRONUS USA, Inc_$XBRL Taxonomy
Statistic_Update_Group: 2
After I execute the job...I get the following:
This gives you complete flexibility so that you can schedule the updating of statistics in a group. This means that you do not "shortcut" the process and you do the entire update. This is the way that we have setup some of our other customers, and how we manage large installations that have large databases (by doing backups in filegroups).
Dynamics-NAV does not do a statistics update...when you "optimize" the tables, it is actually issuing a command similar to the following: The statistics are used by the query optimizer to compute execution plans within the server. Since Dynamics-NAV does not manage this, there is a possibility that any and all statistics could be used in one statement to optimize a SQL Query. We always recommend to do all existing statistics, but have not experimented with the FULLSCAN option.
I hope all of this information helps...there are many other ways to address this solution.
In fact, you could probably use the new PowerShell that Microsoft released today to automate this entire procedure from a command line
Thanks!
- Scott
Vice President, Deployment Operations
Symbiant Technologies, Inc.
http://www.symbiantsolutions.com
I'm going to try to accomplish this for our database.
One thing I forgot to mention it has 30+ companies in it
...
Everybody on-line.
...
Looking good!
30+ Companies...not a problem!
Create 30 groups and schedule certain groups to run every day/every other day. Since Dynamics-NAV creates seperate tables for companies, you just need to modify the Update_Statistics table so that it has the proper information.
- Scott
Vice President, Deployment Operations
Symbiant Technologies, Inc.
http://www.symbiantsolutions.com
It also checks the SIFT-tables and deletes records in which all decimal fields are 0.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
It still uses the same syntax for the SIFT indexes as well. The SIFT triggers are always updated via the triggers established on the table...if a record is deleted the SIFT value is not deleted, but an UPDATE is called to update the record (it never removes it as you have stated). The reason for this is because a DELETE statement is much more "costly" then an update statement. The "optimization" looks for all records in which a zero value is present at the end of the optimization of the index.
When you reindex/optimize a table, the following occurs:
1.) The transaction level is set to SERIALIZABLE: 2.) The index is found using the following statement: 3.) The index on the table (such as Cust. Ledger Entry) is optimized with the following: 4.) The SIFT indexes are computed by the client, and then the following commands are issued: 5.) The "zero filled" values are deleted from the table: 6.) The optimization is committed to the database:
As you can see, you could easily reproduce this with a script that would do exactly the same as what the Dynamics-NAV client does...it's not that much more then what I generalized before...
Remember...sometimes you may _not_ want to delete the 0 values in the SIFT tables. If you have a table that has heavy inserts which result in heavy inserts into the SIFT table, you could be degrading performance. UPDATE transactions are always faster then that of the INSERT (as the index pointer does not need to be updated...just the data pages) and DELETE transactions. There may be some situation in which you do not want the SIFT table values that are zero to be deleted. You would need to research this thoroughly before making that decision though...
Thanks for pointing out my generalization...hopefully this will give insight as to what really happens when an optimization occurs within Dynamics-NAV...I was just trying to keep it simple in my previous post...
Thanks!
- Scott
Vice President, Deployment Operations
Symbiant Technologies, Inc.
http://www.symbiantsolutions.com
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
You may also want to try SP3.
And Scott, thanks for that very useful info.
(yes, I'm writing this in the name of my colleague GoMaD
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog