10.07.2015 Views

Best Practices for Running Dassault Systèmes ENOVIA ... - Microsoft

Best Practices for Running Dassault Systèmes ENOVIA ... - Microsoft

Best Practices for Running Dassault Systèmes ENOVIA ... - Microsoft

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

DisclaimerThis document is provided "as-is." In<strong>for</strong>mation and views expressed in this document, including URL andother Internet Web site references, may change without notice. You bear the risk of using it.Some examples are <strong>for</strong> illustration only and are fictitious. No real association is intended or inferred.This document does not provide you with any legal rights to any intellectual property in any <strong>Microsoft</strong>product. You may copy and use this document <strong>for</strong> your internal, reference purposes.2


Table of ContentsOVERVIEW ............................................................................................................................................... 5<strong>ENOVIA</strong> V6 ARCHITECTURE ............................................................................................................................. 5BEST PRACTICES FOR RUNNING <strong>ENOVIA</strong> ON SQL SERVER 2008 ................................................................ 6PLANNING AND INSTALLING THE SQL SERVER 2008 INSTANCE ................................................................................ 6Use a Dedicated Database Server and SQL Instance ............................................................................. 6Selecting the Appropriate SQL Server 2008 Edition ............................................................................... 6Select Which Features to Install ........................................................................................................... 10Set the Service Account <strong>for</strong> SQL Server ................................................................................................ 11Set the Server Collation During Installation ......................................................................................... 13Choose the Security Mode ................................................................................................................... 16Decide Which Services to Auto-Start .................................................................................................... 17TEMPDB BEST PRACTICES ............................................................................................................................... 18Move tempdb ....................................................................................................................................... 18Size tempdb.......................................................................................................................................... 19Per<strong>for</strong>mance Tuning <strong>for</strong> <strong>Microsoft</strong> SQL Server (tempdb) ..................................................................... 21Use Read-Committed Snapshot ........................................................................................................... 21Use Multiple, Dedicated Disks.............................................................................................................. 22CONFIGURE MEMORY FOR SQL SERVER 2008 ................................................................................................... 22Configure RAM on 64-bit Servers ......................................................................................................... 22Configure RAM on 32-bit Servers (V6R2011 and Earlier Only)............................................................. 24INSTALL <strong>ENOVIA</strong> DATABASE........................................................................................................................... 25File Placement on the Disk Subsystem ................................................................................................. 25Size Data Files Up Front ....................................................................................................................... 26Distribute the PRIMARY Filegroup Across Files on Multiple Disks (Optional) ...................................... 27Use Data Compression (Enterprise Edition Only) ................................................................................. 28ADJUST SQL SERVER 2008 AND DATABASE SETTINGS .......................................................................................... 28Verifying Database Collation ............................................................................................................... 28Set Automatic Statistic Updates, Auto Shrink, and Other Options ...................................................... 28Choose a Database Recovery Model .................................................................................................... 29ONGOING MANAGEMENT............................................................................................................................... 30The Database Backup Plan .................................................................................................................. 30Synchronize <strong>ENOVIA</strong> Database and File Backups................................................................................. 32Monitor Index Fragmentation and Defragment when Necessary ....................................................... 32Periodically Check Database Integrity ................................................................................................. 34Monitor Space Used ............................................................................................................................. 34Use SQL Server Agent Jobs and Alerts .................................................................................................. 34TOOLS FOR MONITORING DATABASE SERVER PERFORMANCE ................................................................................ 35SQL Server Activity Monitor ................................................................................................................. 35Standard Database Reports in SSMS ................................................................................................... 36Per<strong>for</strong>mance Monitor .......................................................................................................................... 363


CHECKLIST .............................................................................................................................................. 39SUMMARY ............................................................................................................................................. 41LINKS FOR FURTHER INFORMATION ...................................................................................................... 424


Overview<strong>Dassault</strong> Systèmes <strong>ENOVIA</strong> delivers a collaborative product lifecycle management (PLM) solutionto customers in a diverse set of industries, including aerospace, automotive, life sciences, andindustrial equipment. <strong>ENOVIA</strong> V6, the latest version of the <strong>ENOVIA</strong> software, is an enterprisePLM solution <strong>for</strong> implementing business processes, letting all users view, share, and create in3D. <strong>ENOVIA</strong> V6 delivers a single PLM plat<strong>for</strong>m <strong>for</strong> intellectual property (IP) management thatmakes global collaboration possible via an HTTP connection.<strong>ENOVIA</strong> V6 ArchitectureThe <strong>ENOVIA</strong> V6 architecture is composed of centralized database with distributed file stores.The database is accessible to all users, regardless of their location. The remote sites use a localfile server to load large representation files, eliminating time-consuming network transmissions.The <strong>ENOVIA</strong> V6 clients use an HTTP or HTTPS connection to the application server. Allcommunication between sites supports proxy-reverse proxy implementation and encryptioncapabilities if Secure Sockets Layer (SSL) is implemented. In addition to the IT security schemas,the <strong>ENOVIA</strong> V6 applications deliver specific security schemas <strong>for</strong> user management (P&O, orpermissions and ownerships) and data access (security).The <strong>ENOVIA</strong> V6 server contains the <strong>ENOVIA</strong> Live Collaboration environment, and theapplications are deployed via a Web Application Archive (WAR) or Enterprise Archive (EAR) filein a Java Plat<strong>for</strong>m, Enterprise Edition (Java EE) web application server. These components, alongwith the required database server and other application servers, make up the <strong>ENOVIA</strong> PLMsolution. Figure 1 provides a graphical representation of the <strong>ENOVIA</strong> V6 architecture.Figure 1: <strong>ENOVIA</strong> V6 architecture5


<strong>Best</strong> <strong>Practices</strong> <strong>for</strong> <strong>Running</strong> <strong>ENOVIA</strong> on SQLServer 2008Among the strengths of using <strong>Microsoft</strong> SQL Server 2008 as a database plat<strong>for</strong>m <strong>for</strong> <strong>ENOVIA</strong> isthe relative simplicity of managing and tuning the database engine. There is, nevertheless, arange of best practices <strong>for</strong> managing SQL Server 2008 production deployments and <strong>for</strong> gettingthe best per<strong>for</strong>mance and reliability from the database plat<strong>for</strong>m. Many of these best practicesare standard procedures, irrespective of the <strong>ENOVIA</strong> application, while some specific guidance isdriven by the nature of the <strong>ENOVIA</strong> database and application.The following sections discuss a range of best practices and recommended choices <strong>for</strong> <strong>ENOVIA</strong>deployments on SQL Server 2008.Planning and Installing the SQL Server 2008 InstanceThe following sections describe best practices <strong>for</strong> planning and installing the SQL Server 2008instance.Use a Dedicated Database Server and SQL Instance<strong>Dassault</strong> Systèmes recommends hosting the SQL Server 2008 database on a dedicated server <strong>for</strong>better scalability. Using a dedicated server prevents the <strong>ENOVIA</strong> database workload from havingto compete <strong>for</strong> CPU, memory, network, and I/O with other processes, and permits individualtuning of servers dedicated to different roles (<strong>for</strong> example, application servers).Selecting the Appropriate SQL Server 2008 EditionThe database plat<strong>for</strong>m <strong>for</strong> <strong>ENOVIA</strong> V6R2011 can be either the Standard or Enterprise edition of<strong>Microsoft</strong> SQL Server 2008 Service Pack 1 (SP1) or <strong>Microsoft</strong> SQL Server 2008 R2. For mostfunctional aspects of <strong>ENOVIA</strong>, SQL Server 2008 Standard and Enterprise editions are equivalent.However, the Enterprise edition of SQL Server 2008 includes a variety of higher-end features,including the ability to use more than four CPUs in a database server. Table 1 summarizes someof the key distinctions between editions.6


