Na2009 enus sql_02

  • 478 views
Uploaded on

 

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
478
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
14
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Chapter 2: Setup and InstallationCHAPTER 2: SETUP AND INSTALLATIONObjectives The objectives are: • Evaluate the software requirements for Microsoft Dynamics® NAV 2009. • Evaluate the hardware requirements for Microsoft Dynamics NAV 2009. • Review the Microsoft Dynamics NAV 5.0 Architecture. • Understand the Microsoft Dynamics NAV 2009 Architecture. • Configure the components in a Microsoft Dynamics NAV implementation. • Explain the security model and security synchronization.Introduction One of the most important steps in a Microsoft Dynamics NAV implementation is the selection of the hardware and software platform. When planning a Microsoft Dynamics NAV 2009 installation, you must make sure that the computers that will be used meet the minimum requirements and are sufficient for your current and future needs. Failure to meet these specifications can cause the installation of some or all of the components to fail. This lesson describes the requirements for installing Microsoft Dynamics NAV 2009. Understanding the setup requirements and options help you plan a successful installation. Microsoft Official Training Materials for Microsoft Dynamics ® 2-1 Your use of this content is subject to your current services agreement
  • 2. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009Software Requirements The software requirements for a Microsoft Dynamics NAV 2009 implementation depend on the following factors: • The architecture and the different tiers • The database platform • Additional components and desired functionality Architecture and Tiers Microsoft Dynamics NAV can be used in single-user or multiuser installations. • In single-user installations, all the work is performed on one computer, and all the information (the database) is stored on this computer. Even if you purchase several single-user installations and run each on its own computer, the entire installation is still called "single-user" because the information is stored on each individual computer and not on one centrally located database. • In a multiuser installation, many users share common information that is stored in one or more databases on a server. The computers that work with the data are called clients, and the way the server and the computers work together is called a client/server installation. For a single-user installation, the software requirements are limited. The client must be installed on a supported operating system. Furthermore, when you choose Microsoft SQL Server as a database platform, you also have to consider the software requirements for Microsoft® SQL Server® Express Edition. Multiuser installations require the presence of a server program that is installed on the server computer. Microsoft Dynamics NAV supports two server options: Microsoft Dynamics NAV Classic Database Server and Microsoft SQL Server. Each of these server options has its own software requirements. In addition, in multiuser installations, you can choose between a two-tier and a three-tier architecture. (In fact, both architectures can coexist.) While the Classic client works with both database platforms, the RoleTailored client requires Microsoft SQL Server as a database platform. Database Platform The selected database platform affects the software requirements. While the Microsoft Dynamics NAV Database Server has its own requirements, the requirements for the Microsoft SQL Server Option fully depend on the specifications for Microsoft SQL Server.2-2 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 3. Chapter 2: Setup and Installation Microsoft Dynamics NAV 2009 supports the following SQL Server platforms: • Microsoft SQL Server 2005 SP2 Express, Workgroup, Standard, Enterprise • Microsoft SQL Server 2008 Express, Workgroup, Standard, Enterprise Each edition has its own software and hardware requirements. Additional Components and Functionality Depending on the functions and components used in or together with Microsoft Dynamics NAV, additional software requirements apply. Functional areas such as Business Analytics or Automated Data Capture System require additional software components (for example Application Server for Microsoft Dynamics NAV and Microsoft SQL Server Analysis Services). To use Office integration functions (mail merge, Outlook client integration, and export to Excel), you need Microsoft® Office. Other software requirements can come from a more general perspective or need, such as database size, scalability, and high availability, and so on. For a detailed overview of the software requirements for the individual Microsoft Dynamics NAV components, go to http://www.microsoft.com/dynamics/nav/product/systemrequirements.mspx. Microsoft Dynamics NAV 2009 is designed to take advantage of the Microsoft software platform. This platform consists of the following prerequisites for Microsoft Dynamics NAV 2009: • Windows Server 2003® or 2008 • Microsoft SQL Server 2005 or 2008 • The Microsoft® .NET Framework 3.5 • Microsoft Windows® Services Enhancements • ASP.NET • Microsoft Report Viewer 2008 Users must install and configure these prerequisites to prepare the server on which to load Microsoft Dynamics NAV. These software requirements will influence the hardware configuration, which will be discussed in the next lessons. Operating System Microsoft Dynamics NAV 2009 introduces a three-tier RoleTailored architecture that improves the security, scalability, and flexibility of Microsoft Dynamics NAV. Microsoft Official Training Materials for Microsoft Dynamics ® 2-3Your use of this content is subject to your current services agreement
  • 4. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009 In the RoleTailored architecture there are the following three tiers: • Client tier • Service tier • Database server tier Each tier has its own role and its own requirements that further determine the operating system requirements. The Client Tier - RoleTailored Client The Microsoft Dynamics NAV 2009 RoleTailored client can be installed on the following operating systems: • Microsoft Windows® XP Professional SP3 or later (X86 or running 32 bit on X64) • Windows Server 2003 SP2 or later (X86 or running 32 bit on X64) • Windows Server 2003 R2 SP2 or later (X86 or running 32 bit on X64) • Microsoft Windows Vista® (Business, Enterprise, or Ultimate) SP1 or later (X86 or running 32 bit on X64) • Windows Server 2008 (X86 or running 32 bit on X64) Furthermore, depending on the functionalities and applications used by the client, the following applications are required: • Internet Explorer® 6.0 or later • Microsoft .NET Framework 3.5 • Active Directory required for 3-tier configurations. For instant messaging and TAPI Microsoft® Office Communicator 2007 is required. For Mail Merge*, Microsoft® Outlook® Client Integration, Import and Export Budget to and from Microsoft® Excel® and Office XML and Share Point links, the following is required: • Microsoft Office 2003 or 2007 *Mail merge requires Collaboration Data Object (CDO) installed.2-4 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 5. Chapter 2: Setup and Installation The Client Tier - Classic Client The Microsoft Dynamics NAV 2009 Classic client can be installed on the following operating systems: • Windows XP Professional SP3 or later (X86 or running 32 bit on X64) • Windows Server 2003 SP2 or later (X86 or running 32 bit on X64) • Windows Server 2003 R2 SP2 or later (X86 or running 32 bit on X64) • Windows Vista (Business, Enterprise, or Ultimate) SP1 or later (X86 or running 32 bit on X64) • Windows Server 2008 (X86 or running 32 bit on X64) Depending on the functionalities and applications used by the client, the following applications are required: • Microsoft .NET Framework 3.5 For Mail Merge*, Outlook Client Integration, Import and Export Budget to and from Microsoft Excel and Office XML and Share Point links, the following is required: • Microsoft Office 2003 or 2007 *Mail merge requires Collaboration Data Object (CDO) installed. For single-user installation Microsoft SQL Server 2005 Express or SQL Server 2008 Express is supported. For developing reports for the RoleTailored client, one of the following products is required: • Microsoft® Visual Web Developer™ 2005 Express edition SP1 or above* • Microsoft Visual Studio 2005 Standard / Professional SP1 or later • Microsoft Visual Studio 2008 Standard / Professional SP1 or later * If Microsoft Visual Web Developer 2005 Express edition is used, Reporting Add-in for Microsoft Visual Web Developer 2005 Express is also required. For debugging applications running on the Microsoft Dynamics NAV Server, Microsoft Visual Studio 2008 SP1 is required. Microsoft Official Training Materials for Microsoft Dynamics ® 2-5Your use of this content is subject to your current services agreement
  • 6. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009 The Service Tier The Service Tier requires one of the following operating systems: • Windows XP Professional with SP3 or later (X86 or running 32 bit on X64) • Windows Server 2003 SP2 or later (X86 or running 32 bit on X64) • Windows Server 2003 R2 SP2 or later (X86 or running 32 bit on X64) • Microsoft Small Business Server 2003 R2 SP2 or later (X86 or running 32 bit on X64) • Microsoft Small Business Server 2008 or later (X86 or running 32 bit on X64) • Windows Vista (Business, Enterprise, or Ultimate) SP1 or later (X86 or running 32 bit on X64) • Windows Server 2008 (X86 or running 32 bit on X64) • Microsoft Windows Essential Business Server 2008 Standard or Premium (running 32 bit on X64) The following components are needed: • Microsoft .NET Framework 3.5 • Active Directory required for 3-tier configurations. The Database Tier - Microsoft SQL Server Option Microsoft Dynamics NAV 2009 supports the following versions of SQL Server: • Microsoft SQL Server 2005 SP2 Express, Workgroup, Standard, Enterprise • Microsoft SQL Server 2008 Express, Workgroup, Standard, Enterprise The operating system requirements depend on the specifications for both SQL Server versions. Both x86 and x64 operating systems are supported. Windows Server 2003 Windows Server 2003 or Windows Server 2008 are the platform operating systems for Microsoft Dynamics NAV 2009. Whether you use the 2003 or 2008 depends on your hardware and infrastructure, and your performance needs.2-6 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 7. Chapter 2: Setup and Installation Windows Server 2003 includes all the functionality customers have to do more with less, while providing security, reliability, availability, and scalability. Microsoft has improved the Microsoft Windows server operating systems to incorporate the benefits of Microsoft .NET. This enables information, people, systems, and devices to successfully connect to one another. Windows Server 2003 is a multipurpose operating system that can handle a diverse set of server roles, depending on a users needs, in either a centralized or distributed manner. Some of these server roles include the following: • Application server • File and print server • Web server and Web application services • Mail server • Terminal server • Remote access and Virtual Private Network (VPN) server • Directory services including Domain Name System (DNS), Dynamic Host Configuration Protocol (DHCP) server, and Microsoft Windows Internet Naming Service (WINS) • Streaming media server Windows Server 2003 Standard Edition is designed for departmental and standard workloads. Windows Server 2003 R2 Enterprise Edition differs from Windows Server 2003 R2 Standard Edition primarily in its support for high-performance servers and its ability to cluster servers for more load handling. These capabilities include the following: • Eight-way Symmetric Multiprocessing (SMP) • Eight-Node Clustering • Up to 64 Gigabytes of RAM This powerful platform provides reliability that helps systems remain available even if problems occur. Windows Server 2003 Datacenter Edition is designed for: • The highest levels of scalability and reliability • Supporting mission-critical solutions for databases • Enterprise resource planning software • High-volume, real-time transaction processing • Server consolidation Microsoft Official Training Materials for Microsoft Dynamics ® 2-7Your use of this content is subject to your current services agreement
  • 8. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009 Windows Server 2003 R2, Datacenter Edition, is available in both 32-bit and 64- bit versions and includes the following: • Thirty two-way SMP • Eight-Node Clustering • Up to 64 Gigabytes of RAM Microsoft Dynamics NAV uses Windows Server 2003 as an application server, and will be installed on a Windows Server 2003 Standard Edition in most production environments. Other environments may require the Enterprise or Datacenter Editions. Windows Server 2008 Windows Server 2008, with built-in Web and virtualization technologies, enables businesses to increase the reliability and flexibility of their server infrastructure. New virtualization tools, Web resources, and security enhancements help save time, reduce costs, and provide a platform for a dynamic and optimized datacenter. Powerful new tools, such as Internet Information Services (IIS) 7.0 and Server Manager, provide more control over servers, and streamline Web, configuration, and management tasks. Advanced security and reliability enhancements, such as Network Access Protection and the Read-Only Domain Controller, empower the operating system and help protect the server environment to make sure a solid foundation on which to build businesses. Windows Server 2008 is available in multiple editions to support the varying server needs of organizations of all sizes. Windows Server 2008 is available in five primary editions, and three of these editions are also available without Windows Server Hyper-V, bringing the total number of editions to eight.2-8 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 9. Chapter 2: Setup and Installation Windows Server 2008 Roles are specified in the following table: FIGURE 2.1 WINDOWS SERVER 2008 ROLES Microsoft Official Training Materials for Microsoft Dynamics ® 2-9Your use of this content is subject to your current services agreement
  • 10. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009 Microsoft SQL Server The software requirements for Microsoft Dynamics NAV 2009 with Microsoft SQL Server depend on the SQL Server versions supported by Microsoft Dynamics NAV. There are two supported versions: • Microsoft SQL Server 2005 SP2 Express, Workgroup, Standard, Enterprise • Microsoft SQL Server 2008 Express, Workgroup, Standard, Enterprise Microsoft SQL Server is a comprehensive database platform providing enterprise-class data management with integrated business intelligence (BI) tools. It is fully integrated into the Microsoft Data Platform. FIGURE 2.2 THE MICROSOFT DATA PLATFORM The Microsoft SQL Server data engine is the core of this enterprise data management solution. Additionally, Microsoft SQL Server combines analysis, reporting, integration, and notification. Business intelligence (BI) features provide a competitive advantage. These advantages include enriching data and building complex business analytics with Analysis Services, and writing, managing, and delivering rich reports that use Reporting Services.2-10 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 11. Chapter 2: Setup and Installation Software Requirements for SQL Server SQL Server must be installed on a computer running Microsoft Windows. The specific version of Windows required depends on the edition of SQL Server being installed. SQL Server is available in many editions to help meet the needs of your organization. Microsoft SQL Server Enterprise Edition Microsoft SQL Server 2008 Enterprise provides a trusted, productive, and intelligent data platform that enables you to run your most demanding business- critical applications, reduce time and cost of development and management of applications, and deliver actionable insight to your entire organization. SQL Server 2008 Enterprise provides the highest levels of security, reliability, and scalability. Enterprise Edition is meant to support the largest enterprise online analytical processing environments, highly complex data analysis, data warehousing, and active Web servers. For more information, go to http://www.microsoft.com/sqlserver/2008/en/us/enterprise.aspx. Microsoft SQL Server Standard Edition SQL Server 2008 Standard is a complete data management and business intelligence platform providing best-in-class ease of use and manageability for running departmental applications. Standard Edition includes the necessary functionality for e-commerce, data warehousing, and line of business solutions that most small and medium sized business use. If your organization needs to track large amounts of data but does not need all the functionality of Enterprise Edition then Standard Edition will work well with Microsoft Dynamics NAV. For more information, go to http://www.microsoft.com/sqlserver/2008/en/us/standard.aspx. Microsoft SQL Server Workgroup Edition SQL Server 2008 Workgroup is a reliable data management and reporting platform that delivers secure, remote synchronization and management capabilities for running branch applications. It includes the core database features of the SQL Server product line and is easy to upgrade to Standard or Enterprise. Microsoft Official Training Materials for Microsoft Dynamics ® 2-11Your use of this content is subject to your current services agreement
  • 12. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009 Workgroup Edition is the data management solution for small organizations that need a database that has no limit on the size or number of users and can work as a back end to small Web servers and departmental or branch office operations. For more information, go to http://www.microsoft.com/sqlserver/2008/en/us/workgroup.aspx. Microsoft SQL Server Developer Edition SQL Server 2008 Developer enables developers to build and test applications that run on SQL Server on 32-bit, IA-64, and x64 platforms. SQL Server 2008 Developer includes all of the functionality of Enterprise Edition, but is licensed only for development, test, and demonstration use. The license for SQL Server 2008 Developer entitles one developer to use the software on as many systems as necessary. For rapid deployment into production, instances of SQL Server 2008 Developer can easily be upgraded to SQL Server 2008 Enterprise without reinstallation. Developer Edition includes all the functionality of SQL Server Enterprise Edition. However, it is licensed as a development and test server, not as a production server. For more information about SQL Server Developer Edition, go to http://www.microsoft.com/sqlserver/2008/en/us/developer.aspx. For more information about upgrading Developer to Enterprise Edition, go to http://msdn.microsoft.com/en-us/library/ms143393.aspx. Microsoft SQL Server Express Microsoft SQL Server 2008 Express is a free edition of SQL Server that is ideal for learning, developing and powering desktop, Web and small server applications, and for redistribution by Independent Software Vendors (ISVs). SQL Server 2005 Express Edition is a free, easy to use and easy to manage database that can be redistributed to act as a client database and basic server database. It is usually suited for small data sets and will not work in some Microsoft Dynamics NAV implementations. For more information, go to http://www.microsoft.com/sqlserver/2008/en/us/express.aspx. Microsoft SQL Server Web Edition and Compact Edition Microsoft SQL Server 2008 Web and Compact 3.5 Edition are specifically targeted for web application hosting and mobile application development scenarios.2-12 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 13. Chapter 2: Setup and Installation Edition Features SQL Server is available in many editions to meet the needs of your organization. To determine which SQL Server edition will work best for your Microsoft Dynamics NAV implementation, review the features in each edition. FIGURE 2.3 SQL SERVER EDITION FEATURE COMPARISON For a full comparison of the features available in each edition of SQL Server, please go to http://www.microsoft.com/sqlserver/2008/en/us/editions- compare.aspx. SQL Server 2005 on Windows Server 2008 and Windows Vista In order to give customers more secure products, Windows Server 2008 and Windows Vista are supported by SQL Server 2005 Express Edition Service Pack 1 (SP1). All other editions will be supported by SQL Server 2005 Service Pack 2 (SP2) or later when it becomes available. Earlier versions of SQL Server, including SQL Server 2000 (all editions including Desktop Engine edition, also known as MSDE), SQL Server 7.0, and SQL Server 6.5, will not be supported on Windows Server 2008 or Windows Vista. Customers running applications that have these earlier versions of SQL Server should consider evaluating and upgrading to SQL Server 2005, which was designed to take advantage of the upcoming security and performance enhancements in the operating environment. Microsoft Official Training Materials for Microsoft Dynamics ® 2-13Your use of this content is subject to your current services agreement
  • 14. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009 SQL Server 2005 requires Microsoft SQL Server 2005 Service Pack 2 (http://www.microsoft.com/downloads/details.aspx?FamilyId=d07219b2-1e23- 49c8-8f0c-63fa18f26d3a&displaylang=en) (SP2) to run on Windows Server 2008 and Windows Vista SP1. You must first install the full release version of SQL Server 2005 before you apply SP2. Other .NET Framework The .NET Framework is a development and execution environment that enables different programming languages and libraries to work together seamlessly to create Microsoft Windows-based applications that are easier to build, manage, deploy, and integrate with other networked systems. Microsoft Web Services Enhancements The Web Services Enhancements for Microsoft .NET is an add-in to Microsoft Visual Studio 2005 and the Microsoft .NET Framework 3.5 that enables developers to build secure Web services based on the latest Web services protocol specifications. Microsoft Report Viewer 2008 The Microsoft Report Viewer 2008 Redistributable Package includes Windows Forms and ASP.NET Web server controls for viewing reports designed by using Microsoft reporting technology. Microsoft Report Viewer control enables applications that run on the .NET Framework to display reports designed using Microsoft reporting technology. This redistributable package contains Windows Forms and ASP.NET Web server control versions of the Report Viewer.Hardware Requirements Microsoft Dynamics NAV does not require particularly sophisticated equipment, but as with all programs, the better your equipment, the better the results. You get the best solution with the optimal equipment and with the program settings optimized for that equipment. In a multi-user installation, you can, in principle, use the same type of computer for both the clients and the server. However, there is a difference in how much CPU power, memory, and disk space the client and server will need. Computers for servers that run Windows Server 2003 or Windows Server 2008 must comply with the requirements specified by Microsoft. If you use the Microsoft Dynamics NAV SQL Server option, the hardware must meet the specifications of both the operating system and the Microsoft SQL Server edition.2-14 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 15. Chapter 2: Setup and Installation The database is stored on the server, making it a critical area of the application because several users can access it at the same time. Therefore, it is important to select a powerful computer for the server. In addition, the following are aspects of the server that require additional consideration: • The hard disk and controller • The RAID system • The memory • The network adapter • The CPU Hard Disks The hard disk is the slowest component in a computer because it consists of mechanical parts. Access times to the hard disk are long compared to those to memory (typical access time to memory is less than 60 nanoseconds and access time to a hard disk is faster than 10 milliseconds). All of the programs and information are stored on the hard disk so that data is continuously read from and written to the disk. Because there is only one read/write head in a hard disk, only one read or write operation can be carried out at a time. By using more than one disk in your system, you can increase performance significantly. Hard Disk Controller You must, however, use a hard disk controller that supports control of more than one hard disk at a time without increasing access time to the disks. Furthermore, it is important for the controller to have a high transfer rate so data can travel quickly between the memory and the hard disk. The use of CPU per disk transfer must also be minimized. An example of a controller with these features is the Fast Wide SCSI 2 (Small Computer System Interface) controller. When selecting a hard disk controller, do not use the write-back or lazy-write caching systems that are built into your hard disk controller unless the disk controller has a battery backup. Using a battery-supported hard disk controller prevents loss of data that might otherwise result if the system experiences a power failure. You should also be aware of the write-cache facility that most of todays hard disks use. When you buy a hard disk, make sure that you can disable its write- cache (using software or a jumper on the disk). When write-cache is enabled and a power failure occurs when data is still in this cache, you could lose the data. It is also necessary to have some sort of error detection unit implemented to allow the controller to determine when a byte of data in the cache is corrupted (for example, caused by a single-bit error or a defective memory chip). Any errors that occur must be corrected so that a correction scheme must be implemented in the controller. An ECC (Error Correction Code) RAM is an example of this kind of correction scheme. Microsoft Official Training Materials for Microsoft Dynamics ® 2-15Your use of this content is subject to your current services agreement
  • 16. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009 Disk Speed and Disk Size Because the hard disk is the slowest component of a computer, you want to make disk read and write transactions as fast as possible. You can do this by using fast disks (15000 rpm). Fast disks definitely perform better than disks that have a lower speed (10000 rpm). Adding hard drives to your system will increase the overall performance. To avoid poor performance in your daily work, you should add more than one hard disk to your system and divide the database among these hard disks. Four relatively slow hard disks perform much better together than one super fast hard disk. Several "intelligent" controllers exist, which can control several hard disks simultaneously, for example, RAID (Redundant Array of Independent Disks) controllers. Important to know is that pure disk performance is not the same as Microsoft Dynamics NAV performance because many other things are going on for example in-memory processing, network transport and so on. It would be wrong to claim that write performance is more important than read performance because Microsoft Dynamics NAV does about five reads every time it does one write. With a RAID setup you can achieve almost double performance by doubling the number of disks in a pure striping setup but most customers will run both striping and mirroring requiring more disks to achieve this performance gain. Solid-state drive (SSD) Solid state disks solve the problem of physical constraints by replacing hard disk drives with high speed circuitry. Instead of a rotating disk, a solid state disk uses memory chips (typically DDR RAM or Flash Memory) to read and write data. Solid state drives have several advantages over the magnetic hard drives. Most of this comes from the fact that the drive does not have any moving parts. While a traditional drive has drive motors to spin up the magnetic platters and the drive heads, all the storage on a solid state drive is handled by flash memory chips. This provides three distinct advantages: • Less Power Usage • Faster Data Access • Higher Reliability While solid state disks will often boost write performance they typically do not provider as much read performance because the memory cache on the SQL Server already serves a lot of read requests. However the initial measurements (http://blogs.msdn.com/freddyk/archive/2009/02/09/more-ssd-testing.aspx) show that they can improve raw read/write performance compared to conventional hard2-16 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 17. Chapter 2: Setup and Installation drives. As with conventional hard drives it is still a good idea to build redundancy into a system using solid-state hard drives (mirroring) RAID (Redundant Array of Independent Disks) RAID systems provide two main advantages: reliability (RAID 1 or mirroring) and performance (RAID 0 or striping). Given the low cost of hard drives, any company should at least implement RAID 1 to be more secure from data-loss. Whether you use RAID 0 depends on the number of transactions the system is required to handle. The advantage of RAID systems is that you can add disks over time and improve performance or increase capacity. A RAID system consists of several disks. The key feature of a RAID system is that the failure of one disk does not bring the entire system down. Several RAID configurations exist. The most important configurations are described in the following table: RAID Description Level RAID 0 This level is also known as disk striping because it uses a disk file system called a stripe set. Data is divided into blocks and spread in a fixed order among all disks in an array. RAID 0 improves read and write performance by spreading operations across multiple disks. RAID 0 is similar to RAID 5, but RAID 0 does not provide redundancy (fault tolerance). RAID 1 Called mirroring. The data is written redundantly to pairs of drives and can be read independently from each drive. This is fast and provides full redundancy, but the disk capacity required is doubled. The read performance can be up to twice as fast as a single drive because both drives can process the read request simultaneously. Write performance is almost unchanged. RAID 1 is best for transaction processing, where many small I/Os are required. RAID 1 is also the most expensive RAID configuration because of the disk overhead. In theory, RAID 1 has twice the read transaction rate of single disks and the same write transaction rate as single disks. Microsoft Official Training Materials for Microsoft Dynamics ® 2-17Your use of this content is subject to your current services agreement
  • 18. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009 RAID Description Level RAID 5 Also known as striping with parity, this level is the most popular strategy for new designs. RAID 5 stripes the data in large blocks across the disks in an array. The parity for the stripes of data is also spread across all of the drives, so no one drive is dedicated to parity. Data redundancy is provided by the parity information. The data and parity information are arranged on the disk array so that the two types of information are always on different disks. In general, striping with parity offers better performance than disk mirroring (RAID 1). RAID 5 requires a minimum of three drives to implement. It has the highest read transaction rate, but a medium write transaction rate. RAID 10 RAID 10 uses a mirrored array of disks (RAID 1 array) that are (1+0) striped to another set of disks. RAID 10 is not to be confused with RAID 0+1. RAID 0+1 This level is also known as mirroring with striping. RAID 0+1 uses a striped array of disks that are then mirrored to another identical set of striped disks. For example, a striped array can be created by using five disks. The striped array of disks is then mirrored using another set of five striped disks. RAID 0+1 provides the performance benefits of disk striping with the disk redundancy of mirroring. RAID Levels and SQL Server RAID is a disk system that contains multiple disk drives, called an array, to provide better performance, reliability, storage capacity, and reduced cost. Fault- tolerant arrays are categorized in six RAID levels: 0 through 5. Each level uses a different algorithm to implement fault tolerance. Although RAID is not a part of SQL Server, implementing RAID can directly affect the way SQL Server performs. RAID levels 0, 1, and 5 are typically used with SQL Server. A hardware disk array improves I/O performance because I/O functions, such as striping and mirroring, are handled efficiently in firmware. Conversely, an operating system-based RAID offers reduced cost, but consumes processor cycles. When cost is an issue and redundancy and high performance are required, RAID 5 volumes are a good solution. Data striping (RAID 0) is the RAID configuration with the best performance, but if one disk fails, all the data on the stripe set becomes inaccessible. A common installation technique for relational database management systems is to configure the database on a RAID 0 drive and then put the transaction log on a mirrored drive (RAID 1). You can obtain the best disk I/O performance for the database2-18 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 19. Chapter 2: Setup and Installation and maintain data recoverability through a mirrored transaction log, assuming you perform regular database backups. RAID 5 provides redundancy of all data on the array. This allows for a single disk to fail and be replaced most of the time without system downtime. Be aware that RAID 5 offers reduced performance compared to RAID 0 or RAID 1 (because of the parity overhead), but better reliability and faster recovery. Write performance on RAID 5 increases when more disks are added to the RAID 5 array. In general, read performance is better in RAID 5 than in RAID 1 (as RAID 5 has at least three disks, whereas RAID 1 has only two). For ERP systems, with many write transactions, RAID 5 is not always the best solution. Microsoft Official Training Materials for Microsoft Dynamics ® 2-19Your use of this content is subject to your current services agreement
  • 20. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009 In general, the following RAID recommendations apply to SQL Server: SQL Server Component RAID Configuration Operating System + SQL Server Files RAID 1 Database RAID 10 Transaction Log RAID 1 or 10 TempDB RAID 1 or 10 The operating system files on a SQL Server are not the most critical nor the most frequently used files of a SQL Server configuration; a RAID configuration with good read performance can always be recommended. However, it is not required (because reading these files does not generate much overhead). For the database files, it is important to select a RAID level with good read and write performance. Make sure that you put the database files and the transaction log files on separate disk arrays. Otherwise you will encounter disk contention which reduces the performance of the SQL Server. You could also lose both the database and transaction log files should a disk failure occur. It is also recommended to keep the Windows page file and the database files on separate disk arrays. The transaction log files require a RAID level with excellent write performance, because the log files are constantly written to. Here, RAID 10 is a good choice. If you have multiple transaction log files, it is better to store each transaction log on a separate RAID 10 array. Although it is possible to place the TempDB on a RAID 0, we recommend that you select a more fault-tolerant RAID configuration for production environments. (For development environments or environments where downtime is not important, RAID 0 can be used.) Be aware that failure of a disk that contains the TempDB will result in server downtime, which is to be avoided in production environments. Processor The speed of the processor (also called Central Processing Unit or CPU) is also an important performance factor. It is the CPU that performs all the calculations involved in Microsoft Dynamics NAV - the faster the CPU, the more calculations per second. It is also important to have as much level 2 cache in the system as possible. This increases the speed with which the CPU gets data from and saves data to RAM. However, it should be noted that adding more hard disks gives a greater improvement in performance than increasing the speed of the CPU.2-20 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 21. Chapter 2: Setup and Installation Multiple Processors Microsoft SQL Server can be configured to use multiple processors. The maximum number of processors that can be used by SQL Server depends on the edition: SQL Server edition Enterprise Standard Workgroup Express Number of CPUs OS Maximum 4 2 1 If multiple processors are enabled, it is recommended that you: • Create as many database files as there are processors • Disable automatic database growth in SQL Server If you have a multi-processor server, make sure not to allocate all processors to SQL Server, but keep a number of processors available for other tasks that are running on the server. For example, in a server that has four processors, allocate a maximum of three processors to SQL Server and keep at least one for the operating system and other applications. 32-bit versus 64-bit The terms 32-bit and 64-bit refer to the way a computers processor handles information. The 64-bit version of Windows handles large amounts of RAM more effectively than a 32-bit system. The benefits are most apparent when you have a large amount of RAM installed on your computer (typically 4 GB of RAM or more). Because a 64-bit operating system can handle large amounts of memory more efficiently than a 32-bit operating system can, a 64-bit system can be more responsive when running several programs at the same time and switching between them frequently. Memory Memory is an important resource in a Microsoft SQL Server environment. Microsoft SQL Server tends to use its memory to serve the user requests. The amount of memory that SQL Server can address depends on the SQL Server edition (and the operating system). It should be proportional to the number of users. Edition Enterprise Standard Workgroup Express Required 512 MB 512 MB 512 MB 192 MB Minimum Recommended 1 GB 1 GB 1 GB 512 MB Minimum (SQL Server 2005) Microsoft Official Training Materials for Microsoft Dynamics ® 2-21Your use of this content is subject to your current services agreement
  • 22. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009 Edition Enterprise Standard Workgroup Express Recommended 2 GB 2 GB 2 GB 1 GB Minimum(SQL Server 2008) Maximum 4 GB (32-bit) 4 GB (32- 4 GB 1 GB Memory or OS bit) or OS Utilization Maximum Maximum (64-bit) (64-bit) The memory requirements in the table do not reflect additional memory requirements for the operating systems. For detailed memory requirements, go to http://www.microsoft.com/sql/. The amount of memory that SQL Server can address can be configured through the Memory page in the Server Properties window in SQL Server Management Studio. When Minimum server memory is set to 0 and Maximum server memory is set to 2147483647, SQL Server can take advantage of the optimal amount of memory at any given time, subject to how much memory the operating system and other applications are currently using. As the load on the computer and SQL Server changes, so does the memory allocated. You can further limit this dynamic memory allocation to the minimum and maximum values. Minimum server memory (in MB) specifies that SQL Server should start with at least the minimum amount of allocated memory and not release memory under this value. Set this value based on the size and activity of your instance of SQL Server. Always set the option to a reasonable value to ensure that the operating system does not request too much memory from SQL Server and inhibit Windows performance. Maximum server memory (in MB) specifies the maximum amount of memory SQL Server can allocate when it starts and while it runs. This configuration option can be set to a specific value if you know there are multiple applications running at the same time as SQL Server and you want to guarantee that these applications have sufficient memory to run. If these other applications, such as Web or e-mail servers, request memory only as needed, then do not set the option, because SQL Server will release memory to them as needed. However, applications often use whatever memory is available when they start and do not request more if needed. If an application that behaves in this manner runs on the same computer at the same time as SQL Server, set the option to a value that guarantees that the memory required by the application is not allocated by SQL Server.2-22 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 23. Chapter 2: Setup and Installation Be aware that sometimes you can achieve better performance by reserving a reduced amount of memory for SQL Server. However, if SQL Server has insufficient memory (because of a lack of physical memory or because of inadequate memory configuration) and Microsoft SQL Server uses all available memory, query response time, CPU usage, and disk input/output will go up (because Windows starts paging). In general, you can say that a SQL Server cannot have too much memory. In the ideal scenario, the SQL Server has sufficient memory to keep the entire Microsoft Dynamics NAV database in memory. It is also important that the memory has a parity bit or is of the ECC (Error Correction Code) type. 32-bit versus 64-bit systems If you run SQL Server on a 32-bit operating system, you can only address 4 GB of memory. For a 64-bit edition running on a 64-bit operating system, the amount of memory is limited to the operating systems maximum. Network Communication to and from the client passes through the network. If messages are to be delivered quickly, you must have a fast network adapter. This also ensures that the CPU use per network send/receive activity is minimal, which reduces the load on the CPU. The physical connection (the cabling) between the server and the clients must also be able to support the high speed. The Microsoft Dynamics NAV Client requires a 100MB switched (no hubs) connection to the server. Therefore, 56K modem or broadband connections are not supported with the standard Microsoft Dynamics NAV Client. Alternative solutions are available (Windows Terminal Services, Microsoft Dynamics NAV Employee Portal or Automated Data Capture System (ADCS) for example). It is important to have a powerful network connection between the Microsoft NAV Service Tier (NST) and the SQL Server because this is where most network communication will take place. The NST processes all business logic on behalf of the client. The Microsoft Dynamics NAV RoleTailored client is designed to communicate less with the NST than the classic client.Microsoft Dynamics NAV Architecture Microsoft Dynamics NAV 2009 is built on a three-tier architecture model. This differs significantly from the two-tier architecture of Microsoft Dynamics NAV 5.0 and earlier versions. Microsoft Dynamics NAV 2009 introduces a new layer in the architecture. This additional layer, or tier, is designed to host and execute all the business logic. In the two-tier architecture of Microsoft Dynamics NAV 5.0, the business logic resides at the client layer. Microsoft Official Training Materials for Microsoft Dynamics ® 2-23 Your use of this content is subject to your current services agreement
  • 24. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009 It improves security to execute the business logic on another layer that does not provide an interface, or access point, to the user. Scalability is also improved in the three-tier architecture. Microsoft Dynamics NAV 5.0 Architecture Two-tier architecture models are used in the true Client/Server Distributed Data solution. In two-tier architectures, the data and data manipulation layers reside on the server, whereas the application logic, presentation logic, and presentation layers reside on the client. Microsoft Dynamics NAV 5.0 is designed according to the two-tier architecture model. It puts the application logic (Business Logic) and presentation logic/layers (User Interface) on the client computer. The two-tier architecture also puts the data and data manipulation layers (DML) on the server in the native database and SQL Server configurations. The Client Tier The Classic client is located on the client tier. It consists of an administration component for administrators and Microsoft Dynamics NAV 4.0/5.0 super users and client access for the Classic client user. The client tier has specific connections for data transfer to the server tier and the database management component. These connections consist of the client, security approved access to the database components on the server tier, and administration access to the database management. The Server Tier The server tier consists of the database management system and the native database for Microsoft Dynamics NAV 4.0/5.0 or the Microsoft SQL Server database. The existing application server or Application Server for Microsoft Dynamics NAV is an integration point to the Microsoft Dynamics NAV 4.0/5.0 application. It can be used for example, to connect to Microsoft® BizTalk Server®. The application server represents an effort to achieve three-tier architecture benefits. However, it is limited to only one process at a time. Therefore, multiple application servers are needed for many production environments. Microsoft Dynamics NAV 2009 Architecture The three-tier architecture is used in the Client/Server Distributed Data and Application system. With this architecture, in which the data and data manipulation layers are put on their own servers, the application logic is put on its own server, and the presentation and presentation logic are put on the client computer.2-24 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 25. Chapter 2: Setup and Installation Microsoft Dynamics NAV 2009 is designed according to the three-tier architecture model as follows: • This version puts the presentation logic/layers (User Interface) on the client computer. • It puts the Business logic on another layer available in the three-tier architecture called the service tier. • It puts the data and data manipulation layers (DML) on the database server tier. The Microsoft Dynamics NAV 2009, three-tier architecture and the classic two- tier architecture are not mutually exclusive. In fact, they coexist. The Classic client remains an essential component for developing and administering Microsoft Dynamics NAV applications. (For example, you must use the Classic client to upload the Microsoft Dynamics NAV 2009 license file or to develop objects for the RoleTailored client.) The three-tier architecture is multithreaded so that it can handle more than one process at a time. It overcomes the following intrinsic limitations of the two-tier architecture: • The first tier of the architecture is the client. • The second tier is the multithreaded middle tier. This is the service tier that is based on Web services. • The third tier is where the SQL Server database resides. The RoleTailored client connects to the service tier instead of to the database directly, and all business logic resides in the Microsoft Dynamics NAV Service Tier. Because the business logic is using the service tier, parties cannot gain access to sensitive data merely by hacking a client. Also, customization and integration scenarios are greatly improved, as programming interfaces are hosted by the service tier and are therefore available from custom solutions. The Service Tier Briefly, the Microsoft Dynamics NAV Server is a .NET-based Windows Service application that works exclusively with SQL Server databases. It uses the Windows Communication Framework as the communication protocol for RoleTailored clients and for Web services. It can execute multiple client requests in parallel and serve other clients by providing Web service access to authenticated clients. As soon as a request is received and validated, it is passed on to the relevant component, metadata provider, application, or reporting service for execution. When execution is complete, the executing component sends a response to the calling client. Microsoft Official Training Materials for Microsoft Dynamics ® 2-25Your use of this content is subject to your current services agreement
  • 26. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009 The Database Tier The database tier in Microsoft Dynamics NAV 2009 can hold either a native or a SQL Server database. The two-tier architecture supports both database server options. Classic client users connect to the database and continue to work with the two-tiered architecture. RoleTailored client users will pass through the three-tier architecture that requires Microsoft SQL Server in the database tier. When upgrading to the new three-tiered architecture, make sure that you plan for a possible database migration.Configuration When creating a Microsoft Dynamics NAV database, you need to specify a number of database settings, such as the database name, the database and transaction log files with their size and location, the collation, and so on. Although the impact of these settings is not always immediately visible when the new database is created, some of these settings can have an influence on user- friendliness and performance once you start using the database. In addition, some of these settings, such as collation, are difficult to change afterward. This lesson describes the most important database settings to use when configuring a Microsoft Dynamics NAV environment. Recommended Database Settings To create a new Microsoft Dynamics NAV database, open the Classic client and select File, Database, and then New. FIGURE 2.4 SELECT SERVER WINDOW In the Select Server window, you select the SQL Server that you want to create a database on. Also, select the database authentication type.2-26 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 27. Chapter 2: Setup and Installation If you select Windows Authentication, the current Windows account will be used to create the database. If you select Database Server Authentication, you have to specify a User ID and a password. Regardless of the selected authentication type, you must use a user ID that is part of the sysadmin server role in Microsoft SQL Server to create a database. On the Advanced tab, you can select the network protocol to connect to the server. We recommend that you use either the Default or the TCP/IP protocols. Finally, when you click OK, the New Database window opens. The New Database window contains a number of tabs with database settings. FIGURE 2.5 THE NEW DATABASE WINDOW On the General tab, enter the name of the database. The Database Name specified here will be used to automatically define the names of the database and transaction log files. After specifying a database name, click the Database Files tab. FIGURE 2.6 THE DATABASE FILE NAMES Microsoft Official Training Materials for Microsoft Dynamics ® 2-27Your use of this content is subject to your current services agreement
  • 28. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009 Here you can specify the number of files that the new database will contain. You can also enter the name, size, growth rate, and so on, of the individual database files. It is recommended that you carefully consider your database before you determine the size of the database. Expanding your database later can take considerable time and resources. Logical Name Logical names make it easier to manage data files. Microsoft Dynamics NAV will by default configure two data files for each new database. The first data file is created as the primary file in the PRIMARY filegroup. The second data file and every subsequent file that is added to the database will be created in an additional filegroup. The primary data file is always the first file listed on the Database Files tab and must always be specified. It is recommended that primary data files have the extension .mdf and secondary data files have the extension .ndf. Multiple Database Files When you create multiple database files, make sure that you create database files of equal size. This is because SQL Server uses a proportional fill strategy across all files in a filegroup. The proportional fill algorithm is based on the size of the data files and writes an amount of data proportional to the free space in the file. If data files are created with unequal sizes, the proportional fill algorithm will use the largest file more frequently rather than spreading the data between all the files. This defeats the purpose of creating multiple data files. Creating multiple database files is especially recommended when you have several server processors enabled in SQL Server. If you enable multiple processors, the server load can be spread over several CPUs. However, if there is only one database file, only one processor can write to the database at a time. To increase performance, it is recommended to create as many database files as you have processors enabled for SQL Server. File Name and Locations Whether you have single or multiple database files, always place them on a disk system that offers excellent read and write performance. As discussed earlier in this chapter, a RAID configuration is preferred to ensure high availability. For more details about the RAID configurations, see the Hardware Requirements section in this chapter. If you have multiple database files, make sure that you spread the database files on multiple disk systems. Because there is only one read/write head in a hard disk, only one read or write operation can be carried out at a time. By using more than one disk in your system, you can increase performance significantly.2-28 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 29. Chapter 2: Setup and Installation By default, the database files will all be placed in SQL Servers data folder (C:Program FilesMicrosoft SQL ServerMSSQL10.MSSQLSERVERMSSQLDATA). You can specify different locations by entering the full path and file name in the File Name field. By preference, place the database files on a different disk than the one that contains the Windows page file. Do not place the database files on a compressed drive, as this degrades performance. Database Size As a default, the size of the primary data file will be set at 40 MB or to the size of the primary data file in the model database (whichever is the greater). The size of the secondary data file will be set at 160 MB. The size of the transaction log file will be set at 50% of the sum of the primary and secondary data files. These settings allow you to restore the standard database backup that is included with the program to a new database without causing the data or transaction log files to grow. You can change all of these sizes and all of the other file properties so that they meet your requirements before you create the database. As stated earlier, make sure that you select an initial size that meets your needs. Be aware that expanding the database costs time and resources. Also, create database files of equal size. To change the default size, enter the new database size (in megabytes) in the File Size (MB) field. File Growth As you continue to work in Microsoft Dynamics NAV, more and more data is entered in the database and the database will grow. At some point, the database files will be completely full, and must be expanded. In the File Growth field, you can enter the amount by which the data file will increase in size each time it expands. This can be expressed in megabytes (MB) or as a percentage (%). The default value is MB. Make sure that you specify an equal file growth size for all database files, to keep the proportional fill strategy. If you enter a percentage, take into account that the database will be expanded with a variable amount. Unrestricted Growth versus Maximum Size You can also specify the maximum size for a database file. You can specify a fixed size (in the Maximum Size (MB) field) or you can select the Unrestricted Growth option for a database file. In the first case, the database will grow until the maximum size specified is reached. In the latter case, the database will continue to grow until all available space on the corresponding disk is used. Microsoft Official Training Materials for Microsoft Dynamics ® 2-29Your use of this content is subject to your current services agreement
  • 30. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009 Whatever option you choose, you must always monitor the amount of free space on the different disks. If the database cannot be expanded (because of a lack of free disk space), SQL Server can no longer write to the database, an error message will be generated, and the database will become unresponsive. We recommend that you do not set the maximum size of the database file to the maximum size of the disk. Instead, set it to 80 or 90% of the disk drive size and keep the remaining disk size as a buffer for emergency cases. Transaction Log Files Microsoft Dynamics NAV will configure one transaction log file for each new database. As a default, the size of this transaction log file will be set at 50% of the sum of the primary and secondary data files. The Transaction Log Files tab lets you control the location, size, growth, and maximum size of all the transaction log files. FIGURE 2.7 DEFINING THE TRANSACTION LOG FILES In general, the recommendations for the database files also apply to the transaction log files. The transaction log is used to track the changes that are made to the database and for database recovery. Therefore, the transaction log files can be considered as the most important files in the SQL Server environment. If a performing disk system is important for the database files, it is even more important and almost a requirement for the transaction log files because these files are constantly being written to. Remember not to place the transaction log files and the database files on the same disk. Make sure that you monitor the free disk space on disks containing the transaction logs. If the transaction log is full and cannot be expanded, the database will enter the Suspect mode and become unavailable for the users.2-30 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 31. Chapter 2: Setup and Installation Collation Types The New Database window contains editable collation information - that is, the system you will use to sort and compare your data. FIGURE 2.8 THE DATABASE COLLATION The SQL Server Option for Microsoft Dynamics NAV allows you to choose between Windows collations and SQL collations. • A Windows collation corresponds to the collations supported by the Windows operating systems where they are known as Regional and Language Options. • SQL collations are the original collations introduced in SQL Server 7.0 and are still supported for backward compatibility. SQL collations are not recommended at all. Instead, Microsoft advises you to use a Windows collation. This type of collation closely follows the collation rules of the operating system. Using a Windows collation enables Microsoft Dynamics NAV to sort and filter data the same way as SQL Server. When you create a new database, this tab displays the default server collation information. If the server collation is a Windows collation, this collation will be used as the default collation for the database. If the server collation is an SQL collation, then a case and accent sensitive Windows collation for the English language will be used as the default collation for the database. If you do not make any modifications, this will be the collation information used for the new database. Always choose the collation that best matches your requirements when you create a database. Before choosing a collation for Microsoft Dynamics NAV, it is important to know in which countries/regions the database is used. If Microsoft Dynamics NAV is used in a single country/region environment, it is advised to always use the valid local Windows collation. In multiple country/region environments, it is recommended to use one database per country/region or, if possible, one for each collation in your region. Microsoft Official Training Materials for Microsoft Dynamics ® 2-31Your use of this content is subject to your current services agreement
  • 32. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009 Microsoft Dynamics NAV works best with a single database per country/region. When you work with multiple collations in your environment, it is advised that you use a dedicated SQL server for each one. The collation of the master database and other system databases such as tempdb should be in the same collation to avoid performance issues because of sorting problems. If users with different collations must work in one and the same database, it is advised that you select the Windows collation that best matches the geographic needs of the different users. When selecting a collation, the following recommendations apply: • Select a Windows collation. • Never use a binary sort order. • Use a case-insensitive, accent sensitive collation. • Never use a collation that mismatches the Regional Settings on the server. Selecting a case-sensitive collation has a negative effect on user-friendliness. Suppose you want to search the Contact table for a contact named "Contoso". In a case-insensitive collation, any notation of the company name (all uppercase, all lowercase, or a mix) will result in the company name being found. In a case- sensitive collation, you have to remember the exact notation used when creating the record for the search to return a result. Although the case-sensitive collation is faster, it is less user-friendly. You can modify the collation to suit your requirements before you create a database. Afterward, it is very difficult to change the collation. Validate Code Page If you have selected the Validate Code Page option, the Collation tab only displays the collation descriptions supported by the operating system installed on the client computer that is being used to create the database. This means that it displays the collations that match either the OEM or ANSI code pages used by the client computer. If you have not selected the Validate Code Page option, the Collation tab displays all of the available collations. You can disable this option if you are sure that every character is converted correctly between all the clients and the database. Disabling this setting allows clients that are using different regional settings (code pages) to use the same database even though special characters entered by one client may not be interpreted correctly by another client or by the server.2-32 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 33. Chapter 2: Setup and Installation The following lists other problems that can be caused by not validating the code page are. • The sorting of textual data is governed by the database server and this means that the data may not be sorted according to the rules specified on the "incompatible" client computers. This problem will be more acute if there is some C/AL code that only works correctly when a particular sort order is selected. • If you are accessing SQL Server with external tools, these tools may not be able to read the data that has been entered by the "incompatible" clients correctly. We recommend that you use the default setting and validate code pages because this will avoid all of these problems. On the Options tab, there are a number of options that may influence performance. FIGURE 2.9 DEFINING THE RECOVERY MODEL The Recovery Model The first option that you should consider is the Recovery Model for the database. This setting determines the kind of information written to the transaction log and therefore the kind of recovery model that you want to use in this database. The available options are: • Bulk-Logged • Full • Simple The Full and Bulk-Logged recovery models are similar, and many users of the Full Recovery model will use the Bulk-Logged model occasionally. Microsoft Official Training Materials for Microsoft Dynamics ® 2-33Your use of this content is subject to your current services agreement
  • 34. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009 If you select Full, the details of every transaction are stored in the transaction log, and this information can be used when you apply transaction log backups. The Full Recovery model uses database backups and transaction log backups to provide complete protection against media failure. If one or more data files are damaged, media recovery can restore all the committed transactions. Incomplete transactions are rolled back. Full Recovery allows you to recover the database to the point of failure or to a specific point in time. To guarantee this degree of recoverability, all the operations, including bulk operations such as SELECT INTO, CREATE INDEX, and bulk loading data, are fully logged. This model will have the biggest effect on the size of the transaction log files. If you select Bulk-Logged, the transaction log will only contain limited information about certain large-scale or bulk copy operations. The Bulk-Logged Recovery model provides protection against media failure combined with the best performance and minimal use of log space for certain large-scale or bulk copy operations. For more information about which operations are logged under this recovery model, see the Minimally logged operations [SQL Server] topic in the SQL Server Books Online. If you select Simple, the database can be recovered to the point at which the last backup was made. However, you cannot restore the database to the point of failure or to a specific point in time. To do that, select either the Full or Bulk- Logged Recovery model. For development or test environments, the Simple recovery model can be selected. For production environments, the Full or Bulk-Logged model is highly recommended. We recommend using the SQL Server backup functions to make backups. If you only use Microsoft Dynamics NAVs internal backup functionality to make backups, it makes no sense to use the Full or Bulk-Logged recovery model. On the contrary, the transaction logs will continue to grow until the hard disk runs out of free space. When selecting the Bulk-Logged or Full models, it is extremely important to make backups with the SQL Server functions. For more information about backups, see Advantages of the SQL Server Option chapter. Auto-shrink If you select the Auto-shrink option, the SQL Server Database Engine will periodically shrink data files. The shrink process runs in the background and will reduce the size of the database files by removing free space from the database files. As already stated, expanding the database can cost time and resources. Therefore, it is recommended not to activate this option for live production environments. However, for static environments (test, development, or archive databases) it can be activated.2-34 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 35. Chapter 2: Setup and Installation Torn Page Detection Torn Page detection is a built-in check mechanism that allows SQL Server to guarantee data integrity. If this option is activated, SQL Server will mark database pages with a small checksum and check this number when reading from and writing data pages to the database. Activating this option causes a small performance hit for every read and write operation, which can become visible for large recordsets. In SQL Server 2005, new I/O verification systems have been introduced. Torn Page Detection is likely to be removed in future SQL Server versions. Therefore, it is recommended not to activate this option. Allow Find as You Type This setting determines whether you can use the Find as You Type option when using the Find function to find an entry in a table or form. Using the Find as You Type facility can affect performance because requests are sent to the server for each character that is typed. By default, the option is selected. Enable for Microsoft Dynamics NAV Server This option determines whether a Microsoft Dynamics NAV database is enabled for the three-tiered architecture. If you activate this option, objects will be automatically compiled upon import in the database. Be aware that object compilation will take longer, because the objects will be translated to C# code and saved as BLOB in the Object table. If you do not plan to use the three-tier architecture, it is recommended that you disable this option. If you create a new database in Microsoft Dynamics NAV 2009, the option is selected by default. When upgrading a Microsoft Dynamics NAV 5.0 database, you must select this option if you plan to use the RoleTailored client only. The Advanced tab contains settings that let you control the way locking is handled in the database. FIGURE 2.10 ADVANCED DATABASE SETTINGS Microsoft Official Training Materials for Microsoft Dynamics ® 2-35Your use of this content is subject to your current services agreement
  • 36. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009 Lock Timeout and Timeout Duration (sec.) This setting allows you to specify whether a session will wait to place a lock on a resource that has already been locked by another session. If you select this option, you can specify a Timeout Duration. This setting allows you to specify the maximum length of time a session will wait to place a lock on a resource that has already been locked by another session. The default value is 10 seconds, which under normal circumstances, is sufficient. You can change this value. If this option is cleared, the session will wait indefinitely (is not recommended). If a lock timeout error message occurs while this option is activated, you can slightly increase the value. However, this may be an indication of a malfunctioning component (a network failure, limited network connectivity, suboptimum coding, or insufficient database maintenance). Use monitoring tools to locate the cause of the problem. Always Rowlock This setting allows you to specify that Microsoft Dynamics NAV always places row-level locks instead of page- and table-level locks. By default, the Always rowlock option is not enabled. This means that the Query Optimizer will decide how to lock a table: by row, by page or by table. As rowlocks require additional memory, SQL Server will sometimes convert multiple rowlocks into a single table lock and use the memory for other purposes. The advantage of this is that SQL Server needs less memory to maintain the locks, so it will have a positive effect on performance. It can have a negative impact on concurrency, because page locks can lock too much data. To keep the Query Optimizer from choosing a locking method, you can activate the Always rowlock option, so Microsoft Dynamics NAV will send ROWLOCK hints to the SQL Server. Sending rowlocks reduces the risk of blocks, but will put pressure on the master database, because administering rowlocks has a higher cost than administering other locks. If you have a high transaction volume, dealing with large result sets, the Always rowlock option can cause an overall decrease of performance if the master database reacts too slowly because of the high number of lock administrations. We do not recommend activating this option. If you do activate it, make sure that SQL Server has sufficient memory to maintain the locks. Security Model The security model setting allows you to specify whether this database uses the Standard or the Enhanced security model. The default setting is Enhanced.2-36 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 37. Chapter 2: Setup and Installation The main difference between these two security models is how they synchronize the Microsoft Dynamics NAV security system with SQL Server and the way that they integrate the Microsoft Dynamics NAV security system with Windows authentication. Security will be discussed in the next lesson. The Standard model does not require synchronization, except for initial synchronization when changing from Enhanced to Standard. We recommend that you use Standard security because it will not require all the synchronizations. The biggest difference is that Standard security model creates one application role, whereas the Enhanced model created a separate application role for each user. The security model can be changed at any time, but can take time, depending on the number of users. To do this, open the database in single-user mode, change the model in the Alter Database window, and clear the single user option. Close and reopen the database. Caching The Record Set field allows you to specify how many records are cached when Microsoft Dynamics NAV performs a FINDSET operation with the ForUpdate parameter set to FALSE. The default value is 50. In versions before NAV2009, the default value is 500. The recommended setting for this property is to set it to the average number of sales lines. If a FINDSET statement reads more than the number of records specified here, additional SQL statements will be sent to the server which will decrease performance. Increasing this value also increases the amount of memory that the client uses to support each FINDSET statement. The statements will be discussed further in the chapter on Performance Audits. Configure the RoleTailored Client The RoleTailored client is a component of the RoleTailored architecture in Microsoft Dynamics NAV 2009. As you run Microsoft Dynamics NAV 2009 Setup, you can provide configuration information for the RoleTailored client. This information is then written, by Setup, to the ClientUserSettings.config file. On Windows Server 2003 or Windows XP, a separate instance of ClientUserSettings.config is maintained for each client user at the following location: Documents and Settings<username>Local SettingsApplication DataMicrosoftMicrosoft Dynamics NAV On Windows Vista or Windows Server 2008, the location is: Users<username>AppDataLocalMicrosoftMicrosoft Dynamics NAV Microsoft Official Training Materials for Microsoft Dynamics ® 2-37Your use of this content is subject to your current services agreement
  • 38. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009 This file is hidden. Change your folder options in Windows Explorer to allow access to hidden files before trying to edit ClientUserSettings.config. After you install the RoleTailored client, configuration settings are stored in the ClientUserSettings.config file. If you have configured the RoleTailored client in Setup, your setting values are included in this file. In addition to the settings you can configure in Setup, ClientUserSettings.config contains additional settings for the RoleTailored client. After modifying ClientUserSettings.config, you must restart the RoleTailored client for the changes to take effect. For more information about the different settings, see Configuring the RoleTailored Client (http://msdn.microsoft.com/en-us/library/dd301077.aspx). Configure the Classic Client Object Cache Object cache, like cache, allows Microsoft Dynamics NAV to work faster. Objects such as code, descriptions, and windows that will be used on the client computer are stored in the object cache. This means that the client computer only needs to retrieve these objects once from the server. The client computer must have sufficient memory to store the objects while they are being used. To change this setting, in the menu select Tools, and then Options. FIGURE 2.11 In the Options window, set the Object Cache parameter to the desired value. The default value is 32MB. To disable object cache completely, set the value to 0. Disabling object cache is frequently done by developers, to make sure they always have the latest version of the object. Be aware that disabling object cache can have a negative impact on performance, as each object must be retrieved from the server.2-38 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 39. Chapter 2: Setup and Installation If you do not want to disable object cache, you have to restart the Classic client to make sure you work with the latest version of the objects. The RoleTailored client will notice page and report modifications and automatically use the latest version without restarting. Configure the Microsoft Dynamics NAV Service Tier In Microsoft Dynamics NAV 2009, the Client Tier will not connect directly to the database tier. The client tier will connect to the service tier, which turn connects to the database tier (and also executes the business logic). When you install the Service Tier, it waits for a connection from a RoleTailored client, so even if the Service Tier is started, it consumes minimal resources until RoleTailored clients connect to it. After you install the Service Tier, it must be configured to connect to a SQL Server database. Each Service Tier has its own configuration file called CustomSettings.config. This file can be found in the Service folder in the installation path of Microsoft Dynamics NAV 2009. Note that the installation path varies according to version and language of the operating system. If you install on a 64-bit computer, it will be installed under C:Program Files (x86) because the Service Tier in Microsoft Dynamics NAV 2009 is 32-bit only. A Microsoft Dynamics NAV Server can only connect to one SQL Server database at a time. However, in many cases you have multiple databases in the Microsoft Dynamics NAV implementation (for example a test database and a production database). You can change the DatabaseServer and DatabaseName keys in the configuration file and restart the service tier every time you need to connect to another database, but this is not really best practice. In environments that have many users, you can enable multiple service tiers on the same database to do load balancing. In both scenarios, you probably want to install additional service tiers and configure each service tier to connect to the correct database. If you have multiple service tiers on the same computer, you have to change the InstanceName, ServerPort and WebServicePort keys for each service tier. When installing multiple service tiers, we recommend that you use the InstanceName key to differentiate between service tiers and not ports. For more information about how to install multiple service tiers, see the following walkthroughs: • Walkthrough: Installing the Three Tiers On Two Computers (http://msdn.microsoft.com/en-us/library/dd355184.aspx) Microsoft Official Training Materials for Microsoft Dynamics ® 2-39Your use of this content is subject to your current services agreement
  • 40. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009 • Walkthrough: Installing the Three Tiers on Three Computers (http://msdn.microsoft.com/en-us/library/dd301254.aspx) • Walkthrough: Accessing Multiple Microsoft Dynamics NAV Databases from a Single Microsoft Dynamics NAV Server Computer (http://msdn.microsoft.com/en-us/library/dd301437.aspx) Configure Microsoft SQL Server Microsoft Dynamics NAV 2009 imposes no special requirements for the Microsoft SQL Server installation. If you already have Microsoft SQL Server installed you should be able to use it with Microsoft Dynamics NAV, provided you have the necessary components installed. If you do not have Microsoft SQL Server installed, this topic provides information about how to install and configure Microsoft SQL Server. SQL Server Components to Install Microsoft Dynamics NAV 2009 is compatible with either Microsoft SQL Server 2005 or Microsoft SQL Server 2008. However, the list of SQL Server components you should install varies somewhat between the two versions. If you have already installed SQL Server, you may need to modify the installation to add components. Microsoft SQL Server 2005 Components If you are installing Microsoft SQL Server 2005 to use with Microsoft Dynamics NAV, install the following components: • SQL Server Database Services • Workstation components, Books Online, and development tools After you install Microsoft SQL Server 2005, remember to also install Service Pack 2. Microsoft SQL Server 2008 Components If you are installing Microsoft SQL Server 2008 to use with Microsoft Dynamics NAV, install the following components: • Database Engine Services • Client Tools Connectivity • Management Tools - Complete Setup Options for Microsoft SQL Server When running Microsoft SQL Server Setup, you will be required to provide various pieces of information. Your responses can affect your use of SQL Server with Microsoft Dynamics NAV 2009.2-40 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 41. Chapter 2: Setup and Installation SQL Server Instances Use the default instance and Instance ID on the Instance Configuration page as you install Microsoft SQL Server. If you need to use a non-default instance or instance ID, contact Microsoft Dynamics NAV support for information about how to customize your installation to work correctly with Microsoft Dynamics NAV 2009. Server Configuration We recommend that you use a dedicated domain user account you created specifically for the SQL Server service (MSSQLSVC), rather than a Local System account or the Network Service account. For more information about service security, see the Microsoft Dynamics NAV 2009 Security Hardening Guide (http://go.microsoft.com/fwlink/?LinkID=126282). Configuring SQL Server for Microsoft Dynamics NAV 2009 The following additional steps are required to configure SQL Server for Microsoft Dynamics NAV: • Set the Microsoft Dynamics NAV Trace Flag for SQL Server. • Configure the Microsoft Dynamics NAV Extended Stored Procedure for a 64-bit Version of SQL Server. Procedure: Set the Microsoft Dynamics NAV Trace Flag for SQL Server On a 64-bit version of Microsoft SQL Server, you must set the trace flag to enable Microsoft Dynamics NAV Server to connect to the SQL database. The Microsoft Dynamics NAV 2009 Setup program automatically sets the trace flag when you install Microsoft Dynamics NAV Database Components to a 32-bit version of SQL Server. Perform the following steps to set the trace flag: 1. Open SQL Server Configuration Manager. 2. In the left pane, click SQL Server 2005 Services. 3. In the right pane, right-click SQL Server (MSSQLSERVER), and on the shortcut menu, click Properties. 4. In the Properties window, click the Advanced tab. 5. Click the Startup Parameters property, and open the drop-down list. 6. Type ;-T4616 at the end of the line in the drop-down list and then click OK. 7. In the right pane, right-click SQL Server (MSSQLSERVER), and on the shortcut menu, click Restart. Microsoft Official Training Materials for Microsoft Dynamics ® 2-41Your use of this content is subject to your current services agreement
  • 42. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009 Setting the -T4616 trace flag is done automatically in Microsoft Dynamics NAV 2009 SP1. In the same way, you can add additional trace flags, such as 1204 and 1222, to the SQL Server configuration to facilitate SQL Server Monitoring. These trace flags send additional information related to locks and deadlocks to the SQL Server Log. Both trace flags will be discussed in the chapter Performance Audit. The trace flag is no longer required with Microsoft Dynamics NAV 2009 SP1 and onwards. For more information about SQL Server trace flags, see Trace Flags (http://msdn.microsoft.com/en-us/library/ms188396.aspx). Procedure: Configure the Microsoft Dynamics NAV Extended Stored Procedure for a 64-bit Version of SQL Server When installing Microsoft Dynamics NAV 2009 on a 64-bit version of SQL Server, you must manually configure the extended stored procedures that Microsoft Dynamics NAV uses to interact with SQL Server. The Microsoft Dynamics NAV Setup program automatically installs this extended stored procedure when you install Microsoft Dynamics NAV Database Components to a 32-bit version of SQL Server. Perform the following steps to configure the Microsoft Dynamics NAV extended stored procedures on a 64-bit version of SQL Server: 1. Copy xp_ndo_x64.dll from the Sql_espx64 folder on the Microsoft Dynamics NAV DVD to the Microsoft Dynamics NAV Database folder on the server computer. In a default installation, the location of the Database folder is C:Program Files (x86)Microsoft Dynamics NAV60Database. 2. Open SQL Server Management Studio. 3. In the Connect to Server pane, in the Server type box, fill in the following fields. Field Action Server Type Select Database Engine Server Name Select the name of the computer hosting SQL Server. Authentication Select Windows Authentication. 4. Click Connect. 5. In the left pane, click Databases, System Databases, master, Programmability, and then Extended Stored Procedures. Update the xp_ndo_enumusergroups extended stored procedure with the 64- bit DLL.2-42 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 43. Chapter 2: Setup and Installation 6. In the Extended Stored Procedures tab, right-click xp_ndo_enumusergroups, and, on the shortcut menu, select Properties. 7. In the Select a Page pane, click General. In the DLL property, provide the location of the 64-bit DLL that you previously copied, such as C:Program Files (x86)Microsoft Dynamics NAV60Database. In the Select a Page pane, click Permissions. 8. In the Users or roles section, click Add to open the Select Users or Roles window. 9. Click Browse, select [public], and then click OK. Click OK to close the Select Users or Roles window. 10. In the Users or roles section, click public. In the Explicit permissions for public section, select the Grant check box for the Execute permission. 11. In the Extended Stored Procedures tab, right-click xp_ndo_enumusersids, and, on the shortcut menu, select Properties. 12. Restart the SQL Server Service. 13. Open SQL Server Configuration Manager. 14. In the left pane, click SQL Server 2005 Services. 15. In the right pane, right-click SQL Server (MSSQLSERVER), and on the shortcut menu, click Restart.Security Synchronization An enterprise business solution must have a built-in security system that protects your database and the information it contains from being accessed by unauthorized people. It must also allow you to specify what the authorized users are allowed to do in the database (whether they can read, enter or modify data). The minimum acceptable level of security requires that each user be assigned an ID and a password. This ensures that only authorized personnel can gain access to your database. This is database-level security. A medium level of security requires you to limit the users access so that they can only access certain types of information stored in the database. In other words, they can only access particular tables in the database. This is table-level security. A high level of security requires that you limit the access that users have to the information stored in the tables. This is record-level security. The SQL Server Option for Microsoft Dynamics NAV satisfies these requirements by integrating its own security system (which includes record-level security) with the Microsoft SQL Server security system and with the Windows security system. This allows Microsoft Dynamics NAV to use the unified login system provided by Windows. If your domain is running on Windows 2003 or Windows 2008, Microsoft Dynamics NAV makes use of both the Active Directory Services and the single sign-on system. Microsoft Official Training Materials for Microsoft Dynamics ® 2-43 Your use of this content is subject to your current services agreement
  • 44. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009 Security Overview To understand how security is managed in the SQL Server Option for Microsoft Dynamics NAV, you must understand the SQL Server security system, Active Directory, the Microsoft Dynamics NAV security system, and how they interact. With several security systems interacting, the terminology can be confusing, so before explaining how the Microsoft Dynamics NAV security system works it is necessary to clarify two key concepts. Authentication Authentication is the process by which the system validates the user identity. This can be done by having the user enter an ID and password when they log on. Microsoft Dynamics NAV supports two kinds of authentication: Windows authentication and database server authentication. Login When users have identified themselves and been recognized by the system, they are granted access to the parts of the system for which they have permission. If the user has used Windows authentication to log on to the system, then he or she has been assigned a Windows login. If users have used database server authentication to log on to the system, they have been assigned a database login. The following table shows what the different authentication modes require from the user before granting access to databases. Authentication Windows requires SQL Server requires Windows Windows account (user ID Windows login authentication and password) Database server SQL Server login (user authentication ID and password) Database Server Authentication In the SQL Server Option for Microsoft Dynamics NAV the database server authentication is based on Microsoft SQL Server authentication. Windows Authentication The Windows single sign-on and the unified login supported by Windows are the same. In this course, both of these systems are referred to as Windows authentication.2-44 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 45. Chapter 2: Setup and Installation With Windows authentication, when a user tries to connect with SQL Server to open a database, they do not have to supply a user ID or password. Microsoft Dynamics NAV automatically asks Windows to confirm whether this user, who has already logged on to the network, has a valid Windows account and whether this account gives them the right to access this particular server. If the user is allowed to access the server then Microsoft Dynamics NAV will check to see if the user has been assigned a Windows login within Microsoft Dynamics NAV. If the user has a Windows login, they will be granted access to the database. The user will be granted access to Microsoft Dynamics NAV and be given the permissions specified for that Windows user and those specified for any Windows groups of which they are a member. If the user does not have a valid Windows account or if their account does not include permission to log on to the Microsoft Dynamics NAV database, authentication fails and the user receives an error. The RoleTailored client and Microsoft Dynamics NAV Service Tier only support Windows authentication. Advantages of Windows security The Windows authentication system includes the following security features: • Secure validation and encryption of passwords • A time limit on passwords • Minimum password length • Account lockout after an invalid password is entered Active Directory and Microsoft Dynamics NAV To take full advantage of the features provided by the Active Directory Security system, the Microsoft Dynamics NAV client computers and the domain controller must all either be running on Windows XP or Windows Vista or otherwise have access to Active Directory. If your Microsoft Dynamics NAV client computers do not have access to Active Directory, they will not be able to see the Windows Users & Groups window. When they create or open a database, the clients will not be able to see the generated list of available servers either. Active Directory allows the administrator to give administrative permissions to other users, thereby delegating large areas of responsibility to other members of the organization. This feature makes administering Microsoft Dynamics NAV more flexible. Other users, for example, department managers, can administer all the groups that they need within their department from the Microsoft Management Console. Microsoft Official Training Materials for Microsoft Dynamics ® 2-45Your use of this content is subject to your current services agreement
  • 46. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009 With this tool you can make Windows user members of specific security groups that have already been given roles within Microsoft Dynamics NAV. You can control access to and permissions within Microsoft Dynamics NAV, without having to open the program, provided that the Windows security groups have been given the appropriate roles within Microsoft Dynamics NAV. In an Active Directory environment, Microsoft Dynamics NAV allows you to create Microsoft Dynamics NAV users and roles from Windows accounts, and modify the rights of these users and roles. All Active Directory security groups will be visible within Microsoft Dynamics NAV and can be given roles within Microsoft Dynamics NAV. Active Directory Service security The Active Directory Service adds new features to the security used by Microsoft Dynamics NAV. The two key features are: • The administrators can grant or deny users access to Microsoft Dynamics NAV by adding them to or deleting them from a Windows security group. • The administrators can allow other people in the organization to create and administer users and groups. The SQL Server Security System Microsoft SQL Server has two levels of security: server security and database security. The SQL Server Option for Microsoft Dynamics NAV works with both levels of security and interacts with them by means of an automatic synchronization process. Server security consists of server-wide security accounts (known as logins), which are used to authenticate users before granting them access to the server. Database security consists of database-specific security accounts that control the level of access and the permissions granted to individual users for the databases on the server. Server Security The SQL Server security system authenticates users by validating their logins before granting them access to any of the resources contained in the system. SQL Server employs two types of authentication. These correspond to the two types of logins that can be created in SQL Server: Windows logins and SQL Server logins. The Windows authentication used by SQL Server corresponds to the Windows authentication used by Microsoft Dynamics NAV, as described earlier.2-46 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 47. Chapter 2: Setup and Installation The database server authentication used by Microsoft Dynamics NAV refers to SQL Server authentication. It is used when the network administrator has decided not to support Windows authentication or the SQL Server administrator has chosen not to use Windows authentication. With this method, SQL Server performs its own authentication of the users ID and password. SQL Server does this by checking whether an SQL Server login with this users ID and password has been created. This login must first have been created by an SQL Server administrator, with an SQL Server tool. If an SQL Server login has not been set up, authentication fails and the user receives an error. Database Security In the SQL Server security system, access to individual databases on the server is controlled by the database user accounts in each database. The user is granted access to the server after the login has been authenticated. Database security then validates permissions by checking the database user accounts on the server. The permissions that the user has been granted to the various objects within the database, such as tables, are determined by the information contained in the users database user account. It also contains information about any additional permissions that the user may have been granted to alter the database itself. Users who have valid SQL Server logins, but no database user accounts, will be granted default permissions. The default setting grants users access to the master database as guests. Guests have very limited rights. This means that a valid SQL Server login always gives access to at least one database. Microsoft Dynamics NAV and the SQL Server Security System The previous sections of this lesson have been devoted to explaining the SQL Server security system and the Microsoft Dynamics NAV security system. This section explains how these two systems interact. Note that Microsoft Dynamics NAV has two login tables. Windows logins are listed in the Windows Login table. Database logins are listed in the User table. The main portion of the security system for the SQL Server Option for Microsoft Dynamics NAV is the synchronization process. The synchronization process ensures that the information contained in the Microsoft Dynamics NAV User table and Windows Login table corresponds with the information contained in the SQL Server security system. SQL Server database user accounts contain information about the permissions that the users have to the objects contained in the database. The information for managing permissions to Microsoft Dynamics NAV objects is contained and administered within Microsoft Dynamics NAV. Microsoft Official Training Materials for Microsoft Dynamics ® 2-47Your use of this content is subject to your current services agreement
  • 48. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009 Synchronization of User Accounts Every time a user is added, deleted, or renamed in the Windows Login table or User table, a synchronization process is initiated. The synchronization process compares the Microsoft Dynamics NAV login tables with the security system in SQL Server. It modifies the SQL Server security system to reflect the changes made in the Microsoft Dynamics NAV Windows Login table or User table. This means that every time a Microsoft Dynamics NAV database administrator alters the information about a login in one of the Microsoft Dynamics NAV login tables for a particular database, the synchronization process automatically updates the information contained in the SQL Server database user accounts for this database. Microsoft Dynamics NAV cannot create or delete an SQL Server login. The SQL Server login must first be created by an SQL Server administrator. Microsoft Dynamics NAV can only verify or reject the validity of a login before updating the database user account. However, Microsoft Dynamics NAV can create and delete Windows logins in SQL Server through the synchronization process. Adding Users For both kinds of logins, the synchronization process creates a database user account for the login in the corresponding database if such an account does not already exist. If a new Windows login is added to the Windows Login table of a Microsoft Dynamics NAV database, the synchronization process matches this login to that in SQL Server. This is done by comparing the security identifiers (SIDs) of the two logins. If the synchronization process does not find a match, the system creates a new Windows login in SQL Server. If a new database login is added to the User table of a Microsoft Dynamics NAV database, the synchronization process checks whether this user ID has a valid SQL Server login in SQL Server. This SQL Server login must have the same name (user ID) as the Microsoft Dynamics NAV login that is being added. Deleting Users For both kinds of logins, if you delete a login from one of the Microsoft Dynamics NAV login tables, the synchronization process deletes the SQL Server database user account for that login. Note that if you delete SQL Server database user accounts from outside Microsoft Dynamics NAV, without deleting the login in Microsoft Dynamics NAV, synchronization will create new database user accounts for these users. When a Windows login is deleted from the Microsoft Dynamics NAV Windows Login table, you are asked if you want to delete this users Windows login on2-48 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 49. Chapter 2: Setup and Installation SQL Server. Microsoft Dynamics NAV does not delete the Windows login on SQL Server automatically. When a database login is deleted from the Navision User table, the synchronization process will not delete the SQL Server login. It can only be deleted by an SQL Server administrator using an SQL Server tool, such as SQL Server Management Studio. When Microsoft Dynamics NAV tries to match user IDs in the User table with SQL Server logins, the uppercase user ID in the User table is matched with the uppercase representation of the logins in SQL Server, regardless of case. Synchronizing The synchronization process can be initiated from within Microsoft Dynamics NAV. To start the synchronization process, click Tools, Security, Synchronize All Logins or Synchronize Single Login. You may need to initiate the synchronization process after restoring a Microsoft Dynamics NAV backup. If the logins in the backup do not match the SQL Server logins or the Windows users and groups, the necessary changes must be made to the Microsoft Dynamics NAV logins, Windows users and groups or SQL Server logins, after the backup has been fully restored. Re-initiate the synchronization process after these changes have been made. Never use SQL Server tools to add or delete information stored in the Microsoft Dynamics NAV Windows Login table or User table because this information is used during the synchronization process. Security Models Microsoft Dynamics NAV contains a comprehensive security system that enables you to manage the access that all of your users have to the objects and data in your Microsoft Dynamics NAV database. As this database is stored on SQL Server, the Microsoft Dynamics NAV security system and SQL Servers own security system must work together to ensure that only authorized users can access the database. The Microsoft Dynamics NAV security system therefore contains a synchronization mechanism that ensures that the information contained in the Microsoft Dynamics NAV security system corresponds with the information contained in the SQL Server security system. Microsoft Dynamics NAV allows you to specify the following level of security to implement: • Standard Security • Enhanced Security The main difference between these security models is the way in which they synchronize the Microsoft Dynamics NAV security system with SQL Server and the way that they integrate the Microsoft Dynamics NAV security system with Windows authentication. Another difference is that Standard security creates one Microsoft Official Training Materials for Microsoft Dynamics ® 2-49Your use of this content is subject to your current services agreement
  • 50. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009 application role, whereas the Enhanced creates a separate application role for each user The security system is not synchronized automatically when you do the following: • Change the security model • Restore a backup • Convert a database • Update the executable files • Update the application To change the security model used in the database, you must be: • A member of the sysadmin server role on SQL Server or be a member of the db_owner database role for the database in question. • Assigned the SUPER role in Microsoft Dynamics NAV. change security models, you must ensure that both of the extended stored procedures that come with Microsoft Dynamics NAV have been added to the instance of SQL Server that you are using. These extended stored procedures are called: • xp_ndo_enumusergroups • xp_ndo_enumusersids These extended stored procedures are part of the xp_ndo.dll that comes on the Microsoft Dynamics NAV product DVD. The main differences between the two security models are listed in the following table: Feature Standard Enhanced Security Security Synchronization Performance Fast Slower If you have several companies and many users in the same database, the synchronization process will be slower with Enhanced Security. Windows groups displayed Local Local domain only domain plus forest of domains Logins required in Microsoft Windows Windows Groups plus the Dynamics NAV groups and members of each group and2-50 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 51. Chapter 2: Setup and Installation Feature Standard Enhanced Security Security individual individual Windows users Windows users Granularity of Entire Entire security system and Synchronization security individual logins. system Automatic synchronization Yes No when you insert, modify or delete a Windows login or a database login in Microsoft Dynamics NAV. Required Extended Stored xp_ndo_en xp_ndo_enumusergroups Procedure umusersids When to Synchronize the Security System The Microsoft Dynamics NAV security system must be synchronized with SQL Server every time you do the following: • Change the security model. • Change the users, permissions, or roles in Microsoft Dynamics NAV. • Restore a backup. • Convert a database. • Modify an object in the database • Update the executable files. • Update the application. NOTE: Every time you modify an object in the database or modify the permissions that an object has to other database objects, you must update all the roles and users who have permission to access this object and then you must synchronize these roles and users. Microsoft Official Training Materials for Microsoft Dynamics ® 2-51Your use of this content is subject to your current services agreement
  • 52. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009 Selecting the Security Model You can specify the security model to use in a database when creating the database. You specify the security model in the Advanced tab of the New Database window. FIGURE 2.12 SELECTING THE SECURITY MODEL You can change the security model used in the database in the Alter Database window. Perform the following steps to change the security model: 1. Ensure that no other users or tools, such as Microsoft SQL Server Management Studio, are using the database. 2. Close and reopen the database to ensure that you are the only user currently accessing the database. 3. Click File, Database, and then Alter to open the Alter Database window. Click the Options tab. 4. Select the Single user field. This prevents other users and tools from accessing the database and blocking the synchronization. 5. Click the Advanced tab. 6. In the Security Model field, click the drop-down list and select the security model to implement in this database. 7. Click OK to alter the database and change the security model. As mentioned earlier, you must synchronize the entire Microsoft Dynamics NAV security system with SQL Server after changing the security model. Be sure to clear the check mark in the Single user field before synchronizing the security system. If another user logs on to the database while you are synchronizing the security system, they will not have access to all the resources that they need.2-52 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 53. Chapter 2: Setup and Installation After Changing the Security Model When changing from Enhanced Security to Standard Security, you can delete all of the individual users who have been given a Windows Login in Microsoft Dynamics NAV if the Windows group(s) that they are members of have the permissions required. However, if any of the users have been assigned extra permissions do not delete them from the Windows Logins window. When changing from Standard Security to Enhanced Security, you must give all of the individual members of any Windows groups entered in the Windows Logins window a Windows login of their own. You do not need to assign any permissions or roles to these logins in Microsoft Dynamics NAV. The Windows group that they belong to has already been assigned the permissions they need. Standard Security The Standard Security model only allows you to synchronize the entire security system when updating the permissions system in Microsoft Dynamics NAV. When using Standard Security, you can enter a Windows group in the Windows Logins window and assign it a role in Microsoft Dynamics NAV. All the users who are members of this windows group are then automatically assigned this role in Microsoft Dynamics NAV. With the Standard Security model, the Windows Users & Groups window lists all of the Windows groups and users that are shown in Active Directory and the local groups on your computer. With the Standard Security model, every time you create, modify, or delete a Windows login or a database login, the security system is automatically synchronized. However, if you add, alter, or delete a role in the Microsoft Dynamics NAV security system, you must manually synchronize the security system. The synchronization of the security system is performed faster with Standard Security than it is with Enhanced Security. Standard Security may be preferable if you have several companies in the same database and need to update the security system on a regular basis. Synchronizing the Standard Security Model If using the Standard Security model, you can only synchronize the entire security system. To synchronize the entire security system, click Tools, Security, Synchronize All and the entire security system is synchronized. When you are using the Standard Security model, synchronizing the entire security system is lengthy short process. Microsoft Official Training Materials for Microsoft Dynamics ® 2-53Your use of this content is subject to your current services agreement
  • 54. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009 Enhanced Security The Enhanced Security model has a more refined synchronization system. Enhanced Security allows you to do the following: • Synchronize individual users one at a time. When you modify the permissions of a particular user, you can select that user and synchronize them. • Synchronize the entire security system at one time. When using Enhanced Security, you can enter a Windows group in the Windows Logins window and assign it a role in Microsoft Dynamics NAV. However, you must also enter all of the individual users who are members of this Windows group in the Windows Logins window. You do not need to assign these individual logins any permissions in Microsoft Dynamics NAV as they receive their permissions by virtue of their membership of the Windows group. However, you can assign them any extra permissions that they might need in Microsoft Dynamics NAV. When using Enhanced Security, the Windows Users & Groups window only lists all of the Windows groups and users that are visible to you in Active Directory. You cannot see any local groups on your computer. IMPORTANT: All of the Microsoft Dynamics NAV users must be members of the current domain. With the Enhanced Security model, every time you create, modify, or delete a Windows login or a database login, the security system is not automatically synchronized. You must remember to synchronize the security system yourself. No message is displayed. If you have implemented Enhanced Security, synchronizing the entire security system can be a lengthy process and is considerably slower than Standard Security. It is therefore recommended that no other users be logged on to the database when you synchronize the entire security system. Synchronizing the Enhanced Security Model If using the Enhanced Security model, you can synchronize: • A single user • All (the entire security system) Perform the following steps to synchronize a user: 1. Click Tools, Security, and Windows Logins to open the Windows Logins window.2-54 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 55. Chapter 2: Setup and Installation 2. Select the Windows login that you want to synchronize. You can only synchronize one login at a time. 3. Click Tools, Security, and Synchronize Single Login to synchronize that login. You can also open the Database Logins window and synchronize the database logins one at a time. To synchronize the entire security system, click Tools, Security, and Synchronize All and the entire security system will be synchronized. Note that synchronizing the entire security system can take a considerable time. NOTE: When you are altering the permissions of users or roles in Microsoft Dynamics NAV, make sure that none of the users whose permissions are being altered, or who have been assigned the role you are altering, are logged on to the database. When synchronizing the entire security system, make sure that you are the only user in the database.Summary This chapter explains how to evaluate the software and hardware requirements for Microsoft Dynamics NAV 2009. It also reviews the Microsoft Dynamics NAV two-tier and three-tier architectures. Next, the chapter provides an overview of the recommended settings for a Microsoft Dynamics NAV database. Finally, the security models and the synchronization process are explained. Microsoft Official Training Materials for Microsoft Dynamics ® 2-55 Your use of this content is subject to your current services agreement
  • 56. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009Test Your Knowledge Test your knowledge with the following questions. 1. Which version of RAID is not recommended for use in ERP applications? ( ) RAID 0 ( ) RAID 1 ( ) RAID 5 ( ) RAID 10 2. When selecting a recovery model for a database, which option allows for a restore operation to a point in time? ( ) Full ( ) Simple ( ) Bulk-Logged 3. What is the advantage of implementing filegroups? (Select all that apply) ( ) Filegroups allow your files to be grouped inside SQL Server. That way it is easier to find them again when they are lost. ( ) Using files and filegroups improves database performance, because it allows creating a database across multiple disks. ( ) When multiple filegroups are used, the files in a database can be backed up and restored individually. ( ) Filegroups enable data placement, because a table can be created in a specific filegroup. That way all I/O for a specific table can be directed at a specific disk. 4. Which two security models are available for a Microsoft Dynamics NAV database? (Select all that apply) ( ) Standard ( ) Simple ( ) Enhanced ( ) Advanced2-56 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 57. Chapter 2: Setup and InstallationLab 2.1 - Change the Recovery Model Recovery models are designed to control transaction log maintenance. Three recovery models exist: simple, full, and bulk-logged. Typically, a database uses the full or simple recovery model. In this lab you will have to select and implement the appropriate recovery model for the Demo Database NAV (6-0) database. Scenario Cronus International Ltd. has been using Microsoft Dynamics NAV for some time. The companys business has expanded a lot since the application was implemented and so have the requirements for data availability and recovery. Originally, a data restore for a specific point in time was not required. If a database crash occurred, it was considered acceptable to lose a half a day of work. To meet this requirement a series of backup procedures were implemented. There is a weekly full backup procedure. Every weekday at 12:00 P.M. and at 7:00 P.M. there are incremental backups in place. Now, the requirements have changed. It is no longer considered acceptable to lose data whenever a database restore occurs. To meet this requirement you will have to change the recovery model of the database to the appropriate level. Challenge Yourself! You need to change the recovery model of the Cronus database to a setting that meets the requirements. There are two possible ways to achieve this goal. You can use the Microsoft Dynamics NAV database properties window or you can use SQL Server Management Studio to implement the requested change. You must decide which is the best tool to implement the change. Need a Little Help? The requirements specify that no data from the Cronus database may be lost when a disaster recovery situation occurs. When to Use the Simple Recovery Model Use the simple recovery model if the following are all true: • Point of failure recovery is unnecessary. If the database is lost or damaged, you are willing to lose all the updates between a failure and the previous backup. • You are willing to risk losing some data in the log. Microsoft Official Training Materials for Microsoft Dynamics ® 2-57 Your use of this content is subject to your current services agreement
  • 58. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009 • You do not want to back up and restore the transaction log, preferring to rely exclusively on full and differential backups. When to Use the Full Recovery Model Use the full recovery model and, optionally, the bulk-logged recovery model if any one of the following is true: • You must be able to recover all the data. • You must be able to recover to the point of failure. • You want to be able to restore individual pages. • You are willing to incur the administrative costs of transaction log backups. When to Use the Bulk-Logged Recovery Model The bulk-logged recovery model is intended strictly as an adjunct to the full recovery model. We recommend that you use it only during periods when you are running large-scale bulk operations, and when you do not require point-in-time recovery of the database. Step by Step To comply with the new requirements, you must make sure the recovery model for the Demo Database NAV (6-0) database is set to Full. The following are two ways to change the recovery model: • Using the Alter Database window in the Microsoft Dynamics NAV Classic client. • Using SQL Server Management Studio (SSMS). Using the Microsoft Dynamics NAV client: 1. Start your Microsoft Dynamics NAV classic client. 2. Connect and open the Demo Database NAV (6-0) database and company. 3. Go to the File menu, then select Alter database. 4. On the Options tab, to change the recovery model select a different model from the list. The choices are Full, Bulk-logged, or Simple. Select Full. 5. Click OK to save the changes. Using SSMS: 1. In the Start menu, select All Programs, Microsoft SQL Server, and then SQL Server Management Studio.2-58 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 59. Chapter 2: Setup and Installation 2. After connecting to the appropriate instance of the Microsoft SQL Server Database Engine, in Object Explorer, click the server name to expand the server tree. 3. Expand Databases, and select the Demo Database NAV (6-0) database. 4. Right-click the database and select Properties to open the Database Properties dialog box. 5. In the Select a Page pane, click Options. The current recovery model is displayed in the Recovery model list box. 6. In the Recovery model field, select Full. 7. Click OK to save the changes. Microsoft Official Training Materials for Microsoft Dynamics ® 2-59Your use of this content is subject to your current services agreement
  • 60. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009Lab 2.2 - Set Trace Flags It is important to know how to set a trace flag on SQL Server. Before accessing SQL Server from Microsoft Dynamics NAV, you must set trace flag 4616 on SQL Server. Scenario In this lab you will set trace flag 4616 on SQL Server. Next, you will test to verify that the trace flag has been set correctly. Challenge Yourself! Make sure trace flag 4616 is set on SQL Server. Make sure that when the server is rebooted the setting is still enabled. Need a Little Help? Before you can access Microsoft SQL Server 2005 from Microsoft Dynamics NAV, you must set trace flag 4616 on SQL Server 2005. Trace flags are used to customize certain characteristics by controlling how SQL Server operates. For more information, see the section How To: Set the Microsoft Dynamics NAV Trace Flag for 64-bit SQL Server in this chapter. Step by Step Perform the following steps to enable the trace flag through SQL Server Configuration Manager: 1. Open SQL Server Configuration Manager. 2. In the left pane, right-click SQL Server 2005 Services, and then click Open to see of all the services. 3. In the right panel, right-click SQL Server (MSSQLSERVER) and select Properties to open the Properties window. 4. In the Properties window, click the Advanced tab and expand the Advanced option if necessary. 5. Click the Startup Parameters property and open the drop-down list. Type ;-T4616 at the end of the line in the drop-down list. 6. Restart the SQL Server service. Perform the following to enable the trace flag using the DBCC TRACEON statement: 1. Open SSMS. 2. Click the New Query button to open a new query window.2-60 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 61. Chapter 2: Setup and Installation 3. In the New Query window, enter the following SQL statement: DBCC TRACEON (4616) 4. Click the Execute button. Perform the following steps to verify if the trace flag has been set correctly: 1. Open SSMS. 2. Click the New Query button to open a new query window. 3. In the New Query window, enter in the following SQL statement: DBCC TRACESTATUS (4616, -1). If you do not specify a trace flag, you will get an overview of all the global trace flags that are currently enabled. 4. Click the Execute button. Microsoft Official Training Materials for Microsoft Dynamics ® 2-61Your use of this content is subject to your current services agreement
  • 62. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009Lab 2.3 - Create a Login Stored Procedure A login stored procedure is a procedure that you can use to perform predefined functions after a user logs on to Microsoft Dynamics NAV with Microsoft SQL Server. The login stored procedure is run immediately after the user has logged on to SQL Server and opened a database and before Microsoft Dynamics NAV carries out any tasks including executing any C/AL triggers. The user must have successfully logged on to the server and have access to the database before the stored procedure is run. Scenario You are the database administrator for Cronus International Ltd. Because you need to perform a large maintenance task on the Microsoft Dynamics NAV 2009 database, you want to make sure nobody else is able to log into the Demo Database NAV (6-0) database. Challenge Yourself! To accomplish this task, you will create and implement a login stored procedure for the Demo Database NAV (6-0) database. This stored procedure will execute every time someone tries to login to the database, until you remove it from the database. The stored procedure will compare the user name to the user name of the administrator. If they are different, login will not be granted and a corresponding error message displays. Finally, you will perform a test to be sure the stored procedure is working. Need a Little Help? The stored procedure is created in the database and has a predefined name and a list of parameters. The stored procedure is called [sp_$ndo$loginproc] and has the following characteristics: • It takes two VARCHAR parameters: the name of the application and the C/SIDE version number. • These parameters must be declared as part of the stored procedure but do not have to be used. • It can perform transactions. Microsoft Dynamics NAV uses a COMMIT to flush any outstanding transactions after the stored procedure has finished executing.2-62 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 63. Chapter 2: Setup and Installation • The RAISERROR statement can be used to display an error message in Microsoft Dynamics NAV and prevent the user from accessing the database. • The PRINT statement can be used to display a warning in Microsoft Dynamics NAV and allow the user to access the database. • If the stored procedure returns a value, it is ignored. • If the stored procedure does not exist, no action is taken by Microsoft Dynamics NAV and the login process continues as usual. After creating the stored procedure, start the RoleTailored and the Classic clients with different credentials. Step by Step Perform the following steps to create a login stored procedure: 1. Open SSMS. 2. Click the New Query button to open a new query window. 3. In the New Query window, enter the following SQL statement: USE [Demo Database NAV (6-0)] GO IF EXISTS(SELECT name FROM sysobjects WHERE name = sp_$ndo$loginproc AND type = P) DROP PROCEDURE [sp_$ndo$loginproc] GO CREATE PROCEDURE [sp_$ndo$loginproc] @appname VARCHAR(64) = NULL, @appversion VARCHAR(16) = NULL AS BEGIN IF SUSER_SNAME() NOT IN (CONTOSOAdministrator) RAISERROR(The system administrator has currently disabled logging into the database. Please try again later., 11, 1) END GO GRANT EXECUTE ON [sp_$ndo$loginproc] TO public GO 4. Click the Execute button. 5. Start the Microsoft Dynamics NAV RoleTailored client. The error message is not displayed and the user is granted access. 6. Close the RoleTailored client. 7. Log off from Windows. Microsoft Official Training Materials for Microsoft Dynamics ® 2-63Your use of this content is subject to your current services agreement
  • 64. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009 8. Log on to Windows with the following credentials: User name Susan Password pass@word1 (mailto:pass@word1) Domain CONTOSO 9. Start the Microsoft Dynamics NAV Classic client. The error message is displayed. 10. Click OK to close the error message dialog box. The user is not logged in.2-64 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 65. Chapter 2: Setup and InstallationLab 2.4 - Use Filegroups to Change the Storage Location of aTable In this lab you move a Microsoft Dynamics NAV table from one filegroup to another. Scenario Cronus International Ltd. has been working in Microsoft Dynamics NAV for some time now and noticed that the data in some tables is growing enormously. Management does not allow deleting or archiving old data in tables because this data has to be available whenever it is requested. As a database administrator you know that spreading a database over multiple hard disks would improve performance. The management allowed for the purchase of a new hard disk and you installed it on the database server. Your task now is to move some tables to the newly installed hard disk. Database monitoring has shown that a large percentage of the queries executed on your database make use of the Value Entry table. So this table may be a good candidate to move towards the new hard disk. Challenge Yourself! Create a new filegroup named SECONDARY for the Demo Database NAV (6-0) database. Next, add a new database file to the Demo Database NAV (6-0) database and give it the name: SECONDARYFILE. Use the newly installed hard disk as the storage location as for the file. Make sure that the new database file is assigned to the new filegroup. Finally, assign the Value Entry table to the new filegroup. Need a Little Help? Perform the following to move an existing index to a different filegroup or partition scheme. 1. In Object Explorer, connect to an instance of the SQL Server Database Engine and then expand that instance. 2. Expand Databases, expand the Demo Database NAV (6-0) database that contains the table with the specific index, and then expand Tables. 3. Expand the table in which the index belongs and then expand Indexes. 4. Right-click the index to be moved and then select Properties. Microsoft Official Training Materials for Microsoft Dynamics ® 2-65 Your use of this content is subject to your current services agreement
  • 66. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009 5. On the Index Properties dialog box, select the Storage page. 6. Select the filegroup in which to move the index. You cannot move indexes created using a unique or primary key constraint by using the Index Properties dialog box. To move these indexes, you need to drop the constraint using ALTER TABLE (Transact-SQL) with the DROP CONSTRAINT option and then re-create the constraint on the desired filegroup using ALTER TABLE (Transact-SQL) with the ADD CONSTRAINT option. If the table or index is partitioned, select the partition scheme in which to move the index. If you are moving a clustered index, you can use online processing. Online processing allows concurrent user access to the underlying data and to nonclustered indexes during the index operation. Step by Step Perform the following steps to move a Microsoft Dynamics NAV table from one filegroup to another: 1. Open SSMS. 2. Click the New Query button to open a new query window. 3. In the New Query window, enter the following SQL statement: USE [Demo Database NAV (6-0)] GO IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N[dbo].[CRONUS International Ltd_$Value Entry]) AND name = NCRONUS International Ltd_$Value Entry$0) ALTER TABLE [dbo].[CRONUS International Ltd_$Value Entry] DROP CONSTRAINT [CRONUS International Ltd_$Value Entry$0] GO ALTER TABLE [dbo].[CRONUS International Ltd_$Value Entry] ADD CONSTRAINT [CRONUS International Ltd_$Value Entry$0] PRIMARY KEY CLUSTERED ([Entry No_] ASC) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = ON, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [SECONDARY] GO 4. Run the query.2-66 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 67. Chapter 2: Setup and Installation 5. Open the Object Explorer in SSMS. 6. Expand the Databases tree. 7. Select Demo Database NAV (6-0) in the list of databases. 8. In the selected database, open the Tables tree. 9. Select the Cronus International Ltd_$Value Entry table in the list 10. Right-click the table and select its properties 11. On the General tab, check the value for the Filegroup property. It is now set to SECONDARY. Microsoft Official Training Materials for Microsoft Dynamics ® 2-67Your use of this content is subject to your current services agreement
  • 68. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009Lab 2.5 - Create Users and Synchronize Security This lab demonstrates how to create a new user in Microsoft Dynamics NAV, and the difference between database and windows user creation. Scenario As the database administrator for the Demo Database NAV (6-0) database you are required to manage the creation and deletion of users. You have been asked to create two new users, Michael and David. Michael will use the RoleTailored client. David will use the Classic client. David requested that his login should be available on different workstations, independent of the current Windows user. Challenge Yourself! Create a new user for Michael and for David. Make sure they are able to login to the Demo Database NAV (6-0) database. Use the RoleTailored and the Classic client to test the users for Michael and David. Once the users have been created, make sure you log off from the database, close it, and reopen it to test the users. Need a Little Help? Michael will work with the RoleTailored client, which requires a Windows login to logon to the database. You need to create a Windows user in the Microsoft Dynamics NAV database and synchronize it with SQL Server. David will work with the Classic client. Because he needs to login to Microsoft Dynamics NAV on different workstations, regardless of the current Windows user, you create a database user for David. Before you create a database user for David in Microsoft Dynamics NAV, you first need to create a database login in SQL Server. After the database login has been created in SQL Server, you must create the database user in Microsoft Dynamics NAV and synchronize the security system. Step by Step Create a Windows user for Michael 1. Open Microsoft Dynamics NAV Classic client. 2. From the Tools menu, click Security, and then Windows Logins. 3. On an empty line, enter CONTOSOMichael and press Enter to insert the login. 4. Select the newly added user and click Roles. The Roles window will appear.2-68 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 69. Chapter 2: Setup and Installation 5. In the Role ID column, click the button to get an overview of the available roles. 6. Select the SUPER role and click OK. 7. Close the Roles window. 8. From the Tools menu, click Security, and then click Synchronize All Logins. Create a SQL Server login for David (Microsoft SQL Server): 1. In SQL Server Management Studio, open Object Explorer and expand the folder of the server instance in which to create the new login. 2. Right-click the Security folder, point to New, and then click Login. 3. On the General page, in the Login Name field, enter DAVID. 4. Select SQL Server Authentication. 5. Enter the following strong password for the login: pass@word1 6. Click OK. Add a Database User for David (Microsoft Dynamics NAV) 1. Open Microsoft Dynamics NAV Classic with SQL Server. 2. From the Tools menu, click Security, and then Database Logins. 3. On an empty line, in the User ID field, enter DAVID. 4. Press Enter to add the user. 5. Select the user DAVID and click the Roles button. 6. In the Role ID column, click the button for an overview of the available roles. 7. Select the SUPER role and click OK. 8. Close the Roles window. 9. From the Tools menu, click Security, and then click Synchronize All Logins. Microsoft Official Training Materials for Microsoft Dynamics ® 2-69Your use of this content is subject to your current services agreement
  • 70. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 2009Quick Interaction: Lessons Learned Take a moment and write down three Key Points you have learned from this chapter 1. 2. 3.2-70 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
  • 71. Chapter 2: Setup and InstallationSolutions Test Your Knowledge 1. Which version of RAID is not recommended for use in ERP applications? ( ) RAID 0 ( ) RAID 1 (•) RAID 5 ( ) RAID 10 2. When selecting a recovery model for a database, which option allows for a restore operation to a point in time? (•) Full ( ) Simple ( ) Bulk-Logged 3. What is the advantage of implementing filegroups? (Select all that apply) ( ) Filegroups allow your files to be grouped inside SQL Server. That way it is easier to find them again when they are lost. (√) Using files and filegroups improves database performance, because it allows creating a database across multiple disks. (√) When multiple filegroups are used, the files in a database can be backed up and restored individually. (√) Filegroups enable data placement, because a table can be created in a specific filegroup. That way all I/O for a specific table can be directed at a specific disk. 4. Which two security models are available for a Microsoft Dynamics NAV database? (Select all that apply) (√) Standard ( ) Simple (√) Enhanced ( ) Advanced Microsoft Official Training Materials for Microsoft Dynamics ® 2-71 Your use of this content is subject to your current services agreement
  • 72. SQLServer Installation and Optimization for Microsoft Dynamics®NAV 20092-72 Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement