An auditor wants last year's logs. A team needs an old database export. The objects are in OCI Archive Storage, and a plain oci os object get fails because archived objects can't be downloaded until you restore them. This post covers the restore request, status checks and the download window. It also shows how to restore a whole prefix without missing objects or paying for data you never read.
How Archive restores work
You need to know four things before you start:
| Fact | What it means for you |
|---|---|
| Restore takes up to an hour before the first byte is available | Start restores early. Larger objects take longer to finish. |
| Restored objects stay downloadable for a download window (default 24 hours, 1 to 240 hours allowed) | If the window closes, the object goes back to Archive and you have to restore it again. |
| An object's state is Archived, then Restoring, then Restored | Download only when the state is Restored. |
| Restored data is billed at the Standard rate while the window is open | A 240-hour window on terabytes of data costs real money. |
The object stays in its bucket in both cases. In an Archive bucket, every object is Archive tier. In a Standard bucket, individual objects can be Archive tier because a lifecycle rule or a manual tier change moved them there. You restore both the same way.
Metadata is always available, even while the object is archived. head and list work right away, so you can plan the restore before you request it.
Step 1: Check permissions and find the objects
To restore you need the OBJECT_RESTORE permission, which is part of manage objects. Here is a minimal policy for a restore operator group:
Allow group ArchiveRestorers to read buckets in compartment Archive
Allow group ArchiveRestorers to manage objects in compartment Archive
where any {request.permission='OBJECT_RESTORE', request.permission='OBJECT_READ', request.permission='OBJECT_INSPECT'}
List the objects under a prefix together with their tier and archival state:
BUCKET=finance-archive
PREFIX=exports/2025/
oci os object list --bucket-name "$BUCKET" --prefix "$PREFIX" --all \
--fields name,size,storageTier,archivalState \
--query 'data[].{name:name,size:size,tier:"storage-tier",state:"archival-state"}' \
--output table
Total the size before you restore anything, so you know what the window will cost:
oci os object list --bucket-name "$BUCKET" --prefix "$PREFIX" --all \
--fields name,size | jq '[.data[].size] | add / 1024 / 1024 / 1024 | "\(.) GiB"'
To check a single object, use head. It returns the archival-state and storage-tier headers:
oci os object head --bucket-name "$BUCKET" --name exports/2025/gl_2025_12.dmp \
| jq '{tier: ."storage-tier", state: ."archival-state"}'
Step 2: Request the restore
Restore a single object with a 48-hour window:
oci os object restore --bucket-name "$BUCKET" \
--name exports/2025/gl_2025_12.dmp --hours 48
The command restores the current version by default. In a versioned bucket, add --version-id to restore an older version. You can get the version IDs from oci os object list-object-versions.
Restore a whole prefix
The CLI has no bulk restore command, so loop over the listing. Restore only the objects whose state is still Archived. That way you can rerun the loop safely after a partial failure:
oci os object list --bucket-name "$BUCKET" --prefix "$PREFIX" --all \
--fields name,archivalState \
--query 'data[?"archival-state"==`Archived`].name' --raw-output \
| jq -r '.[]' \
| while read -r OBJ; do
echo "restoring $OBJ"
oci os object restore --bucket-name "$BUCKET" --name "$OBJ" --hours 72 \
|| echo "FAILED $OBJ" >> restore-failures.txt
done
Tip
Restoring thousands of objects in a fast loop can trigger
429 TooManyRequests. The CLI retries some errors by default, but add a shortsleepin the loop or split the work by prefix if you see throttling.
Step 3: Wait for Restored
Check one object:
oci os object restore-status --bucket-name "$BUCKET" --name exports/2025/gl_2025_12.dmp
To check a whole prefix, count objects by state until nothing is left in Archived or Restoring:
oci os object list --bucket-name "$BUCKET" --prefix "$PREFIX" --all \
--fields name,archivalState \
| jq -r '.data | group_by(."archival-state") | map({state: .[0]."archival-state", count: length})'
The Console shows the same state in the object's Status column. For a restored object, its Details panel shows how long the object is Available for Download.
Step 4: Download before the window closes
Once the state is Restored, download the object like any other:
oci os object get --bucket-name "$BUCKET" \
--name exports/2025/gl_2025_12.dmp --file ./gl_2025_12.dmp
# Or the whole prefix
oci os object bulk-download --bucket-name "$BUCKET" \
--prefix "$PREFIX" --download-dir ./restore-2025
When the download window ends, the object goes back to Archive on its own. Nothing is deleted, and you don't need to clean anything up.
If the data has to stay hot longer than 240 hours, for example as the source for a long-running job, copy it into a Standard bucket during the window. One way is to download and re-upload it. Another is to stage it on File Storage or block storage. Then delete the copy when the job is done.
Warning
Archive has a 90-day minimum retention. If you delete or overwrite an archived object earlier, you pay prorated storage for the rest of the 90 days. Infrequent Access has a 31-day minimum and a per-GiB retrieval fee. Don't "fix" a restore by deleting and re-uploading the archived original.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
get fails on an object you can see in list | Object is still Archived or Restoring | Run restore, then wait for Restored |
restore returns 404 | Wrong bucket, wrong namespace or no permission | Check --bucket-name and the namespace (oci os ns get). The policy needs OBJECT_RESTORE |
Object was Restored yesterday, Archived today | Download window expired | Restore again with a larger --hours value |
| Some objects in a prefix are never restored | Loop hit throttling, or object names contain unusual characters | Check restore-failures.txt and rerun the loop. It skips objects that are already restored |
| Old version of a file needed | Restore defaults to the current version | Use --version-id from list-object-versions |
| Bill spikes after a restore | Large window on a large data set | Use the shortest window that covers the download time |
Prevent it next time
- Archive by lifecycle, not by hand. Use lifecycle rules that move objects to Archive after a set age, so everyone knows which prefixes are archived. Use
oci os object update-storage-tier --storage-tier Archiveonly for one-off moves. - Write the restore time into your SLA. Data in Archive is at least an hour away. Don't archive anything an on-call engineer might need during an incident, such as recent backups or current-quarter logs.
- Keep an index. Store a manifest of archived objects (name, size, date range) in a Standard bucket. Restores can then target exact objects instead of whole prefixes.
- Test once a quarter. Restore one object, download it and verify the checksum. Compare it with the
md5field fromoci os object list --fields name,md5, which works for single-part uploads. Multipart uploads have a different MD5 format, so use your own checksum for those. - Grant restore access narrowly. Give restore permission only to a named group, and check the Audit log for
RestoreObjectscalls if costs move unexpectedly.
Get the weekly HubDatAI email
One email a week with everything new: posts, learning sessions and videos. Free, no spam, unsubscribe in one click. What you get