Table 1: Choose Enterprise or Standard edition of SQL ServerChoose Standard edition if: Your database server has 4 CPU sockets Your high-availability requirements are best metwith a failover cluster with 3+ nodes You will use SQL Server Backup Compression Any of these other features are important <strong>for</strong>your deployment of <strong>ENOVIA</strong>:― Managing server capacity with ResourceGovernor― Online index rebuilds― Hot add of RAM and CPUSQL Server 2008 Enterprise edition also has a wide array of advanced data warehousing features<strong>for</strong> analytics, data mining, and extraction, trans<strong>for</strong>mation, and loading (ETL) of data. For morein<strong>for</strong>mation about the features of SQL Server 2008, see SQL Server 2008 Editions.Note: SQL Server 2008 data compression helps compress the data inside a database,and it can help reduce the size of the database. Data compression provides data spacesavings, and because compressed data is stored in fewer pages, queries need to readfewer pages from the disk, thereby improving the per<strong>for</strong>mance of I/O-intensiveworkloads. However, extra CPU resources are required on the database server tocompress and decompress the data while data is exchanged with the application.There<strong>for</strong>e, it is important to understand the workload characteristics when deciding toenable SQL Server data compression.Table 2 provides in<strong>for</strong>mation on which version of the Windows Server operating systemsupports which version of SQL Server 2008.Table 2: Plat<strong>for</strong>m support <strong>for</strong> SQL Server 2008Plat<strong>for</strong>m SQL Server Clients SQL ServerWindows Server 2008 (64-bit)x64 (Intel, AMD)Windows Server 2008 R2 (64-bit) x64 (Intel, AMD)Note: <strong>ENOVIA</strong> V6R2011 requires SQL Server 2008 SP1SQL Native Client 10.0 on eachserver that requires connectionto SQL Server 2008.SQL Native Client 10.0 on eachserver that requires connectionto the SQL Server 2008 R2.<strong>Microsoft</strong> SQL Server 2008Standard or Enterprise editions<strong>Microsoft</strong> SQL Server 2008 R2Standard or Enterprise editionsBecause the host operating system support <strong>for</strong> <strong>ENOVIA</strong> V6R2011 is only available <strong>for</strong> WindowsServer 2008 and Windows Server 2008 R2 operating systems with x64 (64-bit) architecture,7


installing the equivalent x64 (64-bit) binaries <strong>for</strong> SQL Server 2008 and SQL Server 2008 R2 isrecommended.Be<strong>for</strong>e installation, ensure that you are using the correct setup program. Fortunately, SQL Server2008 makes this verification easy. The main SQL Server 2008 setup wizard has an Options pageto specify which architecture will be installed (see Figure 2). Ensure that the 32-bit variant (x86)is not selected.Note: The <strong>ENOVIA</strong> V6 Application Server is not supported on the Itanium 64-bit IA64architecture.Figure 2: Verify the architecture to be installedAll computers that need to connect to the SQL Server back end must have the SQL Native Clientcomponents installed. Depending on their host operating system architecture (x86 or x64) andthe relative <strong>ENOVIA</strong> V6 application components installed (32-bit or 64-bit), they also require theOpen Database Connectivity (ODBC) Data Source Name (DSN) to be configured in theappropriate way.On the application server side, <strong>ENOVIA</strong> V6R2011 (May 2010 release) is available in both 32-bitand 64-bit versions running on 32-bit and 64-bit Java virtual machines (JVMs) respectively. In aproduction system, installing the 64-bit release is highly recommended to fully take advantageof the characteristics of the host operating system (since Windows Server 2008 and WindowsServer 2008 R2 are only supported as 64-bit operating systems). Only the V6R2011x release is8


supported in 64-bit mode on 64-bit JVMs. To configure the required data source name andconnect to SQL Server from the application server, see Table 3.Table 3: Creating the ODBC Data Source NamesOperating System Version<strong>ENOVIA</strong> V6R2011 orV6R2011x JVM VersionODBC Data SourceAdministrator VersionWindows Server 2008 x64 64-bit (R2011 and later) Control Panel’s ODBC DataSource AdministratorWindows Server 2008 x64 32-bit (R2011 and earlier) %WINDIR%\SysWOW64\odbcad32.exeWindows Server 2008 R2 x64 64-bit (R2011 and later) Control Panel’s ODBC DataSource AdministratorWindows Server 2008 R2 x64 32-bit (R2011 and earlier) %WINDIR%\SysWOW64\odbcad32.exeFor <strong>ENOVIA</strong> Studio Modeling Plat<strong>for</strong>m Rich Clients such as MQL, Matrix, System, and Business,the supported operating system architectures have changed. <strong>ENOVIA</strong> V6R2010x and previousreleases were 32-bit only, while <strong>ENOVIA</strong> V6R2011 has both 32-bit and 64-bit versions. Thismeans that <strong>for</strong> 32-bit applications running on 64-bit operating system versions, the requiredODBC Data Source names have to be created using the 32-bit version of the ODBC Data SourceAdministrator found at %WINDIR%\SysWOW64\odbcad32.exe. For any other combinations (32-bit apps on 32-bit operating systems and 64-bit apps on 64-bit operating systems), the requiredODBC Data Source names must be created using the Control Panel’s ODBC Data SourceAdministrator.For <strong>ENOVIA</strong> V6R2011x and later releases, only the 64-bit versions of the <strong>ENOVIA</strong> StudioModeling Plat<strong>for</strong>m Rich Clients are available, so the required ODBC Data Source names must becreated using the Control Panel’s ODBC Data Source Administrator. Refer to Table 4 <strong>for</strong> asummary.Table 4: Creating the ODBC Data Source NamesOperating System VersionWindows client operating system32-bitWindows client operating system64-bitWindows client operating system64-bit<strong>ENOVIA</strong> V6R2011 andV6R2011x Version32-bit (R2011 and earlier)32-bit (R2011 and earlier)64-bitODBC Data SourceAdministrator VersionControl Panel’s ODBC DataSource Administrator%WINDIR%\SysWOW64\odbcad32.exeControl Panel’s ODBC DataSource Administrator9


It is important to note that <strong>for</strong> <strong>ENOVIA</strong> V6R2011, the 32-bit version is mainly intended <strong>for</strong> testand demonstration environments that are still running on 32-bit Windows Server operatingsystems; <strong>for</strong> production environments, the 64-bit version of <strong>ENOVIA</strong> V6R2011 on x64 releases ofthe Windows Server operating system is recommended.Select Which Features to InstallSQL Server 2008 includes a rich array of components <strong>for</strong> data management and businessintelligence (BI). A minimal installation <strong>for</strong> <strong>ENOVIA</strong> requires only the SQL Server Database Engineand Management Tools. These selections are made in the Feature Selection step of the SQLServer 2008 setup. The choices shown in Figure 3 are the minimum features <strong>for</strong> an <strong>ENOVIA</strong>database installation.Figure 3: SQL Server features required <strong>for</strong> an <strong>ENOVIA</strong> installationMany database administrators (DBAs) also find it useful to install the SQL Server Books Onlineproduct documentation and Integration Services. For other servers that need to access SQLServer, you have to install SQL Native Client: You can find the installation package (Sqlncli.msi)available as part of the SQL Server 2008 installation DVD, or you can download the installationpackage from the <strong>Microsoft</strong> web site as part of the <strong>Microsoft</strong> SQL Server 2008 or SQL Server2008 R2 Feature Pack.10


Note: When using SQL Server 2008 as the database plat<strong>for</strong>m <strong>for</strong> <strong>ENOVIA</strong>, you mustinstall SQL Server 2008 SP1 on the server and all client computers. This service pack isalso required <strong>for</strong> SQL Native Client 10 components on every computer that needs toconnect to the database server. After the service pack is installed, the version of theNative Client should be 10.00.1779 or newer. If you have already created a data source,you need to re-create the data source after downloading this patch. Please refer to the<strong>Dassault</strong> Systèmes’ Program Directory to know the exact SQL Server service packsupported <strong>for</strong> <strong>ENOVIA</strong> V6 on SQL Server 2008.Set the Service Account <strong>for</strong> SQL ServerThe SQL Server Database Engine runs as a Windows service. Like all Windows services, the SQLServer Database Engine must execute in the context of a specific Windows user account. Theservice account <strong>for</strong> the SQL Server Database Engine is set during installation and can be changedafterward using SQL Server Configuration Manager. Changing the service account <strong>for</strong> any SQLServer–related service directly through the Windows Services management snap-in is notsupported.In general, a domain account is recommended instead of a SQL Server account or a local account<strong>for</strong> the Database Engine service. The same recommendation applies to the SQL Server Agentservice. As shown in Figure 4, you configure the service account during SQL Server 2008 setup atthe Server Configuration step.Figure 4: Specify SQL Server service accounts11


