search

Home  >  Q&A  >  body text

mongodb 如何做备份才能支持恢复至任意时间点

我目前用mongodump --oplog来备份数据库, 但是不知道如何恢复到指定时间点
哪怕这个"时间点"是以"天"为单位也好过没有

另外我备份出的文件中有一个oplog.bson, 里面什么内容也没有, 这个正常吗?

天蓬老师天蓬老师2851 days ago672

reply all(2)I'll reply

  • PHPz

    PHPz2017-04-22 09:01:00

    mongodump --host yourdbhost --port 27017 --db dbname --collection collectionname
    
    -o mongodb --query '{"relativeStamp":{$lt:1389949842}}'
    

    Does the original poster want to back up like this?

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-22 09:01:00

    It is not a standard database after all. If it follows your request. Maybe it really doesn't meet your requirements.
    What we are applying now is actually mongo data only for acceleration.
    We have an oracle as the original source.
    Daily data query mongo.
    When the data of the data oracle changes, this operation will also be synchronized to mongo.
    When mongo data is abnormal, we will synchronize the entire database.

    reply
    0
  • Cancelreply