<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head profile="http://internetalchemy.org/2003/02/profile"> <link rel="foaf" type="application/rdf+xml" title="FOAF" href="http://www.openlinksw.com/dataspace/uda/about.rdf" /> <link rel="schema.dc" href="http://purl.org/dc/elements/1.1/" /> <meta name="dc.title" content="Function: backup - Virtuoso Functions Guide" /> <meta name="dc.subject" content="Function: backup - Virtuoso Functions Guide" /> <meta name="dc.creator" content="OpenLink Software Documentation Team ; " /> <meta name="dc.copyright" content="OpenLink Software, 1999 - 2009" /> <link rel="top" href="index.html" title="OpenLink Virtuoso Universal Server: Documentation" /> <link rel="search" href="/doc/adv_search.vspx" title="Search OpenLink Virtuoso Universal Server: Documentation" /> <link rel="parent" href="functions.html" title="Chapter Contents" /> <link rel="prev" href="appendixa.html" title="Appendix" /> <link rel="next" href="functions.html#.html" title="" /> <link rel="shortcut icon" href="../images/misc/favicon.ico" type="image/x-icon" /> <link rel="stylesheet" type="text/css" href="doc.css" /> <link rel="stylesheet" type="text/css" href="/doc/translation.css" /> <title>Function: backup - Virtuoso Functions Guide</title> <meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8" /> <meta name="author" content="OpenLink Software Documentation Team ; " /> <meta name="copyright" content="OpenLink Software, 1999 - 2009" /> <meta name="keywords" content="" /> <meta name="GENERATOR" content="OpenLink XSLT Team" /> </head> <body> <div id="header"> <a name="fn_backup" /> <img src="../images/misc/logo.jpg" alt="" /> <h1>22. Virtuoso Functions Guide - backup</h1> </div> <div id="navbartop"> <div> <a class="link" href="functions.html">Chapter Contents</a> | <a class="link" href="functions.html#array" title="Array Manipulation">Prev</a> | <a class="link" href="fn_backup_online.html" title="backup_online">Next</a> </div> </div> <div id="currenttoc"> <form method="post" action="/doc/adv_search.vspx"> <div class="search">Keyword Search: <br /> <input type="text" name="q" /> <input type="submit" name="go" value="Go" /> </div> </form> <div> <a href="http://www.openlinksw.com/">www.openlinksw.com</a> </div> <div> <a href="http://docs.openlinksw.com/">docs.openlinksw.com</a> </div> <br /> <div> <a href="index.html">Book Home</a> </div> <br /> <div> <a href="contents.html">Contents</a> </div> <div> <a href="preface.html">Preface</a> </div> <br /> <div> <a class="selected" href="functions.html">Virtuoso Functions Guide</a> </div> <br /> <div> <a href="functions.html#admin">Administration</a> </div> <div> <a href="functions.html#aggr">Aggregate Functions</a> </div> <div> <a href="functions.html#array">Array Manipulation</a> </div> <div> <a href="functions.html#bpel">BPEL APIs</a> </div> <div> <a class="selected" href="functions.html#backup">Backup</a> </div> <div class="selected"> <div> <a class="selected" href="fn_backup.html">backup</a> </div> <div> <a href="fn_backup_context_clear.html">backup_context_clear</a> </div> <div> <a href="fn_backup_online.html">backup_online</a> </div> <div> <a href="fn_replay.html">replay</a> </div> </div> <div> <a href="functions.html#compression">Compression</a> </div> <div> <a href="functions.html#cursors">Cursor</a> </div> <div> <a href="functions.html#time">Date & Time Manipulation</a> </div> <div> <a href="functions.html#debug">Debug</a> </div> <div> <a href="functions.html#dict">Dictionary Manipulation</a> </div> <div> <a href="functions.html#encoding">Encoding & Decoding</a> </div> <div> <a href="functions.html#file">File Manipulation</a> </div> <div> <a href="functions.html#ft">Free Text</a> </div> <div> <a href="functions.html#hash">Hashing / Cryptographic</a> </div> <div> <a href="functions.html#ldap">LDAP</a> </div> <div> <a href="functions.html#localization">Locale</a> </div> <div> <a href="functions.html#mail">Mail</a> </div> <div> <a href="functions.html#misc">Miscellaneous</a> </div> <div> <a href="functions.html#number">Number</a> </div> <div> <a href="functions.html#phrz">Phrases</a> </div> <div> <a href="functions.html#rdf">RDF data</a> </div> <div> <a href="functions.html#rmt">Remote SQL Data Source</a> </div> <div> <a href="functions.html#repl">Replication</a> </div> <div> <a href="functions.html#soap">SOAP</a> </div> <div> <a href="functions.html#sql">SQL</a> </div> <div> <a href="functions.html#string">String</a> </div> <div> <a href="functions.html#txn">Transaction</a> </div> <div> <a href="functions.html#type">Type Mapping</a> </div> <div> <a href="functions.html#uddi">UDDI</a> </div> <div> <a href="functions.html#udt">User Defined Types & The CLR</a> </div> <div> <a href="functions.html#vad">VAD</a> </div> <div> <a href="functions.html#jvmpl">Virtuoso Java PL API</a> </div> <div> <a href="functions.html#bif">Virtuoso Server Extension Interface (VSEI)</a> </div> <div> <a href="functions.html#ws">Web & Internet</a> </div> <div> <a href="functions.html#xml">XML</a> </div> <div> <a href="functions.html#XPATH">XPATH & XQUERY</a> </div> <br /> <div> <a href="functionidx.html">Functions Index</a> </div> <br /> </div> <div id="text"> <h2>backup</h2> <div class="refpurpose">Write data into transaction log format for backup purposes. Deprecated. </div> <div class="funcsynopsis"> <span class="funcdef"> <span class="function">backup</span> </span> (<span class="paramdef">in <span class="parameter">file</span> varchar</span>); </div> <div class="funcsynopsis"> <span class="funcdef"> <span class="function">backup_close</span> </span> (<span class="paramdef" />); </div> <div class="funcsynopsis"> <span class="funcdef"> <span class="function">backup_flush</span> </span> (<span class="paramdef" />); </div> <div class="funcsynopsis"> <span class="funcdef"> <span class="function">backup_prepare</span> </span> (<span class="paramdef">in <span class="parameter">file</span> varchar</span>); </div> <div class="funcsynopsis"> <span class="funcdef"> <span class="function">backup_row</span> </span> (<span class="paramdef">in <span class="parameter">row</span> any</span>); </div> <div class="refsect1"> <div class="refsect1title">Description</div> <span class="important"> <strong>Important:</strong> <p> These functions are deprecated. The use of backup_online () is preferred for database backups. Performing a backup with the destination file /dev/null is a good way of verifying a database's physical integrity. </p> <p>All backup files, whether complete (created with <span class="computeroutput">backup</span>) or partial (created with <span class="computeroutput">backup_prepare</span> and <span class="computeroutput">backup_row</span> of selected rows), begin with the complete schema that was effective at the time of the backup.</p> <p>Backup and log files contain assumptions about the schema and row layout of the database. Hence it is not possible to use these for transferring data between databases. Attempt to do so will result in unpredictable results. Thus a log or backup may only be replayed on the same database, an empty database or a copy of the database which has had no schema changed since it was made. Also, when replaying a backup file onto an empty database, the +replay-crash-dump switch should be given on the executable command line. </p> </span> <p>This function requires dba privileges.</p> <div class="refsect2"> <span class="refsect2title">Full backup – </span> The <span class="computeroutput">backup</span> function takes a file name as argument. The file produced will be in the log format and will recreate the database as it was at the time of the last checkpoint when replayed on an empty database. Such a file cannot be replayed on anything except an empty database. Logs made after the backup can be replayed over the database resulting from the backup file's replay. No schema operations are allowed between replays. </div> <div class="refsect2"> <span class="refsect2title">Partial backups – </span> The <span class="computeroutput">backup_prepare</span>, <span class="computeroutput">backup_row</span> and <span class="computeroutput">backup_close</span> operations allow making specific partial backups. <div class="formalpara"> <strong>backup_prepare</strong> <p> <span class="computeroutput">backup_prepare</span> initiates the backup. This must be the first statement to execute in its transaction. The rest of the transaction will be a read only snapshot view of the state as of the last checkpoint. Checkpointing is disabled until <span class="computeroutput">backup_close</span> is called.</p> </div> Checkpoints are disabled for the time between <span class="computeroutput">backup_prepare</span> and <span class="computeroutput">backup_close</span>. The backup transaction being lock-free, it cannot die of deadlock and hence will stay open for the duration of the backup. <div class="formalpara"> <strong>backup_row</strong> <p> <span class="computeroutput">backup_row</span> writes the row given as parameter into the backup file that was associated to the current transaction by a prior <span class="computeroutput">backup_prepare</span>. The row must be obtained obtained by selecting the pseudo column _ROW from any table.</p> </div> <div class="formalpara"> <strong>backup_flush</strong> <p>The <span class="computeroutput">backup_flush</span> function will insert a transaction boundary into the backup log. All rows backed up between two <span class="computeroutput">backup_flush</span> calls will be replayed as a single transaction by replay. Having long intervals between <span class="computeroutput">backup_flush</span> calls will cause significant memory consumption at replay time for undo logs.</p> </div> <div class="formalpara"> <strong>backup_close</strong> <p>The <span class="computeroutput">backup_close</span> function terminates the backup and closes the file. The transaction remains a read only snapshot of the last checkpoint but checkpoints are now re-enabled. The transaction should be committed or rolled back after <span class="computeroutput">backup_close</span>.</p> </div> </div> </div> <div class="refsect1"> <div class="refsect1title">Parameters</div> <div class="refsect2"> <span class="refsect2title">file – </span> <span class="computeroutput">varchar</span> <span class="computeroutput">file</span> filename for the generated log. </div> <div class="refsect2"> <span class="refsect2title">backup_row – </span> <span class="computeroutput">any</span> <span class="computeroutput">row</span> a value of the pseudo column _ROW. </div> </div> <div class="refsect1"> <div class="refsect1title">Return Types</div> <div class="refsect2"> <span class="refsect2title"> – </span> </div> </div> <div class="refsect1"> <div class="refsect1title">See Also</div> <p> <a href="fn_replay.html">replay</a> </p> <p> <a href="fn_backup_online.html">backup_online()</a>, <a href="fn_backup_context_clear.html">backup_context_clear()</a> </p> </div> </div> <div id="footer"> <div>Copyright© 1999 - 2009 OpenLink Software All rights reserved.</div> <div id="validation"> <a href="http://validator.w3.org/check/referer"> <img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /> </a> <a href="http://jigsaw.w3.org/css-validator/"> <img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" height="31" width="88" /> </a> </div> </div> </body> </html>