Note that in Figure 4, svc-EnoviaSqlAgent and svc-EnoviaDatabase are accounts on the ActiveDirectory domain of which the server is a member; you do not have to use these exact names<strong>for</strong> your accounts.Ensure That the Database Engine Can Use Fast File InitializationSQL Server 2008 can initialize its data files instantly, without arduously zeroing out the files ondisk. This saves time when creating new database files and when growing existing files. For largedatabases, the impact can be significant. To use this capability, however, the Database Engineservice requires a specific permission in the Windows operating system. <strong>Dassault</strong> Systèmesrecommends granting this permission to the service account to get the per<strong>for</strong>mance benefits offast file initialization.The permission required to use fast file initialization is called Per<strong>for</strong>m Volume MaintenanceTasks. To grant this permission to the Database Engine service account, use the following steps:1. Open the Local Security Policy management snap-in by running Secpol.msc.2. In the left task pane, expand the tree to expose Security Settings > Local Policies > UserRights Assignment, and then select the User Rights Assignment node. Scroll though thelist in the right pane until you see the Per<strong>for</strong>m volume maintenance tasks policy (seeFigure 5).Figure 5: Manage Windows user rights to allow fast file initialization3. Double-click Per<strong>for</strong>m volume maintenance tasks to open the properties dialog box. Usethis dialog box to add the service account used <strong>for</strong> the SQL Server Database Engine.12


Figure 6 shows svc-EnoviaDatabase (the example service account) added to the list ofaccounts having this permission.Figure 6: Grant SE_MANAGE_VOLUME_NAME to SQL Server Database Engine service accountYou can grant this permission any time be<strong>for</strong>e or after SQL Server 2008 is installed. If SQL Server2008 is already installed, however, you need to restart the Database Engine service to see theeffects of this change. Until you restart the Database Engine, large file initializations will take along time as SQL Server 2008 defaults to zeroing out each bit inside of the file.Set the Server Collation During InstallationThe collation setting in SQL Server 2008 affects how the database software handles sorting andcomparisons of text data. Different collations let the Database Engine account <strong>for</strong> variousexpectations of sorting and comparing text across languages and cultures. It also makes itpossible <strong>for</strong> a particular installation to be configured to use case-sensitive vs. case-insensitivecomparison (e.g., does “smith” = “Smith”) and accent-sensitive vs. accent-insensitivecomparison (e.g., does “elan” = “elán”). SQL Server 2008 lets collation be configured at theinstance and database levels and at more granular levels within databases.13


<strong>Dassault</strong> Systèmes <strong>ENOVIA</strong> is designed to use Windows collation with SQL Server 2008.Windows collations are collations defined <strong>for</strong> SQL Server 2008 to support the Windows systemlocales available <strong>for</strong> the operating system on which SQL Server 2008 instances are installed. Byspecifying a Windows collation <strong>for</strong> SQL Server 2008, the instance of SQL Server 2008 uses thesame code pages and sorting and comparison rules as an application that is running on acomputer <strong>for</strong> which you have specified the associated Windows locale. For example, the FrenchWindows collation <strong>for</strong> SQL Server 2008 matches the collation attributes of the French locale <strong>for</strong>Windows.<strong>Dassault</strong> Systèmes recommends setting this collation at the SQL Server 2008 instance level toensure that it affects all databases used by <strong>ENOVIA</strong>. It is strongly recommended that servercollation be set at the time SQL Server 2008 is installed. Changing the server collation afterinstallation is a difficult and involved procedure.When discussing <strong>ENOVIA</strong>, you must decide whether to use case-sensitive (CS) or case-insensitive(CI). Whether you choose CS or CI, you need to make sure that your queries are designed <strong>for</strong> theproper case sensitivity.Administrators can configure <strong>ENOVIA</strong> <strong>for</strong> either CI mode or CS mode when using a SQL Serverdatabase. The underlying database must be configured to support the desired sensitivity. Bydefault, SQL Server 2008 is supported as case-insensitive.In general, case sensitivity does not have an impact on <strong>ENOVIA</strong> Live Collaboration per<strong>for</strong>mance.An exception may be queries using case-insensitive comparison operators on a case-sensitivedatabase. For in<strong>for</strong>mation on configuring the case sensitivity, see “Case-Sensitive Mode” in the<strong>ENOVIA</strong> MQL Guide.Collation is set during SQL Server 2008 installation at the Server Configuration step (seeFigure 7). Click the Collation tab, and then click Customize <strong>for</strong> Database Engine collation.14


Figure 7: Set the server Windows collation <strong>for</strong> the Database EngineAfter clicking Customize, the dialog box shown in Figure 8 appears. Select Windows collationdesignator and sort order. In the Collation designator drop-down list, select the Windowscollation. Click OK to return to the Setup wizard.15


Figure 8: Choose server collation <strong>for</strong> a dedicated <strong>ENOVIA</strong> instanceChoose the Security Mode<strong>ENOVIA</strong> requires mixed mode authentication, which can be configured during SQL Server 2008setup in the Database Engine Configuration step (see Figure 9).16


Figure 9: Set the server authentication to Mixed ModeWhen choosing mixed mode, you must provide a strong password <strong>for</strong> the built-in systemadministrator (sa) account.While the sa account can be used to administer SQL Server, it is a best practice to haveadministrators log on to the server with their individual user accounts. Use the “Specify SQLServer administrators” section of the dialog box to add one or more domain accounts as SQLServer administrators.SQL Server 2008 setup does not add any accounts or groups to the sysadmin role by default, butit is possible to add administrators after the setup is complete by logging in to the SQL Serverusing the sa logon and password and adding users to the sysadmin role. Clicking Add CurrentUser grants sysadmin rights to the user currently executing the setup program.Decide Which Services to Auto-StartAt minimum, the SQL Server Database Engine should be configured with automatic startup <strong>for</strong>stand-alone servers. The SQL Server Agent service is a job scheduling engine that is useful <strong>for</strong>running regular maintenance or health-checking tasks. <strong>Dassault</strong> Systèmes there<strong>for</strong>erecommends configuring SQL Server Agent with manual startup <strong>for</strong> production databaseservers.The service startup types can be configured in SQL Server 2008 setup at the Server Configurationstep, which is shown in Figure 4. After installation, service startup types can be changed in SQLServer Configuration Manager.17


