Download Presentation


Published on

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Download Presentation

    1. 1. Multi-Instancing in Microsoft SQL Server 2000 Jyothi Pai SQL Server Support Microsoft Corporation
    2. 2. What & Why of Multi-Instancing <ul><li>New feature in Microsoft ® SQL Server™ 2000 </li></ul><ul><li>Can run separate instances of the product </li></ul><ul><li>Is cost effective </li></ul><ul><li>Provides security isolation </li></ul><ul><li>Each instance can be at different binary levels </li></ul><ul><li>Allows server consolidation </li></ul><ul><li>Provides failover clustering </li></ul><ul><li>Allows application hosting </li></ul>
    3. 3. Why Use Single Server Model? <ul><li>Single Server model has its own advantages </li></ul><ul><ul><li>Common structures are not duplicated </li></ul></ul><ul><ul><li>No additional SQL Server administration </li></ul></ul><ul><ul><li>Database- and column-level collation allowed </li></ul></ul><ul><ul><li>Automatic server settings work better with less contention for resources </li></ul></ul><ul><ul><li>Likely to perform better in production environments </li></ul></ul><ul><ul><li>Dedicated server is still the best way to go if you can do it </li></ul></ul>
    4. 4. Terminology <ul><li>Instance </li></ul><ul><ul><li>A single installation of SQL Server on a computer </li></ul></ul><ul><li>Named instance </li></ul><ul><ul><li>Any instance of SQL Server 2000 other than the default instance </li></ul></ul><ul><ul><li>Connect to the instance “ instance1 ” using the extended name: osql -E -S server1instance1 </li></ul></ul>
    5. 5. Terminology (2) <ul><li>Default instance </li></ul><ul><ul><li>Like any other “named instance” </li></ul></ul><ul><ul><li>Has settings similar to SQL Server 6.5 and 7.0 for backward compatibility </li></ul></ul><ul><ul><li>Connect to server using just the network name of the machine: osql -E -S server1 </li></ul></ul>
    6. 6. Rules <ul><li>Can have multiple named instances on a machine </li></ul><ul><li>Only SQL Server 2000 can operate as a named instance </li></ul><ul><li>One machine can have only one version operating as a default instance at a time </li></ul><ul><li>Supported number of instances on a single machine is 16 </li></ul><ul><li>Desktop Engine has a hard coded limit of 16 instances per machine </li></ul>
    7. 7. Rules (2) <ul><li>Only one copy of tools installed on each machine </li></ul><ul><li>SQL Server 2000 cannot be installed on a machine with SQL Server 4. x and 6.0 </li></ul><ul><li>SQL Server 6.5 must be at Service Pack 5a before installing SQL Server 2000 on the same machine </li></ul><ul><li>Instance names must be unique across all nodes in a failover cluster and on stand-alone machines </li></ul><ul><li>Only one default instance per failover cluster is allowed </li></ul>
    8. 8. Naming Standards <ul><li>Identified by the name specified during setup </li></ul><ul><li>Referenced by an extended name as: Computer_nameinstance_name </li></ul><ul><li>Instance name can have up to 16 characters </li></ul><ul><li>Complete string Computer_nameinstance_name cannot exceed 128 characters </li></ul>
    9. 9. Naming Standards (2) <ul><li>Must begin with either a letter, an ampersand or an underscore </li></ul><ul><li>Can contain numbers, letters, or other characters </li></ul><ul><li>SQL Server reserved names are not allowed </li></ul><ul><li>Instance name is not case-sensitive </li></ul>
    10. 10. Services <ul><li>Default instance is same as SQL Server 7.0 </li></ul><ul><ul><ul><li>MSSQLServer </li></ul></ul></ul><ul><ul><ul><li>SQLServerAgent </li></ul></ul></ul><ul><li>Named instance: Reflects the instance name </li></ul><ul><ul><ul><li>MSSQL$instance_name </li></ul></ul></ul><ul><ul><ul><li>SQLAgent$instance_name </li></ul></ul></ul><ul><li>MSDTC and MSSearch </li></ul><ul><ul><ul><li>Only one copy per machine </li></ul></ul></ul><ul><ul><ul><li>They are multi-instance aware </li></ul></ul></ul>
    11. 11. Registry Keys <ul><li>Default instance is similar to 7.0 </li></ul><ul><ul><li>HKEY_LOCAL_MACHINESoftwareMicrosoft MSSQLServer </li></ul></ul><ul><li>Named instance: Reflects the instance name </li></ul><ul><ul><li>HKEY_LOCAL_MACHINE SoftwareMicrosoft Microsoft SQL Server instance_name </li></ul></ul>
    12. 12. Registry Keys (2) <ul><li>Tools location is specified here: </li></ul><ul><ul><li>HKEY_LOCAL_MACHINESoftwareMicrosoft Microsoft SQL Server 80Tools </li></ul></ul><ul><li>Information on all installed instances is found in “InstalledInstances” under: </li></ul><ul><ul><li>HKEY_LOCAL_MACHINESoftwareMicrosoft Microsoft SQL Server </li></ul></ul>
    13. 13. Installation & Upgrade Options <ul><li>SQL Server 7.0 </li></ul><ul><ul><li>Cannot install default instance of SQL Server 2000 unless you upgrade the SQL Server 7.0 installation </li></ul></ul><ul><ul><li>Can install a named instance of SQL Server 2000 </li></ul></ul>
    14. 14. Installation & Upgrade Options (2) <ul><li>SQL Server 6.5 </li></ul><ul><ul><li>Can install a default instance of SQL server 2000 </li></ul></ul><ul><ul><li>SQL Server 6.5 and SQL Server 2000 default instance cannot run at the same time </li></ul></ul><ul><ul><li>Must switch between versions using the vswtich utility </li></ul></ul>
    15. 15. How Can They Be Installed?
    16. 16. Directory Structure Tools Default Instance Instance1- Bin/Data
    17. 17. Network Libraries <ul><li>Default instances have standard endpoints </li></ul><ul><ul><li>Named pipes: pipesqlquery </li></ul></ul><ul><ul><li>TCP/IP: Port 1433 </li></ul></ul><ul><li>Named instances reflect their names </li></ul><ul><ul><li>Named pipes: pipeMSSQL$instance_namesqlquery </li></ul></ul><ul><ul><li>TCP/ IP: User defined or dynamic port </li></ul></ul>
    18. 18. Network Libraries (2) <ul><li>Named instance cannot use these network libraries: </li></ul><ul><ul><li>Multiprotocol </li></ul></ul><ul><ul><li>AppleTalk </li></ul></ul><ul><ul><li>Banyan Vines </li></ul></ul><ul><li>SSL encryption possible over any network library </li></ul>
    19. 19. Network Connectivity Table Not supported for named instances Banyan Not supported for named instances AppleTalk Instance name needs to be selected on local computer Shared memory Instance specific port into ListenOn key during setup. Setup enumerates existing instances and picks next available port. Port 33854 reserved for default instance Novell Not supported for named instances Multiprotocol Machine_Name , Port ( 1433 for default, next available for each additional named instance ) TCP/IP pipeMSSQL$ Instance_Name sqlquery (Local) Machine_Name pipeMSSQL$ Instance_Name sqlquery Named pipes ListenOn entry Network libraries
    20. 20. Port Assignment <ul><li>Port 1433 is reserved for the default instance </li></ul><ul><li>Named instance takes the next available free port or a user defined port depending on the registry key: “TcpPort” under: HKEY_LOCAL_MACHINESoftwareMicrosoft Microsoft SQL Serverinst_nameMSSQLServer SuperSocketnetlib cp </li></ul><ul><li>A named instance checks the above registry key before attempting to use a TCP port </li></ul><ul><li>If it is 0 (zero), finds an unused port to use </li></ul>
    21. 21. Port Assignment (2) <ul><li>First instance that starts up checks the registry key “ SsrpActiveServer ” under HKEY_LOCAL_MACHINESoftwareMicrosoft Microsoft SQL Server </li></ul><ul><li>Grabs UDP port 1434 and becomes the active server if a server name is not already listed in the above registry key </li></ul><ul><li>Active server acts as a listener and keeps track of all other instances running on the system </li></ul>
    22. 22. Port Assignment Diagram Default TCP 1433 Inst1 TCP 1500 Inst2 TCP 1600 UDP 1434 Client1 Client2 Passive Server List Inst 1 Inst 2 KeepAlive Join Join KeepAlive
    23. 23. Changes for Multi-Instancing <ul><li>Setup changes </li></ul><ul><ul><li>Supports maintenance against any single instance </li></ul></ul><ul><ul><li>Service packs can be installed individually </li></ul></ul><ul><ul><li>Uninstall works without disturbing any other instance </li></ul></ul><ul><ul><li>Common files under ToolsCOM go to the system drive regardless of the location you specify </li></ul></ul><ul><li>Client connectivity changes </li></ul><ul><ul><li>Use server_name instance_name to connect </li></ul></ul><ul><ul><li>Need MDAC 2.6 to get multi-instance connectivity from clients </li></ul></ul>
    24. 24. Changes for Multi-Instancing (2) <ul><li>Server changes </li></ul><ul><ul><li>Event log entries are instance specific Source: MSSQL$ instance_name </li></ul></ul><ul><ul><li>Performance monitor entries are instance specific MSSQL$ instance_name : Counter for named instance </li></ul></ul>
    25. 25. Changes for Multi-Instancing (3) <ul><li>Tools changes </li></ul><ul><ul><li>Enterprise Manager identifies each server distinctly </li></ul></ul><ul><ul><li>osql supports extended server name </li></ul></ul><ul><ul><li>Only one copy of Books Online, development libraries, Service Manager, sample applications </li></ul></ul><ul><ul><li>Tools are removed when the last instance is removed </li></ul></ul><ul><ul><li>sqldiag -I instance_name -E </li></ul></ul>
    26. 26. SERVERPROPERTY() Function <ul><li>Returns variant data type </li></ul><ul><li>Some of the properties include </li></ul><ul><ul><ul><li>ProductLevel </li></ul></ul></ul><ul><ul><ul><li>ProductVersion </li></ul></ul></ul><ul><ul><ul><li>ServerName </li></ul></ul></ul><ul><ul><ul><li>InstanceName </li></ul></ul></ul><ul><ul><ul><li>MachineName </li></ul></ul></ul><ul><ul><ul><li>ProcessID </li></ul></ul></ul><ul><ul><ul><li>IsClustered </li></ul></ul></ul><ul><ul><ul><li>IsIntegratedSecurityOnly </li></ul></ul></ul>
    27. 27. Command-line Options <ul><li>Need -s parameter for starting any named instance </li></ul><ul><li>Must switch to appropriate Binn directory for the instance at a command prompt before starting Sqlservr.exe. </li></ul><ul><ul><li>Example: If instance1 will be started from the command line, need to be in the MSSQL$instance1Binn directory and execute: Sqlservr.exe -c -s instance1 </li></ul></ul><ul><li>Without the -s parameter, the default instance would start </li></ul><ul><li>Debugger also needs to start with the -s parameter to debug a particular instance </li></ul>
    28. 28. Scenarios <ul><li>Application hosting </li></ul><ul><ul><li>Outsourcing resources and administrative services for multiple companies </li></ul></ul><ul><ul><li>Flexibility in providing varying service levels based on customer segment </li></ul></ul><ul><ul><li>Security isolation among applications and companies </li></ul></ul>
    29. 29. Scenarios (2) <ul><li>Server consolidation </li></ul><ul><ul><li>Fewer machines to administer </li></ul></ul><ul><ul><li>Cost effective (hardware, software, licenses, and so forth) </li></ul></ul><ul><ul><li>Concurrent development and testing environments </li></ul></ul><ul><ul><li>Support Center </li></ul></ul><ul><ul><li>More likely to invest in and protect more expensive computers, leading to greater reliability </li></ul></ul>
    30. 30. Scenarios (3) <ul><li>Desktop engine support </li></ul><ul><ul><li>Independent applications might not support the same settings like security, service pack levels, and collations </li></ul></ul><ul><ul><li>Each application can now install a separate instance of SQL Server 2000 Desktop Engine </li></ul></ul>
    31. 31. Scenarios (4) <ul><li>Failover clustering </li></ul><ul><ul><li>Makes it easier to install and configure virtual servers in a failover cluster </li></ul></ul><ul><ul><li>In a multiple virtual instance setup, when SQL Server fails over to one of the other participating nodes, there will be two instances of SQL Server 2000 running on that node </li></ul></ul>
    32. 32. Known Issues <ul><li>DB-Library is not supported with named instances </li></ul><ul><ul><li>Can work around it by using server alias </li></ul></ul><ul><li>These network libraries are not supported: </li></ul><ul><ul><li>Multiprotocol </li></ul></ul><ul><ul><li>AppleTalk </li></ul></ul><ul><ul><li>Banyan Vines </li></ul></ul><ul><li>Renaming an instance is not supported </li></ul><ul><li>No direct upgrade path to a named instance </li></ul><ul><li>SQL Server 7.0 client tools are unavailable after SQL Server 2000 is installed </li></ul>
    33. 33. Known Issues (2) <ul><li>Instances in a failover cluster must be at the same version level </li></ul><ul><li>Cannot have more than 16 instances in a failover cluster </li></ul><ul><li>Only one default instance per failover cluster is allowed </li></ul><ul><li>By default, only SQL Server 2000 clients can be used to connect to named instances </li></ul><ul><li>SQL Server Upgrade Wizard is not installed during a named instance installation </li></ul>
    34. 34. Knowledge Base Resources <ul><li>Q260414 , “INF: Frequently Asked Questions - SQL Server 2000 - Multiple Instances” </li></ul><ul><li>Q265808 , “INF: How to Connect to an SQL Server 2000 Named Instance with the Previous Version's Client Tools” </li></ul><ul><li>Q270126 , “PRB: How to Manage Client Connectivity to Both SQL Server 2000 Virtual Servers After an Active/Active Cluster 7.0 Upgrade” </li></ul><ul><li>Q287932 , “INF: TCP Ports Needed for Communication to SQL Server Through a Firewall” </li></ul>
    35. 35. Book Resources <ul><li>Inside Microsoft® SQL Server™ 2000 by Kalen Delaney </li></ul><ul><li>Topics from Microsoft SQL Server 2000 Books Online: </li></ul><ul><ul><li>“Working with Named and Multiple Instances of SQL Server 2000” </li></ul></ul><ul><ul><li>“Multiple Instance FAQ” </li></ul></ul>