0% found this document useful (0 votes)
212 views4 pages

Recommended Maintenance With Microsoft SQL Server For Microsoft Dynamics GP Databases - Microsoft Dynamics CustomerSource

Uploaded by

BAY THEJACK
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
212 views4 pages

Recommended Maintenance With Microsoft SQL Server For Microsoft Dynamics GP Databases - Microsoft Dynamics CustomerSource

Uploaded by

BAY THEJACK
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

4/26/2019 Recommended Maintenance with Microsoft SQL Server for Microsoft Dynamics GP Databases - Microsoft Dynamics CustomerSource

Welcome User

Microsoft Dynamics GP Search...

Home Support Downloads Learning Community Products

Recommended Maintenance with Send a Question to the


Community

Microsoft SQL Server for Microsoft Can't find a solution yourself? Send a
question to the Community and

Dynamics GP Databases
receive answers from other customers,
partners, MVP's, and Microsoft
employees.
LAST MODIFIED WEDNESDAY, JANUARY 6, 2016

Share Post Forum Question

Escalate your issue to an


Database maintenance helps keep the inner workings of Microsoft SQL Server
Incident
and the Microsoft Dynamics GP databases running at their peak level. We
Existing Dynamics customers on an
recommend that you use the following SQL Server maintenance procedures: active support plan can use the
appropriate phone number or web
links to the left to create a new
Use database consistency check commands managed support incident for
Dynamics 365 Online or on-premises.
Update statistics
Recompile stored procedures
Recommended Articles
We recommend that you perform these maintenance procedures weekly for the DYNAMICS How to Add a Company in
database and all company databases. However, you can vary this frequency based on your Microsoft Management
environment and the activity each database receives. We also recommend that you stagger these Reporter 2012
How-To Articles
maintenance procedures throughout the week to handle lots of data.
How to Configure
Note Before you follow the instructions in this article, make sure that you have a complete backup SharePoint 2007 for
Microsoft Management
copy of the database that you can restore if a problem occurs.
Reporter 2012
How-To Articles
Database consistency check commands
How to Configure
You can run database consistency check (DBCC) commands manually with SQL Server through SQL SharePoint 2010 for
Query Analyzer or SQL Server Management Studio. To do this, follow these steps: Microsoft Management
Reporter 2012
How-To Articles
1. If you use Microsoft SQL Server 2000, click Start, point to Programs, point to Microsoft SQL
Server, and then click Query Analyzer.

Training News
If you use Microsoft SQL Server 2005 or 2008, click Start, point to Programs, point to Microsoft
Making Time for Training
SQL Server 2005 or Microsoft SQL Server 2008, and then click SQL Server Management Training News

Studio. Training Helps Teams


2. In SQL Query Analyzer or SQL Server Management Studio, run one or more of the following Work
Training News
DBCC commands:
Training to Lead: Future
DBCC CHECKCATALOG (DBNAME) Leaders Need to Learn
Training News
When you use this statement, replace DBNAME with the name of your database, such as
DYNAMICS.

https://mbs.microsoft.com/customersource/northamerica/GP/learning/documentation/how-to-articles/MSD_GPRecommendedMaintenanceSQLDataba… 1/4
4/26/2019 Recommended Maintenance with Microsoft SQL Server for Microsoft Dynamics GP Databases - Microsoft Dynamics CustomerSource

Note DBCC CHECKCATALOG is included in DBCC CHECKDB for Microsoft SQL Server 2005 or
later.
DBCC CHECKDB (DBNAME)
When you use this statement, replace DBNAME with the name of your database, such as
DYNAMICS.

You can schedule this command within SQL Server Enterprise Manager or SQL Server
Management Studio so that the maintenance process runs automatically.
DBCC DBREINDEX (TableName)
When you use this statement, replace TableName with the name of the table, such as
GL00100.

The DBCC DBREINDEX command can also be executed manually against all tables at the
same time by using the Reindex.sql script. You can find the Reindex.sql script in the default
path for Microsoft Dynamics GP as C:\Program Files\Microsoft Dynamics\GP\SQL\Utility\0
folder.

You can also schedule this command within SQL Server Enterprise Manager or SQL Server
Management Studio so that the maintenance process runs automatically.

Update Statistics
There are several ways for you to run the update statistics procedure.

You can update statistics by running the UpdatSta.sql script with Microsoft SQL Server by using
SQL Query Analyzer or SQL Server Management Studio. You can find the UpdatSta.sql script in
the default path for Microsoft Dynamics GP as C:\Program Files\Microsoft
Dynamics\GP\SQL\Utility\0 folder.
You can run the update statistics process within Microsoft Dynamics GP. To do this, follow these
steps:
On the File menu, point to Maintenance, and then click SQL.
Select a database from the Database box and product for Product box.
Select all the tables for that database by pressing CTRL+A within the table listing.
Click Update Statistics, and then click Process.

