|
|
xdmp:database-backup(
|
|
$forestIDs as unsignedLong*,
|
|
$pathname as xs:string,
|
|
[$journal-archiving as xs:boolean?],
|
|
[$journal-archive-path as xs:string?],
|
|
[$lag-limit as xs:unsignedLong]
|
| ) as xs:unsignedLong |
|
 |
Summary:
Starts an asynchronous backup of the specified list of forests to the
backup data directory. Optionally starts journal archiving of the specified
list of forests to the specified journal archive directory. Returns a job
ID that uniquely identifies the backup task.
|
Parameters:
$forestIDs
:
A sequence of forest IDs.
|
$pathname
:
A backup data directory pathname. The directory must exist and be
writable by the operating system user under which MarkLogic Server
is running. The directory cannot be the MarkLogic Server install
directory or the MarkLogic Server data directory. The directory
specified can be an operating system mounted directory path, it can be
an HDFS path, or it can be an S3 path. For detail on using HDFS and S3
storage in MarkLogic, see
Disk Storage
Considerations.
|
$journal-archiving
(optional):
Whether or not to enable journal archiving. Defaults to false.
|
$journal-archive-path
(optional):
Path to where archived journals are stored. Defaults to the backup data
directory.
|
$lag-limit
(optional):
Maximum difference in seconds that the archived journal can lag behind its
forest's active journal. Defaults to 15.
|
|
Required Privilege:
http://marklogic.com/xdmp/privileges/xdmp-database-backup
|
Usage Notes:
You cannot restore to a read-only forest.
Reindexing will stop while a backup or restore is in progress.
The backup directory must exist on each host that has a forest
specified in the database backup call (that is, the d-nodes in which the
forests being backed up are hosted).
If enabling journal archiving, all forest must belong to the same database.
|
Example:
xdmp:database-backup((11183608861595735720,898513504988507762),
"/backups/Data")
=> 33030877979801813489
|
Example:
xdmp:database-backup(xdmp:database-forests(xdmp:database("Documents")),
"/backups/Data", fn:true(), "/backups/JournalArchiving", 15)
=> 437302857479804813287
|
|
|
|
xdmp:database-backup-status(
|
|
$jobid as unsignedLong,
|
|
[$hostid as unsignedLong]
|
| ) as element() |
|
 |
Summary:
Checks the status of the outstanding backup job with the specified
job ID. Returns a database backup status node defined in the
job-status.xsd schema.
|
Parameters:
$jobid
:
A backup job ID.
|
$hostid
(optional):
The ID of the host that the backup was started on.
|
|
Required Privilege:
http://marklogic.com/xdmp/privileges/xdmp-database-backup-status
|
Usage Notes:
The structure of the data
returned is as follows: A job-status element with the following element children:
forest
-
The forest being backed up. There is one forest element for each
forest in the backup.
This is a complex element with the following element children: forest-name-
The name of the forest.
forest-id-
The forest ID.
status-
The status of the forest backup. The status is one of: "queued",
"in-progress", "failed", "canceled", completed", or "unknown".
restore-to-time-
The date and time this backup was created.
journal-archiving-
Is journal archiving enabled for a full backup?
journal-archive-path-
Path to the associated journal archive location.
safe-restore-to-time-
The date and time this backup was created.
journal-archive-lag-limit-
Number of seconds the archived journal can lag the active journal.
|
Example:
xdmp:database-backup-status(33030877979801813489, 16529920850295602277)
=>
<job:job-status xsi:schemaLocation="http://marklogic.com/xdmp/job-status
job-status.xsd" xmlns:job="http://marklogic.com/xdmp/job-status"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<job:forest>
<job:forest-name>Documents</job:forest-name>
<job:forest-id>9157142760003704384</job:forest-id>
<job:status>in-progress</job:status>
<job:journal-archiving>true</job:journal-archiving>
<job:journal-archive-path>/backup/JournalArchive</job:journal-archive-path>
<job:journal-archive-lag-limit>15</job:journal-archive-lag-limit>
</job:forest>
</job:job-status>
|
|
|
|
xdmp:forest-clear(
|
|
$forestIDs as unsignedLong*
|
| ) as empty-sequence() |
|
 |
Summary:
Clears forest data files, including all stands and journals.
If any of the forests being cleared are attached to the context database,
then xdmp:forest-clear is run asynchronously, returning
immediately but doing the clear in a background thread.
If the forest being cleared is not attached to the context database, it
is run synchronously and will block until it returns.
The xdmp:forest-clear function is not transactional, and
the best practice is to not call it in a transaction that is also doing
updates.
|
Parameters:
$forestIDs
:
The IDs of the forests to clear. If a forest has replica forests, the
replicas are cleared as well.
|
|
Required Privilege:
http://marklogic.com/xdmp/privileges/xdmp-forest-clear
|
Example:
xdmp:forest-clear(11183608861595735720)
|
|
|
|
xdmp:forest-rollback(
|
|
$forestIDs as unsignedLong*,
|
|
$timestamp as unsignedLong
|
| ) as empty-sequence() |
|
 |
Summary:
Rolls forests back to a previous point in time, marking any fragment
newer than the specified timestamp as deleted. Also, any fragments that
were created before the specified timestamp and deleted after will be
rolled back (un-deleted).
|
Parameters:
$forestIDs
:
A sequence of forest IDs.
|
$timestamp
:
The system timestamp to which you want to roll back.
|
|
Required Privilege:
http://marklogic.com/xdmp/privileges/xdmp-forest-rollback
|
Usage Notes:
If the timestamp specified is greater than the current system timestamp
(that is, greater than the value of xdmp:request-timestamp()),
then an exception is thrown.
If the specified timestamp is less than (earlier) then the oldest
timestamp in the specified forest(s), then an exception is thrown.
You should not have any updates occurring on a forest while it is being
rolled back; the best practice is for the forest to be quiesced during
a rollback operation.
If you have failover replication configured for a forest, the replica
forest(s) will be rolled back at the same time as the specified forest(s).
If MarkLogic Server restarts during a rollback operation, the rollback will
complete when the forest comes back online.
You can only roll back a forest that is in the "Open" state.
The updates-allowed setting must be set to
all in order to successfully roll a forest back
to a previous timestamp.
As part of the xdmp:forest-rollback operation, the
specified forest(s) are restarted.
As a consequence of the forest(s) restarting, if
the forest is a failover forest and it is failed over to another host,
the system will attempt to mount the forest on the original host
(that is, it will un-failover the forest).
If you perform an xdmp:forest-rollback operation on a
forest attached to the context database or any of its auxilliary databases (the security, modules, or triggers databases for that database), then the
rollback is performed asyncronously in the background, and any exceptions
that occur will not be reported back to the program; in this case, if an
exception occurs it might be reported to the ErrorLog.txt file.
Additionally, because the rollback of forests in the context database (or in
its auxilliary databases) is run asyncronously, there might be a small delay
between when the rollback is issued and when the forest is restarted, and
the rollback state is not reflected until the forest restart is completed.
Therefore, it is best practice to call xdmp:forest-rollback
against forests not attached to the context database.
After an xdmp:forest-clear operation on a forest, you will
no longer be able to roll that forest back (because the forest clear deletes
all of the stands in the forest).
The forest rollback operation cannot be undone (except by restoring from
backup); that is, after rolling a forest back to a point in time, you cannot
roll the forest "forward" to where you started.
|
Example:
xdmp:forest-rollback(11183608861595735720, 12345623)
|
Example:
(:
Run this against a different database context then
the my-db database.
:)
xdmp:forest-rollback(
xdmp:database-forests(xdmp:database("my-db")), 12345623)
|
|
|