Sybase Technical Library - Product Manuals Home
[Search Forms] [Previous Section with Hits] [Next Section with Hits] [Clear Search] Expand Search

Appendix A: Troubleshooting Network Connections [Table of Contents] Appendix C: SQL Server System Specifications

System Administration Guide Supplement for OS/2

[-] Appendix B: System Administration Guide Examples

Appendix B

System Administration Guide Examples

This appendix provides OS/2 examples for the Transact-SQL commands and procedures introduced in the System Administration Guide . For background information on these examples, see the corresponding chapters of the System Administration Guide .

Chapter 3 Examples: Mirroring the Master Device

The following example shows the command used to start a mirrored master device:

 sqlsrvr -dc:\masters\master.dat  
   -rd:\mirrors\masterm.dat
   -ec:\sql10\install\errorlog

Chapter 8 Examples: Backing Up and Restoring User Databases

This section provides examples on how to use the dump and load commands for backup, recovery, and log truncation. Refer to Chapter 8 of the System Administration Guide for background information on these examples.

Using Sytron Tape Device for Dumps

The Sytron tape backup device drivers and support software can be used with a compatible tape device to provide tape backups. You must install the tape device and the Syplus tape backup software on your system. Verify that the tape device is functioning properly as a standard tape backup system.

After the tape device has been installed, you must:

  1. Verify that the installation of the Sytron Syplus software has created an entry in your config.sys file similar to the following:

     DEVICE=D:\SYPLUS\SYFILES\TBS2150B.SYS 
    Refer to Sytron Syplus documentation for more information.

    Set the SYTAPE: variable within config.sys to the path of the corresponding Syplus Dynamic Link Libraries (DLL's). For example:

     SET SYTAPE:=D:\SYPLUS\SYFILES\TBS2150B.DLL 
  2. Reboot the system for these new values to take effect.

Once DEVICE and SYTAPE: are properly configured, you can reference SYTAPE: as any standard OS/2 device.

Specifying the Database and Dump Device

The following example shows how to use the tape drive configured as SYTAPE: for dumps and loads:

 dump database pubs2 to "SYTAPE:" capacity=100000 
load database pubs2 from "SYTAPE:"
Note: Always specify the capacity in kilobytes when you use the dump database command to dump a tape device.

Specifying a Remote Backup Server

The following example dumps to and loads from a remote OS/2 Backup Serverä named REMOTE_BKP_SERVER:

 dump database pubs2 
    to "SYTAPE:" capacity=100000
    at REMOTE_BKP_SERVER
 load database pubs2 
    from "SYTAPE:"
    at REMOTE_BKP_SERVER

Identifying a Dump

The following example dumps and loads a transaction log using the default Backup Server file name with the file clause:

 dump tran publications 
    to "SYTAPE:"
load tran publications
    from "SYTAPE:"
    with file = "cations930590E100"

The following example uses a user-defined file naming convention with the file clause. The 15-character file name, mydb93jul201800 , identifies the database ( mydb ), the date (July 20, 1993), and the time (18:00, or 6:00 p.m.) the dump was made. The load command advances the tape to mydb93jul201800 before loading. The example file names are valid only for systems that use the HPFS file system. If you are using a FAT-based file system, file names are limited to 8 characters with a 3-character extension:

 dump database mydb 
    to "SYTAPE:" capacity=100000
    with file = "mydb93jul201800"
 load database mydb 
    from "SYTAPE:"
    with file = "mydb93jul201800"

Getting Information About Dump Files

The following examples return header information for the first file and then for the file mydb9229510945 :

 load database mydb 
    from "SYTAPE:"
    with headeronly
 load database mydb 
    from "SYTAPE:"
    with headeronly, file = "mydb9229510945"

Chapter 9 Examples: Backing Up and Restoring the System Databases

This section provides examples on how to restore the master, model and sybsystemprocs databases. Refer to Chapter 9 of the System Administration Guide for background information on these examples.

Recovering the master Database

This example rebuilds the master database on a 17MB (8704 2K pages) master device:

 bldmastr -d c:\devices\master.dat -s8704 -m 

The following command starts SQL Server in master-recover mode using the -m option:

 c:\sql10\bin\sqlsrvr     -dc:\masters\master.dat  
    -sSYBASE -ec:\sql10\install\errorlog
    -ic:\sql10\ini -m

The following example loads the most recent backup of the master database from disk with the load database command. After the load database command is completed successfully, SQL Server automatically shuts itself down. Watch for any error messages during the load and during the shutdown:

load database master from "SYTAPE:"

The following example commands run the instmodl script to build a new model database:

 cd %sql10%\scripts 
isql -Usa -P password -S server_name < instmodl

Where password and server_name are the values for your system.

Recovering the model Database

The following buildmaster command restores the model database without affecting master :

 bldmastr -d c:\devices\master.dat -x 

Recovering the sybsystemprocs Database

The following example commands run the installmaster script:

 cd %sql10%\scripts 
isql -Usa -P password -S server_name < instmstr

Where password and server_name are the values for your system.

The following example shows how to restore a backup of the sybsystemprocs database with the load database command:

 load database sybsystemprocs from "SYTAPE:" 


Appendix A: Troubleshooting Network Connections [Table of Contents] Appendix C: SQL Server System Specifications