OCI – File storage snapshot management

OCI file storage snapshots are not managed automatically by OCI like block volumes backups are when using policy-managed backups.

Which means that you have to create and delete the snapshots by yourself.

On this blog post I will share a shell script to accomplish this task using oci cli.

Here is an example to create daily snapshots: fssnap.sh

# !/bin/bash
export CLI=/home/oracle/ocicli
export FSSOCID=<file storage ocid>
export TSTAMP=`date +%Y%m%d`
export ENV=prod

# create snap
$CLI/oci fs snapshot create --file-system-id=$FSSOCID --name=$ENV.$TSTAMP

You can get the file storage ocid at OCI console:

Create a user and group and assign the below policy to the group:

Allow group StorageAdmins to manage file-family in compartment PROD

Schedule this shell script to run on a regular internal that fits your needs.

But in my case I had to keep a limited amount of backups based on same information such as: environment (prod or dev) and customer retention policy (bronze, silver or gold).

So I wrote another simple shell to accomplish this: fscleanup.sh

export CI=/home/oracle/ocicli
export FSSOCID=<file storage ocid>
export TSTAMP=`date +%Y%m%d`
export KEEP=42

# dump backups to tempfile
$CI/oci fs snapshot list --file-system-id=$FSSOCID | grep '"id"' | awk '{print $2}' | sed 's/"//g' | sed 's/,//g' > /tmp/fss.bkp

CT=`cat /tmp/fss.bkp | wc -l`

#remove backups older then $KEEP
if [ "$CT" -gt $KEEP ]; then
    DIFF=$(expr $CT - $KEEP)
    for id in `tail -$DIFF /tmp/fss.bkp`
       $CI/oci fs snapshot delete --force --snapshot-id $id
    echo "less then KEEP: $KEEP"

Please check OCI doc about managing snapshots for more info.

Let’s wait for the OCI native and automated way for doing this but until then this is the workaround.

Oracle dNFS

Nesse post vou demonstrar como configurar o Oracle dNFS para acessar um NFS e subir seus bancos.

Sobre o meu ambiente:

HW: Cisco UCS

Sistema Operacional: Oracle Linux 6.9


NAS: Netapp

Conectividade: 10G

Vamos ao que interessa 🙂

Pare o banco, ative o dNFS e inicie a instance novamente.

Ativando o dNFS:

$ cd $ORACLE_HOME/rdbms/lib

$ make -f ins_rdbms.mk dnfs_on

Procure no alert pela string: Oracle instance running with ODM: Oracle Direct NFS ODM Library Version 3.0.

Crie o(s) diretório(s) como ponto de montagem para o NFS:

Ex: mkdir –p /mnt/sha1

Configure o fstab e monte o NFS

ex:  /mnt/sha1  nfs  rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0  0 0


<NFS IP>:<device> <mount point> nfs rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0  0 0

Para montar o NFS: mount /mnt/sha1

Pronto! Agora é só criar as tablespaces no NFS.


Links que recomendo a leitura para aprofundar o assunto:

Best Practices: How to Configure DNFS in Oracle Database (Doc ID 2246245.1)

Clone your dNFS Production Database for Testing (Doc ID 1210656.1)

DNFS Performance Monitoring (Doc ID 1556066.1)

How to configure DNFS to use multiple IPs (Doc ID 1552831.1)