Orientdb-export-database

提供:Dev Guides
移動先:案内検索

OrientDB-データベースのエクスポート

RDBMSと同様に、OrientDBはデータベースのエクスポートやインポートなどの機能も提供します。 OrientDBはJSON形式を使用してデータをエクスポートします。 デフォルトでは、exportコマンドはGZIPアルゴリズムを使用してファイルを圧縮します。

データベースをエクスポートしている間、データベースはロックされていません。つまり、データベースに対して同時読み取りおよび書き込み操作を実行できます。 また、読み取りと書き込みの同時操作により、そのデータの正確なコピーを作成できることも意味します。

この章では、OrientDBコマンドラインからデータベースをエクスポートする方法を学習できます。

次の文は、データベースのエクスポートコマンドの基本的な構文です。

EXPORT DATABASE <output file>

注意-このコマンドは、特定のデータベースに接続した後にのみ使用できます。

この例では、前の章で作成した「デモ」という名前の同じデータベースを使用します。 次のコマンドを使用して、データベースを「export-demo」という名前のファイルにエクスポートできます。

orientdb {db = demo}> EXPORT DATABASE ./export-demo.export

正常に実行されると、オペレーティングシステムに基づいて「export-demo.zip」または「exportdemo.gz」という名前のファイルが作成され、次の出力が表示されます。

Exporting current database to: DATABASE/home/linuxtp/Desktop/demo.export in
GZipped JSON format ...

Started export of database 'demo' to/home/linuxtp/Desktop/demo.export.gz...
Exporting database info...OK
Exporting clusters...OK (12 clusters)
Exporting schema...OK (11 classes)
Exporting records...
- Cluster 'internal' (id = 0)...OK (records = 3/3)
- Cluster 'index' (id = 1)...OK (records = 0/0)
- Cluster 'manindex' (id = 2)...OK (records = 0/0)
- Cluster 'default' (id = 3)...OK (records = 0/0)
- Cluster 'orole' (id = 4)...OK (records = 3/3)
- Cluster 'ouser' (id = 5)...OK (records = 3/3)
- Cluster 'ofunction' (id = 6)...OK (records = 0/0)
- Cluster 'oschedule' (id = 7)...OK (records = 0/0)
- Cluster 'orids' (id = 8)...OK (records = 0/0)
- Cluster 'v' (id = 9)...OK (records = 0/0)
- Cluster 'e' (id = 10)...OK (records = 0/0)
- Cluster '_studio' (id = 11)...OK (records = 1/1)

Done. Exported 10 of total 10 records

Exporting index info...
- Index dictionary...OK
- Index OUser.name...OK
- Index ORole.name...OK
OK (3 indexes)
Exporting manual indexes content...
- Exporting index dictionary ...OK (entries = 0)
OK (1 manual indexes)

Database export completed in 377ms