how to compact an Oracle NoSQL database #160
dario-vega
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Let me start with a brief description extracted from the documentation about how Oracle NoSQL uses the disk to store data.
Storage Nodes use their available disk space for two purposes:
Reserved files consist of data that has already been replicated to active replica nodes. The purpose of storing a copy of this data is to use it for Replica Nodes that lose contact with the Master Node. Losing contact typically occurs because Replica nodes are shut down, a network partition event occurs, or another transient problem occurs.
The Storage Node is primarily designed to consume the amount of disk space you assign it and to use the remaining disk space to save the reserved files. Each Storage Node manages its available disk space, leaving 5 GB free for recovery purposes. Your intervention is typically not required in this disk management process unless a storage node exceeds its available disk capacity.
Note: If a Storage Node (SN) consumes more than what is assigned as
storagedirsize
, including leaving 5 GB of space free, the SN automatically attempts to free up disk space by deleting reserved files (not your data files), until more than 5 GB of space is available. If the Storage Node is unable to free up enough space, it suspends write operations to the node. Read operations continue as normal. Write operations resume automatically once the node obtains sufficient free disk space.The most common reason a node's storage directory fills up is because of reserved files. If the Storage Node exceeds its disk threshold, it continues to delete the reserved files until the threshold is no longer exceeded. With a very low impact on the performances.
Be sure to monitor disk usage regularly using the statistics provided, as described in Monitoring Disk Usage.
Snapshot
When you create a snapshot, it is stored in a subdirectory of the SN. But these snapshots don't become persistent backups unless they are copied to separate storage. It is your responsibility to copy each of the snapshots to another location, preferably on a different machine, for data safety.
It is also your responsibility to manage the space consumed by snapshots.
Impact of Erasure with snapshots
Snapshot-based backups create hard-links to original files. Until these backups are copied to their target location (complete off-store copy work) and the corresponding hard-links are removed (performing a
snapshot remove
command), erasure doesn't process obsolete data in those files. Erasure ignores files with hard-links to them.Avoiding Disk Usage Violation
The storage engine does not consider the data consumed by snapshots when it collects information about disk space usage. Initially, the files in the snapshot are considered to be part of the live data of the store. Over time, though, as older files are cleaned and deleted, their presence in the snapshot causes the files to be retained and use the disk space that is not taken into account by the storage engine. It could cause a disk usage violation, in which case further writes to the store are disabled. To avoid this problem, users should delete snapshot files at regular intervals.
The DbSpace tool
The DbSpace displays the disk space utilization for an environment. Is it another way to obtain information about the space consumed to store your data and the space used by the reserved files. You can execute the following command for each disk in your store. Behind the scenes, Oracle NoSQL uses Berkeley JE.
Compact an Oracle NoSQL database by restoring from a snapshot
The snapshots do not include the reserved files. After Restoring Directly from a Snapshot, You have 2 directories
env
andenv.old
- without having the same files. You can delete the directoryenv.old
to use less space. It is a way to delete the reserved files and compact your store.if a customer wants to compact a store (e.g UAT cluster), Can they use this procedure? yes, you can
ATTENTION Due to the distributed nature and scale of the Oracle NoSQL Database, when executing this procedure be sure that it is applied to all SN and all disks used by each SN.
Beta Was this translation helpful? Give feedback.
All reactions