SQL Server For Teamcenter Best Practices 1.4
SQL Server For Teamcenter Best Practices 1.4
White Paper
A Technical White paper describing Teamcenter’s best
practices for use in a Microsoft SQL DB environment.
Issued by: Siemens PLM Software. © 2019. Siemens Product Lifecycle Management Software Inc. All rights reserved.
Unrestricted
White Paper | Microsoft SQL Server for Teamcenter Best Practices 2
© 2019 Siemens Product Lifecycle Management Software Inc. All Rights Reserved. No
part of this document may be copied, reprinted, or distributed without the written
permission of Siemens Product Lifecycle Management Software Inc. (“Siemens PLM
Software”), except that entities with a Teamcenter Maintenance Agreement in force may
reproduce this document for their internal use only.
Siemens PLM Software Teamcenter and Transforming the process of innovation are trademarks
or registered trademarks of Siemens PLM Software or its subsidiaries in the US and in other
countries. Adobe and Acrobat are either registered trademarks or trademarks of Adobe Systems
Incorporated in the United States and/or other countries. All other trademarks or registered
trademarks belong to their respective holders.
This software and related documentation are proprietary to Siemens PLM Software.
Note: The pages of this document are numbered consecutively 1…N without the usual
Roman numeral numbering of the front matter. This makes the document’s page
numbers consistent with the numbers displayed by the Adobe® Acrobat® viewer and
simplifies printing of page ranges from Acrobat.
For Teamcenter Customer Support, contact the Siemens PLMS Global Technical Access
Center at
800-955-0000 or http://support.ugs.com.
Issued by: Siemens PLM Software. © 2019. Siemens Product Lifecycle Management Software Inc. All rights reserved.
Unrestricted
White Paper | Microsoft SQL Server for Teamcenter Best Practices 3
Disclaimer
This document is intended to provide guidance and best practices for Microsoft SQL Server.
Siemens PLM Software is providing this information as is, without warranty of any kind.
SIEMENS PLM SOFTWARE hereby disclaims and assumes no responsibility or liability
for any results that occur due to the use of the information contained in this document.
Issued by: Siemens PLM Software. © 2019. Siemens Product Lifecycle Management Software Inc. All rights reserved.
Unrestricted
White Paper | Microsoft SQL Server for Teamcenter Best Practices 4
DOCUMENT HISTORY
Contributors
Reviewed By
Issued by: Siemens PLM Software. © 2019. Siemens Product Lifecycle Management Software Inc. All rights reserved.
Unrestricted
White Paper | Microsoft SQL Server for Teamcenter Best Practices 5
Table of Contents
1 INTRODUCTION 7
5.1 OVERVIEW 17
5.2 VM SIZE GUIDANCE 17
5.3 STORAGE GUIDELINES 18
5.4 DISK GUIDANCE 18
5.5 CACHING POLICY 18
5.6 NTFS ALLOCATION SIZE 19
5.7 I/O GUIDANCE 19
Issued by: Siemens PLM Software. © 2019. Siemens Product Lifecycle Management Software Inc. All rights reserved.
Unrestricted
White Paper | Microsoft SQL Server for Teamcenter Best Practices 6
6 ONGOING MANAGEMENT 19
8 KNOWN ISSUES 30
9 CHECKLIST 31
Issued by: Siemens PLM Software. © 2019. Siemens Product Lifecycle Management Software Inc. All rights reserved.
Unrestricted
White Paper | Microsoft SQL Server for Teamcenter Best Practices 7
1 Introduction
Among the strengths of SQL Server as a database platform is the relative simplicity of managing
and tuning the database engine. There are, nevertheless, a range of best practices for managing
SQL Server production deployment and for getting the best performance and reliability from the
platform. Many of these are standard, irrespective of the Teamcenter application, while some
specific guidance is driven by the nature of the Teamcenter database and application.
The following sections discuss a range of best practices and recommended choices for
Teamcenter deployments on SQL Server.
Page 7
White Paper | Microsoft SQL Server for Teamcenter Best Practices 8
Teamcenter 10.1 can run on either the Standard or Enterprise Edition of SQL Server 2008 R2,
SQL Server 2008 R2 SP2, SQL Server 2012 and TC 10.1.5 added support for SQL Server 2014.
Teamcenter 11.1 can run on either the Standard or Enterprise Edition of SQL Server 2012, SQL
Server 2014 and TC 11.3 added support for SQL Server 2016.
Regardless of version and edition, you should always run on the latest SQL Server service pack,
which you can find in the Downloads section of the SQL Server Developer Center. For most
functional aspects of Teamcenter, SQL Server Standard and Enterprise editions are equivalent.
However, the Enterprise Edition of SQL Server includes a variety of higher-end features.
Consult the Microsoft website for a current list of differences for your proposed version of SQL
Server as these features may change with newer releases.
Siemens recommends a high availability strategy based on failover clustering as the preferred
approach. However Microsoft are rapidly replacing clustering with AlwayOn availability groups
using synchronous replication and automatic failover. This method should avoid many of the
failover caused by the standard clustering.
The use of database mirroring (without automatic failover) and log shipping are viable options as
well especially for disaster recovery. However, administrators must be prepared for the need to
manually intervene to redirect Teamcenter to a standby server if the primary server experiences a
failure.
Page 8
White Paper | Microsoft SQL Server for Teamcenter Best Practices 9
There are some specific issues around using Always On and Teamcenter using asynchronous
commit and automatic failover, however there is a project to fully support this feature in
Teamcenter 12. If a customer chooses to use the Always On feature for high availability and
automatic failover it should be configured to utilize a synchronous commits. For a remote
Disaster recovery system, the system should be configured with asynchronous commit for best
performance.
These tempdb best practices can be boiled down to a few key points:
1. Move tempdb from its default location to one or more high-performance, fault-tolerant
disk volumes.
2. If possible and practical given your disk resources, give tempdb files dedicated use of
their disk(s).
3. To minimize auto growth, configure the startup size of tempdb based on your server’s
needs. Frequent auto growth can hurt performance.
4. Create multiple data files for tempdb to reduce contention in the engine’s internal
allocation routines.
Page 9
White Paper | Microsoft SQL Server for Teamcenter Best Practices 10
We’ll review the guidelines around each of these and then provide an example that brings it all
together.
SQL Server must be restarted for this change to take effect. Note that SQL Server creates fresh
copies of tempdb data and log files every time the service starts, so there is no need to move any
files yourself. Just restart the service, and you will see the files in the new location(s) you have
specified.
Two disk volumes available for tempdb Place the tempdb log on one volume. Place all
tempdb data files on the other volume.
More than two disk volumes available for Place the tempdb log alone on one volume.
tempdb Distribute tempdb data files evenly across the
remaining volumes.
Page 10
White Paper | Microsoft SQL Server for Teamcenter Best Practices 11
small auto growths will result in heavily fragmented data files, which hurts tempdb I/O
performance from that time forward.
To avoid these problems, the size of tempdb should be set proactively as appropriate for the
environment. There is no fixed rule for the size of tempdb—it depends on the environment. Two
potential approaches are recommended here. The first is to use an arbitrary rule of thumb, and
the second is to observe your environment in action and derive appropriate sizing. DBAs should
monitor usage over time to see if configuration changes become needed.
The DBA can use the size to which tempdb data and log files have grown as a good indicator of
target size. Adding an additional 20% buffer can help ensure that auto growth is minimized.
Finally, whatever size you choose for tempdb, it is a good idea to leave auto growth enabled on
the database. Minimizing auto growth is a goal, but you want to leave auto growth enabled so
that tempdb does not run out of space in an emergency.
1. Aim for one tempdb data file per processor core available to SQL Server. For systems
with more than 16 CPUs, it is safe to relax this ratio closer to 0.5 files per core but no
more than 8.
2. Ensure that the data files are equally sized. This allows SQL Server’s proportional fill
algorithms to run at their most efficient.
3. The data files need not all be on separate disk volumes. The purpose of this
recommendation is not to split I/O throughput across devices, but to exploit some aspects
of the Database Engine’s internal I/O and allocation algorithms. This is a bit
counterintuitive and differs from the guidance for user databases, but it is intentional.
Page 11
White Paper | Microsoft SQL Server for Teamcenter Best Practices 12
KB 2154845 advises that Trace Flag 1118 can help in some situations. That trace flag
tells SQL Server that it should avoid “mixed extents” and use “full extents”.
This means that each newly allocated object in every database on the instance gets its
own private 64KB of data. Tempdb is usually the place where most objects are created,
so it makes the most difference there.
Trace flag 1117 changes the behavior of file growth: if one data file in a filegroup grows,
it forces other files in that filegroup to ALSO grow. This can be useful for tempdb, which
is commonly configured with multiple data files as KB 2154845 advises.
Implementing this trace flag impacts every database on the instance and not just tempdb.
Some administrators may prefer to pre-grow tempdb files so they fill the tempdb drive,
ensuring to leave room for any “free space monitoring” you have.
Note: Both of these are now defaults for SQL Server 2016, so they will need to be set in earlier
versions. In Server 2016 this is controlled by controlled by SET
MIXED_PAGE_ALLOCATION.
A key indicator that this may be necessary is if the size of the Teamcenter database (actual data
space used) is significantly greater than the amount of RAM on the database server. Over time,
memory pressure may develop. SQL Server will want to continue growing its in-memory data
cache to avoid reading from disk, but the operating system will push back, trying to allocate
memory for itself and other processes. The result can be excessive memory paging and a
negative effect on performance.
Page 12
White Paper | Microsoft SQL Server for Teamcenter Best Practices 13
If your Teamcenter database (data + indexes) is or is expected to be much larger than the total
RAM on the database server, Siemens recommends configuring the min and max server memory
options in SQL Server. Use the recommendations in the following table to select values
appropriate for your environment.
Physical RAM SQL Min Server Memory SQL Max Server Memory
(MB) (MB)
8GB 4,096 5,120 (5GB)
16GB 8,192 12,288 (12GB)
24GB 12,288 18,432 (18GB)
32GB 16,384 25,600 (25GB)
48GB 32,768 39,936 (39GB)
64GB 49,152 56,320 (55GB)
96GB 73,728 88,064 (86GB)
The min/max server memory options can be set in the Server Properties dialog box in SQL
Server Management.
Another option to consider is granting the Lock pages in memory permission to the SQL Server
service account. This permission allows SQL Server to lock its buffer memory and refuse to page
it out in response to requests from the operating system. This can give the Database Engine
additional ability to preserve its caches and maintain performance, especially if other processes
are competing for resources on the server. However, Siemens recommends hosting the
Teamcenter database on a server dedicated to this purpose. If this recommendation is followed,
the importance of the Lock pages in memory permission is lessened. In addition, improvements
in memory management in newer versions of SQL Server and Windows Server make it less
likely that this setting will make a big difference.
Page 13
White Paper | Microsoft SQL Server for Teamcenter Best Practices 14
It is critical that the disk volumes on which you place your database files be fault-tolerant RAID
sets. The ultimate safety of your Teamcenter data depends on the data and log files residing on
redundant physical disk storage. Siemens recommends RAID 10 (also called RAID 1 + 0) for the
data file. RAID 5 is acceptable. For the log file, RAID 10 or RAID 1 is recommended. The log
file should never be placed on a RAID 5 volume because RAID 5 has lower write performance
than the other RAID levels. The following table shows a summary of recommendations for
where to place the Teamcenter database files.
Note that when placing data and log files on separate disk volumes, they should be truly
physically separate. The drive letters on which the files are placed should actually map to distinct
physical disk drive sets. Placement on different partitions/LUNs on a single disk drive set is not
helpful for performance or fault tolerance.
Page 14
White Paper | Microsoft SQL Server for Teamcenter Best Practices 15
If no explicit size is provided, SQL Server creates data and log files based on the size of a special
template database called model. Usually, this is just a few MB in size. As data flows in to the
Teamcenter database, SQL Server automatically extends the data and log files as needed. For
large, heavily used databases, this eventually produces data files that are highly fragmented on
disk. This fragmentation has a negative effect on performance. There is also a small run-time
performance penalty every time a file is extended.
These problems can easily be avoided by sizing files appropriately when the database is created.
The following guidelines are recommended for setting the initial size of database files.
2. Add 50% for small-sized databases (< 100GB). Add 35% for medium-sized databases (>
100GB). Add 25% for larger databases (> 500GB). This is the recommended data file
size.
3. Size the transaction log file at approximately 20% of the data file size.
Automatic file growth should be enabled for the database, even though the initial size ought to be
sufficient for some time. This is simply to avoid a production problem if the data files run out of
space. As a rule, though, file size for the Teamcenter database should be managed proactively.
Siemens recommends configuring data files for 5GB growth increments and log files for 1GB
growth increments. In particular, avoid using large percent-based growth settings on large log
files, because the initialization of new log segments can temporarily block activity on the
database.
If you choose to add additional files to spread I/O across disks, there are a few things to consider.
First, Teamcenter creates all data objects (except optional audit logs) on the PRIMARY
filegroup, so this is the one you will want to map to the new files. Second, SQL Server balances
I/O most effectively when the files used by a filegroup are of equal size. Try to create all the files
that will host the PRIMARY filegroup so that they are the same size.
The Teamcenter database also contains a filegroup called ILOG. In the default database
configuration, ILOG is hosted in its own file. Objects in the ILOG filegroup are created and used
only if Teamcenter audit logging is enabled and configured to log to the database (rather than
Page 15
White Paper | Microsoft SQL Server for Teamcenter Best Practices 16
text files for older versions of Teamcenter). If your deployment is set up to log to the database,
you can expect heavy activity on this file. Therefore, if you use the database for audit logging,
Siemens recommends placing the ILOG data file on a separate disk volume from the main
data file and the transaction log.
Benchmarking with Teamcenter and SQL Server has shown significant performance increases
when data compression is used for the Teamcenter database. Siemens recommends using data
compression if your edition of SQL Server allows it.
• Full recovery model: This is the best model for preventing critical data loss and
restoring data to a specific point in time, and it is generally used by enterprise production
Page 16
White Paper | Microsoft SQL Server for Teamcenter Best Practices 17
• Bulk-logged model: This model is for databases that have critical data, but for which the
DBA wants to minimize storage or performance impact of bulk operations (e.g., bulk data
loads, table copies, index maintenance). It provides nearly the recovery power of the Full
model, but with some limitations.
• Simple recovery model: This model is appropriate if the data backed up is not critical,
data is static or does not change often, or if data loss is not a concern for the organization.
If an active database is lost with the Simple recovery model, the organization loses all
transactions since the last full or last differential backup. This model is typical for test
environments or production databases that are not mission critical or have very light
activity.
In general, Teamcenter databases are frequently updated and hold information that is of high
importance to the organization. Especially for large Teamcenter databases, full backups may not
be feasible with high frequency (e.g., daily or more often). For these reasons, Siemens
recommends using the Full recovery model with Teamcenter databases. Administrators must be
aware of the management implications of the Full and Bulk-logged recovery models. In
particular, under these recovery models, transaction logs must be backed up regularly to prevent
them from filling up or exhausting available disk space.
Page 17
White Paper | Microsoft SQL Server for Teamcenter Best Practices 18
VM configurations are available with constrained core sizes to reduce overall licensing cost. No
matter the specific VM class you choose ensure that it supports the premium storage option.
The OS disk should be used for system files only, the default caching policy on the OS disk is
Read/Write. For performance sensitive applications such as Teamcenter you should install the
database on a data disk.
The Temporary disk is not persistent! Do not store any of your user database files or logs in the
temp disk! It is however possible to store TempDB files on the D drive and may result in higher
throughput and lower TempDB latency. However, there is an exception to this, if your workload
profile on TempDB is very write intensive you can achieve best performance by locating it on
premium SSD storage instead.
Data disks should be used for your data and log files. If you are not using disk striping, use two
premium SSDs with one containing the data and TempDB and the other used for log files. If
additional throughput is required you can add additional data disks and use disk striping. Before
implementing this, you will need to analyze the number of IOPs and bandwidth required for your
log and data files. Be aware that different VM sizes come with different IOP limits.
• If you are using separate disks for data and logs, enable read caching on the disks hosting
your data and TempDB files. This can greatly increase performance, do not however
enable this for the disk holding the log files as it will cause a decrease in performance.
Page 18
White Paper | Microsoft SQL Server for Teamcenter Best Practices 19
• If you are using striping in a single storage pool most workloads will benefit from read
caching. If you have separate storage pools for the log and data files, only enable read
caching for the data files. In certain very write heavy workloads you may achieve better
performance without having caching enable. This can only be determined through testing
however.
6 Ongoing Management
6.1 The Database Backup Plan
Perhaps the single most important ongoing maintenance task for a business-critical database such
as Teamcenter is managing backups. Siemens recommends you carefully plan, document, and
test the backup and recovery strategy for the Teamcenter database.
• Full database backup: Contains all the data in the database, plus enough transaction log
information to allow for recovering that data.
• Differential database backup: Contains all the data changed since the last full backup.
Differential backups allow a smaller, faster backup to be taken, which can later be
combined with the full backup to restore the database to the time of the differential
backup.
Page 19
White Paper | Microsoft SQL Server for Teamcenter Best Practices 20
• Transaction log backup: Contains all the database changes since the last (full or
differential) database or log backup. Periodically backing up the log allows you to restore
the last database backup followed by subsequent log backups to recover to the latest point
in time needed.
• Database file or filegroup backup: Contains only data from specified file(s) or
filegroups(s) to allow quick, piecemeal restores if only part of the database is lost. These
types of backup are not recommended for Teamcenter deployments.
The different types of backup allow you to back up with the frequency appropriate to your
business requirements, even for databases that are very large. For example, a typical backup
strategy for a large database (e.g., several hundred gigabytes) might include a weekly full
backup, nightly differential backups, and transaction log backups every 30 minutes. If the
database were lost, the DBA would:
If properly executed, this would return the database to operation with at most 30 minutes of work
lost.
For small databases, it is perfectly valid to simply perform full backups one or more times per
day. There is nothing inherently wrong with this approach, and it has the virtue of simplicity. But
it is only practical for databases that can be backed up very quickly.
Keep in mind also that for databases with the Full or Bulk-logged recovery model, regular
transaction log backups are required to keep the log from growing out of control.
The right backup strategy is dependent on the database size and level of change activity in your
installation. This can vary greatly, even across deployments of the Teamcenter product, so a one-
size-fits-all recommendation can’t be made here. However, keep the following in mind as you
plan your backup strategy:
• If you choose the Full recovery model, the transaction log can grow very quickly and
should be scheduled for backup at multiple times throughout the day. Performing
multiple backups ensures that the log is truncated frequently and provides for improved
data recoverability.
• If you choose the Simple recovery model, schedule full database backups for at least once
per day. With this method, data recoverability is limited to the last full database backup.
• Database backups should be stored off site when possible and appropriate.
• Back up a database immediately after you make extensive changes or perform non-
logged operations.
Page 20
White Paper | Microsoft SQL Server for Teamcenter Best Practices 21
• Be sure to include regular backups of the master and msdb databases as part of your
overall backup strategy. The master database contains information about the databases on
your system, and the msdb database stores information about scheduled jobs.
• If you are using SQL Server 2008 Enterprise Edition or later, use backup compression to
reduce the size of backups and the time required to take them.
Finally, remember that what you really need in an emergency is a restore, not a backup.
Therefore, plan restore with care, and test restoring your database from actual backups to
validate that you have covered everything.
The Teamcenter database contains references (essentially file pointers) to content in the file
repository. To ensure maximum consistency between the database file references and the actual
content of the file repository, some attention must be paid to backing up both simultaneously.
• Option 2: Take online backups and accept some small potential inconsistency. The
issues with this approach can be minimized if the backups are taken during periods of
low activity.
• Option 3: Use Teamcenter’s hot backup mode. In this mode, Teamcenter suspends
writing files directly to the file repository (they are held in a temporary location called a
Blobby Volume). File backups are taken, and the system is then returned to normal mode.
If a restore is necessary, SQL Server’s point-in-time restore capability can be used to
restore the database to the point in time when the system was placed in hot backup mode.
This will ensure consistency between the database and the file repository.
More information on this advanced topic is available from Siemens. You can talk with your
Siemens support professional, or refer to documentation at the Siemens Teamcenter GTAC
Support Site.
Page 21
White Paper | Microsoft SQL Server for Teamcenter Best Practices 22
not match the logical order of the data (as defined by the index key) or when data pages that
contain the index are dispersed across non-adjacent sections of the disk.
Fragmentation of an index can reduce the speed of data access and result in slower application
performance. It can also cause more disk space to be used than is actually necessary. Index
fragmentation can be corrected by reorganizing or rebuilding the index.
You can tell which indexes, if any, have fragmentation problems by using the
sys.dm_db_physical_stats() system function. This function provides lots of details about the
physical layout of the index. However, the most important result column for tracking
fragmentation is avg_fragmentation_in_percent. This column indicates how fragmented the
index is on disk. A low number means low fragmentation (good); a high number means high
fragmentation (bad). Similar information is also available in the Standard Reports in SQL Server
Management Studio.
Reorganizing an index does not block user access to the index while underway. However,
rebuilding or re-creating the index does prevent user access to the index. The exception to this is
if the ALTER INDEX REBUILD statement is used with the ONLINE = ON option. Note that
online index rebuild requires the Enterprise Edition of SQL Server.
Periodically checking index fragmentation and taking any necessary corrective action is
important to maintaining the performance of your Teamcenter deployment. The rate at which
fragmentation may occur depends on user activity, but as a general rule, Siemens recommends
checking index fragmentation at least monthly.
Note: There is a problem with 11.2.1 fixed in 11.3. POM_M_LOCK has an index REF_UID and
ASPACE_UID, this causes plan problems. So drop index PIPOM_M_LOCK;
Page 22
White Paper | Microsoft SQL Server for Teamcenter Best Practices 23
Siemens also recommends adding additional indexes you may require by using the install
command-line utility provided with Teamcenter. Doing so will register the index as part of the
Teamcenter schema, at which point the index_verifier utility can check for its existence. If you
manually add indexes to the Teamcenter database, index_verifier will have no knowledge of
them, and it will be your responsibility to ensure that those indexes are carried forward and
maintained.
Full documentation of these utilities can be found in the Teamcenter Utilities Reference Manual,
available on the Siemens Teamcenter GTAC Support Site.
It is best to include database integrity checks in a scheduled job that executes DBCC
CHECKDB, or do it with a scheduled Maintenance Plan that includes the Check Database
Integrity task.
If any problems are detected, you can restore from backups (usually the best option) or use one
of the REPAIR options on DBCC CHECKDB.
Space consumed and remaining for the Teamcenter database can easily be checked using the
Standard Reports in SQL Server Management Studio. The Disk Usage report displays the
currently reserved space in data and log files and the amount that is in use. This is also a handy
place to check for any recent data or log file growths. If these are occurring, it could be a sign
that a rearrangement or expansion of data files is necessary.
Page 23
White Paper | Microsoft SQL Server for Teamcenter Best Practices 24
Details on space usage can also be obtained via T-SQL by using the sp_spaceused stored
procedure.
SQL Server Maintenance Plans also provide a neatly packaged way to define and schedule
routine management tasks for a database or for multiple databases.
Siemens recommends making use of these tools to configure automated maintenance and
monitoring tasks for the Teamcenter database.
You can also configure the destination for the trace data, a file or a database table, in the trace
definition. You can use it to:
Page 24
White Paper | Microsoft SQL Server for Teamcenter Best Practices 25
Important Note: SQL Trace and SQL Server Profiler have been marked for deprecation since
SQL Server 2012. SQL Server 2016 includes SQL Server Profiler and SQL Trace, but Microsoft
has declared an intention to remove both tools in a future version of SQL Server. Extended
Events is now the recommended activity tracing tool.
With Extended Events, you can define sophisticated filters on captured data. In addition to using
value filters, you can filter events by sampling and data can be aggregated at the point it is
captured. You can manage Extended Events either through a GUI in SQL Server Management
Studio (SSMS) or by using TransactSQL statements.
Extended Events was introduced in SQL Server 2008; since the deprecation of SQL Trace and
SQL Server Profiler was announced with the release of SQL Server 2012, many features
introduced in SQL Server 2012, 2014 and 2016 can only be traced using Extended Events.
Extended Events replaces SQL Server Profiler and SQL Trace. You can therefore use it to
perform regular monitoring, such as the following:
You can also use Extended Events to collect information that you were not able to monitor with
SQL Trace. You can now:
Although Extended Events is a lightweight logging framework, each active session has an
overhead of CPU and memory resources. You should get into the practice of only running
Extended Events sessions you have created when you have to troubleshoot specific issues.
Page 25
White Paper | Microsoft SQL Server for Teamcenter Best Practices 26
To open Activity Monitor, right-click the server icon in the Object Explorer pane of SQL Server
Management Studio and select the Activity Monitor item. There is also a button for Activity
Monitor on the Standard toolbar in SQL Server Management Studio. The Activity Monitor will
open as a new tab in the main Management Studio window.
The Overview section, at the top, shows summary graphs of four key metrics for getting a sense
of the load on the server. % Processor Time is an average of CPU utilization across all
processors. Waiting Tasks shows the number of tasks waiting on CPU, memory, disk, locks, or
other resources. The Database I/O graph shows overall disk I/O throughput of SQL Server. Batch
Requests/sec shows the number of individual T-SQL batches executed per second (e.g., SQL
statements or stored procedures calls from applications).
The other sections (also called panes) in the Activity Monitor window provide detailed snapshots
about different aspects of the Database Engine’s current workload. A full discussion of these
sections and how to interpret the information provided is well beyond the scope of this paper.
However, a brief introduction to each section is provided here.
The Processes section presents a list of the active user connections to the server. For each
connection, useful troubleshooting information is provided, including the current database the
connection is using, what resource the connection is waiting on (if any), and whether the
connection is blocked by another connection. The Processes section is thus useful for getting an
idea of the number of active connections and what sort of performance roadblocks they may be
experiencing.
The Resource Waits section provides a summary of the “waits” the Database Engine is observing
in current activity. Examples of waits are network I/O for clients to pull results across the wire,
disk I/O for the server to pull data from disk into buffer memory, or lock waits while one
connection waits on a transaction lock held by another connection. Besides the type of wait, this
section shows the cumulative and recent amount of time spent on this type of wait and the
number of connections experiencing it. This information is just a coarse summary of a highly
detailed set of tuning information available from SQL Server wait statistics. It can be quite
useful, though, to get an indication of system bottlenecks at a glance.
The Data File I/O section lists all data and transaction log files in use by databases on the current
SQL Server instance. With each file, recent read and write throughput (in MB/sec) is reported.
The last column in this section is particularly interesting. The Response Time (ms) column
reports disk latency for I/O against the file. This is a good number to look at to begin an
investigation of whether a workload is I/O bound.
Page 26
White Paper | Microsoft SQL Server for Teamcenter Best Practices 27
Finally, the Recent Expensive Queries section lists some of the most expensive queries the
engine has recently executed. Besides the query text, average execution metrics are listed for
each.
SQL Server makes a large number of performance counters available to Performance Monitor to
make it easier for you to monitor SQL Server activity and Windows activity from one place.
Some examples of SQL Server performance counters that are typically used when examining
SQL Server performance are:
Note: In most cases it is expected that you will see page life to be very long, in some cases days
if the system has a large amount of memory. However, you may see drops when various
administrative functions are performed. If you see drops in life expectancy during periods of
high database utilization then that indicates that you need more memory in the system.
Note that if you are using a named instance of SQL Server, the name of the object in
Performance Monitor will be slightly different. For default (not named) instances, the object
name is SQL Server: <object>. For a named instance, the object name is
MSSQL$InstanceName: <object>.
Page 27
White Paper | Microsoft SQL Server for Teamcenter Best Practices 28
There are more than 200 DMOs in SQL Server 2016. DMOs can be found in the sys schema;
their names start with “dm”. They are further divided into other categories based on the kind of
information that they return. Some of the most useful DMO categories that you can use when
performance tuning SQL Server are listed here:
• sys.dm_exec_*. This set of DMVs contains information that relates to the execution of
user queries. They are useful in diagnosing blocking, deadlock, long running queries,
CPU intensive queries, and so on. For example, sys.dm_exec_requests returns
information about currently executing requests.
• sys.dm_os_*. This set of DMVs gives details about SQLOS operations; that is, memory
management and scheduling. For example, sys.dm_os_wait_stats returns aggregate
information about all of the waits that have been incurred on an instance of SQL Server.
The sys.dm_os_schedulers DMV returns one row per scheduler and is used to monitor
the health and condition of the scheduler, or to identify runaway tasks.
• sys.dm_tran_*. This set of DMVs provides details about current transactions and
isolation. For example, the sys.dm_tran_active_transactions DMV returns transaction
details for a SQL Server instance.
• sys.dm_io_*. This set of DMVs provides insight into the I/O activity in SQL Server. For
example, sys.dm_io_pending_io_requests identifies pending I/O requests that SQL
Server has initiated.
• sys.dm_db_*. This set of DMVs provides details about the database and database-level
objects such as tables and indexes. For example, sys.dm_db_index_physical_stats is a
DMF that returns fragmentation information across all indexes in a database or for a
specific index.
For a complete list of DMOs in SQL Server 2016, see the topic Dynamic Management Views
and Functions (TransactSQL) in SQL Server Technical Documentation.
Page 28
White Paper | Microsoft SQL Server for Teamcenter Best Practices 29
7.10 Diskspd
Diskspd is a command line utility, developed by Microsoft, for load generation and performance
testing of storage I/O subsystems. Although Diskspd is not specifically designed for simulating
SQL Server I/O activity, it can be configured to do so. Diskspd replaces SQLIO, an older utility
that had a similar purpose.
Diskspd is suitable for use when performance tuning I/O subsystems because, for a given set of
parameters, the load that is generated will always be the same.
Note: Be aware that gathering the information required to run Live Query Statistics will place
additional load on your SQL Server instance.
Page 29
White Paper | Microsoft SQL Server for Teamcenter Best Practices 30
8 Known Issues
Once the user number reach around 50 to 100 you will see a lot of dead-locks caused by lock
escalation. You have to enable read committed snapshot isolation to avoid this issue.
Once enabled a row version for each transaction is maintained in tempdb. The versions are
maintained until the transaction is complete. A simple select is considered a transaction and
requires a commit to compete it.
The problems come from long running transactions as they build a huge number of rows version
in the tempdb. So, for example IDSM can make a simple select and repeats it without a commit;
the result is a huge number of row versions.
If you sent this as the default for TC it adds between 5 and 10% overhead. So, this should only
be set it for long running processes like IDSM, T4S etc.
Consider setting the index Fill factor to 20% for the POM_M_LOCK, POM_R_LOCK,
PPOM_SESSION, POM_F_LOCK, POM_LOCK, POM_LOCK_LOGGING,
PM_PROCESS_LIST tables. They have a high insert/delete load, which leaves a lot of ghost
records when using snapshot isolation. The Fill factor should make it easier to insert new records
in the indexes without constantly tearing the pages.
Page 30
White Paper | Microsoft SQL Server for Teamcenter Best Practices 31
• If the SQL Server is a new install and a database import the compatibility is at the new
level
ALTER DATABASE
SCOPED CONFIGURATION
SET LEGACY_CARDINALITY_ESTIMATION = ON;
go
9 Checklist
For convenience, the following checklist summarizes and consolidates the best practices
discussed in this paper. After familiarizing yourself with the preceding in-depth discussion, you
can use this as a reminder to cover all the recommended best practices. Use a dedicated database
server and instance.
Page 31
White Paper | Microsoft SQL Server for Teamcenter Best Practices 32
Size and place tempdb per best practices (as described in detail in this document).
Set the maximum server memory for SQL Server per recommendations.
Ensure frequent transaction log backups are scheduled to prevent the log file from growing
out of control.
Plan and implement an effective backup strategy.
Test database restore using live backups.
Be sure to back up the master and msdb databases in addition to the Teamcenter database.
Monitor index fragmentation, and defragment when necessary.
Check database integrity before backups to ensure the data will be good to restore.
Monitor space used.
Use SQL Server Agent jobs and alerts to automate and schedule maintenance and
monitoring.
Run the index_verifier monthly.
Get familiar with SQL Server monitoring tools, and establish a baseline performance
profile for your system.
Page 32
White Paper | Microsoft SQL Server for Teamcenter Best Practices 33
Page 33