You can configure SQL Server to run the update statistics process automatically within SQL
Server Enterprise Manager or SQL Server Management Studio. To do this, right-click your
database, click Properties, click Options, and then click to select Auto Create Statistics and
Auto Update Statistics.
You can schedule the update statistics process on a recurring basis within Database
Maintenance Plans.

Recompile Stored Procedures


There are several ways for you to recompile stored procedures.

You can recompile stored procedures by running the Recomp.sql script with Microsoft SQL
Server by using SQL Query Analyzer or SQL Server Management Studio. You can find the
Recomp.sql script in the default path for Microsoft Dynamics GP as C:\Program Files\Microsoft
Dynamics\GP\SQL\Utility\0 folder.

https://mbs.microsoft.com/customersource/northamerica/GP/learning/documentation/how-to-articles/MSD_GPRecommendedMaintenanceSQLDataba… 2/4
4/26/2019 Recommended Maintenance with Microsoft SQL Server for Microsoft Dynamics GP Databases - Microsoft Dynamics CustomerSource

You can also recompile stored procedures within Microsoft Dynamics GP. To do this, follow
these steps:
On the File menu, point to Maintenance, and then click SQL.
Select a database from the Database box and product for Product box.
Select all the tables for that database by pressing CTRL+A within the table listing.
Click Recompile, and then click Process.

You can recompile stored procedures by scheduling the sp_recompile procedure by using SQL
Server Agent Jobs. For more information about steps to create a job within SQL Server
Enterprise Manager or SQL Server Management Studio, see SQL Server Books Online. To
download SQL Server Books Online, visit the following Microsoft Web site:
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=765433f7-0983-
4d7a-b628-0a98145bcb97

Note If you receive any consistency or allocation errors when you are running these SQL
maintenance procedures, you must contact Microsoft SQL Server support. This is not included in
the support plan for Microsoft Dynamics GP and it would be an additional cost. Microsoft SQL
Server support can be contacted at 1-800-936-5800.

Database Maintenance Procedure Definitions


The following is a list of definitions of database maintenance procedures. For more information,
see SQL Server Books Online. To download SQL Server Books Online, visit the following Microsoft
Web site:

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=765433f7-0983-
4d7a-b628-0a98145bcb97

DBCC CHECKCATALOG: Examines the consistency in system tables and between system tables.
This command checks data pages and tables in the specified database for errors.

Note DBCC CHECKCATALOG is included in DBCC CHECKDB for Microsoft SQL Server 2005 or
later.
DBCC CHECKDB: Examines the allocation and structural integrity of all the objects in the
specified database.
DBCC DBREINDEX: Rebuilds all indexes. This command will help reduce page splitting and will
improve data modification performance.
Update statistics: Updates the query optimizer with distribution information about key values
of indexes. This enables the query optimizer to make efficient decisions.
Recompile stored procedures: Recompiles the queries and optimizes the triggers used by
stored procedures. This recompile procedure updates database statistics and optimization
information that can become outdated with changes to the database.

REFERENCES

For more information about how to create a database maintenance plan within SQL Server
Management Studio, click the following article number to view the article in the Microsoft
Knowledge Base:

875193 Information about database maintenance plans for Microsoft Dynamics GP or Microsoft
Dynamics SL on Microsoft SQL Server 2000 or on Microsoft SQL Server 2005

https://mbs.microsoft.com/customersource/northamerica/GP/learning/documentation/how-to-articles/MSD_GPRecommendedMaintenanceSQLDataba… 3/4
4/26/2019 Recommended Maintenance with Microsoft SQL Server for Microsoft Dynamics GP Databases - Microsoft Dynamics CustomerSource

For more information about how to use SQL Server Desktop Engine, click the following article
number to view the article in the Microsoft Knowledge Base:

862589 Recommended maintenance for Microsoft SQL Server Desktop Engine (MSDE 2000) or for
Microsoft SQL Server 2005 Express for Microsoft Great Plains databases

APPLIES TO

System Manager, when used with:


Microsoft Dynamics GP 2010
Microsoft Dynamics GP 10.0
Microsoft Dynamics GP 9.0

CustomerSource Our Friends Other Customer Resources


Home Bing Ask a question to the Community

Support Microsoft Store MSDN Developer Center

Downloads Office TechNet

Learning Skype User Groups

Community Surface Marketplace

Products Windows Explore other Business Solutions

Windows Phone

Xbox

North America - English Privacy and Cookies Terms of Use Trademarks © Microsoft 2019

https://mbs.microsoft.com/customersource/northamerica/GP/learning/documentation/how-to-articles/MSD_GPRecommendedMaintenanceSQLDataba… 4/4

You might also like