Note: While the startup <strong>for</strong> a stand-alone SQL Server 2008 instance can be set toAutomatic, the startup <strong>for</strong> Windows Server failover cluster service should be set toManual. Instead of the service being started automatically, the Windows Server failovercluster service monitors and manages the instance. The startup type should be set toManual <strong>for</strong> all cluster-aware services, including full-text search and SQL Server Agent,and cannot be changed during installation.<strong>Microsoft</strong> recommends that you configure service accounts individually to provide leastprivileges <strong>for</strong> each service, where SQL Server services are granted the minimumpermissions they need to complete their tasks. For more in<strong>for</strong>mation, see Setting UpWindows Service Accounts (http://msdn.microsoft.com/en-us/library/ms143504.aspx)and SQL Server Configuration - Service Accounts (http://msdn.microsoft.com/enus/library/cc281953.aspx)in SQL Server Books Online.Tempdb <strong>Best</strong> <strong>Practices</strong>The configuration of the SQL Server tempdb database is critical <strong>for</strong> best per<strong>for</strong>mance because ofthe potential of added per<strong>for</strong>mance stress on tempdb from new features such as readcommittedsnapshot isolation level and online index operations.It is recommended that tempdb be isolated from other database activity and be placed on itsown set of physical disks. It is especially important to use RAID 10 <strong>for</strong> tempdb.Move tempdbBy default, tempdb files are located in the same directory as the other SQL Server systemdatabases. For busy servers, this is usually not optimal. Tempdb should be moved during theinstallation process to a high-per<strong>for</strong>mance, fault-tolerant disk volume—<strong>for</strong> example, a RAID 1 orRAID 10 volume on fast disks. Tempdb should not be placed on a RAID 5 volume because of theinferior write per<strong>for</strong>mance of RAID 5. When configuring especially busy high-per<strong>for</strong>mancesystems, solid-state disks (SSDs) may also be considered <strong>for</strong> tempdb.If you did not move the tempdb during the installation process, move it after the installation iscompleted by using the ALTER DATABASE statement. For example, to move tempdb to the G:drive and the log file to the H: drive, execute the following commands in a <strong>Microsoft</strong> SQL ServerManagement Studio (SSMS) query window:USE master;GOALTER DATABASE tempdbMODIFY FILE (NAME = tempdev, FILENAME = 'G:\SQLData\tempdb.mdf');GOALTER DATABASE tempdbMODIFY FILE (NAME = templog, FILENAME = 'H:\SQLData\templog.ldf');GO18


You must restart SQL Server 2008 <strong>for</strong> this change to take effect. Note that SQL Server 2008creates fresh copies of the tempdb data and log files every time the service starts, so there is noneed to move any files yourself. Just restart the service, and you will see the files in the newlocation(s) you have specified.Size tempdbPre-sizing tempdb to a sufficiently large size is strongly recommended. Tempdb should beconfigured on a separate disk from the operating system and data files. All the files in tempdbshould be identical in size since SQL Server 2008 uses a proportional fill algorithm. Tempdbsizing should be per<strong>for</strong>med after a series of thorough tests so that it has had a chance to grow toa meaningful size. You may also want to increase the FILEGROWTH setting <strong>for</strong> tempdb to 50megabytes (MBs). This prevents tempdb from expanding too frequently, which can affectper<strong>for</strong>mance. Set the tempdb database to auto grow, but use this option to increase disk space<strong>for</strong> unplanned exceptions.For in<strong>for</strong>mation on SQL Server 2008 tempdb size recommendations, see Optimizing tempdbPer<strong>for</strong>mance.When the READ_COMMITTED_SNAPSHOT database option is set to ON, logical copies aremaintained <strong>for</strong> all data modifications per<strong>for</strong>med in the database. Every time a row is modifiedby a specific transaction, the instance of the Database Engine stores a version of the previouslycommitted image of the row in tempdb until the transaction that modified the row iscommitted. The tempdb database should be sized to have sufficient capacity to store these rowversions in addition to the other objects that are usually stored in tempdb.Set the file growth increment to a reasonable size to prevent the tempdb database files fromgrowing by too small a value. If the file growth is too small compared to the amount of data thatis being written to tempdb, tempdb may have to constantly expand, and this will negativelyaffect per<strong>for</strong>mance.Note: To avoid negatively impacting per<strong>for</strong>mance, administrators should monitor filegrowth and not enable automatic file growth. Every time SQL Server 2008 is started, thetempdb file is re-created with the default size. While tempdb can grow, it does takeresources to per<strong>for</strong>m this task. To reduce the overhead of tempdb growing, you maywant to permanently increase the default size of tempdb after carefully monitoring itsgrowth.Table 5 provides general guidelines <strong>for</strong> setting the FILEGROWTH increment <strong>for</strong> tempdb files.19


Table 5: Tempdb FILEGROW increment recommendationsTempdb File SizeSQL Server Client0 to 100 MB 10 MB100 to 200 MB 20 MB200 MB or more 10%Note: You may have to adjust this percentage based on the speed of theI/O subsystem on which the tempdb files are located. To avoid potentiallatch time-outs, we recommend limiting the auto grow operation toapproximately two minutes. For example, if the I/O subsystem caninitialize a file at 50 MB per second, the FILEGROWTH increment shouldbe set to a maximum of 6 gigabytes (GBs), regardless of the tempdb filesize. If possible, use instant database file initialization to improve theper<strong>for</strong>mance of auto grow operations.You should also consider adding multiple data files to the tempdb filegroup. Using multiple filesreduces tempdb contention and yields significantly better scalability. As a general rule, createone data file <strong>for</strong> each processor core on the server. For example, a four-processor dual-coreserver would be configured with eight tempdb data files.It is also important to remember the proportional fill strategy when creating additional tempdbfiles. Even if the files are different sizes, it is possible to have contention due to the proportionalfill strategy. When creating new files, ensure that all tempdb data files are the same size tominimize proportional fill creating file contention.To add multiple data files, use the ALTER DATABASE statement with the ADD FILE clause:USE master;GOALTER DATABASE tempdbADD FILE() ;NAME = tempdev2,FILENAME = 'C:\tempdb2.ndf',SIZE = 100MB,FILEGROWTH = 50MBFor more in<strong>for</strong>mation on capacity planning and optimization of tempdb <strong>for</strong> SQL Server 2008, seeOptimizing Databases.Additional in<strong>for</strong>mation related to tempdb <strong>for</strong> SQL Server 2008 can be found in Working withtempdb in SQL Server 2005.20


Per<strong>for</strong>mance Tuning <strong>for</strong> <strong>Microsoft</strong> SQL Server (tempdb)SQL Server provides two options to keep the statistics current: auto create statistics and autoupdate statistics. These two options are set to TRUE by default. For versions of <strong>ENOVIA</strong> v6 priorto VR2011x, it is necessary to set both options <strong>for</strong> tempdb to FALSE. Modifying these settingsincreases CPU per<strong>for</strong>mance and user response time <strong>for</strong> <strong>ENOVIA</strong> VPLM.You can set auto create statistics and auto update statistics <strong>for</strong> tempdb using SQL ServerManagement Studio or by using the following command:USE [master]GOALTER DATABASE [tempdb] SET AUTO_CREATE_STATISTICS OFF WITH NO_WAITGOALTER DATABASE [tempdb] SET AUTO_UPDATE_STATISTICS OFF WITH NO_WAITGONote: For subsequent releases of <strong>ENOVIA</strong> V6R2011x, it will no longer be necessary tomanually set these options <strong>for</strong> tempdb.Use Read-Committed Snapshot<strong>ENOVIA</strong> requires the use of read-committed snapshot isolation. By using the read-committedsnapshot isolation level introduced in <strong>Microsoft</strong> SQL Server 2005, you can reduce blocking anddeadlocking issues caused by lock contention.Every time a row is modified by a specific transaction, the instance of the Database Enginestores a version of the previously committed image of the row in tempdb. The read-committedsnapshot isolation level provides the following benefits:SELECT statements do not lock data during a read operation. Read transactions do notblock write transactions and vice versa.Since SELECT statements do not acquire locks in most cases, the number of locksrequired by a transaction is reduced, which reduces the system overhead required tomanage locks.The possibility of blocking is significantly reduced.SELECT statements can access the last committed value of the row while othertransactions are updating the row without getting blocked.The number of blocks and deadlocks is reduced.Fewer lock escalations occur.For more in<strong>for</strong>mation about the read-committed snapshot isolation level, see Using SnapshotIsolation.21


Use Multiple, Dedicated DisksIf your database server has sufficient disk resources and your server is heavily utilized, typicalbest practices <strong>for</strong> database file placement should be followed <strong>for</strong> tempdb. Table 6 summarizesthese best practices.Table 6: <strong>Best</strong> practices <strong>for</strong> tempdbIf You Have…One disk volume available <strong>for</strong> tempdbTwo disk volumes available <strong>for</strong> tempdbMore than two disk volumes available <strong>for</strong> tempdbThen…Place all tempdb data and log files here, preferablywith no other heavily utilized files on this volume.Place the tempdb log on one volume. Place alltempdb data files on the other volume.Place the tempdb log alone on one volume.Distribute tempdb data files evenly across theremaining volumes.Configure Memory <strong>for</strong> SQL Server 2008The following sections describe best practices <strong>for</strong> configuring memory.Configure RAM on 64-bit ServersSQL Server 2008 can dynamically manage memory without administrator intervention. While inmost cases this is adequate, servers that host large databases with heavy user traffic may needsome limits on memory usage to prevent per<strong>for</strong>mance degradation. If the size of the <strong>ENOVIA</strong>database (actual data space used) is significantly greater than the amount of RAM on thedatabase server, conflicting demands on the memory may develop over time. SQL Server 2008will try to continue growing its in-memory data cache to avoid reading from disk, but theoperating system will push back, trying to allocate memory <strong>for</strong> itself and other processes. Theresult can be excessive memory paging and a negative effect on per<strong>for</strong>mance.If your <strong>ENOVIA</strong> database (data + indexes) is or is expected to be much larger than the total RAMon the database server, <strong>Dassault</strong> Systèmes recommends configuring the minimum (min) andmaximum (max) server memory options in SQL Server 2008. Use the recommendations in Table7 to select memory settings appropriate <strong>for</strong> your environment.22


Table 7: Memory recommendationsPhysical RAMSQL Server Min ServerMemory (MB)SQL Server Max ServerMemory (MB)8 GB 4,096 5,120 (5 GB)16 GB 8,192 12,288 (12 GB)24 GB 12,288 18,432 (18 GB)32 GB 16,384 25,600 (25 GB)48 GB 32,768 39,936 (39 GB)64 GB 49,152 56,320 (55 GB)96 GB 73,728 88,064 (86 GB)128 GB 104,448 120,832 (118 GB)The min and max server memory options can be set in the Server Properties dialog box in SSMSor by using Transact-SQL (T-SQL), as in the following example:exec sp_configure 'show advanced options', 1RECONFIGUREGOexec sp_configure 'min server memory', 16384RECONFIGUREGOexec sp_configure 'max server memory', 25600RECONFIGUREGOAn in-depth discussion of sizing SQL Server 2008 memory can be found at Ask the Per<strong>for</strong>manceTeam: SQL and the Working Set and in this entry in Slava Oks’ Blog.Another option to consider is granting the Lock pages in memory permission to the SQL Serverservice account, which lets SQL Server 2008 lock its buffer memory and refuse to page thebuffer memory out in response to requests from the operating system. Granting this permissioncan give the Database Engine additional ability to preserve its caches and maintain per<strong>for</strong>mance,especially if other processes are competing <strong>for</strong> resources on the server.<strong>Dassault</strong> Systèmes, however, recommends hosting the <strong>ENOVIA</strong> database on a dedicated server.If this recommendation is followed, the Lock pages in memory permission is less important. Inaddition, improvements in memory management in both SQL Server 2008 and Windows Server2008 make it less likely that this setting will have a large impact. For additional in<strong>for</strong>mation, seeHow To: Enable the Lock Pages in Memory Option.23


Configure RAM on 32-bit Servers (V6R2011 and Earlier Only)The use of 32-bit database servers is increasingly rare. <strong>Dassault</strong> Systèmes strongly recommendsthat you run your <strong>ENOVIA</strong> database on a 64-bit server running a 64-bit Windows operatingsystem with a 64-bit edition of SQL Server 2008. The key advantage of a 64-bit server <strong>for</strong>database workloads is the ability to efficiently use much larger amounts of RAM.If you are using a 32-bit server to host the <strong>ENOVIA</strong> database, <strong>Dassault</strong> Systèmes recommendsconfiguring SQL Server 2008 to use as much RAM as possible. By default, a 32-bit process (i.e.,an x86 install of SQL Server 2008) can use at most 2 GB of system RAM. If the database serverhas 4 GB or more of RAM, SQL Server 2008 should be configured to use Address WindowingExtensions (AWE) memory. A simplified description of the procedure <strong>for</strong> enabling AWE memory<strong>for</strong> SQL Server 2008 is as follows:1. Add the /PAE switch to the Windows boot.ini file. An example of this procedure can befound at http://support.microsoft.com/kb/283037. Note that a server restart is required<strong>for</strong> this change to take effect.2. Grant the Lock pages in memory permission to the SQL Server service account. Thispermission is required <strong>for</strong> SQL Server 2008 to use AWE memory. Refer to How To:Enable the Lock Pages in Memory Option if necessary.3. Execute the following commands in a query window in SSMS:exec sp_configure 'show advanced options', 1RECONFIGUREGOexec sp_configure 'awe enabled', 1RECONFIGUREGOexec sp_configure 'min server memory', 8192RECONFIGUREGOexec sp_configure 'max server memory', 12288RECONFIGUREGOSubstitute appropriate values (in MB) <strong>for</strong> the min and max server memory settings. Theexample uses values that might be appropriate <strong>for</strong> a server with 16 GB of RAM.4. Restart SQL Server 2008.24


More in<strong>for</strong>mation and background on supporting large amounts of memory in 32-bit servers canbe found at the following links:Memory ArchitectureUsing AWEEnabling Memory Support <strong>for</strong> Over 4 GB of Physical MemoryEnabling AWE Memory <strong>for</strong> SQL ServerServer Memory OptionsPAE and /3GB and AWE, Oh My…Install <strong>ENOVIA</strong> DatabaseThe following sections describe best practices <strong>for</strong> installing the <strong>ENOVIA</strong> database.File Placement on the Disk SubsystemBe<strong>for</strong>e installing the <strong>ENOVIA</strong> database, <strong>Dassault</strong> Systèmes recommends planning the placementof the files that make up the database. A SQL Server 2008 best practice is to place these files onseparate physical disk volumes to get the best per<strong>for</strong>mance from the overall system. These diskvolumes should not be used <strong>for</strong> any other heavily accessed files or <strong>for</strong> the Windows Serveroperating system.It is critical to place your database files on fault-tolerant RAID sets. The ultimate safety of your<strong>ENOVIA</strong> data depends on the data and log files residing on redundant physical disk storage.<strong>Dassault</strong> Systèmes recommends RAID 10 (also called RAID 1 + 0) <strong>for</strong> the data file, although RAID5 may be acceptable <strong>for</strong> systems with lower I/O requirements. For the log file, RAID 10 or RAID 1is recommended. The log file should not be placed on a RAID 5 volume because RAID 5 has alower write per<strong>for</strong>mance than the other RAID levels. Table 8 shows a summary ofrecommendations <strong>for</strong> where to place the <strong>ENOVIA</strong> database files.25


Table 8: Recommendations <strong>for</strong> placement of <strong>ENOVIA</strong> databaseFile Type Placement RecommendedRAID LevelDisk SpeedData(.mdf, .ndf)Physically separate disks orlogical unit number (LUN) fromthe logRAID 10 or RAID 510,000 RPM or fasterDisk(s) should not be used <strong>for</strong>other heavy file I/OLog(.ldf)Physically separate disks or LUNfrom data filesDisk(s) should not be used <strong>for</strong>other heavy file I/ORAID 1 or RAID 10RAID 5 is discouraged<strong>for</strong> log10,000 RPM or fasterNote that when placing data and log files on separate disk volumes, the disk volumes should bephysically separate. The drive letters on which the files are placed should map to distinctphysical disk drive sets. Placement on different partitions/LUNs on a single disk drive set doesnot help per<strong>for</strong>mance or fault tolerance.Depending on the available I/O subsystem and the number of physical disks, it is recommendedthat you keep the following entities on separate volumes, controllers, or I/O paths:Application database data filesApplication database log filesTempdb database data filesTempdb database log filesSize Data Files Up FrontThe databases of most <strong>ENOVIA</strong> installations grow over time. For best long-term per<strong>for</strong>mance,<strong>Dassault</strong> Systèmes recommends sizing data and log files to match the expected long-term size ofthe <strong>ENOVIA</strong> database.If no explicit size is specified, SQL Server 2008 creates data and log files based on the size of aspecial template database called model. This is usually just a few MBs in size. As data flows in tothe <strong>ENOVIA</strong> database, SQL Server 2008 automatically extends the data and log files as needed.For large, heavily used databases, this eventually produces data files that are highly fragmentedon disk, and this fragmentation has a negative effect on per<strong>for</strong>mance. There is also a small runtimeper<strong>for</strong>mance 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 <strong>for</strong> setting the initial size of database files.26


1. Estimate long-term size of the <strong>ENOVIA</strong> database (<strong>for</strong> example, one to three years).2. To get the recommended data file size:Add 50% <strong>for</strong> small-sized databases (< 100 GB).Add 35% <strong>for</strong> medium-sized databases (> 100 GB).Add 25% <strong>for</strong> larger databases (> 500 GB).3. Maintain the size of the transaction log file so that it scales with the level of transactionactivity.Note: Optimization of the tempdb transaction log benefits per<strong>for</strong>mance and disk usage.For more in<strong>for</strong>mation on managing the tempdb transaction log <strong>for</strong> SQL Server 2008, seeManaging the Size of the Transaction Log File.Table illustrates these calculations <strong>for</strong> a new <strong>ENOVIA</strong> database.Table 9: Recommendations <strong>for</strong> sizing <strong>ENOVIA</strong> databaseConstituent Example 1 Example 2Estimated Long-Term Size ofData + Indexes (1-3 years)50 GB 400 GBAdd buffer 25 GB 140 GBInitial Data File Size 75 GB 540 GBInitial Log File Size 15 GB 100 GBAlthough the initial size of the database should be sufficient <strong>for</strong> some time, you should enableautomatic file growth to avoid a production problem if the data files run out of space.As a rule, the file size <strong>for</strong> the <strong>ENOVIA</strong> database should be actively managed. <strong>Dassault</strong> Systèmesrecommends configuring data files at 1-GB growth increments and log files at 1-GB growthincrements. Avoid using large percent-based growth settings on large log files because theinitialization of new log segments can temporarily block activity on the database.Distribute the PRIMARY Filegroup Across Files on Multiple Disks (Optional)For heavily used <strong>ENOVIA</strong> databases, overall per<strong>for</strong>mance can be affected by the throughputlimitations of working with a single data file on a single disk volume.With SQL Server 2008, you can easily spread the I/O load <strong>for</strong> your <strong>ENOVIA</strong> database acrossmultiple disk volumes or RAID sets by mapping SQL Server filegroups to multiple files. (Note thatit is not necessary to create multiple database files on the same disk volume because this doesnot provide significant per<strong>for</strong>mance gains).27


You should only take on the extra administrative work of distributing the primary filegroupacross file on multiple disks if you have confirmed that disk I/O is a bottleneck <strong>for</strong> your system.The monitoring techniques discussed later in this paper can help you make this determination.For high-end systems and workloads, additional tuning and optimization techniques areavailable; refer to this guide (Analyzing I/O Characteristics and Sizing Storage Systems <strong>for</strong> SQLServer Database Applications) <strong>for</strong> more in<strong>for</strong>mation.Use Data Compression (Enterprise Edition Only)SQL Server 2008 Enterprise edition includes the ability to natively compress its data pages ondisk. This saves space on the disk, and because it reduces the amount of disk I/O executed <strong>for</strong> agiven amount of data, data compression also improves per<strong>for</strong>mance. When data compression isenabled, data pages are also compressed in the buffer pool (i.e., RAM). This provides theadditional benefit of increasing the effective amount of application data that can be accessedfrom the data cache rather than accessed from the disk.Adjust SQL Server 2008 and Database SettingsThe following sections describe best practices <strong>for</strong> database settings.Verifying Database CollationWhen the <strong>ENOVIA</strong> database is created, it assumes the server collation (set during SQL Server2008 installation) unless otherwise specified. It is good practice to verify that the collation <strong>for</strong>the database is the one the <strong>ENOVIA</strong> software expects. As shown in Figure 10, this can be verifiedin the Database Properties dialog box in SSMS. The collation displayed in this dialog box shouldbe Windows collation.Figure 10: Verify the Windows collation <strong>for</strong> <strong>ENOVIA</strong>Set Automatic Statistic Updates, Auto Shrink, and Other OptionsSQL Server 2008 uses internal statistics about the data stored in tables to decide which indexes,if any, to use <strong>for</strong> most efficiently executing a query. As table data changes over time, thesestatistics need to be kept current. Each SQL Server database has the option <strong>for</strong> these statistics to28


e updated automatically (statistics update can also be initiated manually, if needed). <strong>Dassault</strong>Systèmes recommends that auto update of statistics be enabled <strong>for</strong> the <strong>ENOVIA</strong> database.Figure 11 shows the Database Properties dialog box with the Options page selected. Thehighlighted section lets you view and configure the settings <strong>for</strong> automatic statistics. Auto CreateStatistics and Auto Update Statistics should be set to True. Auto Update StatisticsAsynchronously can be set to your preference.Figure 11: Enable automatic updates of statisticsTwo other options are also shown in the highlighted section of Figure 111 with theirrecommended settings selected; both Auto Close and Auto Shrink should be set to False.For additional in<strong>for</strong>mation about how SQL Server uses statistics and best practices in definingand maintaining statistics in<strong>for</strong>mation to support the query processor during query executions,you can refer to Statistics Used by the Query Optimizer in <strong>Microsoft</strong> SQL Server 2008 and UsingStatistics to Improve Query Per<strong>for</strong>mance.Choose a Database Recovery ModelThe recovery model of a SQL Server database determines how changes are recorded and storedin the database’s transaction log. The three options <strong>for</strong> the recovery model setting on your<strong>ENOVIA</strong> database are Full, Bulk-logged, and Simple:Full recovery model. <strong>Best</strong> <strong>for</strong> preventing critical data loss and restoring data to a specificpoint in time, and generally used by enterprise production systems. If the transaction29


log is available, it is possible to get up-to-the-minute recovery and point-in-time restoreif the end of the transaction log is backed up and restored. The trade-off <strong>for</strong> the fullrecovery model is that it requires more administrator attention and a more complexbackup/restore strategy.Bulk-logged recovery model. For databases that have critical data, but <strong>for</strong> which theDBA wants to minimize storage or per<strong>for</strong>mance impact of bulk operations (e.g., bulkdata loads, table copies, index maintenance). It provides nearly the recovery power ofthe full recovery model but with some limitations.Simple recovery model. Appropriate if the data backed up is not critical, data is static ordoes not change often, or if data loss is not a concern <strong>for</strong> the organization. If an activedatabase is lost with the simple recovery model, the organization loses all transactionssince the last full or last differential backup. This model is typical <strong>for</strong> test environmentsor production databases that are not mission critical or have very light activity.In general, <strong>ENOVIA</strong> databases are frequently updated and hold in<strong>for</strong>mation that is of highimportance to the organization. Especially <strong>for</strong> large <strong>ENOVIA</strong> databases, full backups may not befeasible with high frequency (e.g., daily or more often). For these reasons, <strong>Dassault</strong> Systèmesrecommends using the full recovery model with <strong>ENOVIA</strong> databases.Administrators must be aware of the management implications of the full and bulk-loggedrecovery models. In particular, under these recovery models, transaction logs must be backedup regularly to prevent them from filling up or exhausting available disk space.Ongoing ManagementThe following sections describe best practices <strong>for</strong> ongoing database management.The Database Backup PlanOne of the most important ongoing maintenance tasks <strong>for</strong> a business-critical database such as<strong>ENOVIA</strong> is managing backups. <strong>Dassault</strong> Systèmes recommends you carefully plan, document,and test the backup and recovery strategy <strong>for</strong> the <strong>ENOVIA</strong> database.The types of database backups allowed in SQL Server 2008 are:Full database backup. Contains all the data in the database plus enough transaction login<strong>for</strong>mation to allow <strong>for</strong> recovering that data.Differential database backup. Contains all the data changed since the last full backup.Differential backups make it possible <strong>for</strong> a smaller, faster backup to be taken, which canlater be combined with the full backup to restore the database to the time of thedifferential backup.Transaction log backup. Contains all the database changes since the last (full ordifferential) database or log backup. Periodically backing up the transaction log lets yourestore the last database backup followed by subsequent log backups to recover to thelatest point in time needed.30


Database file or filegroup backup. Contains only data from specified file(s) orfilegroups(s) to allow quick, piecemeal restores if only part of the database is lost. Thesetypes of backup are not recommended <strong>for</strong> <strong>ENOVIA</strong> deployments.The different types of backup let you back up with the frequency appropriate to your businessrequirements, even if your databases are very large. A typical backup strategy <strong>for</strong> a largedatabase (<strong>for</strong> example, several hundred gigabytes) might include a weekly full backup, nightlydifferential backups, and transaction log backups every 30 minutes.If the database was lost, the DBA would:1. Per<strong>for</strong>m a log backup if the log file is still accessible (this is referred to as a “tail of thelog” backup).2. Restore the last full backup.3. Restore the last differential backup.4. Restore all the transaction log backups since the last differential backup, in sequence.If properly executed, this returns the database to operation with at most 30 minutes of worklost.For small databases, it is perfectly valid to simply per<strong>for</strong>m full backups once a day or even morefrequently. This approach is simple, but is practical only <strong>for</strong> databases that can be backed upvery quickly.It is important to remember that <strong>for</strong> databases using 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 depends on the database size and level of change activity in yourinstallation. This can vary greatly, even across deployments of <strong>ENOVIA</strong>, so there is no “one-sizefits-all”recommendation. However, keep the following in mind as you plan your backupstrategy:If you choose the full recovery model, the transaction log can grow very quickly andshould be scheduled <strong>for</strong> backup at multiple times throughout the day. Per<strong>for</strong>mingmultiple backups ensures that the log is truncated frequently and provides <strong>for</strong> improveddata recoverability.If you choose the simple recovery model, schedule full database backups <strong>for</strong> at leastonce per day. With this method, data recoverability is limited to the last full databasebackup.Database backups should be stored off site when possible and appropriate.Back up a database immediately after you make extensive changes or per<strong>for</strong>m nonloggedoperations.31


Be sure to include regular backups of the master and msdb databases as part of youroverall backup strategy. The master database contains in<strong>for</strong>mation about the databaseson your system, and the msdb database stores in<strong>for</strong>mation about scheduled jobs.If you are using SQL Server 2008 Enterprise edition or later, use backup compression toreduce 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.There<strong>for</strong>e, plan your restore strategy carefully, and test restoration of your database fromactual backups to validate that you have covered everything.Synchronize <strong>ENOVIA</strong> Database and File BackupsAn additional consideration when managing overall backup of the <strong>ENOVIA</strong> application is theinteraction between the SQL Server database and the file repository. Since the Resource Tierincludes both the <strong>ENOVIA</strong> database and the <strong>ENOVIA</strong> file server(s), a full and consistent backupof the Resource Tier requires both database and file backups.The <strong>ENOVIA</strong> database contains references (essentially, file pointers) to content in the filerepository. To ensure maximum consistency between the database file references and theactual content of the file repository, some attention must be paid to backing up bothsimultaneously.<strong>Dassault</strong> Systèmes recommends choosing one of two approaches to do this:Option 1: Take cold backups—that is, take the system offline to halt user activity, backup both the database and file repository, and then put the system back online.Option 2: Take online backups and accept some small potential inconsistency. Theissues with this approach can be minimized if the backups are taken during periods oflow activity.More in<strong>for</strong>mation about this advanced topic is available from <strong>Dassault</strong> Systèmes.Monitor Index Fragmentation and Defragment when NecessarySQL Server 2008 uses indexes to provide fast access to in<strong>for</strong>mation when users or applicationsrequest it. These indexes are maintained by the Database Engine as the table data grows and/orchanges. Over time, the indexes can become fragmented; especially in databases that handleheavy insert, update, and delete activity. An index is fragmented when the physical ordering ondisk does not match the logical order of the data (as defined by the index key) or when datapages 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 applicationper<strong>for</strong>mance. It can also cause more disk space to be used than is actually necessary. Indexfragmentation can be corrected by reorganizing or rebuilding the index.You can tell which indexes, if any, have fragmentation problems by using thesys.dm_db_physical_stats() system function. This function provides many details about the32


physical layout of the index. However, the most important result column <strong>for</strong> trackingfragmentation is avg_fragmentation_in_percent. This column indicates how fragmented theindex is on disk. A low number means low fragmentation (good); a high number means highfragmentation (bad).For example, this query returns index physical stats <strong>for</strong> all the indexes in the current database:SELECT OBJECT_NAME(object_id),index_id,page_count,index_type_desc,avg_fragmentation_in_percent,fragment_countFROM sys.dm_db_index_physical_stats(db_id(),NULL,NULL,NULL,'LIMITED')To identify the indexes by name, you can join against the sys.indexes system view.Similar in<strong>for</strong>mation is also available in the Standard Reports in SSMS. To view this report, rightclickthe <strong>ENOVIA</strong> database, select Reports > Standard Reports, and select the Index PhysicalStatistics report on the fly-out menu.Table 10 provides general guidelines <strong>for</strong> interpreting the avg_fragmentation_in_percent value.Table 10: Guidelines <strong>for</strong> handling fragmentationFragmentationRecommended Action< 5% Do nothing5% to 30% Reorganize withALTER INDEX REORGANIZE> 50% Rebuild withALTER INDEX REBUILD WITH (ONLINE=ON)orCREATE INDEX with DROP_EXISTING=ONReorganizing 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 isif the ALTER INDEX REBUILD statement is used with the ONLINE = ON option. Note that onlineindex rebuild requires the Enterprise edition of SQL Server 2008.Periodically checking index fragmentation and taking any necessary corrective action isimportant to maintaining the per<strong>for</strong>mance of your <strong>ENOVIA</strong> deployment. The rate at which33


fragmentation may occur depends on user activity, but as a general rule, <strong>Dassault</strong> Systèmesrecommends checking index fragmentation at least monthly.For more in<strong>for</strong>mation about reorganizing and rebuilding indexes, see Reorganizing andRebuilding Indexes.Periodically Check Database IntegrityDespite the sophisticated data management techniques embedded in the SQL Server DatabaseEngine, some corruption can still occur in a database, most notably as the result of a hardwareproblem. To head off the potential impact of such problems, you should regularly check theintegrity of the database with the T-SQL statement DBCC CHECKDB.It is best practice to include database integrity checks in a scheduled job that executes DBCCCHECKDB or to use a scheduled Maintenance Plan that includes the Check Database Integritytask.If any problems are detected, you can restore from backups (usually the best option) or use oneof the REPAIR options on DBCC CHECKDB.Monitor Space UsedOver time, the space used in your <strong>ENOVIA</strong> database <strong>for</strong> data and indexes will increase.Regardless of the initial space allocations you have made, you occasionally need to check theamount of space remaining in data and log files and on the host disk volumes.You can check the space consumed and remaining <strong>for</strong> the <strong>ENOVIA</strong> database using the StandardReports in SSMS. The Disk Usage report displays the currently reserved space in data and logfiles and the amount of disk space that is in use. This is also a convenient place to check <strong>for</strong> anyrecent data or log file growth. If growth is occurring, it may indicate that a rearrangement orexpansion of data files is necessary.Details on space usage can also be obtained via T-SQL by using the sp_spaceused storedprocedure. See sp_spaceused (Transact-SQL) in SQL Server Books Online <strong>for</strong> details.Use SQL Server Agent Jobs and AlertsMany of the ongoing database management and monitoring tasks required to administer your<strong>ENOVIA</strong> database can and should be automated. SQL Server 2008 includes SQL Server Agent, ajob scheduling and alerting service that is tightly intertwined with the SQL Server DatabaseEngine. SQL Server Agent can be used to schedule regular backups, database integrity checks,index reorganization jobs, and many other routine tasks. It can also be used to check DatabaseEngine metrics and alert someone if they are outside normal bounds.SQL Server 2008 Maintenance Plans also provide a neatly packaged way to define and scheduleroutine management tasks <strong>for</strong> a database or <strong>for</strong> multiple databases.34


<strong>Dassault</strong> Systèmes recommends using these tools to configure automated maintenance andmonitoring tasks <strong>for</strong> the <strong>ENOVIA</strong> database.Tools <strong>for</strong> Monitoring Database Server Per<strong>for</strong>manceOnce your <strong>ENOVIA</strong> database is in production, it is important to establish a baseline of its normalper<strong>for</strong>mance characteristics and to check its health and status periodically. The followingsections discuss some of the tools and techniques available <strong>for</strong> monitoring database serverper<strong>for</strong>mance.SQL Server Activity MonitorA good, easy-to-use starting point <strong>for</strong> monitoring your SQL Server 2008 instance is the ActivityMonitor in SSMS. This tool combines several key pieces of in<strong>for</strong>mation into one view. Althoughit does not provide highly detailed insight on its own, Activity Monitor can be a good part ofyour SQL Server monitoring toolbox.To open Activity Monitor, right-click the server icon in the Object Explorer pane of SSMS andselect the Activity Monitor item. There is also a button <strong>for</strong> Activity Monitor on the Standardtoolbar in SSMS. The Activity Monitor opens as a new tab in the main Management Studiowindow.The Overview section shows summary graphs of four key metrics <strong>for</strong> getting a sense of the loadon the server. The % 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 otherresources. The Database I/O graph shows overall disk I/O throughput of SQL Server 2008. BatchRequests/sec shows the number of individual T-SQL batches executed per second (<strong>for</strong> example,SQL statements or stored procedures calls from applications).The other sections (also called panes) in the Activity Monitor tab provide detailed snapshots ofdifferent aspects of the Database Engine’s current workload. While a full discussion of thesesections and how to interpret the in<strong>for</strong>mation provided is beyond the scope of this white paper,a brief introduction to each section follows.Processes section: This section presents a list of the active user connections to theserver. For each connection, useful troubleshooting in<strong>for</strong>mation is provided, includingthe current database the connection is using, what resource the connection is waitingon (if any), and whether the connection is blocked by another connection. TheProcesses section is thus useful <strong>for</strong> getting an idea of the number of active connectionsand what sort of per<strong>for</strong>mance roadblocks they may be experiencing.Resource Waits section: This section provides a summary of the “waits” the DatabaseEngine is observing in current activity. Examples of waits are network I/O <strong>for</strong> clients topull results across the wire, disk I/O <strong>for</strong> the server to pull data from disk into buffermemory, or lock waits while one connection waits on a transaction lock held by anotherconnection. Besides the type of wait, this section shows the cumulative and recent35


amount of time spent on this type of wait and the number of connections experiencingit. This in<strong>for</strong>mation is just a coarse summary of a highly detailed set of tuningin<strong>for</strong>mation available from SQL Server 2008 wait statistics. It can be quite useful,though, to get an indication of system bottlenecks at a glance. Much more in<strong>for</strong>mationabout using wait stats to understand the per<strong>for</strong>mance of SQL Server 2008 can be foundin SQL Server 2005 Waits and Queues.Data File I/O section. This section lists all data and transaction log files in use bydatabases on the current SQL Server 2008 instance. With each file, recent read andwrite throughput (in MB/sec) is reported. The last column in this section is particularlyinteresting. The Response Time (ms) column reports disk latency <strong>for</strong> I/O against the file.This is a good number to look at to begin an investigation of whether a workload is I/Obound.Recent Expensive Queries section. This section lists some of the most expensive queriesthe engine has recently executed. Besides the query text, average execution metrics arelisted <strong>for</strong> each.For more in<strong>for</strong>mation about this tool, see the Activity Monitor topic in SQL Server Books Online.Standard Database Reports in SSMSAnother easy-to-use resource is the set of database Standard Reports in SSMS. These reportsare accessible by right-clicking the icon <strong>for</strong> the <strong>ENOVIA</strong> database in the Object Explorer pane andselecting Reports > Standard Reports. The reports available on the fly-out menu provide basicand advanced in<strong>for</strong>mation on many aspects of the database.Per<strong>for</strong>mance MonitorWindows Per<strong>for</strong>mance Monitor 1 , a management tool included with Windows, is a key tool <strong>for</strong>understanding the per<strong>for</strong>mance characteristics of your database server. Per<strong>for</strong>mance Monitorlets you observe a wealth of metrics about the activity of the operating system and applicationssuch as SQL Server 2008. Per<strong>for</strong>mance Monitor can be used to observe these metricsinteractively in real time or to log them to disk <strong>for</strong> later review.It is good practice to establish a baseline understanding of the per<strong>for</strong>mance of your databasesystem after it is deployed. This lets you better understand issues if your system runs intoper<strong>for</strong>mance or other problems later. By comparing observed behavior in a problem situation toyour baseline expectations, you will be able to more easily focus on the root cause.1 Also known as System Monitor in some editions of Windows Server36


The following list of Per<strong>for</strong>mance Monitor counters is a condensed set of valuablemeasurements you can use to understand your database server’s activity. It only scratches thesurface of the SQL Server 2008 monitoring that is possible, but is a useful starting point.Table 11: Some Per<strong>for</strong>mance Monitor countersType Object Counter Instance DescriptionCPU Processor % ProcessorTime- Total CPU use on the serverCPU Process % ProcessorTimeSqlservrCPU use by SQL Server aloneI/O Physical Disk Disk sec/Read All volumesused bySQLI/O Physical Disk Disk sec/Write All volumesused bySQLLatency of reads from disk. If this is high,server may be I/O bound.Latency of writes to disk. If this is high,server may be I/O bound.Memory Memory Page Faults/sec - Rate at which Windows could not findthe page it needed at the expectedlocation in memory.Memory Memory Pages/sec - Rate at which Windows read or wrote tothe system paging file. If the ratio of thisto Page Faults/sec is more than a fewpercentage points, memory may beinsufficient.MemorySQL Server:Buffer ManagerBuffer cache hitratio- % of the time data is found in the SQLServer 2008 memory cache, rather thanread from disk. Should be > 90%.MemorySQL Server:MemoryManagerTotal ServerMemory (KB)- Total memory used by the SQL Server2008 process. If this is near total systemmemory, more memory may be needed,or you may need to reduce ‘max servermemory’.SQLSQL Server: SQLStatisticsBatchRequests/sec- Number of SQL batches executed by SQLServer 2008 per second. An easy gaugeof how actively the server is servicingclient activity.SQLSQL Server:GeneralStatisticsUserConnections- Number of open connections to SQLServer 2008.37


Note that if you are using a named instance of SQL Server 2008, the name of the object inPer<strong>for</strong>mance Monitor is slightly different. For default (not named) instances, the object name isSQL Server: . For a named instance, the object name is MSSQL$InstanceName:. An example of this <strong>for</strong> an instance named <strong>ENOVIA</strong> is shown in Figure 12.Figure 12: Per<strong>for</strong>mance Monitor counters <strong>for</strong> a named instance of SQL Server38


ChecklistFor convenience, the following checklist summarizes and consolidates the best practicesdiscussed in this white 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. Choose the right SQL Server 2008 edition (Standard or Enterprise) <strong>for</strong> your needs. Use 64-bit SQL Server 2008 if your hardware allows. Consider acquiring 64-bithardware if it does not. Use a low-privilege Windows account <strong>for</strong> the SQL Server 2008 and SQL Server Agentservices. Grant the Per<strong>for</strong>m volume maintenance tasks permission to the SQL Server serviceaccount to allow fast file initialization. Set the collation to Windows collation when installing SQL Server 2008. Set the server authentication mode to mixed. Configure the SQL Server Database Engine service and the SQL Server Agent service toauto-start. Size and place tempdb per best practices (as described in detail in this document). Set the maximum server memory <strong>for</strong> SQL Server per recommendations. Place the data and log files on physically distinct disk volumes. Use RAID 10 or RAID 5 <strong>for</strong> data files; use RAID 10 or RAID 1 <strong>for</strong> log files. Use large initial size <strong>for</strong> data and log files, based on projected growth. Leave automatic file growth enabled just in case. Spread the PRIMARY filegroup across equal-sized files on multiple disk volumes(optional). Use SQL Server data compression (SQL Server 2008 Enterprise edition only). Verify that the <strong>ENOVIA</strong> database is using Windows collation. On the <strong>ENOVIA</strong> database, use the following settings:ooooAuto Create Statistics = TrueAuto Update Statistics = TrueAuto Close = FalseAuto Shrink = False39


Use the full recovery model <strong>for</strong> the <strong>ENOVIA</strong> database. Ensure that frequent transaction log backups are scheduled to prevent the log filefrom 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 <strong>ENOVIA</strong>database. Monitor index fragmentation, and defragment when necessary. Periodically check database integrity. Monitor the amount of space used. Use SQL Server Agent jobs and alerts to automate and schedule maintenance andmonitoring. Get familiar with SQL Server monitoring tools, and establish a baseline per<strong>for</strong>manceprofile <strong>for</strong> your system.40


Summary<strong>Dassault</strong> Systèmes <strong>ENOVIA</strong> software, coupled with <strong>Microsoft</strong> SQL Server 2008 databasesoftware, provides your enterprise with the plat<strong>for</strong>m to build an agile, globally competitiveproduct development process.SQL Server 2008 provides an ideal database plat<strong>for</strong>m <strong>for</strong> <strong>ENOVIA</strong>. SQL Server 2008 is anenterprise-ready, comprehensive, integrated data management and analysis plat<strong>for</strong>m thatmakes it possible <strong>for</strong> organizations to reliably manage large, mission-critical workloads andcomplex business applications. SQL Server 2008 provides rapid data integration and data miningand fast, intuitive analysis and reporting capabilities. Its built-in features deliver reliability andsecurity on a scalable foundation that includes a powerful database engine.Using the best practices discussed in this paper can help you optimize per<strong>for</strong>mance of <strong>Dassault</strong>Systèmes <strong>ENOVIA</strong> <strong>for</strong> PLM and can help you avoid and minimize problems. The links in thefollowing section provide even more resources to ensure a successful implementation of<strong>ENOVIA</strong> on SQL Server 2008.41


Links <strong>for</strong> Further In<strong>for</strong>mationFor general in<strong>for</strong>mation, visit the <strong>Dassault</strong> Systèmes <strong>ENOVIA</strong> Resource Library.SQL Server 2008 in<strong>for</strong>mation can be found in Books Online: SQL Server 2008 Books Online SQL Server 2008 Product Documentation (TechNet) SQL Server 2008 R2 Product Documentation (TechNet)See the SQL Server <strong>Best</strong> <strong>Practices</strong> portal <strong>for</strong> technical white papers, the SQL Server <strong>Best</strong><strong>Practices</strong> Toolbox, Top 10 Lists, and other resources.Following is a list of technical white papers that were tested and validated by the SQL Serverdevelopment team. These can help you learn more about specific SQL Server topics.Analyzing I/O Characteristics and Sizing Storage Systems <strong>for</strong> SQL Server DatabaseApplications Statistics Used by the Query Optimizer in <strong>Microsoft</strong> SQL Server 2008<strong>Microsoft</strong> SQL Server 2008 R2 <strong>Best</strong> <strong>Practices</strong> Analyzer Troubleshooting Per<strong>for</strong>mance Problems in SQL Server 2008SQL Server 2008 MonitoringUsing SQL Server 2008 Resource GovernorUsing Statistics to Improve Query Per<strong>for</strong>manceSQL Server 2008 Administration TopicsHigh Availability with SQL Server 2008 R2Getting Started with SQL Server 2008 Failover ClusteringSQL Server 2008 Failover Clustering<strong>Running</strong> SQL Server 2008 in a Hyper-V EnvironmentSQL Server 2008 Upgrade Technical Reference Guide The Data Loading Per<strong>for</strong>mance Guide <strong>for</strong> SQL Server 2008 Introduction to New T-SQL Programmability Features in SQL Server 200842

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!