In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article will explain in detail how to restore the mistakenly deleted database in MongoDB. The content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
Method 1: restore through oplog
If you are deploying a MongoDB replication set, there is a glimmer of hope that you can recover the data as much as possible through oplog; every modification of the MongoDB replication set records an oplog, so when the database is mistakenly deleted, you can replay the existing oplog to "recover the data as much as possible". A user I met not long ago was very lucky. The database was created recently, and all the operations are still in oplog, so the user retrieved all the data deleted by mistake through oplog.
The process of recovering data through oplog is very simple, as long as the oplog collection is exported through mongodump and replayed through mongorestore's oplogReplay mode.
Step1: exporting oplog collections
Mongodump-d local-c oplog.rs-d-o backupdir
Step2: copy data from the oplog collection
Mkdir new_backupdir cp backupdir/local/oplog.rs.bson new_backupdir/oplog.bson
Step3: playback oplog
Mongorestore-- oplogReplay new_backupdir method 2: restore through backup set
If you do a full backup + incremental backup of the MongoDB, you can restore the data through the backup set and. Backups can take many forms, such as:
The logical backup of the database through mongodump and other tools
Physical backup resulting from copying the dbpath directory
Snapshots generated by file systems, volume management, etc.
On how to restore mistakenly deleted database in MongoDB to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.