0% found this document useful (0 votes)
35 views

Tech Note 921 - Optimizing SQL Server For Large Galaxy Migration

This document provides tips for optimizing SQL Server configuration to support large-scale galaxy migrations in ArchestrA System Platform 2012. Key recommendations include: 1. Removing restrictions on the transaction log size to prevent errors from logs filling up. 2. Configuring exclusions for anti-virus software to avoid scanning temporary files. 3. Optimizing SQL Server settings like memory usage and index fill factor. 4. Adjusting database file sizes and growth settings for galaxy databases and system databases to reduce fragmentation.

Uploaded by

profilemail8
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

Tech Note 921 - Optimizing SQL Server For Large Galaxy Migration

This document provides tips for optimizing SQL Server configuration to support large-scale galaxy migrations in ArchestrA System Platform 2012. Key recommendations include: 1. Removing restrictions on the transaction log size to prevent errors from logs filling up. 2. Configuring exclusions for anti-virus software to avoid scanning temporary files. 3. Optimizing SQL Server settings like memory usage and index fill factor. 4. Adjusting database file sizes and growth settings for galaxy databases and system databases to reduce fragmentation.

Uploaded by

profilemail8
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Optimizing SQL Server for Large Galaxy Migration

Tech Note 921


Optimizing SQL Server for Large Galaxy Migration

All Tech Notes, Tech Alerts and KBCD documents and software are provided "as is" without warranty of any kind. See the Terms of Use for more information.

Topic#: 002735
Created: February 2013

Introduction
This Tech Note provides tips and configuration recommendations to migrate a large Galaxy in the context of ArchestrA System Platform
2012 (ASP 2012). The information is intended to mitigate potential problems, such as using the default SQL Server settings for the
migration.

For example, you might see the following logger errors when migrating a large Galaxy:

WWCdi Error 80040E14: Description 'Warning: The join order has been enforced because a local join hint is used'

Error 80040E2F: Description 'Violation of PRIMARY KEY constraint. Cannot insert duplicate key in object'

Application Versions
ArchestrA System Platform 2012 and later (Application Server version 3.5 and later)

Important! Before making any configuration changes, be sure you have backed up your Galaxy, Log (SMC Log) and Registry files.

Optimization Tasks
The following tasks are recommended to ensure your migration is successful:

Change Transaction Log Restrictions

Configure Anti-Virus Exclusions

Optimize SQL Server General Settings

Optimize SQL Server for Galaxy Databases

Monitor and Re-adjust the DB Size

Note: The content in this Tech Note was included as general guidelines in the Application Server Readme.html as a workaround
procedure for handling unexpected and misleading errors that appear in the logger while migrating large Galaxies. In that scenario, the
transaction log for the Galaxy database reached its maximum allocated size.

file:///C|/inetpub/wwwroot/t002735/t002735.htm[6/18/2013 10:49:51 AM]


Optimizing SQL Server for Large Galaxy Migration

Change Transaction Log Restrictions


The following steps show how to remove restrictions on the size of the galaxy database transaction log:

Scan windows events (in the Event Viewer) for evidence that the transaction log is in fact full.

If you confirm that the transaction log has exceeded the size restrictions, do the following to remove the restriction:

1. In the SQL Server Management Studio, right click the Galaxy database, then click Properties.

2. In the Database Properties dialog box, locate Log ... in the File Type column, then click the Ellipsis (...) button in the
Autogrowth column.

3. In the Change Autogrowth for Base_Application_Server_log dialog box, click the Unrestricted File Growth option under the
Maximum File Size parameter.

4. Click OK.

5. Complete the Galaxy migration, then repeat these steps to reinstate a file size ceiling on the transaction log.

Configure Anti-Virus Exclusions


If possible, uninstall the Anti-virus software from the Galaxy nodes.

If this is not possible, ensure the Anti-virus software is enabled as described in the ASP2012 Readme file.

• Ensure the Exclusion list includes the Windows Temp files. The following instructions show how to configure the exclusions in McAfee
VirusScan:

1. Using McAfee, open the VirusScan Console and click Task/On-Access Scanner Properties/All Processes.

2. Click the Exclusions tab, then the Exclusions button.

3. Click Add.

4. Add the C:\Windows\Temp\ directory (Figure 1 below).

file:///C|/inetpub/wwwroot/t002735/t002735.htm[6/18/2013 10:49:51 AM]


Optimizing SQL Server for Large Galaxy Migration

Figure 1: Add Windows Temp Directory

Optimize SQL Server General Settings

SQL Server Memory Setting


The SQL Server installation sets the RAM utilization to a very large number (2 Terabytes) by default. When this is the case, SQL Server
might give memory back to a process if requested, but may just as easily consume the memory without releasing it.

Wonderware Technical Support recommends setting a smaller maximum memory value for SQL Server. Application Server should
have a configured SQL Server memory setting of approximately 65% of the current physical RAM.

For example, if the current hardware configuration is a 16-core machine with 48 GB RAM, the SQL Server maximum memory would
be 32768 MB (65% of the 48 GB).

file:///C|/inetpub/wwwroot/t002735/t002735.htm[6/18/2013 10:49:51 AM]


Optimizing SQL Server for Large Galaxy Migration

Figure 2: MaXimum Memory Setting for SQL Server

General SQL Server Database Settings


Change the Default index fill factor from 0 to 90.

