Appendix H
What's on the CD-ROM




by Paul Galaspie

The following applications have been included on the CD-ROM that accompanies this book to help you with your database administration tasks:

The SQL Server DBA Assistant

The SQL Server DBA Assistant is an application written in 32-bit Visual Basic 4.0. Using the SQL Server Assistant, you can perform the following tasks:

The SQL Server DBA Assistant source code is included on the CD-ROM so that you can make your own modifications and enhancements to the application.


NOTE: The code in the application is discussed in detail in Chapter 27, "SQL OLE Integration."

Following are the prerequisites for using the SQL Server DBA Assistant:

Installing SQL Server DBA Assistant

To install the SQL Server DBA Assistant, run the executable SETUP.EXE file included on the CD-ROM.

Using SQL Server DBA Assistant

Follow these steps to use the SQL Server DBA Assistant:

  1. To start the SQL Server DBA Assistant, click the icon installed during setup or run the executable (SAMSDBA.EXE). The Logon Assistant dialog box appears (see Figure I.1).

    Figure I.1.
    The SQL ServerDBA Assistant Logon dialog box.

  2. Enter the name of the SQL Server to which you want to log on.

  3. Enter the login ID and the password and then click the Logon button. An attempt is made to connect to the specified SQL Server. If the logon is successful, a splash screen appears, followed by the SQL Server DBA Assistant dialog box (see Figure I.2).

    Figure I.2.
    The Memory Estimation page in the SQL Server DBA Assistant dialog box.

  4. The Memory Estimation page displays the estimated memory amounts for the following: SQL Server overhead, procedure cache, and data cache. The values graphed are only estimates based on memory calculation formulas found in Chapter 19, "Which Knobs Do I Turn?" Use the Graph Options at the bottom of the dialog box to explode any of the specified memory break-outs from the pie chart. The Print Options determine how the graph will be printed when you click the Print Graph button.

  5. To perform table maintenance, click the Table Maintenance tab (see Figure I.3).

    Figure I.3.
    The Table Maintenance page in the SQL Server DBA Assistant dialog box.

  6. Select a database from the combo box. To select a table, click the table name in the left list box. To move a table from the Available Tables list box to the Selected Tables list box, click the > button. Click the < button to move the selected table from the Selected Tables list box to the Available Tables list box. Click the >> or << button to move all the tables.

  7. To perform table maintenance, click the appropriate command button. The selected function is performed on all the selected tables. Any error messages or results returned from SQL Server are displayed.

  8. To export data, click the Bulk Copy tab (see Figure I.4).

    Figure I.4.
    The Bulk Copy page in the SQL Server DBA Assistant dialog box.

  9. Select a database from the Select a Database combo box.

  10. Select the table from which you want to export data from the Source Table list box.

  11. Select the file export file format from the File Type drop-down list box and specify the name of the file to which you want to export the data (use the Directories pane to specify the path as necessary).

  12. Click the Export Data button to export the data to the specified file.

The Database Estimator


NOTE: The Database Estimator requires you to have the ODBC DLLs installed on your PC. The Database Estimator also comes with a detailed help file that covers all its functionality.

Tired of manually calculating space requirements (see Figure I.5)? Let the Estimator automatically calculate database space requirements! The following sections discuss some of the features of the Estimator product.

Figure I.5.
Calculating database space requirements manually.

Installing the Database Estimator

Follow these steps to install the Database Estimator:

  1. Create the directory \ESTIMATOR on your destination drive.


NOTE: This example assumes that you are installing the Estimator on drive C and that the CD-ROM containing the Estimator files is located in drive D.
  1. Switch to drive C.
  2. Type cd\ and press Enter.
  3. Type md c:\estimator and press Enter.
  4. Type copy d:\estimator.* c:\estimator and press Enter.
  5. Start your version of Windows and create a new program icon with the following properties:

Automatic Space Calculation

Are you creating a new database and do you have to determine how much space is needed to store the data? Do you have an existing database and do you have to predict future space requirements?

The Estimator is designed to help a DBA determine the amount of storage space required for a new or existing table (and associated indexes). The Estimator lets you perform this type of analysis without resorting to complicated formulas (see Figure I.6).

Figure I.6.
Automatic space calculation.

To use the Estimator, you must enter the expected row size and the estimated number of rows. The Estimator can estimate row sizes using three different methods:

To have the Estimator estimate row sizes based on the table name and column sizes you enter, perform the following steps:

  1. Start the Estimator by running estimate.exe.

  2. Enter the name of your table in the Table text box of the Estimator window.

  3. Select the Fields tab; the Fields page opens.

  4. Click the Add button to display the Field Definition dialog box. Add the name of the field and the datatype of the field. Click the OK button to add the column.

  5. Once you have added all the required table columns, enter the number of rows expected in the table. The Estimator calculates the total storage space required based on your table size and the number of rows expected.

Using ODBC to Read an Existing Table Definition Have you already created a table and do you have to determine future table size? The Estimator can connect to SQL Server (through ODBC) and load table definitions into the Estimator. To use ODBC, perform the following steps:

  1. From the File menu in the main Estimator window, select the Load option. The ODBC data source dialog box appears.

  2. Select the ODBC data source on which the table resides. Log on to the SQL Server data source. The Select a Table dialog box appears (see Figure I.7).

    Figure I.7.
    Selecting a table in SQL Server from the Estimator Select a Table dialog box.

  3. Select the table on which you want to perform size estimates and click the OK button.

  4. The Estimator reads the table and index definitions for the selected table and automatically fills in the information for the table size.

  5. In the main Estimator window, enter the number of rows in the # Rows field. The estimated size of the table is computed.

Loading existing table definitions is useful for determining the impact on storage requirements before you make modifications (such as adding new fields or indexes). Quick Calculator Use the Quick Calculator to get a rough estimate of your storage space requirements without having to resort to field-level definitions (see Figure I.8). Just enter the overall column size, overall index size, and number of rows. Click the Calculate button, and you will have your answer!

Figure I.8.
The Quick Calculator.

Save Estimates

Do you want to save an estimate for future use? No problem! Just click the Save button in the main Estimator window. The Save Estimate dialog box appears (see Figure I.9). Enter the filename and select the directory for the saved estimates. Click the OK button to save the estimate.

Figure I.9.
Saving an estimate.


DISCLAIMER


To order books from QUE, call us at 800-716-0044 or 317-361-5400.

For comments or technical support for our books and software, select
Talk to Us.

© 1997, QUE Corporation, an imprint of
Macmillan Publishing USA, a Simon and Schuster Company.