home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft_Programmers_Library.7z / MPL / net / sqlins.txt < prev    next >
Encoding:
Text File  |  2013-11-08  |  62.8 KB  |  1,807 lines

  1.  Microsoft SQL Server - Installation Guide
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  ────────────────────────────────────────────────────────────────────────────
  11.                  Microsoft(R) SQL Server - Installation Guide
  12.  
  13.               The SYBASE(R) SQL Server database for PC networks
  14.                                  VERSION 1.1
  15.  ────────────────────────────────────────────────────────────────────────────
  16.  
  17.  
  18.                      for the MS(R) OS/2 Operating System
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  Microsoft Corporation
  28.  
  29.  Information in this document is subject to change without notice and does
  30.  not represent a commitment on the part of Microsoft Corporation. The
  31.  software described in this document is furnished under a license agreement
  32.  or nondisclosure agreement. The software may be used or copied only in
  33.  accordance with the terms of the agreement. It is against the law to copy
  34.  the software on any medium except as specifically allowed in the license or
  35.  nondisclosure agreement. No part of this manual may be reproduced or
  36.  transmitted in any form or by any means, electronic or mechanical, including
  37.  photocopying and recording, for any purpose without the express written
  38.  permission of Microsoft Corporation.
  39.  (C) 1990 Microsoft Corporation and SYBASE, Inc. All rights reserved.
  40.  
  41.  
  42.  Printed in the USA.
  43.  
  44.  
  45.  Microsoft, MS, MS-DOS, and the Microsoft logo are registered
  46.  trademarks of Microsoft Corporation. Windows is a trademark of Microsoft
  47.  Corporation.
  48.  
  49.  IBM is a registered trademark of International Business
  50.  Machines Corporation.
  51.  
  52.  SYBASE is a registered trademark of SYBASE, Inc.
  53.  TRANSACT-SQL and DB-LIBRARY are trademarks of SYBASE, Inc.
  54.  
  55.  3Com is a registered trademark of 3Com Corporation.
  56.  
  57.  Document Number: SY10228-0290
  58.   OEM-D/0788-1Z
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  Table of Contents
  66.  ────────────────────────────────────────────────────────────────────────────
  67.  
  68.  
  69.  
  70.  Before You Begin
  71.       Manual Overview
  72.       How to Use This Guide
  73.       Check the Package Contents
  74.       Make Backup Copies
  75.       Register the Product
  76.       Notational Conventions
  77.       Finding Further Information
  78.  
  79.  Chapter 1  Installing SQL Server
  80.  
  81.       Introduction
  82.       The Hardware and Software You Need
  83.              For a Server
  84.              For a Workstation
  85.       Using the setup Program
  86.       Before You Run setup
  87.              Gather Information
  88.              Check Your Network (if necessary)
  89.              Shut Down SQL Server
  90.       Running setup Under OS/2 Systems
  91.       Installing SQL Server on a Remote Server
  92.       Running setup Under MS-DOS
  93.       Starting SQL Server
  94.              Network Server
  95.              Stand-alone Server
  96.       Testing SQL Server
  97.       Viewing the Error Log
  98.       Permitting Workstations to Use SQL Server
  99.       Running MS-DOS Applications
  100.       Where to Go Next
  101.              For System Administrators
  102.              For Application Developers
  103.              For Other Users
  104.  
  105.  Chapter 2  Configuring SQL Server
  106.  
  107.       Introduction
  108.       What the setup Program Does: OS/2 System
  109.              Network Server
  110.              Stand-alone Server
  111.       What the setup Program Does: MS-DOS System
  112.       Performance Issues
  113.              Adding Physical Memory
  114.              Disabling Write Caching
  115.              Disabling the MS-DOS Compatibility Box
  116.              OS/2-System Swapping
  117.       LAN Manager/LAN Server Options
  118.              Disabling LAN Manager Disk Caching
  119.              Changing LAN Manager/LAN Server Parameters
  120.       SQL Server Configuration Options
  121.              The memory Option
  122.              The user connections Option
  123.              The procedure cache Option
  124.       SQL Server Configuration Guidelines
  125.              Running SQL Server on a Dedicated Computer
  126.              Running SQL Server on a File or Print Server
  127.              Running SQL Server on a User Workstation
  128.       Common Installation Problems
  129.              Problem 1
  130.              Problem 2
  131.              Problem 3
  132.  
  133.  Appendix A  Upgrading from Version 1.0
  134.  
  135.       Introduction
  136.       Changes to SQL Server, Version 1.0
  137.              Changes to the Server
  138.              Changes to DB-LIBRARY
  139.              Changes to SAF
  140.              Changes in Running MS-DOS Application
  141.       Upgrading from SQL Server, Version 1.0
  142.              Updating the Error Message Table
  143.       Upgrading from the Network Developer's Kit
  144.  
  145.  
  146.  Before You Begin
  147.  ────────────────────────────────────────────────────────────────────────────
  148.  
  149.  
  150.  Manual Overview
  151.  
  152.  This manual describes how to install the SQL Server software on your OS/2,
  153.  MS-DOS(R), or Microsoft(R) Windows(tm) system. It also includes information
  154.  that describes how to upgrade from SQL Server, Version 1.0.
  155.  
  156.  
  157.  How to Use This Guide
  158.  
  159.  The following topics are covered in this manual:
  160.  
  161.  ────────────────────────────────────────────────────────────────────────────
  162.  Chapter 1
  163.    How to install SQL Server
  164.  
  165.  Chapter 2
  166.    How to maximize performance
  167.  
  168.  Appendix A
  169.    How to upgrade from version 1.0
  170.  
  171.  ────────────────────────────────────────────────────────────────────────────
  172.  Check the Package Contents
  173.  
  174.  Before you attempt to install SQL Server, Version 1.1, make sure you have
  175.  received the following items:
  176.  
  177.  
  178.    ■   Three 5-1/4 inch high density (1.2 megabyte) disks:
  179.  
  180.        ■   Setup for OS/2 systems
  181.  
  182.        ■   Disk 2 for OS/2 systems
  183.  
  184.        ■   Disk 3 for OS/2 systems
  185.  
  186.  
  187.    ■   Four 5-1/4 inch low density (360 kilobyte) disks:
  188.  
  189.        ■   Setup for MS-DOS systems
  190.  
  191.        ■   Disk 2 for MS-DOS systems
  192.  
  193.        ■   Disk 3 for MS-DOS systems
  194.  
  195.        ■   Disk 4 for MS-DOS systems
  196.  
  197.  
  198.    ■   Three 3-1/2 inch high density (1.44 megabyte) disks:
  199.  
  200.        ■   Setup for OS/2 systems
  201.  
  202.        ■   Disk 2 for OS/2 systems
  203.  
  204.        ■   Disk 3 for OS/2 systems
  205.  
  206.  
  207.    ■   Two 3-1/2 inch low density (720 kilobyte) disks:
  208.  
  209.        ■   Setup for MS-DOS systems
  210.  
  211.        ■   Disk 2 for MS-DOS systems
  212.  
  213.  
  214.    ■   The SQL Server manual set, in addition to this manual:
  215.  
  216.        ■   SQL Server System Administrator's Guide
  217.  
  218.        ■   SQL Server Learning TRANSACT-SQL
  219.  
  220.        ■   SQL Server Language Reference
  221.  
  222.        ■   SQL Server Programmer's Reference
  223.  
  224.        ■   SQL Server Quick Reference
  225.  
  226.  
  227.    ■   SQL Server Product Registration Card
  228.  
  229.    ■   Support Services Agreement and Registration Card
  230.  
  231.    ■   Value Pack
  232.  
  233.    ■   Third Party Product Coupons
  234.  
  235.  
  236.  If you are missing any of these items, contact Microsoft Customer Service at
  237.  (206) 882-8088.
  238.  
  239.  
  240.  Make Backup Copies
  241.  
  242.  Before you attempt to install SQL Server, you should make backup copies of
  243.  the product's master disks. Use the MS-DOS or OS/2-system diskcopy command
  244.  to copy each original disk to a backup. Consult the appropriate
  245.  documentation if you do not know how to use this command.
  246.  
  247.  After you have made backup copies, store the SQL Server master disks in a
  248.  safe place.
  249.  
  250.  
  251.  Register the Product
  252.  
  253.  Be sure to mail in the Product Registration Card, to register your purchase
  254.  of SQL Server, Version 1.1. Sending this card also registers you for product
  255.  support and allows us to keep you informed of future releases of SQL Server.
  256.  
  257.  
  258.  
  259.  Notational Conventions
  260.  
  261.  Throughout this manual, the following conventions are used to distinguish
  262.  elements of text:
  263.  
  264. ╓┌─────────────────────────────────┌─────────────────────────────────────────
  265.  Convention                        Purpose
  266.  ────────────────────────────────────────────────────────────────────────────
  267.  UPPERCASE                         Represents statement and clause names,
  268.                                    functions, macros, and any other portions
  269.                                    of syntax that must appear exactly as
  270.                                    shown.
  271.  
  272.  SMALL CAPS                        Represent keynames such as CTRL.
  273.  
  274.  bold                              Represents stored procedures, system
  275.  Convention                        Purpose
  276.  ────────────────────────────────────────────────────────────────────────────
  277. bold                              Represents stored procedures, system
  278.                                    procedures, triggers, defaults, rules,
  279.                                    utility programs, and commands.
  280.  
  281.  italic                            Represents database names, table names,
  282.                                    view names, column names, datatypes, index
  283.                                    names, pathnames, filenames, and variables
  284.                                    that appear in text.
  285.  
  286.  monospace                         Represents examples, screen output,
  287.                                    program code, and error messages.
  288.  
  289.  [brackets]                        Enclose optional items. Type only the
  290.                                    information within the brackets, not the
  291.                                    brackets themselves.
  292.  
  293.  {braces}                          Enclose required items. Type only the
  294.                                    information within the braces, not the
  295.                                    braces themselves.
  296.  Convention                        Purpose
  297.  ────────────────────────────────────────────────────────────────────────────
  298.                                   braces themselves.
  299.  
  300.  | (vertical bar)                  Separates items inside a set of braces or
  301.                                    brackets. The vertical bar means you must
  302.                                    choose one and only one item.
  303.  
  304.  ... (ellipsis)                    Means that you can repeat the previous
  305.                                    item as many times as you like.
  306.  
  307.  <execute>                         Executes one or more SQL statements. (In
  308.                                    the SQL Server Administration Facility,
  309.                                    SQL statements are executed by pressing
  310.                                    the CTRL+E keys. In the isql program, SQL
  311.                                    statements are executed with the go
  312.                                    command.)
  313.  
  314.  ────────────────────────────────────────────────────────────────────────────
  315.  
  316.  
  317.  
  318.  
  319.  Finding Further Information
  320.  
  321.  The following manuals describe SQL Server and are included in the standard
  322.  documentation set:
  323.  
  324.  ────────────────────────────────────────────────────────────────────────────
  325.  SQL Server Learning TRANSACT-SQL
  326.    A guide to learning and using TRANSACT-SQL(tm)
  327.  
  328.  SQL Server System Administrator's Guide
  329.    A guide to managing SQL Server and to using the SQL Server Administration
  330.    Facility (SAF) for database queries
  331.  
  332.  SQL Server Language Reference
  333.    A reference to the syntax of all TRANSACT-SQL statements, commands,
  334.    procedures, and utilities
  335.  
  336.  SQL Server Programmer's Reference
  337.    A reference to DB-LIBRARY(tm), which is a set of C routines and macros
  338.    that allow your application to interact with SQL Server
  339.  
  340.  SQL Server Quick Reference
  341.    A quick reference guide to TRANSACT-SQL
  342.  
  343.  ────────────────────────────────────────────────────────────────────────────
  344.  
  345.  
  346.  
  347.  
  348.  Chapter 1  Installing SQL Server
  349.  ────────────────────────────────────────────────────────────────────────────
  350.  
  351.  
  352.  Introduction
  353.  
  354.  This chapter describes:
  355.  
  356.  
  357.    ■   The hardware and software you need to install SQL Server on your
  358.        computer
  359.  
  360.    ■   How to install SQL Server with the setup program
  361.  
  362.    ■   How to start SQL Server
  363.  
  364.  
  365.  
  366.  The Hardware and Software You Need
  367.  
  368.  To install SQL Server on a server or workstation, you need the SQL Server
  369.  distribution diskettes and the hardware and software described on the next
  370.  page.
  371.  
  372.  
  373.  For a Server
  374.  
  375.  SQL Server requires an OS/2 system, Version 1.1 or later, to run. To install
  376.  SQL Server on a server, you need at least 20 megabytes of free space on your
  377.  hard disk and the requirements in the table on the next page:
  378.  
  379. ╓┌─────────────────────────────────┌─────────────────────────────────────────
  380.  You Need                          Your Choices Are
  381.  ────────────────────────────────────────────────────────────────────────────
  382.  Computer                          A personal computer with an 80286 or 80386
  383.                                    microprocessor running OS/2 system,
  384.                                    Version 1.1 or later. An 80386 is
  385.                                    recommended.
  386.  
  387.  Minimum memory                    8 megabytes.
  388.  
  389.  Disk drives                       A minimum 40-megabyte hard disk drive and
  390.                                    5-1/4 inch or 3-1/2 inch disk drive.
  391.  
  392.  Operating system(1)               OS/2 system, Version 1.1 or later.
  393.  
  394.  Network software(1)               Microsoft LAN Manager-based network;
  395.                                    IBM(R) OS/2 LAN Server.
  396.  
  397.  Network adapter                   The appropriate network adapter card.(1)
  398.  
  399.  ────────────────────────────────────────────────────────────────────────────
  400.  
  401.  You Need                          Your Choices Are
  402.  ────────────────────────────────────────────────────────────────────────────
  403. 
  404.  
  405.  
  406.  (1) See your network software manuals for more information.
  407.  
  408.  
  409.  
  410.  For a Workstation
  411.  
  412.  SQL Server workstations can run under either MS-DOS or OS/2 systems. To
  413.  install SQL Server utility programs and programming tools on a workstation,
  414.  you need at least 1 megabyte of free space on your hard disk and the
  415.  following:
  416.  
  417. ╓┌─────────────────┌──────────────────────────────┌──────────────────────────
  418.  You Need          MS-DOS Workstation             OS/2-System Workstation
  419.  ────────────────────────────────────────────────────────────────────────────
  420.  Computer          An IBM personal computer, or   A personal computer with an
  421.                    compatible, with a hard disk.  80286 or 80386
  422.  You Need          MS-DOS Workstation             OS/2-System Workstation
  423.  ────────────────────────────────────────────────────────────────────────────
  424.                   compatible, with a hard disk.  80286 or 80386
  425.                                                   microprocessor.
  426.  
  427.  Minimum memory    640 kilobytes (K).             3 megabytes.
  428.  
  429.  Operating system  MS-DOS, Version 3.2 or later.  OS/2 system, Version 1.1 or
  430.                                                   later.
  431.  
  432.  Network software  IBM DOS LAN Requestor.         IBM LAN Server.
  433.  
  434.                    MS-DOS LAN Manager-based       Microsoft LAN Manager-based
  435.                    networks.                      networks.
  436.  
  437.  ────────────────────────────────────────────────────────────────────────────
  438.  
  439.  
  440.  
  441.  
  442.  Using the setup Program
  443.  
  444.  Use the setup program to install SQL Server software on your server or
  445.  workstation. Depending on your choices, the setup program copies all or part
  446.  of the SQL Server software. The three most common installations are as
  447.  follows:
  448.  
  449. ╓┌───────────────────────────────────────┌───────────────────────────────────
  450.  Type of Installation                    Software Installed
  451.  ────────────────────────────────────────────────────────────────────────────
  452.  An OS/2-system server.                  Server software and utility programs.
  453.  
  454.  An MS-DOS workstation or an             Utility programs.
  455.  OS/2-system workstation used mainly
  456.  for accessing data in SQL Server
  457.  databases or for the remote
  458.  administration of SQL Server
  459.  databases.
  460.  
  461.  An MS-DOS workstation or an             Utility programs and programming
  462.  OS/2-system workstation used mainly     tools.
  463.  for developing SQL Server
  464.  Type of Installation                    Software Installed
  465.  ────────────────────────────────────────────────────────────────────────────
  466. for developing SQL Server
  467.  applications.
  468.  
  469.  ────────────────────────────────────────────────────────────────────────────
  470.  
  471.  
  472.  
  473.  The setup program makes it easy to install only those SQL Server components
  474.  you need.
  475.  
  476.  
  477.  Before You Run setup
  478.  
  479.  Before you run setup, you must:
  480.  
  481.  
  482.    1.  Gather the configuration information you'll need.
  483.  
  484.    2.  Make sure your network is set up and running if you are installing
  485.        over the network. The network need not be running if you are
  486.        installing SQL Server on the local machine.
  487.  
  488.    3.  Shut down SQL Server if it is already running.
  489.  
  490.  
  491.  
  492.  Gather Information
  493.  
  494.  The SQL Server setup program prompts you for the following information when
  495.  you install the SQL Server software. You can fill in the appropriate details
  496.  under "Your Computer" and refer to this information when running setup.
  497.  
  498. ╓┌───────────────────────────────────────┌───────────────────────────────────╖
  499.  Type of Information                     Your Computer
  500.  ────────────────────────────────────────────────────────────────────────────
  501.  Amount of memory in computer(1)         ______ Kilobytes
  502.  
  503.  Amount of space on the server's hard    ______ Megabytes
  504.  disk to reserve for the master
  505.  database device(2)
  506.  Type of Information                     Your Computer
  507.  ────────────────────────────────────────────────────────────────────────────
  508. database device(2)
  509.  
  510.  Case sensitivity of character data and  ______ Case sensitive
  511.  object names(3)                         ______ Non-case-sensitive
  512.  
  513.  ────────────────────────────────────────────────────────────────────────────
  514.  
  515.  
  516.  
  517.  (1) To find the amount of memory in the computer, turn the power switch off
  518.  and then on. The amount of memory available is displayed at the upper-left
  519.  corner of the screen. The last number that appears is the number of
  520.  kilobytes of memory available in your computer.
  521.  (2) This amount must be at least 10 megabytes. See the SQL Server System
  522.  Administrator's Guide for a description of the master database device.
  523.  (3) With case-sensitive data, character data retrieved from a database must
  524.  contain the same uppercase and lowercase letters it contained when it was
  525.  entered into the database. If you entered "Bill Smith," you must retrieve
  526.  "Bill Smith" and not "BILL SMITH." Object names must also contain the same
  527.  uppercase and lowercase letters used when the object was created.
  528.  With non-case-sensitive data, if you entered "Bill Smith," you could
  529.  retrieve "BILL SMITH," "bill smith," or "bill Smith."
  530.  Check the application manual to find out whether your application requires
  531.  case-sensitive data.
  532.  
  533.  
  534.  
  535.  Check Your Network (if necessary)
  536.  
  537.  If you intend to install as a network server, your server must have both
  538.  network server software and network workstation software installed. Before
  539.  installing SQL Server, make sure your server and workstation are set up
  540.  correctly:
  541.  
  542.  
  543.    1.  Start your network server and workstation, if they have not been
  544.        started.
  545.  
  546.    2.  Make sure you are logged on as a valid network user with
  547.        administrative privileges on your server.
  548.  
  549.    3.  Make sure that your server is sharing the IPC$ resource. (If your
  550.        server has user-level security, the IPC$ resource is shared
  551.        automatically, but if your server has share-level security, use the
  552.        appropriate network command to share IPC$.)
  553.  
  554.  
  555.  Refer to your network documentation for details.
  556.  
  557.  
  558.  Shut Down SQL Server
  559.  
  560.  If SQL Server has been installed previously and is currently running, shut
  561.  it down from a SQL Server session, (such as the isql or SAF utility program)
  562.  by typing
  563.  
  564.    shutdown
  565.  
  566.  You may shutdown SQL Server running on a network by typing net stop
  567.  sqlserver; however, no checkpoints are performed in the databases with this
  568.  method until SQL Server is started again.
  569.  
  570.  
  571.  Running setup Under OS/2 Systems
  572.  
  573.  This section describes how to run the OS/2-system version of setup. With
  574.  this version of setup, you can
  575.  
  576.  
  577.    ■   Install the server software on a local or remote computer
  578.  
  579.    ■   Install the workstation software on a local or remote computer
  580.  
  581.    ■   Remove all server and workstation software from a local or remote
  582.        computer
  583.  
  584.  
  585.  The setup program is a menu-driven utility that gives you step-by-step
  586.  instructions. To run setup:
  587.  
  588.  
  589.    1.  Insert the SQL Server setup disk in drive A.
  590.  
  591.    2.  At the C> prompt, type
  592.  
  593.        a:setup [/remote]
  594.  
  595.  
  596.        Specify the /remote switch if you want to install or delete software
  597.        on a remote computer system.
  598.  
  599.    3.  Press ENTER.
  600.  
  601.  
  602.  The setup program displays a menu.
  603.  
  604.  Select the option you desire. Whichever option you choose, the setup program
  605.  prompts you for any information it requires to carry out its work. At the
  606.  completion of each option, setup returns you to the menu and prompts you for
  607.  another choice.
  608.  
  609.  You can start SQL Server automatically every time you start your computer by
  610.  selecting the default menu item when prompted to allow setup to modify the
  611.  startup.cmd file for you.
  612.  
  613.  If you have problems and need additional information, see Chapter 2,
  614.  "Configuring SQL Server."
  615.  
  616.  
  617.  Installing SQL Server on a Remote Server
  618.  
  619.  Generally, the SQL Server setup program is run on the same computer that
  620.  will run SQL Server. However, some network servers do not have a floppy
  621.  drive, keyboard, or monitor (specifically, 3Com(R) servers such as the
  622.  3S/400). The SQL Server setup program has been designed with a remote option
  623.  that simplifies installation on these servers.
  624.  
  625.  To install SQL Server on a remote server, the remote server must have ADMIN$
  626.  shared and you need an OS/2-system workstation. The workstation must be
  627.  logged on with a logon ID/password which has administrative privileges on
  628.  the remote server. You must then make a connection from the workstation to
  629.  ADMIN$ on the remote server.
  630.  
  631.  Once you've made this connection, you can install SQL Server:
  632.  
  633.  
  634.    1.  Insert the SQL Server setup disk for OS/2 systems in drive A of the
  635.        workstation.
  636.  
  637.    2.  Type
  638.  
  639.        a:setup /remote
  640.  
  641.  
  642.    3.  Select option 1.
  643.  
  644.        The setup program asks for the remote server name.
  645.  
  646.    4.  Type the server name, preceded by two backslashes. For example:
  647.  
  648.        \\mysqlserver
  649.  
  650.  
  651.  
  652.  The rest of the setup procedure is unchanged from the standard SQL Server
  653.  setup.
  654.  
  655.  
  656.  Running setup Under MS-DOS
  657.  
  658.  This section describes how to run the MS-DOS version of setup. With this
  659.  version of setup, you can
  660.  
  661.  
  662.    ■   Install the workstation software on the local computer
  663.  
  664.    ■   Remove all server and workstation software from the local computer
  665.  
  666.  
  667.  The setup program is a menu-driven utility that gives you step-by-step
  668.  instructions. To run setup:
  669.  
  670.  
  671.    1.  Insert the SQL Server setup disk in drive A.
  672.  
  673.    2.  At the C> prompt, type
  674.  
  675.        a:setup
  676.  
  677.  
  678.    3.  Press ENTER.
  679.  
  680.        The setup program displays a menu.
  681.  
  682.  
  683.  Select the option you desire. Whichever option you choose, the setup program
  684.  prompts you for any information it requires to carry out its work. At the
  685.  completion of each option, setup returns you to the menu and prompts you to
  686.  make another choice.
  687.  
  688.  If you have problems and need additional information, see Chapter 2,
  689.  "Configuring SQL Server."
  690.  
  691.  
  692.  Starting SQL Server
  693.  
  694.  You should reboot your system after installing SQL Server, because changes
  695.  may have been made to your config.sys file and your network.
  696.  
  697.  
  698.  Network Server
  699.  
  700.  After running the setup program, start SQL Server from the computer on which
  701.  you installed the server software:
  702.  
  703.  
  704.    1.  If your network server is not running, type
  705.  
  706.        net start server
  707.  
  708.  
  709.    2.  To start SQL Server, type
  710.  
  711.        net start sqlserver
  712.  
  713.  
  714.  
  715.  If you have problems starting SQL Server, see the "Common Installation
  716.  Problems" section in Chapter 2, "Configuring SQL Server."
  717.  
  718.  
  719.  Stand-alone Server
  720.  
  721.  If you have installed SQL Server on a stand-alone workstation (that is, with
  722.  no network installed), use the following command to start the server:
  723.  
  724.    cd \sql\data
  725.     sqlservr -d master.dat
  726.  
  727.  You then need to change screen groups by pressing ALT+ESC.
  728.  
  729.  If you have problems starting SQL Server, see the "Common Installation
  730.  Problems" section in Chapter 2, "Configuring SQL Server."
  731.  
  732.  
  733.  Testing SQL Server
  734.  
  735.  To make sure SQL Server is working correctly, start the isql program and
  736.  execute a sample query:
  737.  
  738.  
  739.    1.  Start isql by typing the following commands:
  740.  
  741.        isql /Usa /P /Sservername
  742.  
  743.  
  744.        If you installed SQL Server stand-alone, type
  745.  
  746.        isql /Usa /P
  747.  
  748.    2.  When the number prompt (1>) appears, type the following statements:
  749.  
  750.        1>select * from sysdatabases
  751.         2>go
  752.  
  753.  
  754.    3.  Press ENTER.
  755.  
  756.        You will see a report similar to the following:
  757.  
  758.        name      dbid   suid  mode  status  version  crdate
  759.         --------  ----   ----  ----  ------  -------  -------------------
  760.         master       1      1     0       0        1  Jan  1 1990 12:00AM
  761.         model        3      1     0       0        1  Jan  1 1990 12:00AM
  762.         pubs         4      1     0       0        1  Feb 22 1990  4:50PM
  763.         tempdb       2      1     0       4        1  Jan  1 1990 12:00AM
  764.  
  765.         (4 rows affected)
  766.  
  767.    4.  To leave isql, type
  768.  
  769.        1>exit
  770.  
  771.  
  772.    5.  Press ENTER.
  773.  
  774.  
  775.  
  776.  Viewing the Error Log
  777.  
  778.  SQL Server writes all messages to the sql\log\errorlog file. Each message,
  779.  as it occurs, is appended to this file. You can review this file at any time
  780.  to check error messages.
  781.  
  782.  
  783.  Permitting Workstations to Use SQL Server
  784.  
  785.  Use your network software to permit workstations to use SQL Server:
  786.  
  787.  
  788.    1.  If you are running user-level security, give each user a username and
  789.        password on the network server.
  790.  
  791.    2.  Assign each username to a valid group that has access to \pipe.
  792.  
  793.  
  794.  See your network manual for details.
  795.  
  796.  ────────────────────────────────────────────────────────────────────────────
  797.  NOTE
  798.  
  799.  The only SQL Server account available is "sa," until users are given login
  800.  IDs to SQL Server.
  801.  ────────────────────────────────────────────────────────────────────────────
  802.  
  803.  
  804.  Running MS-DOS Applications
  805.  
  806.  If your workstation is running MS-DOS, the terminate and stay resident (TSR)
  807.  program, DBNMPIPE, must be loaded for your application to communicate with
  808.  the server. If you did not choose the option to include this in your
  809.  autoexec.bat file, you may load the TSR by simply typing dbnmpipe at the
  810.  prompt. You may want to unload the TSR to free up more memory for other
  811.  applications. To do this, type enddblib.exe at the prompt.
  812.  
  813.  
  814.  Where to Go Next
  815.  
  816.  
  817.  For System Administrators
  818.  
  819. ╓┌───────────────────────────────────────┌───────────────────────────────────
  820.  To Find This                            Consult This Manual
  821.  To Find This                            Consult This Manual
  822.  ────────────────────────────────────────────────────────────────────────────
  823.  Instructions on how to manage SQL       SQL Server System Administrator's
  824.  Server databases                        Guide
  825.  
  826.  Instructions on how to use the System   SQL Server System Administrator's
  827.  Administrator's Facility (SAF) to       Guide
  828.  access databases
  829.  
  830.  Tutorials in the TRANSACT-SQL           SQL Server Learning TRANSACT-SQL
  831.  programming language
  832.  
  833.  A complete description of TRANSACT-SQL  SQL Server Language Reference
  834.  syntax
  835.  
  836.  
  837.  
  838.  
  839.  For Application Developers
  840.  
  841. ╓┌──────────────────────────────────────────┌────────────────────────────────
  842.  To Find This                               Consult This Manual
  843.  ────────────────────────────────────────────────────────────────────────────
  844.  A complete description of the functions    SQL Server Programmer's Reference
  845.  available in DB-LIBRARY, the programmatic
  846.  interface to SQL Server
  847.  
  848.  Tutorials in the TRANSACT-SQL programming  SQL Server Learning TRANSACT-SQL
  849.  language
  850.  
  851.  A complete description of TRANSACT-SQL     SQL Server Language Reference
  852.  syntax
  853.  
  854.  
  855.  
  856.  
  857.  For Other Users
  858.  
  859.  Read the first three chapters of the SQL Server System Administrator's Guide
  860.  to learn how to use the SAF. Then, study SQL Server Learning TRANSACT-SQL
  861.  for a tutorial about TRANSACT-SQL.
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  Chapter 2  Configuring SQL Server
  869.  ────────────────────────────────────────────────────────────────────────────
  870.  
  871.  
  872.  Introduction
  873.  
  874.  This chapter discusses the setup program and common problems encountered
  875.  when installing SQL Server.
  876.  
  877.  
  878.  What the setup Program Does: OS/2 System
  879.  
  880.  When installing SQL Server on an OS/2 system, you can set it up as either a
  881.  network server or a stand-alone server.
  882.  
  883.  
  884.  Network Server
  885.  
  886.  When installing SQL Server on a network server, the setup program does the
  887.  following:
  888.  
  889.  
  890.    1.  Checks that named-pipe interprocess communication (IPC) exists on the
  891.        server.
  892.  
  893.    2.  Loads executable and data files from the setup disks.
  894.  
  895.    3.  Updates the following files:
  896. ╓┌──────────────────────────┌────────────────────────────────────────────────╖
  897.  To This File               setup Adds
  898.  ────────────────────────────────────────────────────────────────────────────
  899.  config.sys                 c:\sql\dll to libpath, and copies dynamic link
  900.                             libraries (DLLs) to that directory and also
  901.                             adds c:\sql\binp to path
  902.  
  903.  lanman.ini or              sqlserver in the services section and an
  904.  ibmlan.ini                 sqlserver section containing full pathnames for
  905.  To This File               setup Adds
  906.  ────────────────────────────────────────────────────────────────────────────
  907. ibmlan.ini                 sqlserver section containing full pathnames for
  908.                             master.dat, errorlog, and sqlservr.exe
  909.  
  910.  ────────────────────────────────────────────────────────────────────────────
  911.  
  912.  
  913.  
  914.  
  915.  
  916.    4.  Creates the master database to your specifications.
  917.  
  918.    5.  Starts SQL Server.
  919.  
  920.    6.  Runs four scripts:
  921. ╓┌─────────────────────────────────┌─────────────────────────────────────────
  922.  This Script                       Does This
  923.  ────────────────────────────────────────────────────────────────────────────
  924.  instmstr.sql                      Loads system procedures
  925.  
  926.  This Script                       Does This
  927.  ────────────────────────────────────────────────────────────────────────────
  928. 
  929.  instmodl.sql                      Loads system procedures
  930.  
  931.  instpubs.sql                      Loads the pubs database if specified
  932.  
  933.  config.sql                        Adjusts configuration parameters based on
  934.                                    your replies to memory size and master.dat
  935.                                    location
  936.  
  937.  ────────────────────────────────────────────────────────────────────────────
  938.  
  939.  
  940.  
  941.  After installation, the computer must be restarted to make the change to
  942.  libpath effective.
  943.  
  944.  
  945.  
  946.  Stand-alone Server
  947.  
  948.  When installing SQL Server as a stand-alone server, the setup program does
  949.  the following:
  950.  
  951.  
  952.    1.  Checks that named-pipe interprocess communication (IPC) exists on the
  953.        server.
  954.  
  955.    2.  Loads executable and data files from the setup disks.
  956.  
  957.    3.  Adds c:\sql\binp to path in the config.sys file.
  958.  
  959.    4.  Creates the master database to your specifications.
  960.  
  961.    5.  Starts SQL Server.
  962.  
  963.    6.  Runs four scripts:
  964. ╓┌─────────────────────────────────┌─────────────────────────────────────────
  965.  This Script                       Does This
  966.  ────────────────────────────────────────────────────────────────────────────
  967.  instmstr.sql                      Loads system procedures
  968.  This Script                       Does This
  969.  ────────────────────────────────────────────────────────────────────────────
  970.  instmstr.sql                      Loads system procedures
  971.  
  972.  instmodl.sql                      Loads system procedures
  973.  
  974.  instpubs.sql                      Loads the pubs database if specified
  975.  
  976.  config.sql                        Adjusts configuration parameters based on
  977.                                    your replies to memory size and master.dat
  978.                                    location
  979.  
  980.  ────────────────────────────────────────────────────────────────────────────
  981.  
  982.  
  983.  
  984.  After installation, the computer must be restarted to make the change to
  985.  libpath effective.
  986.  
  987.  
  988.  
  989.  What the setup Program Does: MS-DOS System
  990.  
  991.  When installing SQL Server on an MS-DOS workstation, the setup program does
  992.  the following:
  993.  
  994.  
  995.    1.  Loads executable and data files from the setup disks.
  996.  
  997.    2.  Adds c:\sql\bin to path in the config.sys file.
  998.  
  999.    3.  Updates the autoexec.bat file by adding dbnmpipe.
  1000.  
  1001.  
  1002.  
  1003.  Performance Issues
  1004.  
  1005.  The following recommendations concern your system hardware or operating
  1006.  system.
  1007.  
  1008.  
  1009.  Adding Physical Memory
  1010.  
  1011.  SQL Server requires a computer with at least 8 megabytes of system memory
  1012.  installed. In this minimum configuration, the computer system should be
  1013.  dedicated to running SQL Server. Adding additional memory above 8 megabytes
  1014.  can significantly improve system throughput.
  1015.  
  1016.  SQL Server caches frequently accessed database information in physical
  1017.  memory. In systems with a large amount of memory (9-16 megabytes), SQL
  1018.  Server may be able to locate previously accessed information without reading
  1019.  from the hard disk. This can significantly increase performance.
  1020.  
  1021.  
  1022.  Disabling Write Caching
  1023.  
  1024.  OS/2 systems and LAN Manager 1.X networks support a sophisticated read/write
  1025.  disk cache to improve file server performance. The read cache buffers data
  1026.  in memory, which allows read requests to be satisfied without accessing the
  1027.  disk. Similarly, the write cache delays writes to the disk until they are
  1028.  required. Disk writes buffered through a write cache are called lazy writes.
  1029.  
  1030.  
  1031.  SQL Server will run if a read cache is installed, but you can get better
  1032.  performance if you give the memory to SQL Server's own buffer instead of to
  1033.  the OS/2 or LAN cache.
  1034.  
  1035.  ────────────────────────────────────────────────────────────────────────────
  1036.  WARNING
  1037.  
  1038.  Data written using lazy writes is at risk until it is physically written to
  1039.  disk. If the system were to crash before buffered data is written, it would
  1040.  be lost. This would cause database corruption.
  1041.  ────────────────────────────────────────────────────────────────────────────
  1042.  
  1043.  When you issue the command net start sqlserver, SQL Server automatically
  1044.  disables lazy writes if they are enabled on the server. However, if you
  1045.  start the server directly with the sqlservr program, SQL Server does not
  1046.  disable lazy writes. You can determine the state of write caching by issuing
  1047.  the following command at the operating system prompt:
  1048.  
  1049.    cache /options
  1050.  
  1051.  If the cache program displays the following message:
  1052.  
  1053.    Drive C is enabled with lazy write selected
  1054.  
  1055.  then disable the write cache with the following command:
  1056.  
  1057.    cache /lazy:c:off
  1058.  
  1059.  You should also remove the following command from the startup.cmd file, if
  1060.  it is present:
  1061.  
  1062.    cache /lazy:c:on
  1063.  
  1064.  This ensures that the write cache is disabled each time you reboot your
  1065.  machine. Other versions of LAN Manager may handle the write cache operations
  1066.  differently, as may other network software. Consult your network software
  1067.  manual(s) for more information if necessary.
  1068.  
  1069.  ────────────────────────────────────────────────────────────────────────────
  1070.  NOTE
  1071.  
  1072.  You must disable write caching on any File Allocation Table (FAT) drive
  1073.  where you intend to place SQL Server data.
  1074.  ────────────────────────────────────────────────────────────────────────────
  1075.  
  1076.  
  1077.  Disabling the MS-DOS Compatibility Box
  1078.  
  1079.  OS/2 systems provide a special screen session known as the compatibility
  1080.  box, where you can run MS-DOS programs. For performance reasons, you should
  1081.  disable this feature when running SQL Server. Running the compatibility box
  1082.  on the same machine with SQL Server will severely impair system performance.
  1083.  
  1084.  
  1085.  To disable the compatibility box, edit the operating system configuration
  1086.  file (config.sys or config.os2). Set the protectonly option by typing
  1087.  
  1088.    protectonly = yes
  1089.  
  1090.  You should also disable any real-mode device drivers such as dos.sys. For
  1091.  this change to take effect, you must reboot your machine.
  1092.  
  1093.  
  1094.  OS/2-System Swapping
  1095.  
  1096.  OS/2 systems retain only the most important data and programs in physical
  1097.  memory. Only when OS/2 systems need more physical memory are segments that
  1098.  have not been used recently discarded or transferred to the hard disk. This
  1099.  conserves physical memory. When a segment is needed, it is transferred back
  1100.  into memory from the disk. This action can cause another segment to be
  1101.  swapped or discarded in order to make room.
  1102.  
  1103.  OS/2 systems perform swapping without user intervention. If configured
  1104.  correctly, the OS/2-system swapping mechanism can improve system performance
  1105.  by removing infrequently used portions of data to disk. This allows
  1106.  dedicated programs like SQL Server to use as much memory as possible. Only
  1107.  modified data segments are swapped. Others are discarded and reread from
  1108.  original sources (.EXEs and .DLLs).
  1109.  
  1110.  OS/2-system swap files can become very large (greater than 4 megabytes) when
  1111.  running SQL Server. In particular, when the computer is dedicated to SQL
  1112.  Server, much of the OS/2 system and LAN Manager will be swapped to disk.
  1113.  This is normal and will improve system performance. You can control the
  1114.  amount of memory dedicated to SQL Server through the SQL Server memory
  1115.  configuration option, discussed later in this chapter. If you are running MS
  1116.  OS/2 1.1, you can also free up memory by disabling the Presentation Manager
  1117.  spooler.
  1118.  
  1119.  
  1120.  LAN Manager/LAN Server Options
  1121.  
  1122.  The following recommendations apply to your network software.
  1123.  
  1124.  
  1125.  Disabling LAN Manager Disk Caching
  1126.  
  1127.  LAN Manager 1.X networks include a sophisticated disk cache that improves
  1128.  performance when LAN Manager is used as a file server. This cache minimizes
  1129.  physical reads (and, optionally, writes) during file sharing.
  1130.  
  1131.  SQL Server does its own caching. Because SQL Server's cache is optimized for
  1132.  database operations, running the LAN Manager cache concurrently does not
  1133.  improve performance. However, disabling the LAN Manager cache and releasing
  1134.  the cache memory to SQL Server can improve overall system performance.
  1135.  
  1136.  To disable the LAN Manager cache, edit the OS/2-system configuration file
  1137.  (either config.sys or config.os2) by converting the diskcache command into a
  1138.  remark. Type the following:
  1139.  
  1140.    rem diskcache=x
  1141.  
  1142.  where x is the amount of memory dedicated to the disk cache. For this change
  1143.  to take effect, you must reboot your machine.
  1144.  
  1145.  If you are using the hpfs386.ifs installable file system driver, it is
  1146.  advised that you set the cache to 64K. Modify the line in the config.sys to
  1147.  look like this:
  1148.  
  1149.    IFS=c:\Lanman\netprog\HPFS386.IFS /I:c:\lanman -c:64
  1150.  
  1151.  If you are running SQL Server on a network file server, you can retain a
  1152.  small disk cache without significantly affecting SQL Server performance. On
  1153.  an 8 megabyte system, allow no more than a 512K cache. On a 10 megabyte
  1154.  system, allow no more than 1024K for the cache.
  1155.  
  1156.  
  1157.  Changing LAN Manager/LAN Server Parameters
  1158.  
  1159.  The setting of LAN Manager and LAN Server parameters can also affect SQL
  1160.  Server performance. The SQL Server setup program adjusts LAN Manager
  1161.  parameters based on its estimate of the number of user connections. (See
  1162.  "The user connections Option" section, later in this chapter.) If you change
  1163.  the number of user connections, you may need to adjust the settings of the
  1164.  LAN Manager/LAN Server parameters. These parameters are specified in the
  1165.  following files:
  1166.  
  1167. ╓┌─────────────────────────────────┌─────────────────────────────────────────╖
  1168.  File                              System
  1169.  ────────────────────────────────────────────────────────────────────────────
  1170.  \lanman\lanman.ini                LAN Manager
  1171.  
  1172.  \ibmlan\ibmlan.ini                LAN Server
  1173.  
  1174.  
  1175.  
  1176.  You can change the LAN Manager/LAN Server parameters with a text editor. For
  1177.  the changes to take effect, you must stop and restart the network. See your
  1178.  network manual for details.
  1179.  
  1180.  
  1181.  The maxopens Parameter
  1182.  
  1183.  This parameter determines the total number of network connections available.
  1184.  Each SQL Server user connection counts as one network connection. In
  1185.  addition, other network activity also consumes connections. You should
  1186.  always set maxopens to a number greater than the SQL Server user connections
  1187.  option. For a dedicated SQL Server machine, you should set maxopens to the
  1188.  number of SQL Server user connections plus 25. For a file and print server,
  1189.  maxopens should be increased. Many SQL applications use several connections
  1190.  for each user. Check with your application's vendor for more details.
  1191.  
  1192.  
  1193.  The numbigbuf,numreqbuf, andsizereqbuf Parameters
  1194.  
  1195.  These parameters specify the number and size of the network server buffers.
  1196.  They generally do not need to be changed. Although SQL Server is a network
  1197.  application, it does not impose the network overhead commonly encountered
  1198.  with file and print sharing. The LAN Manager/ LAN Server setup program sets
  1199.  the values of the parameters based on the available memory. For maximum
  1200.  throughput on dedicated SQL Servers, it is usually best to keep the number
  1201.  of network buffers small and give the memory to SQL Server. If you add more
  1202.  users to SQL Server, set the numreqbuf value to the number of users times 2.
  1203.  
  1204.  
  1205.  
  1206.  The maxpipes and maxthreads Parameters
  1207.  
  1208.  These parameters specify the number of named-pipe IPC connections that can
  1209.  be established on a workstation. If you run the SQL Server setup program, it
  1210.  will increase these parameters from their default value (10) up to 20. A
  1211.  value of 20 should be sufficient for any normal SQL Server application.
  1212.  Check with your application's vendor for more details.
  1213.  
  1214.  
  1215.  SQL Server Configuration Options
  1216.  
  1217.  The following SQL Server configuration options have an effect on overall
  1218.  system performance. Use the SAF menus or the sp_configure stored procedure
  1219.  to change these options. See the SQL Server System Administrator's Guide for
  1220.  instructions on using SAF and stored procedures.
  1221.  
  1222.  
  1223.  The memory Option
  1224.  
  1225.  The memory configuration option is the most important option because it
  1226.  determines the amount of system memory available for use by SQL Server. The
  1227.  number specified includes all memory requirements of SQL Server. Setting the
  1228.  memory option correctly is the most important single factor in improving SQL
  1229.  Server performance.
  1230.  
  1231.  ────────────────────────────────────────────────────────────────────────────
  1232.  NOTE
  1233.  
  1234.  When using SAF, specify the memory option in kilobytes; when using
  1235.  sp_configure, specify it in 2K blocks.
  1236.  ────────────────────────────────────────────────────────────────────────────
  1237.  
  1238.  Set the memory option to the largest possible value, while still leaving
  1239.  memory for the operating system and network code. If you set this parameter
  1240.  too high, the system will spend an inordinate amount of time swapping
  1241.  frequently used code and data segments in and out. This condition is known
  1242.  as thrashing. For best performance, set the memory option to no less than
  1243.  6000K. In cases where there is very little physical memory and the system is
  1244.  also used as a file or print server, you can set memory to as little as
  1245.  4000K, but SQL Server performance will suffer in this environment.
  1246.  
  1247.  On a computer dedicated to SQL Server, the optimal setting for memory is
  1248.  roughly 75-80 percent of available memory, with a minimum of 6000K. So, if
  1249.  your computer has 8 megabytes available, set memory to 6000K. For a 10
  1250.  megabyte machine, set memory to 7500K, and so on. It's possible to set
  1251.  memory so high that you will be unable to start SQL Server. If this happens,
  1252.  see the bldmaster utility in the SQL Server Language Reference for
  1253.  information about how to restore initial configurations without altering the
  1254.  database(s) themselves.
  1255.  
  1256.  If your computer is not dedicated to SQL Server, reduce the value for
  1257.  memory. Finding the best value for memory in this case is tricky, because
  1258.  different services require different amounts of memory. A reasonable
  1259.  guideline for nondedicated computers is to have at least 8 megabytes of
  1260.  memory available. Then, set the memory option to 50 or 60 percent of
  1261.  available memory.
  1262.  
  1263.  
  1264.  The user connections Option
  1265.  
  1266.  After memory, the next most important configuration option is the number of
  1267.  user connections. You must specify enough connections to allow your user
  1268.  community to access the server. If you run out of connections, some users
  1269.  will be denied access. On the other hand, each connection consumes 42K of
  1270.  SQL Server memory space. Thus, you should set the user connections option
  1271.  just high enough to allow the maximum number of concurrent users you want to
  1272.  support.
  1273.  
  1274.  While most application programs require only one user connection for each
  1275.  actual user, some applications use more than that. Consult your application
  1276.  manual to determine the number of user connections required for each actual
  1277.  user.
  1278.  
  1279.  If you are developing applications with SQL Server, remember that each open
  1280.  DBPROCESS requires one user connection. Consult the SQL Server System
  1281.  Administrator's Guide for more information.
  1282.  
  1283.  
  1284.  The procedure cache Option
  1285.  
  1286.  This configuration option specifies the percentage of SQL Server memory
  1287.  dedicated to the procedure cache, after all other memory needs are
  1288.  satisfied. The procedure cache is used for both SQL compilation and the
  1289.  storage of any active stored procedures.
  1290.  
  1291.  The default procedure cache setting is 20 percent. This is a reasonable
  1292.  number for most applications. If you are developing applications for SQL
  1293.  Server, increasing this number can improve system throughput. If you are
  1294.  running applications that use a limited number of stored procedures,
  1295.  reducing the procedure cache value may improve performance.
  1296.  
  1297.  
  1298.  SQL Server Configuration Guidelines
  1299.  
  1300.  The SQL Server setup program configures your computer, using reasonable
  1301.  values based on the amount of available memory. You should not need to
  1302.  change the configuration values established by setup until you are familiar
  1303.  with SQL Server and are actively using it.
  1304.  
  1305.  Because of the many different ways in which you can use SQL Server on your
  1306.  network, there is no single configuration that will provide optimal
  1307.  performance in all cases. Use the guidelines below as a starting point in
  1308.  your efforts to tune SQL Server for your application.
  1309.  
  1310.  
  1311.  Running SQL Server on a Dedicated Computer
  1312.  
  1313.  In this configuration, the machine is dedicated to running SQL Server; it is
  1314.  not used for file or print sharing, or as a user workstation.
  1315.  
  1316. ╓┌────────────────────────────┌────────────────────────────┌──────┌──────┌───
  1317.                               System Memory (in
  1318.                               megabytes)
  1319.                               8                            10     12     16
  1320.  ────────────────────────────────────────────────────────────────────────────
  1321.  SQL Server memory            6000K                        7500K  9000K  12500
  1322.  
  1323.  SQL Server user connections  Configure as needed
  1324.  
  1325.                               System Memory (in
  1326.                               megabytes)
  1327.                               8                            10     12     16
  1328. 
  1329.  SQL Server procedure cache   20%                          20%    20%    20%
  1330.  
  1331.  LAN Manager disk cache       0                            0      0      0
  1332.  
  1333.  LAN Manager maxopen          user connections + 25
  1334.  
  1335.  LAN Manager numreqbuf        user connections * 2
  1336.  
  1337.  LAN Manager numbigbuf        0                            0      0      0
  1338.  
  1339.  LAN Manager sizereqbuf       1024                         1024   1024   1024
  1340.  
  1341.  ────────────────────────────────────────────────────────────────────────────
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  Running SQL Server on a File or Print Server
  1347.  
  1348.  You can run SQL Server on a machine that is also acting as a LAN Manager or
  1349.  LAN Server file or print server. This configuration can provide good
  1350.  performance for installations with moderate server demands. In this
  1351.  configuration, machine resources (primarily memory) are divided between the
  1352.  network file or print services and SQL Server.
  1353.  
  1354. ╓┌────────────────────────────┌────────────────────────────┌──────┌──────┌───
  1355.                               System Memory (in
  1356.                               megabytes)
  1357.                               8                            10     12     16
  1358.  ────────────────────────────────────────────────────────────────────────────
  1359.  SQL Server memory            4000K                        5000K  6000K  8000K
  1360.  
  1361.  SQL Server user connections  Configure as needed
  1362.  
  1363.  SQL Server procedure cache   20%                          20%    20%    20%
  1364.  
  1365.  LAN Manager disk cache       512K                         1024K  2048K  4096K
  1366.  
  1367.                               System Memory (in
  1368.                               megabytes)
  1369.                               8                            10     12     16
  1370. 
  1371.  LAN Manager maxopen          user connections + 64
  1372.  
  1373.  LAN Manager numreqbuf        user connections * 2
  1374.  
  1375.  ────────────────────────────────────────────────────────────────────────────
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  Running SQL Server on a User Workstation
  1381.  
  1382.  In this configuration, the machine is running both SQL Server and the client
  1383.  application. This is the least optimal configuration.
  1384.  
  1385. ╓┌────────────────────────────┌────────────────────────────┌──────┌──────┌───
  1386.                               System Memory (in
  1387.                               megabytes)
  1388.                               System Memory (in
  1389.                               megabytes)
  1390.                               8                            10     12     16
  1391.  ────────────────────────────────────────────────────────────────────────────
  1392.  SQL Server memory            4000K                        5000K  6000K  8000K
  1393.  
  1394.  SQL Server user connections  Configure as needed
  1395.  
  1396.  SQL Server procedure cache   20%                          20%    20%    20%
  1397.  
  1398.  LAN Manager disk cache       0                            0      0      0
  1399.  
  1400.  LAN Manager maxopen          user connections + 25
  1401.  
  1402.  LAN Manager numreqbuf        user connections * 2
  1403.  
  1404.  ────────────────────────────────────────────────────────────────────────────
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  Common Installation Problems
  1410.  
  1411.  This section describes two of the most common installation problems.
  1412.  
  1413.  
  1414.  Problem 1
  1415.  
  1416.  The computer is not properly configured.
  1417.  
  1418.  
  1419.  Message
  1420.  
  1421.    This computer is not properly configured...
  1422.  
  1423.  
  1424.  Description
  1425.  
  1426.  When this error message appears, it is often followed by specific
  1427.  instructions on how to fix the error. In other cases, the message is
  1428.  followed by an error code and another message to call customer support.
  1429.  
  1430.  This error message means that the setup program has failed to create and use
  1431.  a named pipe or that you do not have user permission.
  1432.  
  1433.  
  1434.  Solution
  1435.  
  1436.  Either fix the error by following the instructions or record the error code
  1437.  and call customer support.
  1438.  
  1439.  Make sure that IPC$ is shared and that you are logged to the network as a
  1440.  user who has privileges to access named pipes. If this still doesn't work,
  1441.  refer to your network documentation for testing pipe access.
  1442.  
  1443.  
  1444.  Problem 2
  1445.  
  1446.  You have insufficient disk space for the OS/2-system swap file or
  1447.  insufficient memory. This problem can result in an incomplete installation.
  1448.  
  1449.  
  1450.  
  1451.  Message
  1452.  
  1453.  Check the error log file for the following message:
  1454.  
  1455.    Unable to create timer thread, insufficient core
  1456.  
  1457.  
  1458.  Description
  1459.  
  1460.  While installing SQL Server, if you see the message "Now Starting SQL
  1461.  Server" but not "SQL Server Shutdown," it can mean that you do not have
  1462.  enough disk space for the OS/2-system swap file or enough memory.
  1463.  
  1464.  The amount of disk space required for the swap file depends on the amount of
  1465.  memory in the computer and how much of it is being used by other processes.
  1466.  The OS/2-system swap file is called swapper.dat and can be found by looking
  1467.  at the swappath parameter in the config.sys file. It usually starts out at
  1468.  approximately 0.6 megabytes and grows in response to the memory requirements
  1469.  of the processes that are running.
  1470.  
  1471.  
  1472.  Solution
  1473.  
  1474.  To increase available swap space, change the swappath to point to a disk
  1475.  with more space or remove files from the swap drive. Check the size of the
  1476.  sqlserver.out file by typing
  1477.  
  1478.    dir c:\sql\log\sqlserver.out
  1479.  
  1480.  If the file has some data in it (a size other than 0), take a look at the
  1481.  messages in the file. Based on these messages, try to fix the problems or
  1482.  call customer support.
  1483.  
  1484.  If the sqlserver.out file has 0 size, start SQL Server from the sqlservr.exe
  1485.  file by typing
  1486.  
  1487.    cd \sql\data
  1488.     sqlservr -d master.dat
  1489.  
  1490.  Note any error messages. If the message "Recovery complete" appears, SQL
  1491.  Server has started successfully. Press ALT+ESC to switch to another screen
  1492.  group and test SQL Server (as described in Chapter 1 in the "Testing SQL
  1493.  Server" section).
  1494.  
  1495.  If the computer has at least 8 megabytes of memory, if the network software
  1496.  buffers were not increased significantly, and if nothing else is running,
  1497.  then the swap file should not exceed 8 megabytes during installation.
  1498.  
  1499.  
  1500.  Problem 3
  1501.  
  1502.  The setup program can't find the server while installing on a remote
  1503.  workstation.
  1504.  
  1505.  
  1506.  Message
  1507.  
  1508.    The remote server could not be found or is not configured for remote
  1509.    administration.
  1510.  
  1511.    Verify that the remote server exists, and that this workstation has
  1512.  administrative privileges on the server.
  1513.  
  1514.  
  1515.  Description
  1516.  
  1517.  This error message appears if you are installing SQL Server on a remote
  1518.  workstation and setup can't find the server. It will also occur if you don't
  1519.  have administrative privileges.
  1520.  
  1521.  
  1522.  Solution
  1523.  
  1524.  Make sure the remote server has ADMIN$ shared. Verify that you are logged on
  1525.  as a valid user with administrative privileges on the remote server. Make
  1526.  sure the workstation has a connection to ADMIN$.
  1527.  
  1528.  
  1529.  
  1530.  
  1531.  
  1532.  
  1533.  Appendix A  Upgrading from Version 1.0
  1534.  ────────────────────────────────────────────────────────────────────────────
  1535.  
  1536.  
  1537.  Introduction
  1538.  
  1539.  This appendix discusses how to upgrade from SQL Server, Version 1.0.
  1540.  Specifically, it describes
  1541.  
  1542.  
  1543.    ■   Changes made to the product since SQL Server, Version 1.0
  1544.  
  1545.    ■   How to upgrade from SQL Server, Version 1.0
  1546.  
  1547.    ■   How to upgrade from the SQL Server Network Developer's Kit (NDK)
  1548.  
  1549.  
  1550.  
  1551.  Changes to SQL Server, Version 1.0
  1552.  
  1553.  This section discusses changes made to SQL Server, Version 1.0, that have
  1554.  gone into this release. It describes
  1555.  
  1556.  
  1557.    ■   Changes to the Server
  1558.  
  1559.    ■   Changes to DB-LIBRARY
  1560.  
  1561.    ■   Changes to the System Administration Facility (SAF)
  1562.  
  1563.  
  1564.  
  1565.  Changes to the Server
  1566.  
  1567.  Known bugs in the server have been fixed.
  1568.  
  1569.  
  1570.  Changes to DB-LIBRARY
  1571.  
  1572.  DB-LIBRARY has been completely rewritten for this release. The new library
  1573.  is both smaller and faster than previous versions. In addition, the
  1574.  following changes were made:
  1575.  
  1576.  
  1577.    ■   Support for the Minimal Subset has been dropped. Memory requirements
  1578.        for various combinations of library functions are now documented in
  1579.        the SQL Server Programmer's Reference.
  1580.  
  1581.    ■   Support for the dbsetbusy, dbsetidle, and dbsetinterrupt functions has
  1582.        been dropped.
  1583.  
  1584.    ■   The dbinit and dbwinexit functions have been added. Calling dbinit is
  1585.        optional in all environments except Windows. Under Windows, your
  1586.        application must call dbinit before calling any other DB-LIBRARY
  1587.        function, and it must call dbwinexit after the last call to any
  1588.        DB-LIBRARY routines and before exiting.
  1589.  
  1590.    ■   All macros have been rewritten. Macros are those DB-LIBRARY routines
  1591.        that are named in uppercase letters in the SQL Server Programmer's
  1592.        Reference. In this release of DB-LIBRARY, all macros resolve directly
  1593.        into calls to functions of the same name, written with lowercase
  1594.        letters. Source compatibility is maintained.
  1595.  
  1596.    ■   The definition for the DBPROCESS data structure is no longer visible
  1597.        to application programmers. It is no longer possible for application
  1598.        programs to directly access data within the DBPROCESS structure.
  1599.        DB-LIBRARY provides tools to accomplish these needs while retaining
  1600.        compatibility with future releases.
  1601.  
  1602.    ■   All application programs must now include the header files sqlfront.h
  1603.        and sqldb.h; sqldbtok.h, sqllogin.h, and sqlerror.h are no longer
  1604.        supported.
  1605.  
  1606.    ■   All application programs must define the environment under which they
  1607.        run before including sqlfront.h. The following table defines the
  1608.        appropriate constants:
  1609. ╓┌─────────────────────────────────┌─────────────────────────────────────────╖
  1610.  Constant                          Environment
  1611.  ────────────────────────────────────────────────────────────────────────────
  1612.  DBMSDOS                           MS-DOS
  1613.  
  1614.  DBMSOS2                           OS/2 systems
  1615.  
  1616.  DBMSWIN                           Windows
  1617.  
  1618.  ────────────────────────────────────────────────────────────────────────────
  1619.  Constant                          Environment
  1620.  ────────────────────────────────────────────────────────────────────────────
  1621. ────────────────────────────────────────────────────────────────────────────
  1622.  
  1623.  
  1624.  
  1625.  
  1626.    ■   dbnextrow () must be called repeatedly until NO_MORE_ROWS is returned.
  1627.        Version 1.0 of dbnextrow allowed this function to be called only once
  1628.        if a query returned only 1 row. This was not documented behavior, and
  1629.        was not presented in examples. However, if your application depended
  1630.        on this behavior, a slight modification of your application will be
  1631.        necessary.
  1632.  
  1633.    ■   The names of the SQL Server libraries have been changed, as documented
  1634.        in the following table. This will avoid name collisions in
  1635.        environments that must use a combination of both new and old versions
  1636.        for a period of time.
  1637. ╓┌────────────┌────────────┌─────────────────────────────────────────────────
  1638.  Old Name     New Name     Environment
  1639.  ────────────────────────────────────────────────────────────────────────────
  1640.  Old Name     New Name     Environment
  1641.  ────────────────────────────────────────────────────────────────────────────
  1642.  ldblibr.lib  rldblib.lib  MS-DOS, large model
  1643.  
  1644.  mdblibr.lib  rmdblib.lib  MS-DOS, medium model
  1645.  
  1646.  dblibp.dll   pdblib.dll   OS/2 systems, dynamic link library
  1647.  
  1648.  dblibp.lib   pdblib.lib   OS/2 systems, import definitions
  1649.  
  1650.  dblibw.exe   wdblib.exe   Windows (Version 2.1), dynamic link library
  1651.  
  1652.  dblibw.lib   wdblib.lib   Windows (Version 2.1), import definitions
  1653.  
  1654.  none         dbnmpp.dll   Named pipe dynamic link library
  1655.  
  1656.  ────────────────────────────────────────────────────────────────────────────
  1657.  
  1658.  
  1659.  
  1660.  
  1661.  
  1662.    ■   Applications no longer need to link with dosnet.lib, unless they
  1663.        access the network directly.
  1664.  
  1665.        NOTE  Old applications using the previous version of DB-LIBRARY will
  1666.        work with the new server. However, we strongly recommend that you
  1667.        recompile and relink to get the benefit of the new libraries.
  1668.  
  1669.  
  1670.  For more information see Appendix E, "Building Applications," in the SQL
  1671.  Server Programmer's Reference.
  1672.  
  1673.  
  1674.  Changes to SAF
  1675.  
  1676.  The SAF has been enhanced for this release. In several instances, the
  1677.  interface was changed to provide more useful information on screen.
  1678.  
  1679.  
  1680.  Changes in Running MS-DOS Application
  1681.  
  1682.  If your workstation is running MS-DOS, the TSR program, DBNMPIPE, must be
  1683.  loaded for your application to communicate with the server. If you did not
  1684.  choose the option to include this in your autoexec.bat file, you may load
  1685.  the TSR by simply typing dbnmpipe at the prompt. You may want to unload the
  1686.  TSR to free up more memory for other applications. To do this, type
  1687.  enddblib.exe at the prompt.
  1688.  
  1689.  
  1690.  Upgrading from SQL Server, Version 1.0
  1691.  
  1692.  If you are upgrading from SQL Server, Version 1.0, you simply need to
  1693.  install the new software over the old version.
  1694.  
  1695.  ────────────────────────────────────────────────────────────────────────────
  1696.  NOTE
  1697.  
  1698.  All existing databases are retained but as a precaution, back up your
  1699.  databases before you update SQL Server.
  1700.  ────────────────────────────────────────────────────────────────────────────
  1701.  
  1702.  To upgrade:
  1703.  
  1704.  
  1705.    1.  Run setup from an OS/2-system server.
  1706.  
  1707.    2.  Select option 1, Install Server and Utilities. Install the server and
  1708.        utilities on all server machines.
  1709.  
  1710.    3.  Run setup on all MS-DOS and OS/2-system client workstations.
  1711.  
  1712.    4.  Select option 1 (MS-DOS) or option 2 (OS/2 systems) to install the
  1713.        utility programs.
  1714.  
  1715.    5.  Select option 2 (MS-DOS) or option 3 (OS/2 systems) to install the
  1716.        programming tools.
  1717.  
  1718.    6.  If you have developed SQL Server applications and wish to use the new
  1719.        and improved version of DB-LIBRARY, you must recompile and relink your
  1720.        code with the new DB-LIBRARY modules. See "Changes to DB-LIBRARY,"
  1721.        earlier in this appendix, for information about changes you need to
  1722.        make to your programs for version 1.1.
  1723.  
  1724.  
  1725.  
  1726.  Updating the Error Message Table
  1727.  
  1728.  The next step in upgrading is to add one new error message to the
  1729.  sysmessages system table. To help update the sysmessages table while
  1730.  upgrading from version 1.0 to version 1.1, a script (update.sql) has been
  1731.  included for the System Administrator (SA) to run.
  1732.  
  1733.  To run this script:
  1734.  
  1735.  
  1736.    1.  Move to the directory containing the script by typing
  1737.  
  1738.        cd \sql\install
  1739.  
  1740.  
  1741.    2.  Redirect the file update.sql into isql by typing
  1742.  
  1743.        ISQL -Usa -Sservername -Ppassword -i update.sql
  1744.  
  1745.  
  1746.        where servername and password are variables.
  1747.  
  1748.  
  1749.  The system exits from isql when the update is complete. The following
  1750.  message has now been added to the error message file:
  1751.  
  1752.    Message 216: Cannot update table because it's an inner member of an
  1753.     outer join.
  1754.  
  1755.  The update.sql script temporarily allows the SA to update system tables.
  1756.  When it has finished running, however, the system is configured to prevent
  1757.  any further updates to the system tables.
  1758.  
  1759.  
  1760.  Upgrading from the Network Developer's Kit
  1761.  
  1762.  The NDK was a prerelease (Beta) edition of SQL Server. If you have the NDK
  1763.  version of SQL Server and are upgrading to SQL Server, Version 1.1, you must
  1764.  remove the NDK version from your hard disk before you can upgrade.
  1765.  
  1766.  To save any NDK databases that you want to preserve:
  1767.  
  1768.  
  1769.    1.  Change the Database Owner of each database to sa. See the SQL Server
  1770.        System Administrator's Guide.
  1771.  
  1772.    2.  Delete all other usernames from each database.
  1773.  
  1774.    3.  Back up each database. You can use either SAF to create disk dump
  1775.        devices and then back up the databases to those devices, or use the
  1776.        isql and console utility programs to back up the databases to disk. If
  1777.        you use disks, back up each database twice to minimize the possibility
  1778.        of data loss due to media failure.
  1779.  
  1780.        You need not back up the master, model, or tempdb databases. If you
  1781.        have added datatypes or made other changes to the master database, you
  1782.        should reapply those changes after you have installed the software for
  1783.        SQL Server, Version 1.1. Do not load an NDK backup of the master,
  1784.        model, or tempdb databases onto software for SQL Server, Version 1.1.
  1785.  
  1786.    4.  Use the setup program to remove all existing files from the SQL Server
  1787.        directory tree. (Select option 4 under the MS-DOS version of setup,
  1788.        option 5 under the OS/2-system version.)
  1789.  
  1790.  
  1791.  ────────────────────────────────────────────────────────────────────────────
  1792.  WARNING
  1793.  
  1794.  This removes all files in the SQL directory. Therefore, if you've saved any
  1795.  batch files, queries, or other data, be sure to move them before executing
  1796.  this option.
  1797.  ────────────────────────────────────────────────────────────────────────────
  1798.  
  1799.  
  1800.    1.  Install SQL Server, Version 1.1, using setup option 1.
  1801.  
  1802.    2.  Restore your databases, create login IDs, create usernames, and
  1803.        reapply changes to the model database as necessary.
  1804.  
  1805.  
  1806.  
  1807.