Collection Contents Index The Validation utility The SQL preprocessor pdf/chap4.pdf

Reference Manual
   CHAPTER 4. Database Administration Utilities     

The Write File utility


The Write File utility is used to manage database write files. A write file is a file attached to a particular database. All changes are written into the write file, leaving the database file unchanged.

Using write files for development 

Write files can be used effectively for testing when you do not wish to modify the production database. They can also be used in network and student environments where read-only access to a database is desired, or when you distribute on CD-ROM a database that you wish users to be able to modify.

Compressed databases 

If you are using a compressed database, you must use a write file; compressed database files cannot be modified directly. The write file name is then used in place of the database name when connecting to the database, or when loading a database on the database server command line.

  You can access the write file utility in the following ways:
  1. From Sybase Central, for interactive use under Windows 95 or NT.

  2. From the system command line, using the dbwrite command-line utility. This is useful for incorporating into batch or command files.

The Write File utility runs against a database file. The database must not be running on a server when you run the Write File utility.

Top of page  Creating a write file from Sybase Central

  To create a write file for a database:
  1. Open the Database Utilities folder in the left panel.

  2. Double-click Create Write File in the right panel. The Write File wizard is displayed.

  3. Follow the instructions in the wizard.

For Info     For full information on creating a write file from Sybase Central, see the Sybase Central online Help.

Top of page  The DBWRITE command-line utility

Syntax 

dbwrite [switches] database-file [write-name]

Windows 3.x
syntax 

dbwritew [switches] database-file [write-name]

Switch

Description

-c

Create a new write file

-d database-file

Point a write file to a different database

-f database-file

Force the write file to point at a file

-m mirror-name

Set the transaction log mirror name

-o file

Output messages to file

-q

Quiet mode—do not print messages

-s

Report the write file status only

-t log-name

Set the transaction log name

-y

Erase/replace old files without confirmation

Description 

If any changes are made to the original database (not using the write file), the write file will no longer be valid. This happens if you start the server using the original database file and make a modification to it. If a write file becomes invalid, you can discard all of your changes and create a new write file with the following command.

dbwrite -c db-name write-name

The log-name and mirror-name parameters are used only when creating a new write file. The write-name parameter is used only with the -c and -d parameters. Note that the database_file parameter must be specified before the write-name parameter.

For Info     For more information about the command-line switches, see Write file utility options.

Top of page  Write file utility options

Create a new write file (-c )     If an existing write already exists, any information in the old write file will be lost. If no write file name is specified on the command line, the write filename defaults to the database name with the extension wrt. If no transaction log name is specified, the log file name will default to the database name with the extension wlg.

Change the database file to which an existing write file points (-d )     If a database file is moved to another directory, or renamed, this option allows you to maintain the link between the write file and the database file. This option is available only from the command-line utility.

Force a write file to point to a file (-f )     This option is available only from the command-line utility. This option is for use when a write file is being created and the database file is held on a Novell NetWare or other network path, for operating systems on which they cannot be entered directly. By providing the full Novell path name for the database file (for example: SYS\\asademo.db), you can avoid dependencies on local mappings of the NetWare path. Unlike with the -d option, no checking is done on the specified path.

Operate quietly (-q )     Do not display messages on a window. This option is available only from the command-line utility.

Report the write file status only ( -s )     This displays the name of the database to which the write file points. This option is available only from the command-line utility.

Operate without confirming actions (-y )     Without this option, you are prompted to confirm the replacement of an existing write file.

Top of page  

Collection Contents Index The Validation utility The SQL preprocessor pdf/chap4.pdf