Copying the log after a device failure  Truncating the log in early development environments

Chapter 12: Backing Up and Restoring User Databases

Truncating a log that is not on a separate segment

If a database does not have a log segment on a separate device from data segments, you cannot use dump transaction to copy the log and then truncate it. For these databases, you must:

  1. Use the special with truncate_only option of dump transaction to truncate the log so that it does not run out of space.

  2. Use dump database to copy the entire database, including the log.

Because it does not copy any data, with truncate_only requires only the name of the database:

dump transaction database_name with truncate_only

The following example dumps the database mydb, which does not have a log segment on a separate device from data segments, and then truncates the log:

dump database mydb to mydevice
dump transaction mydb with truncate_only




Copyright © 2005. Sybase Inc. All rights reserved. Truncating the log in early development environments

View this book as PDF