Home > Common Problem > OrientDB backup database

OrientDB backup database

DDD
Release: 2023-06-15 16:50:09
Original
1400 people have browsed it

OrientDB backup database

Like RDBMS, OrientDB also supports backup and recovery operations. When performing a backup operation, it will convert all files of the current database into compressed zip format using the ZIP algorithm. This functionality (backup) can be exploited automatically by enabling the automatic backup server plugin.

However, backing up or exporting a database is the same, depending on the process you have to know when to use a backup and when to use an export.

When a backup is taken, it creates a consistent copy of the database and all further write operations are locked and waiting for the backup process to complete. In this operation, it will create a read-only backup file.

If concurrent read and write operations are required when performing a backup, you must choose to export the database instead of backing up the database. The export does not lock the database and allows concurrent writes during the export process.

The following statements are the basic syntax for database backup.

./backup.sh <dburl> <user> <password> <destination> [<type>]Shell
Copy after login

Here are the details about the options in the above syntax.

- The database URL where the database is located locally or remotely.

- Specifies the username to run the backup.

- Specifies the user's password.

- Destination file location, indicating the location where the backup zip file is stored.

- Optional backup type. It has one of two options.

Default - Locks the database during backup.

LVM - Use LVM copy-on-write snapshots in the background.

Example

Back up the database demo files located in the local file system /opt/orientdb/databases/demo to a file named sample-demo.zip and located in the current directory.

You can use the following command to back up the database demo.

$ backup.sh plocal: opt/orientdb/database/demo admin admin ./backup-demo.zipSQL
Copy after login

Using the console

You can use the OrientDB console to perform the same operation. Before taking a backup of a specific database, you must first connect to the database. You can use the following command to connect to the database named demo.

orientdb> CONNECT PLOCAL:/opt/orientdb/databases/demo admin adminSQL
Copy after login

After connecting, you can use the following command to back up the database to a file named 'backup-demo.zip' in the current directory.

orientdb {db=demo}> BACKUP DATABASE ./backup-demo.zipShell
Copy after login

If this command executes successfully, you will receive some success notification along with the following message.

Backup executed in 0.18 seconds
Copy after login

The above is the detailed content of OrientDB backup database. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template