Home > Data Protection > PowerProtect Data Manager > PowerProtect Cloud Snapshot Manager: Application Consistent Snapshots > Oracle on a Linux virtual machine
You can run shell scripts on Linux virtual machines using the custom scripts feature after uploading the scripts to a blob container.
The following figure is an example of an Azure container storing shell script files:
To take an application consistent snapshot of an Oracle database running on an Azure Linux VM, you need to set the database to backup mode before the snapshot is created and exit the backup mode after the snapshot is created, but you might want to run other commands.
It is recommended to consult with your database administrator prior to running any of the sample scripts provided in this document.
You need to create an SQL script file that contains the commands to set the database to backup mode. The following SQL script is an example that does that, it must be named oracle_pre_script.sql and placed locally on the VM before a snapshot is created, under the path /home/oracle/scripts:
You also need to create another SQL script file that contains the commands to exit from the backup mode. The following SQL script is an example and should be named oracle_post_script.sql and placed locally on the VM before a snapshot is created, under the path /home/oracle/scripts:
After you have placed the SQL scripts on the VM, you can create and upload shell scripts to a blob container on your Azure subscription which CSM will run before and after a snapshot is created.
The following bash script is an example that runs the oracle_pre_script.sql SQL script file stored locally on the Oracle VM and creates a log file. The log’s file name is auto generated along with the time it was executed:
The following bash script is an example that runs the oracle_post_script.sql SQL script file stored locally on the Oracle VM and creates a log file. The log’s file name is auto generated along with the time it was executed:
Note that it’s not required to have a script file on the local VM, you can also run a script stored on a blob container without having a script on the local VM.
Now you can create a Protection Plan or an on-demand snapshot using the Resources page to create a snapshot and use the custom scripts.
The following figure demonstrates how to select an Oracle VM on Azure, select the Azure custom scripts option and provide the path to the shell scripts on your blob container. The path that you need to provide must be in the following format <storage account name>/<container name>/<script file name>:
After the scripts have run, you will find the logs in the /home/oracle/scripts folder on your VM, as shown in the following figure: