Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/entity-framework/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
OrientDB恢复->;数据库已关闭_Orientdb - Fatal编程技术网

OrientDB恢复->;数据库已关闭

OrientDB恢复->;数据库已关闭,orientdb,Orientdb,我有一个db.zip存档文件(带有.cpm、.pcl、.irs、.sbt、.wal等文件),我想还原 create database plocal:mydb admin admin restore database /path/to/db.zip Restoring database database /path/to/db.zip... - Uncompressing file $FILE1_IN_ARCHIVE [...snip...] - [...snip...] Database re

我有一个
db.zip
存档文件(带有.cpm、.pcl、.irs、.sbt、.wal等文件),我想还原

create database plocal:mydb admin admin
restore database /path/to/db.zip

Restoring database database /path/to/db.zip...
- Uncompressing file $FILE1_IN_ARCHIVE [...snip...]
- [...snip...]
Database restored in 0.19 seconds
在我看来,恢复似乎是成功的。但是,无论我下一步使用什么命令(例如,
select*from V
),我都会得到以下错误:

Error: com.orientechnologies.orient.core.exception.ODatabaseException: Database 'mydb' is closed

我做错什么了吗?为什么DB关闭了?如何打开它?

我按照以下步骤使用OrientDB 2.1.11版尝试了您的案例(之前我创建了一个数据库的备份副本,新名称为
mydb.zip

  • 创建新数据库:

    create database plocal:/path/to/db/newDB admin admin
    
    Creating database [plocal:/path/to/db/newDB] using the storage type [plocal]...
    
    Database created successfully.
    
  • 还原
    mydb.zip

    restore database C:/path/to/db/mydb.zip
    
    Restoring database database C:/path/to/db/mydb.zip...
    ...
    Database restored in 0,29 seconds
    
  • V
    中选择所有顶点(我得到相同的例外):

  • 这个(您的)问题似乎与此相关,其中解释了在
    plocal
    模式下使用另一个运行的OrientDB实例访问DB会产生冲突。 如果关闭打开的OrientDB实例并尝试以
    plocal
    模式连接到DB,则可以访问DB

  • 关闭正在运行的OrientDB实例,并在
    plocal
    模式下重新连接:

    orientdb> connect plocal:/path/to/db/newDB admin admin
    
    Connecting to database [plocal:/path/to/db/newDB] with user 'admin'...OK
    
  • 再次从
    V
    中选择所有顶点:

    orientdb {db=newDB}> select * from V
    
    ----+-----+-------+------+--------
    #   |@RID |@CLASS |name  |category
    ----+-----+-------+------+--------
    0   |#12:0|Station|First |#13:0
    1   |#12:1|Station|Second|#13:1
    2   |#12:2|Station|Third |#13:2
    ----+-----+-------+------+--------
    
  • 无论如何,我也尝试过使用新的OrientDB 2.2.0测试版,而在这个版本中,这种行为不会发生:

        Restoring database 'database C:/path/to/db/mydb.zip' from full backup...
        ...
        Database restored in 0,75 seconds
    
        orientdb {db=newDB}> select * from V
    
        ----+-----+-------+------+--------
        #   |@RID |@CLASS |name  |category
        ----+-----+-------+------+--------
        0   |#12:0|Station|First |#13:0
        1   |#12:1|Station|Second|#13:1
        2   |#12:2|Station|Third |#13:2
        ----+-----+-------+------+--------
    

    希望有帮助

    您好,您是否对原始数据库执行了
    导出
    备份
    “关闭”,然后重新连接成功。但是,还原后该图形为空。出于测试的原因,我做了一个具有相同效果的数据库备份和恢复。所以,我做了一件完全错误的事情:)对我来说,有效的方法是将解压后的文件夹复制到磁盘上的物理文件夹。嗨,谢谢。不管怎样,你用的是哪个版本?你试过新的2.2.0测试版吗?最后一次我没有遇到这个问题。
        Restoring database 'database C:/path/to/db/mydb.zip' from full backup...
        ...
        Database restored in 0,75 seconds
    
        orientdb {db=newDB}> select * from V
    
        ----+-----+-------+------+--------
        #   |@RID |@CLASS |name  |category
        ----+-----+-------+------+--------
        0   |#12:0|Station|First |#13:0
        1   |#12:1|Station|Second|#13:1
        2   |#12:2|Station|Third |#13:2
        ----+-----+-------+------+--------