Home >Common Problem >OrientDB backup database

OrientDB backup database

DDD
DDDOriginal
2023-06-15 16:50:091405browse

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

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

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

be1cdaf6779910b92a0a47fc24e82b4f - Specifies the username to run the backup.

cb1ebc435675187bdcfb539b370c2e37 - Specifies the user's password.

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

7674b22ef33c73b930516fd6bc30b7a3 - 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

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

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

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

Backup executed in 0.18 seconds

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

Statement:
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