file:///C|/inetpub/wwwroot/t002735/t002735.htm[6/18/2013 10:49:51 AM]


Optimizing SQL Server for Large Galaxy Migration

Figure 3: Default IndeX Fill Factor

SQL Server Optimizations for System Databases

For the Master DB

Verify the configuration of the database files by clicking the Master DB and clicking Properties, then Files.

Figure 4: Master and Log File DB Settings

Modify the database files to minimize fragmentation by doing the following:

Change the initial file size to 100 MB for both the database and the transaction logs.
file:///C|/inetpub/wwwroot/t002735/t002735.htm[6/18/2013 10:49:51 AM]
Optimizing SQL Server for Large Galaxy Migration

Set the Autogrowth parameters to a percentage value.

Increase the file growth to a fixed size such as 200MB.

For example if you have a database that is 50MB original size, enabling the file growth by 10% grows the database file by
increments of 5MB each time. At 400MB, you then have the database file partitioned many times. When you enable the database
growth by size, your database file is partitioned only 4 times.

For the tempdb

Do the following for the tempdb:

Figure 5: TempDB File SiZe and AutogrowtH Settings

Set the recovery mode to Simple.

(Optional) move the tempDB path to a different physical hard disk.

USE MASTER
GO
ALTER DATABASE TEMPDB
MODIFY FILE (NAME = tempdev, FILENAME = 'D:TempDBtempdb.mdf')
GO
ALTER DATABASE tempdb
MODIFY FILE (NAME = templog, FILENAME = 'D:TempDBtemplog.ldf')
GO

Optimize SQL Server for Galaxy Databases


file:///C|/inetpub/wwwroot/t002735/t002735.htm[6/18/2013 10:49:51 AM]
Optimizing SQL Server for Large Galaxy Migration
Configure the settings for your Galaxy database (for example: CCP1DCS)

Configure the initial size to 500MB for both MDF and LDF.

(Optionally) Configure the growth to 500MB for both MDF and LDF. This helps reduce fragmentation.

Ensure the recovery mode is set to Simple.

Stop and restart SQL Server.

Adjust the Proxy Polling Rate


The following setting determines how often to refresh the IDE Galaxy Tree.

We do not recommend changing this value unless a big operation is going to occur, such as importing thousands of objects or migrating
your Galaxy. Reset the rate to the original value when those operations are finished. This ensures the correct States will be displayed in
the Galaxy Tree View when you perform future operations.

Change the ProxyPollingRate in the registry to 10 seconds:

Figure 6: Set ProXyPollingRate to 10 Seconds

Windows Registry Editor Version 5.00

file:///C|/inetpub/wwwroot/t002735/t002735.htm[6/18/2013 10:49:51 AM]


Optimizing SQL Server for Large Galaxy Migration
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ArchestrA\Framework]
"ProxyPollingRate"=dword:00002710 (10000)

Reset it to the default value:

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ArchestrA\Framework]
"ProxyPollingRate"=dword:000001f4 (500)

Change Restrictions on the Transaction Log Size


If you have confirmed that the transaction log has exceeded the size restrictions, do the following to remove the restriction:

1. From SQL Server Management Studio, right-click your Galaxy DB and click Properties.

2. Click Files, then click on the Log database file to change the restrictions.

Figure 7: CHange Restricted File GrowtH Setting

3. Select unrestricted file growth.

file:///C|/inetpub/wwwroot/t002735/t002735.htm[6/18/2013 10:49:51 AM]


Optimizing SQL Server for Large Galaxy Migration

Figure 8: Unrestricted File GrowtH

Monitor and Re-adjust the DB Size


You need to monitor database and transaction log over time and adjust again.

To Monitor your DB Size

Use Perfmon Alerts to monitor the database size and the Transaction log. If either reaches a certain threshold, you can send an
"alert" email.

To Re-adjust your DB

You can choose to just shrink the transaction log file individually by right-clicking the Galaxy DB, and clicking Tasks/Shrink/Files.

You can also re-adjust the growth parameters.

file:///C|/inetpub/wwwroot/t002735/t002735.htm[6/18/2013 10:49:51 AM]


Optimizing SQL Server for Large Galaxy Migration

References
Monitoring Log File Growth using PerfMon

http://sqlserverpedia.com/blog/sql-server-bloggers/monitoring-log-file-growth-using-perfmon/

http://bradcorbin.net/2009/09/monitoring-log-file-growth-using-perfmon/

Integrating Profiler and PerfMon Log Files

http://www.sqlteam.com/article/integrating-profiler-and-perfmon-log-files

Note: After the Galaxy migration is finished, follow the same procedure to reestablish a ceiling on the transaction log. In other words,
reset it to what it was before the migration was initiated.

M. AbouELsoud

Tech Notes are published occasionally by Wonderware Technical Support. Publisher: Invensys Systems, Inc., 26561 Rancho Parkway South, Lake Forest, CA 92630. There is also
technical information on our software products at Wonderware Technical Support.

For technical support questions, send an e-mail to [email protected].

Back to top

©2013 Invensys Systems, Inc. All rights reserved. No part of the material protected by this copyright may be reproduced or utilized in any form or by any means, electronic or
mechanical, including photocopying, recording, broadcasting, or by anyinformation storage and retrieval system, without permission in writing from Invensys Systems, Inc.
Terms of Use.

file:///C|/inetpub/wwwroot/t002735/t002735.htm[6/18/2013 10:49:51 AM]

You might also like