Вы находитесь на странице: 1из 3

Primavera KnowledgeBase

Page 1 of 3

Solution ID: prim49750 How to gather statistics on a SQL database Status: Reviewed Version(s): 4.0, 4.1, 5.0, 6.0, 6.1 Problem:How to gather statistics on a SQL database Problem:How can I update the statistics on my SQL database? Problem:Loading Data hangs at 98% Problem:Performance issues in SQL Server Problem:Opening projects is slow Problem:PM.exe not responding after entering username and password Problem:Project Management window disappears after loading data Problem:Cannot login to PM, no error Fix: Fix, Part A: Run the following queries to re-gather stats for the DB: Log into the PMDB as the 'sa' user For MSDE: From a DOS command prompt, log into the MSDE database with the following: osql -U sa -P prima -S localhost\primavera -d pmdb$primavera Then enter each line at the prompt and hit enter: 1>update statistics project with fullscan ,all 2>update statistics task with fullscan ,all 3>go For Microsoft SQL Express:

Log into the Microsoft SQL Management Studio Express as the "sa" user.

http://knowledgebase.primavera.com/eserver/esupport/consumer/solutionview.asp?id=prim49750

1/20/2009

Primavera KnowledgeBase

Page 2 of 3

Select your Primavera Database in the Object Explorer Window.

Click "New Query" , add the following query into the new query window and click "Execute".

In the "Messages" Window you should see "Command completed successfully". Fix, Part B: Re-gather stats for all Primavera tables by running the following stored procedure. For MSDE: log into OSQL as above if needed and run the following: 1>exec sp_updatestats 2>go

http://knowledgebase.primavera.com/eserver/esupport/consumer/solutionview.asp?id=prim49750

1/20/2009

Primavera KnowledgeBase
For Microsoft SQL Express:

Page 3 of 3

Follow the login steps in "Fix, Part A" and In the query Window add the following query "exec sp_updatestats". In the Messages window you will see what has been updated. At the end of the Message you should see "Statistics for all tables have been updated." These steps apply for Microsoft SQL Server 2000 & 2005 as well.

Note: These statistics settings in MSDE are usually on by default, you can run the following to make sure the setting that updates statistics is enabled: Log into OSQL as above if needed and run the following: 1>exec sp_dboption '<my database>', ' auto update statistics', 'true' 2>go **Statistics will only be updated by Auto Update when SQL Server thinks it needs to be done (which is typically when 20% of the rows have changed)

http://knowledgebase.primavera.com/eserver/esupport/consumer/solutionview.asp?id=prim49750

1/20/2009

Вам также может понравиться