# 22. Virtuoso Functions Guide - replay

Chapter Contents | Prev | Next
Keyword Search:
www.openlinksw.com
docs.openlinksw.com
Book Home
Contents
Preface
Virtuoso Functions Guide
Administration
Aggregate Functions
Array Manipulation
BPEL APIs
Backup
backup
backup_context_clear
backup_online
replay
Compression
Cursor
Date & Time Manipulation
Debug
Dictionary Manipulation
Encoding & Decoding
File Manipulation
Free Text
Hashing / Cryptographic
LDAP
Locale
Mail
Miscellaneous
Number
Remote SQL Data Source
Replication
SOAP
SQL
String
Transaction
Type Mapping
UDDI
User Defined Types & The CLR
Virtuoso Java PL API
Virtuoso Server Extension Interface (VSEI)
Web Server & Internet
XML
XPATH & XQUERY
Functions Index

## replay

starts the roll forward of the given log
replay (in log_file varchar);
Description

This starts a roll forward of the given log. The log may have been produced by normal transaction logging, backup or crash dump. Logs may not be transferred between databases and thus cannot be rolled forward anywhere except on the database that generated them.

This function is for example useful after restoring a backup. It should be called for each archived transaction log produced since the backup, including and starting with the one that was current when the backup was made.

The operation blocks until the roll forward is complete. Other clients are not affected.

Errors

Parameter data type checking errors

sqlstate | error code | error text
25000 | SR074 | replay must be run in a fresh transaction.
42000 | FA002 | Can't open file <fname>, error <OS errno> (<OS description>)

Parameters
log_file – Full pathname of file containing the transactions to be replayed. The file must be produced by backup.
Return Values

Zero, if no error is signalled.

Examples
Replaying A Log File

    checkpoint 'new.log';
    backup 'bak.log';
    shutdown 'new2.log';

The above sequence of commands makes a checkpoint and starts logging subsequent transactions into new.log. The backup statement makes bak.log, which represents the state prior to starting new.log. The shutdown statement makes a new checkpoint and marks new2.log as the log file to be used for logging transactions after the database restarts. The database server exits at the completion of the SHUTDOWN statement.

    replay ('bak.log');
    replay ('new.log');

These statements executed on an empty database will recreate the state in effect after the last transaction to commit before the SHUTDOWN statement of the previous example.

See Also

backup